Shenzi
Nmap Scan
$ nmap -sC -sV -p- --min-rate 10000 -Pn -oN nmap 192.168.235.55
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-06-19 01:58 EDT
Nmap scan report for 192.168.235.55
Host is up (0.0073s latency).
Not shown: 65520 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
21/tcp open ftp FileZilla ftpd 0.9.41 beta
| ftp-syst:
|_ SYST: UNIX emulated by FileZilla
80/tcp open http Apache httpd 2.4.43 ((Win64) OpenSSL/1.1.1g PHP/7.4.6)
|_http-server-header: Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6
| http-title: Welcome to XAMPP
|_Requested resource was http://192.168.235.55/dashboard/
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
443/tcp open ssl/http Apache httpd 2.4.43 ((Win64) OpenSSL/1.1.1g PHP/7.4.6)
| http-title: Welcome to XAMPP
|_Requested resource was https://192.168.235.55/dashboard/
|_http-server-header: Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6
| tls-alpn:
|_ http/1.1
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=localhost
| Not valid before: 2009-11-10T23:48:47
|_Not valid after: 2019-11-08T23:48:47
445/tcp open microsoft-ds?
3306/tcp open mysql?
| fingerprint-strings:
| DNSStatusRequestTCP, DNSVersionBindReqTCP, Help, LANDesk-RC, LDAPSearchReq, NULL, RTSPRequest, SIPOptions, SMBProgNeg, SSLSessionReq, TerminalServer, WMSRequest, giop:
|_ Host '192.168.45.200' is not allowed to connect to this MariaDB server
5040/tcp open unknown
7680/tcp open pando-pub?
49664/tcp open msrpc Microsoft Windows RPC
49665/tcp open msrpc Microsoft Windows RPC
49666/tcp open msrpc Microsoft Windows RPC
49667/tcp open msrpc Microsoft Windows RPC
49668/tcp open msrpc Microsoft Windows RPC
49669/tcp open msrpc Microsoft Windows RPC
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port3306-TCP:V=7.94SVN%I=7%D=6/19%Time=66727386%P=x86_64-pc-linux-gnu%r
SF:(NULL,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200'\x20is\x20not\x2
SF:0allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20server")%r(RTSPRe
SF:quest,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200'\x20is\x20not\x2
SF:0allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20server")%r(DNSVer
SF:sionBindReqTCP,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200'\x20is\
SF:x20not\x20allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20server")
SF:%r(DNSStatusRequestTCP,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200
SF:'\x20is\x20not\x20allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20
SF:server")%r(Help,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200'\x20is
SF:\x20not\x20allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20server"
SF:)%r(SSLSessionReq,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200'\x20
SF:is\x20not\x20allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20serve
SF:r")%r(SMBProgNeg,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200'\x20i
SF:s\x20not\x20allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20server
SF:")%r(LDAPSearchReq,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200'\x2
SF:0is\x20not\x20allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20serv
SF:er")%r(SIPOptions,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200'\x20
SF:is\x20not\x20allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20serve
SF:r")%r(LANDesk-RC,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200'\x20i
SF:s\x20not\x20allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20server
SF:")%r(TerminalServer,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200'\x
SF:20is\x20not\x20allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20ser
SF:ver")%r(WMSRequest,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200'\x2
SF:0is\x20not\x20allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20serv
SF:er")%r(giop,4D,"I\0\0\x01\xffj\x04Host\x20'192\.168\.45\.200'\x20is\x20
SF:not\x20allowed\x20to\x20connect\x20to\x20this\x20MariaDB\x20server");
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled but not required
| smb2-time:
| date: 2024-06-19T06:01:09
|_ start_date: N/A
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 180.70 secondsInitial Access
Port 80
There is a XAMPP Website running on port 80

If we click into phpMyAdmin, it will give us this error page.

We are able to see the phpinfo page also

After doing some research, there is a way to get RCE with phpinfo.
There are 2 prerequisites we need to fulfil in order for this exploit to work.

The 2nd option definately is working. We only need to check if file_uploads are turned on.
As we can see, file_uploads is turned on.
However, there is no place that I can do LFI.
Port 445
Despite enum4linux returning no results, there is something interesting in the smb shares.

We can see that the anonymous user has access to this shared folder Shenzi.
After logging in using null credentials, we are able to see these files.

After inspecting, we can see that there might be a wordpress page that is running.

However, during the directory enumeration, there is nothing special. What if we try the box name as part of the URL. It turns out there is a wordpress page running there.

We can try to go wp-login.php to see if there is a login into the admin page.
There is a login page after we went there. The next step is to try the credentials that we got from passwords.txt.

We are successfully able to login as admin.

The next step is to upload a webshell so that we can trigger a reverse shell to be called.
FIrst, we need to go to theme editor.

We will change the content of the file of 404.php to this:
We will then press Update File to update the file content.
Lastly we just need to trigger the page and we should be able to get our reverse shell.

We are now in as the user shenzi
Privilege Escalation
AlwaysInstalledElevated
After some enumeration, there is this registry key that is turned on
After some searching online, we can see that it will automatically elevate us to admin when we installing a .msi file.
First, we need to create the payload that is required.
Next, we need to upload the payload into the target machine.


Next, we need to start the listener on our side.

Lastly, we just need to execute to trigger the reverse shell.

Last updated
