$ nmap -p- --min-rate 5000 -Pn 10.129.71.39
Starting Nmap 7.93 ( https://nmap.org ) at 2023-05-06 15:38 EDT
Nmap scan report for 10.129.71.39
Host is up (0.0079s latency).
Not shown: 65532 closed tcp ports (conn-refused)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
3000/tcp open ppp
We have to add help.htb to the /etc/hosts file to access port 80.
GraphQL
This port had a HTTP API running:
$ curl http://help.htb:3000/
{"message":"Hi Shiv, To get access please find the credentials with given query"}
I ran a gobuster scan to find any places that I could send queries.
$ gobuster dir -w /usr/share/seclists/Discovery/Web-Content/big.txt -u http://help.htb:3000 -t 100
===============================================================
Gobuster v3.3
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://help.htb:3000
[+] Method: GET
[+] Threads: 100
[+] Wordlist: /usr/share/seclists/Discovery/Web-Content/big.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.3
[+] Timeout: 10s
===============================================================
2023/05/06 15:43:46 Starting gobuster in directory enumeration mode
===============================================================
/graphql (Status: 400) [Size: 18]
GraphQL was present. So we need to send query parameters and hopefully find some credentials or other information from this. We can use this to see all types and argument accepted:
We can login with helpme@helpme.com:godhelpmeplz. From the HelpDeskZ repository, there's a readme.html file present where we can find the version that is running.
First we need to open a ticket and then upload a cmd.php webshell.
Then we can submit this, and even though the website says the file type is not allowed, the file is still uploaded onto the website. Then, we can use 40200.py to find it.