r/Hacking_Tutorials • u/FrostMoxie • 13h ago
Question Low-privilege shell on Ubuntu. Sudo lets you run /usr/local/bin/configcheck as root. Can you reach root?
You're on a lab Ubuntu server as user dev.
dev@lab:~$ whoami
dev
dev@lab:~$ id
uid=1001(dev) gid=1001(dev)
groups=1001(dev),1002(web)
dev@lab:~$ sudo -l
User dev may run the following commands:
(root) NOPASSWD:
/usr/local/bin/configcheck
The script:
#!/bin/bash
echo "Checking config files..."
/usr/bin/find /etc/webapp -name "*.conf" -exec /usr/bin/head -n 20 {} \; > /tmp/config_summary.txt
echo "Summary saved."
Task:
- Identify the exact issue that allows privilege escalation.
- Show the commands to reach root.
- Explain how you would fix the script and permissions properly.
No Metasploit. No automated tools. Just standard Linux commands and shell knowledge.
This is a controlled lab scenario. Share your approach in the comments.
1
u/tinywaistcutiee 9h ago
probably the script itself is writable by dev so you could just swap in a root shell command before the find runs