Format

Recon

nmap_scan.log

HTTP (80)

Writeup.png

We are allowed to register and then add new domain. I tried injecting PHP code inside, but it got replaced by comments.

Writeup-1.png

Gitea

Going back to home page for enumeration I noticed Contribute here! link leading to port 3000, which wasn't discovered by RustScan

Writeup-2.png

Application lives in /var/www/microblob

Writeup-3.png

order.txt records all the files that are in content directory.

Writeup-4.png

File Write

microblog/microblog-template/edit/index.php contains some dangerous login, it opens any file given by id parameter and writes any content wrapped in html.

We are able to write to any file, but no code execution.

Writeup-5.png

bulletproof.php is being included by the code itself so we might achieve RCE this way. But to do that we need to have the file, and for that we need to be pro.

LFI

The code is also vulnerable to file read, because the file we write to is added in order.txt which on page render includes and displays all the fles.

We can't write to the file, but because it's added in orders.txt that's why we get LFI.

Writeup-6.png

To pretty print:

Controlling Proxied Host

/etc/nginx/nginx.conf is not helpful, but /etc/nginx/sites-enabled/default was

This clearly smells like SSRF, but I wasn't able to get it to work with domain name in the URL.

Google to the rescue: Middleware, middleware everywhere – and lots of misconfigurations to fixarrow-up-right

Turns our nginx allows sending requests to endpoints with that structure even if it has http:// prefix and fixed suffix.

Properly urlencode the parts and send like shown in blog. recipearrow-up-right

Note: The space at the end of Redis command is very important as it's the delimiter for proper HTTP request!

Writeup-7.png

The server returns 502, but as we can see the username on dashboard is changed, meaning Redis was overwritten!

Redis (Update Pro)

Make yourself pro

Pro user's have third option of uploading images.

Writeup-8.png

Reverse Shell

The image upload functionality is not useful for us, but provisionProUser function created new folder /uploads where we can try to write php and see what happens

Writeup-9.png

Current user can't do much, root owns most of the stuff. .git has same stuff as Gitea.

We might as well check Redis as that was the database.

Reverse Shell (Automated)

The shell died 💀 automated the process...

Redis Enumeration

SSH (22)

Creds: cooper:zooperdoopercooper

User.txt

Privilege Escalation

The script is vulnerable to Format String Injection, because we are able to control fstring we are allowed to make modifications. Like using license.created field and not the raw string itself.

Writeup-10.png
Writeup-11.png

Creds: root:unCR4ckaBL3Pa$$w0rd

Root.txt

Last updated