strace ./elfpwngdb调试堆
b main c r vmmap heap bin p __&malloc_hooklibc的查找利用
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pwn import *
>>> elf = ELF('libc_32.so.6')
[*] '/home/hacker/Desktop/pwnstudy_file/xctf-low/libc_32.so.6'
Arch: i386-32-little
RELRO: Partial RELRO
Stack: Canary found
NX: NX enabled
PIE: PIE enabled
>>> elf.search(b'/bin/sh')
>>> next(elf.search(b'/bin/sh')
... next(elf.search(b'/bin/sh'))
File "", line 2
next(elf.search(b'/bin/sh'))
^
SyntaxError: invalid syntax
>>> next(elf.search(b'/bin/sh'))
1413163
>>> hex(13163)
'0x336b'
格式化字符串漏洞
%3$x 是打印出第三个格式化字符串



