pwn.college-pro sec-_Return Oriented Programming
Welcome to back
Return Oriented Programming
Calling Functions
Loose Link (Easy)

1 | |

Loose Link (Hard)


Call Chain (Easy)

1 | |

Call Chain (Hard)

Chain of Command (Easy)

we find 5 win_funs


set edi = 1,2,3,4,5

1 | |

Chain of Command (Hard)


Chaining Gadgets
Stop, Pop, and ROP (Easy)
at the challenge, we have no win_fun


offset = 0x88 =136


Stop, Pop, and ROP (Hard)


Stop, Pop, and ROP ll (Easy)
without leak


offset = 0x68 =104

1 | |

Stop, Pop, and ROP ll (Hard)

Indirect Invocation (Easy)

no syscall

wow

1 | |

Indirect Invocation (Hard)


Leveraging Libc
Leaky Libc (Easy)
Utilize a libc leak to ROP with libc!


1 | |

Leaky Libc (Hard)

Putsception (Easy)
ROP with libc, no free leak this time!

offset = 0x38

we can use puts_fun to leak puts.got
| 位置 | 内存地址 | 存放的内容 (Value) | 逻辑意义 |
|---|---|---|---|
| GOT 条目 | <font style="color:rgb(68, 71, 70);">0x405028</font> |
<font style="color:rgb(68, 71, 70);">0x79059c5f4420</font> |
指向 Libc 中 <font style="color:rgb(68, 71, 70);">puts</font>的指针 |
| Libc 代码区 | <font style="color:rgb(68, 71, 70);">0x79059c5f4420</font> |
<font style="color:rgb(68, 71, 70);">0xfa1e0ff3...</font>( <font style="color:rgb(68, 71, 70);">endbr64</font>) |
<font style="color:rgb(68, 71, 70);">puts</font>函数真正的机器码指令 |



1 | |

Putsception (Hard)

Stack Pivoting Challenges
Pivotal Prelude (Easy)
Perform a stack pivot to gain control flow!

read 0x1000 to 0x4140e0

copy top 24bytes to rbp + 8 -> ret_addr


start privilege


1 | |

Pivotal Prelude (Hard)



Pivotal Pointer (Easy)

wow

we have input buffer address
buffer -8bytes = pointer_win


so, fake_rbp = buffer-8-8= buf -0x10

1 | |

Pivotal Pointer (Hard)

offset = 0x50-0x8 = 0x48

Pivotal Payload (Easy)


easy
1 | |

Pivotal Payload (Hard)



Pivotal Pursuit (Easy)

no challenge_fun???

so, we have to get leave;ret at libc

0x00000000000578c8 : leave ; ret
good

offset = 0x58
1 | |

Pivotal Pursuit (Hard)

offset = 0x68

Exploitation
Guarded Gadgets (Easy)

we can leak canary

scanf(“%lx”, &addr) and printf

then, read
0x00000000000022f0 <+44>: mov QWORD PTR [rbp-0x8],rax
canary is here
offset_canary=0x80 - 0x8 = 0x78
offset = 0x78 +8+8 =0x88



Offset = 0x7449948c6083 - 0x7449948a2000 = 0x24083
libc_base = ret_Leak - 0x24083



call main
1 | |

Guarded Gadgets (Hard)

offset = 0x58

wow
same as before

ROP Roulette (Easy)
forkserver?



offset_canary=0x38


:(
0x00000000000024ca main


?????


wtf
1 | |

?????

restart
ROP Roulette (Hard)



rm sendafter

Libc Lottery (Easy)

no challenge


0x38


at __libc_start_main

same as Guarded Gadgets

1 | |


1 | |

Libc Lottery (Hard)

