Created
March 7, 2016 14:06
-
-
Save Ga-ryo/a6b4bbe4b1f2f51457cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
//gcc exec_shellcode.c -o exec_shellcode -m32 -z execstack -fno-stack-protector | |
char sc[] = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69" | |
"\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80"; | |
int main(){ | |
int a=0xdeadbeef; | |
//pointer incremetn by its size | |
*(int *)(&a + 2) = sc; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment