r/Hacking_Tutorials • u/XeVoriax • 3d ago
Question Low-privilege shell on Ubuntu. Sudo lets you run /usr/local/bin/netcheck 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 -I User dev may run the following commands: (root) NOPASSWD: /usr/local/bin/netcheck 11
The script: #!/bin/bash echo "Running network check ... " /usr/bin/nmap -sT -p 22,80,443 -- script http-title 192.168.1.0/24 -oN /tmp/netscan.txt echo "Scan 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.
Metasploit. No automated tools. Just standard Linux commands and shell knowledge. This is a controlled lab scenario. Share your approach in the comments.