ROP: Stack Pivoting

Marco Ramilli
Date
3 August 2011
Read
Share
During the past few days I saw people complaining about Stack Overflow. The main argument was that Stack based overflow is the perfect way to control the program execution BUT not so common as it was in the past. I totally agree with this argument. Nowadays the most common overflows are in the memory HEAP. So the question comes easy: how can I control the attacked program control flow if I control the HEAP ? The answer is int he "stack pivoting" techniques.
The goal of these techniques is to put ESP to the attacker controlled memory area. There are many ways to perform stack pivoting but one of my favorite one is by using ROP gadgets:
  1. mov %esp, %eax // ret
  2. xchg %eax, %esp // ret
  3. add esp, // ret
xchg exchanges values between two operands and it's pretty common to find out into "ropped libraries" after all.
Summing up, this post is about telling you a simple ROP sequence useful to pivoting your stack (pointer).
Marco Ramilli
Date
3 August 2011
Read
Share
← Go back
Latest Posts

i-SOON Data Leak: Key Points

Introduction i-SOON (上海安洵), a prominent contractor for various Chinese government agencies such […]

Date
26.02.2024
Duration
5 min
Text
Marco Ramilli

X Gold Badges: a new proliferating market

When I saw a threat actor hijacking the X account of Google's […]

Date
08.01.2024
Duration
5 min
Text
Marco Ramilli

Technical Data Sheet: LOCKBIT 3.0

LOCKBIT 3.0 is a notorious Ransomware Group that was first identified on […]

Date
20.12.2023
Duration
5 min
Text
Marco Ramilli
1 2 3 236
Back to Top
magnifier