ROP Chaining: Return Oriented Programming
ROP Chaining: Return Oriented Programming
echo 0 > /proc/sys/kernel/randomize_va_space1st ROP Chain
Vulnerable Code
#include <stdio.h>
#include <string.h>
void rop1()
{
printf("ROP 1!\n");
}
void rop2() {
printf("ROP 2!\n");
}
void rop3() {
printf("ROP 3!\n");
}
void vulnerable(char* string)
{
char buffer[100];
strcpy(buffer, string);
}
int main(int argc, char** argv)
{
vulnerable(argv[1]);
return 0;
}Objective
Stack Layout

Payload





Exploit

Inspecting the Stack Layout





2nd ROP Chain
Vulnerable Code
Objective
Stack Layout

ROP Gadgets


Payload



Exploit

Inspecting the Stack Layout

Useful Python
Little Endian Converter
Payload Executor

References
Last updated