In this video we are going to solve Pickle Rick challenge from Tryhackme, which is focused on exploiting
command injection vulnerabilities on websites.
So on.
Try hack me in pickle rec room.
Start your machine.
No, I am already connected to Tryhackme VPN.
First of all, let's just add the website address to our host file with the command sudo nano host.
Then add the IP address and the website address to it.
No.
Browse to the website.
Here we have a single static page called Help Morty.
You can view the page with pressing Ctrl you.
And if you look closely, you will find a username here.
Now whenever you are doing website testing, the second thing to look at is robots.txt file.
The visit, the robots.txt file.
And we also have a term here, I think it's password.
Now let's do some dare busting on the website.
I'm using f give the IP address.
And I'm using the word list from derp.
It has found one directory called assets.
Here.
We have some files listed.
Now let's just look for some specific extensions.
Do the same command with dash e flag and specify the extensions.
Here I am looking for php, html or text files.
So there is a login dot PHP page also on the website.
Let's just try to visit that.
And use the same username and password that you found earlier to log in.
And we have a command panel here.
So we can execute any command here.
We can use to list down the files.
And here we have super secret pickle ingredient text file.
This looks interesting.
Let's just try to cat out the contents of this file.
However, this command is disabled.
Let's just try some other commands like Head, which is also disabled.
Nano is also not working.
So let's just try grep.
You can use grep dot and file name to list down the contents.
And we do have the contents of the file.
When the folder.
There were also some other files which looks interesting.
Just check the contents of the text file with grep dot glue dot text command.
To the hint says look into the file system for other ingredients.
You can use grep to recursively list the contents of all files in the current folder.
Just use the command grep dash capital r.
Dot and it will list down the contents of all files.
So in this manner you can quickly check if there is some important or interesting thing listed in any
file.
So let's just answer the first question on Tryhackme, which was the first ingredient Name.
And paste the answer there.
Now let's see if Python is installed on the web server.
Use the command python version.
So we do have Python 3.5.2 on the server.
We can use a python reverse shell to execute commands on the system.
First of all, open a new terminal on your Kali machine and open a netcat listener.
Load down your IP address.
Now go to rev shells and create a python three reverse shell.
To copy it.
And paste it in the command panel.
No.
Execute the command.
We do get the reverse shell on our Kali Linux.
So in this manner we can easily navigate in our file system.
Currently we are in w w directory.
We can move to home.
Here is a directory.
Just list down the contents.
So we have second ingredients file here.
Just get out its contents.
And we have the second ingredient.
Just paste it in.
Try hack me.
Now let's just move to route.
Here we have third text file.
Just list down its content as well.
And here we have the third ingredient as well.
So copy the ingredient.
And paste it on.
Try hack me.
So we have successfully solved the Pickle Rick challenge on Tryhackme, which is a very good room in
terms of learning command injection.
I hope you like this video and see you in the next video.