0x0 Introduction
Medium
Our horoscope developers have pivoted to a more security-focused approach to predicting the future. You won’t find breaking into this one quite so easy!
Connect
nc sechoroscope.sdc.tf 1337
By green beans
files: secureHoroscope
0x1 Mitigation
1 | Arch: amd64-64-little |
0x2 Vulnerability
In function dbg.getInfo
, there is 0x8c-0x70 = 0x1c
long buffer over. Although it is very small. It still allow us to do a stack pivot.
- overwrite rbp to writable memory page, jump
dbg.getInfo
again, but skip callee prologue so that rbp stay the same. - write payload (leak libc address and return to dbg.getInfo) to current stack frame
- double leave ret, point rsp to our payload
- write ropchain for calling system("/bin/sh") to get shell
0x3 Exploit
1 | from pwn import * |
0x4 Flag
sdctf{Th0s3_d4rN_P15C3s_g0t_m3}