exit的shellcode
来源:互联网 发布:杭州淘宝基地在哪里 编辑:程序博客网 时间:2024/04/29 20:06
在linux下输入man 3 exit
[root@localhost ~]# man 3 exit
得到
NAME exit - cause normal process terminationSYNOPSIS #include <stdlib.h> void exit(int status);DESCRIPTION The exit() function causes normal process termination and the value of status & 0377 is returned to the parent (see wait(2)). All functions registered with atexit(3) and on_exit(3) are called, in the reverse order of their registration. (It is possible for one of these functions to use atexit(3) or on_exit(3) to register an additional function to be executed during exit processing; the new registration is added to the front of the list of functions that remain to be called.) If one of these functions does not return (e.g., it calls _exit(2), or kills itself with a signal), then none of the remaining functions is called, and further exit processing (in particular, flushing of stdio(3) streams) is abandoned. If a function has been registered multiple times using atexit(3) or on_exit(3), then it is called as many times as it was regis- tered. All open stdio(3) streams are flushed and closed. Files created by tmpfile(3) are removed. The C standard specifies two constants, EXIT_SUCCESS and EXIT_FAILURE, that may be passed to exit() to indicate successful or unsuccessful ter- mination, respectively.RETURN VALUE The exit() function does not return.
exit只有一个参数,那就是状态。我一般设置状态为0 ,在C语言中调用就是
exit(0);
上面用linux汇编语言实现:
;exit.asm[SECTION .text]global _start_start: xor eax, eax ;exit is syscall 1 mov al, 1 ;exit is syscall 1 xor ebx,ebx ;zero out ebx int 0x80
exit的系统调用号是1,状态是0,于是eax设置为1,ebx设置为0,再调用0x80号中断。
在linux上编译:
[root@localhost shellcode]# nasm -f elf exit.asm
连接:
[root@localhost shellcode]# ld -o exiter exit.o
生成了exiter,然后对exiter进行反汇编:
[root@localhost shellcode]# objdump -d exiter
显示:
exiter: file format elf32-i386Disassembly of section .text:08048060 <_start>: 8048060: 31 c0 xor %eax,%eax 8048062: b0 01 mov $0x1,%al 8048064: 31 db xor %ebx,%ebx 8048066: cd 80 int $0x80
于是,shellcode就是\x31\xc0\xb0\x01\x31\xdb\xcd\x80
- exit的shellcode
- bind stage shellcode ,reverse stage shellcode,reverse shellcode的异同
- shellcode的初步编写
- 编写"优美"的SHELLCODE
- 我的Shellcode生成器
- 写精简的shellcode
- 编写shellcode的全过程
- 一个神奇的shellcode
- shellcode的隐藏运行
- 编写"优美"的SHELLCODE
- hello的shellcode
- Shellcode的基本介绍
- XSS ShellCode的调用
- 文件上传下载的shellcode
- hello的shellcode
- shellcode的两个关键技术
- ShellCode欺骗的艺术!
- Shellcode的编写
- chrome插件开发1:永远的helloworld
- vxWorks内核实现基本原理
- [ jQuery] 还是JQuery闭包!
- 一天时间用python写门语言
- LA 4239 树状数组
- exit的shellcode
- CF-25E - Test(KMP)
- 公益404页面-愿2013充满各种正能量!
- Ibatis代码自动生成工具——Abator安装与应用实例
- Lucene:基于Java的全文检索引擎简介
- 检测是浏览器还是手机,需求为是否支持FLASH,此文为检测是否支持FLASH的代码(含demo下载)
- VxWorks 内存结构小结
- 没有积分怎么办
- 服务器设计和客户端设计的感悟