IClean

Recon

chevron-rightnmap_scan.loghashtag
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-' `-'`-----'`----'  `-'  `----'  `---' `-'  `-'`-' `-'
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog           :
: https://github.com/RustScan/RustScan :
 --------------------------------------
Real hackers hack time ¬フ

[~] The config file is expected to be at "/home/rustscan/.rustscan.toml"
[~] Automatically increasing ulimit value to 5000.
Open 10.10.11.12:22
Open 10.10.11.12:80
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} {{ip}} -vvv -sV -sC -Pn" on ip 10.10.11.12
Depending on the complexity of the script, results may take some time to appear.
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
[~] Starting Nmap 7.93 ( https://nmap.org ) at 2024-05-18 16:24 UTC
NSE: Loaded 155 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 16:24
Completed NSE at 16:24, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 16:24
Completed NSE at 16:24, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 16:24
Completed NSE at 16:24, 0.00s elapsed
Initiating Parallel DNS resolution of 1 host. at 16:24
Completed Parallel DNS resolution of 1 host. at 16:24, 0.01s elapsed
DNS resolution of 1 IPs took 0.02s. Mode: Async [#: 1, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]
Initiating Connect Scan at 16:24
Scanning 10.10.11.12 [2 ports]
Discovered open port 22/tcp on 10.10.11.12
Discovered open port 80/tcp on 10.10.11.12
Completed Connect Scan at 16:24, 0.84s elapsed (2 total ports)
Initiating Service scan at 16:24
Scanning 2 services on 10.10.11.12
Completed Service scan at 16:24, 6.38s elapsed (2 services on 1 host)
NSE: Script scanning 10.10.11.12.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 16:24
Completed NSE at 16:24, 3.95s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 16:24
Completed NSE at 16:24, 0.69s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 16:24
Completed NSE at 16:24, 0.00s elapsed
Nmap scan report for 10.10.11.12
Host is up, received user-set (0.84s latency).
Scanned at 2024-05-18 16:24:06 UTC for 13s

PORT   STATE SERVICE REASON  VERSION
22/tcp open  ssh     syn-ack OpenSSH 8.9p1 Ubuntu 3ubuntu0.6 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   256 2cf90777e3f13a36dbf23b94e3b7cfb2 (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBG6uGZlOYFnD/75LXrnuHZ8mODxTWsOQia+qoPaxInXoUxVV4+56Dyk1WaY2apshU+pICxXMqtFR7jb3NRNZGI4=
|   256 4a919ff274c04181524df1ff2d01786b (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJBnDPOYK91Zbdj8B2Q1MzqTtsc6azBJ+9CMI2E//Yyu
80/tcp open  http    syn-ack Apache httpd 2.4.52 ((Ubuntu))
|_http-server-header: Apache/2.4.52 (Ubuntu)
|_http-title: Site doesn't have a title (text/html).
| http-methods: 
|_  Supported Methods: HEAD GET POST OPTIONS
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 16:24
Completed NSE at 16:24, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 16:24
Completed NSE at 16:24, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 16:24
Completed NSE at 16:24, 0.00s elapsed
Read data files from: /usr/bin/../share/nmap
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 15.19 seconds
└─$ grep clean /etc/hosts
10.10.11.12     capiclean.htb

HTTP (80)

Writeup.png

We have few pages to browse

Choose page gives us option to get a quote, form usually means we can inject something

Writeup-1.png

XSS

After sending the email we get message that our email will be seen by management team

Writeup-2.png

I first tried XSS on email field, but it didn't work. After trying it on different field like service we got a callback

Payload:

Writeup-3.png

Assign the cookie to your session to become the user whose cookie we stole.

First I tried going to Loginarrow-up-right, but it didn't redirect me to anywhere. Without directory enumeration I tried Dashboardarrow-up-right and we got in, as it is one of the most common endpoint after login.

/dashboard

Writeup-4.png
Writeup-5.png

Submit link and get report:

Writeup-6.png

SSTI

The generated report comes from Python server, so SSTI is somewhat guaranteed

Writeup-7.png

Automate the QR shinanigans:

But it's not successful, nor was XSS

Any special character is filtered out right away.

QR Link

Inspecting the url we see qr_link variable and then qr-code html element rendered as base64 image

Writeup-9.png

Fuzz the parameter and it gets reflected:

Writeup-8.png

Performing SSTI on the qr_link is successful!

Writeup-10.png

https://book.hacktricks.xyz/pentesting-web/ssti-server-side-template-injection#jinja2-pythonarrow-up-right

After some fuzzing we determine that application doesn't like __ in the parameter

{% end_raw %}

Writeup-11.png

Test script: srcarrow-up-right

. was also blocked, which made the injection a bit harder

circle-info

Note: Piping to sh didn't work?...

Reverse Shell (www-data)

Writeup-12.png
circle-check

SSH (22)

User.txt

Privilege Escalation

GTFOBins didn't have this binary, so look into the official docs: https://qpdf.readthedocs.io/en/stable/cli.htmlarrow-up-right

Root.txt

Root scripts

Last updated