Texas Instruments Security Week 2025

⚓️ Ahoy, landlubbers and logic-lords! This be she11D0n3 of the notorious crew H4ck_th3_Wh47, chartin’ a course straight into the stormy seas of Texas Instruments Security Week 2025! 🏴‍☠️ Each system’s a cryptic siren song, each puzzle a treasure chest locked with layers of encryption. We don’t just hack—we unravel, we decode, we conquer. 🔐⚡

PWN

ez printf

First I look for file type and protections.

>>>file vuln
ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, ..., for GNU/Linux 4.4.0, not stripped
>>>checksec --file=vuln
RELRO:      Partial RELRO
Stack:      Canary found
NX:         NX enabled
PIE:        PIE enabled
Stripped:   No

Analysing and de-compiling the binary:

read(0, buf, 120uLL);
printf(buf);
read(0, buf, 120uLL);
printf(buf);
puts("nice try");
return 0;

So, we can see that there is a clear format string vulnerability twice, since no format specifiers are passed to printf.

Further there is also a win function that prints the flag.

Exploit

  1. Use the first input to leak an address that points into the binary itself, which we'll use further to get runtime win function address (thereby Bypassing PIE protection).

  2. Overwriting the GOT entry for puts with the dynamically resolved addr of the win function (GOT overwrite).

Execution

So there is 0x55.. address of _start which is pointing in the binary (can also check using command vmmap in pwndbg).

Inorder to access this address by printf we need to de-reference 0x7fffffffd9e0 this for which we'll use %s format specifier and will further unpack the printed addr.

I found the offset to be 20, so initial payload: %20$s

I usually prefer manually crafting the payload in case of overwriting via %n specifier because it took me some good time to understand the working, but since here the addr to jump on was being dynamically resolved, I used the pwntools library function.

FINAL EXPLOIT

Flag: texsaw{Pr1nt1ng_tHe_Fs_15_e4sy}

Last updated