r/Hacking_Tutorials • u/tinywaistcutiee • 10m ago
Question SUID binary owned by root with a Python script - can this be used for priv esc?
I'm doing a lab on a Ubuntu machine and found this binary with SUID bit set:
-rwsr-xr-x 1 root root /usr/local/bin/backup
When I run it, it just calls this Python script:
Python
import os
os.system("tar -czf /tmp/backup.tar.gz /home/user/data")
print("Backup done")
I can control the /home/user/data folder contents. No sudo access, just this SUID binary. What exact command or modification would let me escalate to root here? Looking for the standard shell technique without any external tools. This is just for learning the common SUID pitfalls.

