sudonmap192.168.235.55-p--sV-sSPORTSTATESERVICEVERSION21/tcpopenftpFileZillaftpd0.9.41beta80/tcpopenhttpApachehttpd2.4.43((Win64) OpenSSL/1.1.1g PHP/7.4.6)135/tcp open msrpc Microsoft Windows RPC139/tcpopennetbios-ssnMicrosoftWindowsnetbios-ssn443/tcpopenssl/httpApachehttpd2.4.43 ((Win64)OpenSSL/1.1.1gPHP/7.4.6)445/tcpopenmicrosoft-ds?3306/tcpopenmysql?5040/tcpopenunknown
As SMB is open we can run smbclient with no credentials to see if we can connect.
After running the above command smbclient returns results showing a share called 'Shenzi'. We can connect to the share and then view the contents with the dir command.
From here I set the recurse command and prompt off before downloading all files for an easy single line download.
The contents of passwords.txt of course proved to be interesting.
Out of all of the credentials above the WordPress one was potentially the most interesting considering further checks for phpmyadmin and webdav showed either the services are not running or inaccessible outside of local access on the target machine.
Running dirsearch.py against port 80 showed no interesting directories discovered.
Knowing that Wordpress is potentially installed and that Wordpress sites do not generally have to exist in the directory of /wordpress/ I tried the Machine and SMB share name of Shenzi on port 80.
Now that we have a valid WordPress site and some credentials we can try logging in. Heading over to http://192.168.235.55/shenzi/wp-admin/ I was able to log in with the credentials of admin:FeltHeadwallWight357
Heading over to Appearance > Theme editor I was able to edit the contents of the 404.php file and insert a webshell.
Uploaded the file with the PHP web shell and set a netcat listener on port 21. After uploading the shell through the web shell I then executed and received a shell back.
After some initial enumeration I was unable to find anything interesting. I then turned to winpeas look for any quick wins. Shortly after running, I came into:
With this, we can create a malicious MSI file with msfvenom and when executed will be run in the context of SYSTEM.