Again and again we start with nmap:
no other ports with using -p-
We see already that webserver has robots.txt with disallowed /admin
from nginx output. Also we see nodejs, I’m quite sure site is running nginx reverse proxy and port 32768 isn’t locked with firewall.
Nothing interesting on webpage except <a href="/login">Log in</a> | <a href="/signup">Sign up</a>
Also we see that links to items are http://10.10.4.72:32768/item/<NUMBER>
so i tried a bit of bruteforcing them, found nothing interesting.
Let’s run ffuf while checking
/signup
/login
and /admin
I created account
test:123456
ffuf finished scan, we see nothing interesting.
Pressing on Messages opens quite interesting forms with “File uploads temporarily disabled due to security issues” i think we still can upload making that active.
So we just remove
disabled=""
from <input>
tag.
Let’s upload just an image to test does it work or not.
Let’s test for XSS. Just put
<script>alert(0);</script>
into title
Yes! We have XSS!
So box is emulating admin reviewing reports. It makes request to that post, so we can utilize that to get cookies of admin.
I have only one idea: Let’s start python’s http server that will show all the requests to us and create code that will make request that includes cookies.
So we run python -m http.server 4444
and let’s create post.
So this is out cookies that we got when did enter page. Now let’s report it and wait.
So that’s admin token! Let’s use it.
Now we have new button that leads to /admin
First thing I had in mind was bruteforce with that usernames, but then I recognized that clicking on every user opens
http://10.10.4.72/admin?user=<USERID>
so we can try SQLi
I’m absolute noob at SQLi so I will try sqlmap:
sqlmap -u "http://10.10.4.72/admin?user=1" --cookie='token=<STOLLENTOKEN>' --technique=U -dump --delay=2
We got a lot of info!
Of course SSH password looks very juicy, let’s try that.
ID 3 is user jake, so we try
in that file we have tar wildcard
gtfobins gives us this parameters, let’s try to use them to gain revshell access.
Let’s create simple nc revshell.
and on host we run nc -lvnp 4444
Oops… So let’s get revshells.com nc revshell with mkfifo
Connection received on 172.30.112.1 52607
sucess now we are michael!
Let’s run linpeas cause I have no idea what to do next.
On host:
On target:
michael is in docker group that is very interesting
nothing interesting. let’s check gtfobins
Untitled-4.avif
It was quite a fun machine!