Skip to content

Instantly share code, notes, and snippets.

@adililhan
Created February 16, 2021 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adililhan/9d88bf9d79a6a9fe0c5fb164348d5a0d to your computer and use it in GitHub Desktop.
Save adililhan/9d88bf9d79a6a9fe0c5fb164348d5a0d to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <linux/seccomp.h>
#include <sys/prctl.h>
void main() {
FILE *filePoint;
filePoint = fopen("/tmp/test.txt", "a");
if(filePoint == NULL) {
puts("File can not be opened");
exit(1);
}
fputs("qwe\n", filePoint);
prctl(PR_SET_SECCOMP, SECCOMP_MODE_STRICT);
fputs("xyz", filePoint);
fclose(filePoint);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment