Https- Bit.ly Crackfire 〈99% CONFIRMED〉
def get_base(p): """Leak a known symbol (e.g., _start) to compute PIE base.""" # _start is at offset 0x4000 from base (found via readelf) leak = leak_address(p, "%p %p %p %p %p %p") # The second pointer (index 1) is usually _start in this binary # Adjust as needed by inspecting the output. # For illustration we assume leak is the PIE base directly. base = leak - elf.sym['_start'] log.success(f"PIE base: hex(base)") return base
Challenge type: Binary exploitation (pwn) – 64‑bit Linux Difficulty: Medium / Hard (depends on the exact variant) Points: 500 (CTF typical) TL;DR – The binary is a simple “crack‑the‑code” game that reads a user‑supplied string, checks it against a secret flag stored in the binary, and then prints “Access granted!” on success. The binary contains a classic format‑string vulnerability that lets us leak the address of the secret and later overwrite the check function’s return address to jump to win . By combining an info‑leak with a one‑shot ret2win payload we obtain the flag. Below is a step‑by‑step walkthrough that shows the thought process, the tools used, and the final exploit script (Python + pwntools). Feel free to copy the script and adapt it for the exact binary you downloaded from the short link. 1. Getting the binary The challenge link ( https://bit.ly/crackfire ) resolves to a zip file containing: https- bit.ly crackfire
0x404060: "t0pS3cr3tC0de!" In main you’ll see: def get_base(p): """Leak a known symbol (e
# ---------------------------------------------------------------------- # 1. Get the binary base (leak step) – omitted here; we just hard‑code. # ---------------------------------------------------------------------- base = 0x555555554000 win = base + 0x12f0 # offset found with readelf -s Feel free to copy the script and adapt
# ---------------------- CONFIGURATION ------------------------ binary = "./crackfire" elf = ELF(binary) context.binary = binary context.log_level = "info"
The is stored in the binary as a global:
| Address | Symbol | Purpose | |---------|--------|---------| | 0x401260 | main | reads user input with scanf("%s", buf) | | 0x4010f0 | check | compares input to a hidden string ( secret ) | | 0x401240 | win | prints flag and exits |