FristiLeaks: 1.3
Machine: https://www.vulnhub.com/entry/fristileaks-13,133/
Tools
- NMap
- dirb
- netcat
Gaining Access
- Download VM and Install OVA file. Open the machine, you will get the IP. In my case IP is 192.168.0.10.
- Basic
NMapscan shows http port 80 is open. There is a website running there. - Running directory busting tool
dirbgivesrobots.txturl. - 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
eezeepzInside an html comment. - We can find
base64string inside another html comment. - If we convert the
base64topng, it will load the image with the passwordkeKkeKKeKKeKkEkkEk. - Now we can login with username
eezeepzand 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
.jpgextension. - If we open a
netcatlistener withnc -lvp port. Then open the linkhttp://{VM_IP}/fristi/uploads/{upload_file_name}then we will get reverse shell.
Priviledge Escalation
- By running
uname -awe can find that version is vulnerable todirty cow. I used this exploit https://www.exploit-db.com/exploits/40839 and added a user namedfirefartas root user with passwordpassword. - Now we can simply get a
tty shellto make the shell interactive withpython -c 'import pty; pty.spawn("/bin/bash")'and login as root userfirefartwithsu 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