IClean

Port scan

β””β”€βžœ nmap -p22,80 $IP -sCV                                                                                                                                                                 [0]
Starting Nmap 7.94 ( https://nmap.org ) at 2024-04-08 21:55 IST
Nmap scan report for capiclean.htb (10.129.43.189)
Host is up (0.38s latency).

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.9p1 Ubuntu 3ubuntu0.6 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|   256 2c:f9:07:77:e3:f1:3a:36:db:f2:3b:94:e3:b7:cf:b2 (ECDSA)
|_  256 4a:91:9f:f2:74:c0:41:81:52:4d:f1:ff:2d:01:78:6b (ED25519)
80/tcp open  http    Apache httpd 2.4.52 ((Ubuntu))
|_http-title: Capiclean
| http-server-header:
|   Apache/2.4.52 (Ubuntu)
|_  Werkzeug/2.3.7 Python/3.10.12
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 36.43 seconds
  • Directory scan wasn't that imp on this machine (so skipping it)

Web -> XSS

image

Give dummy data and click on submit, after submitting we can see that there's a message "team will get back to you"

image

Hmm, feel like XSS, (BLIND XSS)

  • Blind XSS

We can send a payload and wait for the admin to view our response and we can get their cookies.

  • Payload

  • Response

And now we are admin

image

Web -> SSTI

AAAHHH, the website is build with python flask, the first bug i can thought of is SSTI.

image
  • The invoice generator is vulnerable to SSTI

image

SSTI -> RCE

image
  • Encode the payload to base64 and send it to the server

image

www -> User

  • we have found db creds

  • I used mysql cli to view data from the db

The reason i choose to use mysql cli is because the tty session of rev shell is not good to handle sql data, it doesn't work better basically

  • Crack the hash

User -> root

  • Login with ssh and get user.txt

Sudo -l

  • Documentation

After we bring pwn.pdf in our local machine (through, scp, python3 server) we can get contents of root.txt

You can take id_rsa in order to get root shell on the box.

Machine pwned!!

____heapbytes still pwning

Last updated