This Rick and Morty-themed challenge requires you to exploit a web server and find three ingredients to help Rick make his potion and transform himself back into a human from a pickle.
Started with Nmap scan:-
sudo nmap -sVC -p- -A -Pn 10.49.172.49 -T5 -oN nmap_scan.txt -vAdded ip to /etc/hosts by
sudo nano /etc/hosts
Press enter or click to view image in full size
Press enter or click to view image in full size
Found a web server at port 80
Press enter or click to view image in full size
Press enter or click to view image in full size
username:- R1ckRul3s
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Tried login with the username we got that is R1ckRul3s with both username and password field with R1ckRul3s but failed.
Press enter or click to view image in full size
Lets see whats present in
robots.txtthose who don't knowrobots.txtits a public file that tells search engines which parts of a website to avoid but for us, it often reveals hidden or sensitive paths worth checking.
On checking robots.txt we got something interesting as Wubbalubbadubdub
Hey maybe this would be password?
Join Medium for free to get updates from this writer.
Lets try Wubbalubbadubdub in the password of /login.php
And we successfully logged in! with R1ckRul3s:Wubbalubbadubdub we got redirected into /portal.php
Press enter or click to view image in full size
Command Panel so lets play with it! and found command injection.Press enter or click to view image in full size
lets try getting a RCE from this so lets check and confirm that does python3 is installed on the target using
which python3so that we will send python reverse shell payload.
Press enter or click to view image in full size
revshells.com and setup a listenerPress enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
After listing files and folder got a file named Sup3rS3cretPickl3Ingred.txt after reading it we got our first answer that first ingredient that Rick needs.
Press enter or click to view image in full size
Lets enumerate more…
we tried to read clue.txt and found a message Look around the file system for the other ingredient.
/home/rickAfter little enumeration we got another user directory at /home called ubuntu we tried ls to read files and directories but it showed nothing, so we tried to list hidden files and directories using ls -a and found .bash_history we tried to read but we don't have any permission.
Press enter or click to view image in full size
We checked what permission we have using sudo -l and found that we can run any command as root (or any user) without needing a password. so we loggedin as root by sudo suand now we are root user
Press enter or click to view image in full size
Press enter or click to view image in full size