You're inside a Linux machine as a regular user named alex.
Your goal is to gain root access.
You start by checking your permissions.
alex@lab:~$ whoami
alex
alex@lab:~$ id
uid=1001(alex) gid=1001(alex) groups=1001(alex),1002(devops)
You check what you're allowed to run:
alex@lab:~$ sudo -l
User alex may run the following commands:
(root) NOPASSWD: /usr/local/bin/backup
You investigate the backup script:
alex@lab:~$ ls -l /usr/local/bin/backup
-rwxrwxr-x 1 root devops 245 Nov 20 10:30 /usr/local/bin/backup
Here's the script:
#!/bin/bash
echo "Starting system backup..."
tar -czf /tmp/backup.tar.gz /var/www/html
echo "Backup completed."
Your challenge:
- Can you escalate your privileges to root?
- What's the security misconfiguration?
- How would you exploit it in this lab?
- How would you fix it without breaking the backup process?
Try solving it before checking the comments.
No Metasploit. No automated privilege escalation scripts.
Just Linux knowledge and a terminal.
This is a fictional, authorized lab scenario.