HomeCapture The FlagMoneyBox 1 Vulnhub CTF Walkthrough

MoneyBox 1 Vulnhub CTF Walkthrough

This MoneyBox 1 Vulnhub ctf walkthrough covers an easy box built from small clues that fit together. Three ports are open – FTP, SSH and HTTP. HTML comments on the website give you a steghide password. That password opens an image from the anonymous FTP share, and the hidden text names the SSH user to brute force. From there, an SSH key moves you to a second user, and a sudo perl rule with NOPASSWD gives you root. MoneyBox 1 Vulnhub ctf walkthrough is overall easy for beginners who wanted to solve their first ctf.

The machine is on Vulnhub and on OffSec Proving Grounds. The path is the same on both, with one difference, the second user flag isn’t on the Proving Grounds version.

What you need

Standard Kali tools – nmap, gobuster, an FTP client, steghide, hydra and ssh. You also need SecLists and rockyou.txt. You don’t need any exploits on this box.

Enumeration

Step 1: Port Scanning

Start with the usual enumeration using nmap or any other port scanner.

nmap -sV 192.168.31.181 -oN nmap.txt
moenybox-vulnhub-port-scanning

Three ports are open: 21 (FTP), 22 (SSH) and 80 (HTTP).

Step 2: Check the web server

Port 80 serves a simple page.

moenybox-vulnhub-web-server

The home page has nothing useful on it, so move on to fuzzing.

Step 3: Directory fuzzing and HTML comments

 gobuster dir -u http://192.168.31.181 -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
moenybox-vulnhub-dir-fuzzing

gobuster finds /blogs. The page itself looks empty, but inspect element, because a comment points to another directory, /S3cr3t-t3xt.

moenybox-vulnhub-hidden-directory

Check that page’s source too. This time the comment contains a secret key.

moenybox-vulnhub-secret-key

Save the key. It doesn’t log in to anything on the web server. It’s the steghide password for the next step.

Step 4: Download the image from anonymous FTP

FTP allows anonymous login. There’s one image on the share, trytofind.jpg

ftp 192.168.31.181
ls -la
mget trytofind.jpg
moenybox-vulnhub-ftp-login

Step 5: Extract hidden data with steghide

exiftool and strings show nothing interesting. That’s expected, because the data is embedded with steghide and only comes out with the right password. Use the key from /S3cr3t-t3xt.

steghide extract -sf trytofind.jpg -p "3xtr4ctd4t4"
moenybox-vulnhub-steghide

You get data.txt. It mentions a user called renu and says renu’s password is weak, so the next step is a brute force.

Initial Foothold

Step 6: Brute force SSH for renu

hydra -l renu -P ~/rockyou.txt ssh://192.168.31.181
moenybox-vulnhub-hydra-ssh-brute-force

Hydra finds the password 987654321. It’s high up in rockyou, so the brute force finishes quickly.

Step 7: SSH in as renu

Login using renu’s credentials.

ssh renu@192.168.31.181
moenybox1-vulnhub-ctf-walkthrough-user

The first user flag is in renu’s home directory.

Privilege Escalation

Step 8: Move to user lily with an SSH key

Read renu’s shell history.

cat .bash_history
moneybox-vulnhub-cat-bash-history

The history shows renu has set up SSH key login to the user lily, so renu’s private key works for lily’s account. Use it over localhost from the box itself.

ssh -i id_rsa lily@127.0.0.1
moenybox1-vulnhub-ctf-walkthrough-user2

That gets you lily’s shell and the second user flag. On Proving Grounds this flag doesn’t exist, so don’t spend time looking for it.

Step 9: root with sudo perl (NOPASSWD)

Check lily’s sudo rights.

sudo -l

lily can run perl as root without a password. Perl can run system commands, so a sudo perl rule is effectively a root shell. This is the one-liner from GTFOBins.

sudo perl -e 'exec "/bin/sh";'
moenybox1-vulnhub-ctf-walkthrough-root

Bingo! got the root, so you own the box.

DriftingBlues 6 Vulnhub CTF Walkthrough – https://pentestguy.com/driftingblues-6-vulnhub-ctf-walkthrough/
Evilbox One – Vulnhub CTF Walkthrough – https://pentestguy.com/evilbox-one-vulnhub-ctf-walkthrough/
Mercury Vulnhub CTF Walkthrough – https://pentestguy.com/mercury-vulnhub-ctf-walkthrough/


If you found this post helpful, please share it with your co-workers and friends. Please leave a comment and let us know if you have any suggestions. You can also collaborate with us, so please check our collaboration page. Thank you!

Shubham Nagdive
Shubham Nagdivehttps://www.pentestguy.in
Shubham Nagdive is founder of Pentestguy. Working as Penetration Tester, Infosec Speaker. He love to explorer more about Cyber Security and Ethical Hacking.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments