Bounty Hacker Walkthrough - Try Hack Me
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More β
You were boasting on and on about your elite hacker skills in the bar and a few Bounty Hunters decided they'd take you up on claims! Prove your status is more than just a few glasses at the bar. I sense bell peppers & beef in your future!
Task 1: Living up to the title.
Enumaration
Nmap
We found three ports open that is port 21, 22 and 80.
For us to answer Who wrote the task list?
We will have to connect to the system using FTP since it allows anonymous connections.
NB: FTP is used to transfer files in a network between the client and server
FTP Exploitation
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More β
As we can see, we have access to our FTP. We can try and see what file are here using ls.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More β
We see, there are two files. To get them in my machine, I will use get filename
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More β
Now I can exit and read the files downloaded and try to answer the question Who wrote the task list?
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More β
As we can see, the author is -lin
Next, we now answer the question What service can you bruteforce with the text file found?
Ans: SSH
Next, is to get the user password
. We will use Hydra
, to bruteforce the ssh creds and have the file locks.txt
as our wordlist.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More β
Gaining User
We now have the user password, we can now ssh into the target.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More β
I have successfully connected to the target.
Now, I can have user.txt
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More β
Yaay we got user.
Privilege Escalation
We can check what service we can run as super user using sudo -l
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More β
Now as you can see, we have permission of tar as root.
After a little bit of research and googling, i found some exploit from gtfoibins on tar escalation
sudo tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh
Using the exploit as root, Boom! we get root
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More β
Now we can successfully get root.txt
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More β
Congratulantions , finally we solved the lab and thank you so much for your time, if you liked this writeup and you feel itβs helpful then please share it with your friends.
Happy hacking!