Machine: https://www.vulnhub.com/entry/fristileaks-13,133/
- NMap
- dirb
- netcat
- Download VM and Install OVA file. Open the machine, you will get the IP. In my case IP is 192.168.0.10.
- Basic
NMap
scan shows http port 80 is open. There is a website running there. - Running directory busting tool
dirb
givesrobots.txt
url. - There are three links inside
robots.txt
. But those links are not useful. - But all those links are rabbit holes. So, I guessed fristi as wordlist as the word fristi is everywhere and found this link,
http://192.168.0.10/fristi/
. - If we open source code, we can find username as
eezeepz
Inside an html comment. - We can find
base64
string inside another html comment. - If we convert the
base64
topng
, it will load the image with the passwordkeKkeKKeKKeKkEkkEk
. - Now we can login with username
eezeepz
and passwordkeKkeKKeKKeKkEkkEk
. - Now we have an interface to upload files.
- Tried to upload a shell but only image files were allowed. So, I downloaded the pentester monkey php reverse shell from https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php and updated the ip port to machine ip and listener port. Then renamed the file with
.jpg
extension. - If we open a
netcat
listener withnc -lvp port
. Then open the linkhttp://{VM_IP}/fristi/uploads/{upload_file_name}
then we will get reverse shell.
- By running
uname -a
we can find that version is vulnerable todirty cow
. I used this exploit https://www.exploit-db.com/exploits/40839 and added a user namedfirefart
as root user with passwordpassword
. - Now we can simply get a
tty shell
to make the shell interactive withpython -c 'import pty; pty.spawn("/bin/bash")'
and login as root userfirefart
withsu firefart
. - Now we can simply got to root directory and find a file with name
fristileaks_secrets.txt
. Inside that file we have the flagY0u_kn0w_y0u_l0ve_fr1st1
.
Author: Zishan Ahamed Thandar