4 minute read

SniperPermalink

Information GatheringPermalink

Nmap Port ScanPermalink

Screenshot

Nmap Script ScanPermalink

Screenshot

Nmap Full Sport ScanPermalink

Screenshot

Nmap Vulnerability ScanPermalink

Screenshot

Service EnumerationPermalink

Nikto Web Scan on Port 80Permalink

Screenshot

FFuF Web Enumeration on Port 80Permalink

Screenshot

Nmap SMB ScanPermalink

Screenshot

HTTP Service EnumerationPermalink

Screenshot

Gobuster Web EnumerationPermalink

Screenshot

/blog Web EndpointPermalink

Screenshot

User Account RegistrationPermalink

Screenshot

Screenshot

PenetrationPermalink

Local File Inclusion - Lang ParameterPermalink

The lang parameter on the /blog/ endpoint is vulnerable to local file inclusion. The curl request below shows the basic local file inclusion of the win.ini file on the target server.

Screenshot

Remote File Inclusion over SMBPermalink

After testing local file inclusion we can attempt to utilize an SMB path starting with \\ and then our attacking machine IP. Standing up a basic SMB server using the Impacket Python library allows us to confirm the connectivity on the back end. The Impacket library server does not appear to be fully functioning but settings up an SMB share on the attacking Kali machine will allow us to use the RFI vulnerability against the full SMB server. Creating a reverse shell is documented below.

Screenshot

Screenshot

Screenshot

iusr User Shell EnumerationPermalink

Once remote code execution is achieved and a reverse shell can be easily spawned by copying nc64.exe onto the box and then executing the reverse shell command.

Screenshot

Privilege EscalationPermalink

SQL Credentials in db.phpPermalink

Screenshot

Chris User ShellPermalink

The Chris user is the only other interactive user on the target machine. Using the stolen MySQL credentials to create a PowerShell command we can run our reverse shell as the Chris user.

Screenshot

Screenshot

Chris User Shell EnumerationPermalink

It appears that C:\Docs is being used to discuss documentation on a new PHP project and they are expecting files to be placed there so that they can be read. After placing our CHM file in our downloads folder here we can see that it is read and deleted.

Screenshot

Screenshot

Crafting Malicious CHM FilePermalink

Because this CHM file is being opened and deleted we can craft a malicious file to be read by the end user. A tool has been created to do just that called Out-CHM.ps1 by Nishang. Below illustrates the steps for successful exploitation. A second Windows VM was used to compile the particular file.

http://web.archive.org/web/20160201063255/http://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe

https://github.com/samratashok/nishang/blob/master/Client/Out-CHM.ps1

Screenshot

Screenshot

Screenshot

Administrator User ShellPermalink

By mounting the attacking machine SMB share using net use we can easily access files on the attacking server from the compromised user shell. Simply copying files off of this share to the C:\Docs location and waiting will return a user shell as the NT AUTHORITY\SYSTEM user, allowing for infinite control over the target system.

Screenshot

Screenshot

Screenshot

Screenshot