🚩 Challenge Overview
- Platform/Event: HTB Cyber Apocalypse 2025
- Difficulty: Medium
- Points: 280
- Solves: 145
- Category: Pwn
- Tags: Format String, Stack Canary Bypass, ret2libc, ASLR Bypass
📝 Description
A console chatbot vulnerable to format strings and stack overflows. Leak stack values (canary & libc addresses) via format string, then trigger stack overflow to perform a ret2libc payload.
💡 Solution / Approach
-
Format string leak: Inject
%11$p.%15$pto leak stack canary and__libc_start_main_retaddress. -
Calculate libc base and offset to
system()and/bin/sh. -
Send stack overflow payload: Fill buffer, place leaked canary, overwrite RBP, and write ROP chain (
pop rdi; pop rsi; system) pointing to/bin/sh.