πYear of the Rabbit
Time to enter the warren...

1.Reconnaisance
1.1 Nmap
Using nmap to scan and identify open ports and services
We find open port
21,22, and80running ftp ,ssh and http server respectivelyWebpage is a default Apache landing page

2. Scanning
2.1 Gobuster
Directory brute forcing using gobuster on port
80
Going over to
/assets, we find

Viewing
style.css, we get another endpoint/sup3r_s3cr3t_fl4g.php

Going over, it pops up a warning to tun off the JavaScript and redirects us to a YouTube video of 'Rick Roll'

Capturing this request in burp,

We get an intermediary path
/WExYY2Cv-qUGoing over to that path, while forwarding the request one at a time, we get an image
Hot_Babe.png

Downlaoding the image
Using
stringson the image, we get an FTP password list for the userftpuser
Saving these to
pass.txt
2.2 Hydra
Using
hydrato brute force ftp password
We get the credentials
ftpuser:5iez1wGXKfPKQLogin in via FTP, we get a text file
Eli's_Creds.txt
In that file, we find some weird encoded text
It gives us the credentials
eli:DSpDiM1wAEwid
3. Gaining access
SSHing as Eli, we find a message in the headers
It talks about a secret hiding place, with the secret spelled in leet code.
Searching for
s3cr3t, we find a directory.usr/gamnes/s3cr3t
It has a hidden file
.th1s_m3ss4ag3_15_f0r_gw3nd0l1n3_0nly!. Reading it
We get the credentials
Gwendoline:MniVCQVhQHUNISwitching user as
gwendoline, we finduser.txtin her home folder
4. Privilege Escalation
4.1 CVE-2019-14287
When using
sudo -l, we get
There is a
!rootspecified, which meansgwendolinecan run/usr/bin/vias any user but therootuserViewing the sudo version we find that it is
1.8.10
This version is vulnerable to
CVE-2019-14287and it can be exploited to run as root by prependingsudo -u#-1to the path of the command that can be run by the user, i.e.sudo -u#-1 /usr/bin/vi /home/gwendoline/user.txt. Read more about it hereThis opens vi as root, and we can spawn as bash shell by typing
:!/bin/sh

Reading the
root.txtflag
Last updated