Skip to content

Instantly share code, notes, and snippets.

@adililhan
Created February 16, 2021 21:53
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/61d9fd346b41be71ef6c5d43f34c00b3 to your computer and use it in GitHub Desktop.
Save adililhan/61d9fd346b41be71ef6c5d43f34c00b3 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <sys/utsname.h>
#include <seccomp.h>
void main() {
puts("What's up?");
scmp_filter_ctx ctx;
ctx = seccomp_init(SCMP_ACT_ALLOW);
seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(uname), 0);
seccomp_load(ctx);
struct utsname unameData;
uname(&unameData);
printf("%s \n", unameData.sysname);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment