Cat

Recon

nmap_scan.log

HTTP (80)

The website is about some contest about Cats. Register for website from /join.php

Writeup-1.png

For some reason the credentials are passed via GET params and not POST data.

Writeup.png

Fuzzing

I tried tempering with upload form but nothing, run a recon in background.

Git Dump

Git exists so dump it

There's SQL injection in accept_cat.php, if we are user axel

Writeup-2.png

There seems to be second injection if we can manipulate username in such a way to create injection, but it's only accessible to axel again.

Writeup-3.png

contest.php:

File Upload Bypass (fail)

We are able to bypass the upload restrictions and slip in PHP, but no idea where it is.

Writeup-4.png

Following location is too random because of uniqid


From the future: The bypass fooled the php functions, but it's still uploaded as JPG. Also to access the file you need to URL Encode the percentage.

Writeup-9.png

With actual null byte it didn't work.

Writeup-10.png

XSS

Exfiltrate cookies via username:

There was no callback from box so after many tries and box restart I got callback... classic HTB

I think any session id works, using last 1 we are able to login as admin

Writeup-5.png

SQLi

Going back to the first discovered vulnerability

Note: Make sure to use correct PHPSESSID and remove proxy if you don't want to debug

Dump database

Writeup-6.png

Creds: rosa:soyunaprincesarosa

SSH (rosa)

There's SMTP server running and 3000 seems to be serving Gitea

Privilege Escalation (axel)

As adm group we are allowed to read /var/log files, and since auth happens with GET params check access.log for requests.

Creds: axel:aNdZwgC4tI9gnVXv_e3Q

User.txt

Privilege Escalation (axel)

Port forward Gitea

axel user is able to login

Writeup-7.png

axel doesn't have anything, we can't auth as rosa and we don't know credentials for administrator.

Run linpeas in background:

I don't think it's CVE, but there was SMTP server.

Gitea 1.22.0 - Stored XSSarrow-up-right

Hmm... Send mail, trigger XSS, get cookies?

We have CSRF with user jobert:

Note: For some reason in email 127.0.0.1 didn't work, but localhost did....

EXFILTRATE_PAGE = 'http://localhost:3000/administrator/Employee-management/ returns

Writeup-8.png

To catch all the requests and log them use ncat with -k

Note: tee may not work correctly.... Terminal better..... (It's quick and dirty!)

EXFILTRATE_PAGE = 'http://localhost:3000/administrator/Employee-management/raw/branch/main/index.php

Root.txt

Last updated