engañar a cisco vpn con rutas

engañar a cisco vpn con rutas

Estoy trabajando en una manera de engañar al cliente vpn de Cisco modificando las rutas en el sistema local para lograr un estado que se llama túnel dividido.

Sé que no tengo derecho a hacer esto sin el permiso del administrador de la red VPN y no tengo intención de utilizarlo. Sin embargo, esto es un desafío para mí para comprender mejor el enrutamiento en Windows, tal vez incluso una prueba de concepto que podría usar para mostrar a algunos administradores que confiar en esa casilla de verificación en su software no tiene ninguna utilidad para la seguridad.

Vamos, esto es lo que encontré. Todo está modificado a direcciones de redes privadas. El escenario es un trabajador remoto que trabaja desde su red soho 192.168.81.0 y se conecta a través de cisco-vpn a la red de su empresa 192.168.71.0. En este ejemplo, el VPN-Host para la configuración de Cisco se modifica a 192.168.10.5.

El trabajador remoto está conectado a su red soho a través de WLAN, su configuración de IP normal mientras no está en VPN es similar a la siguiente:

Drahtlos-LAN-Adapter Drahtlosnetzwerkverbindung:

   Verbindungsspezifisches DNS-Suffix: soho
   Beschreibung. . . . . . . . . . . : Intel(R) Centrino(R) Ultimate-N 6300 AGN
   Physikalische Adresse . . . . . . : 00-00-00-00-00-01
   DHCP aktiviert. . . . . . . . . . : Ja
   Autokonfiguration aktiviert . . . : Ja
   IPv4-Adresse  . . . . . . . . . . : 192.168.81.105(Bevorzugt) 
   Subnetzmaske  . . . . . . . . . . : 255.255.255.0
   Standardgateway . . . . . . . . . : 192.168.81.254
   DHCP-Server . . . . . . . . . . . : 192.168.81.254
   DNS-Server  . . . . . . . . . . . : 208.67.222.222
                                       8.8.8.8
                                       195.66.0.3
   NetBIOS über TCP/IP . . . . . . . : Aktiviert

La tabla de enrutamiento del sistema no parece espectacular como se esperaba:

===========================================================================
Schnittstellenliste
 15...24 77 03 20 82 20 ......Intel(R) Centrino(R) Ultimate-N 6300 AGN
===========================================================================

IPv4-Routentabelle
===========================================================================
Aktive Routen:
     Netzwerkziel    Netzwerkmaske          Gateway    Schnittstelle Metrik
          0.0.0.0          0.0.0.0   192.168.81.254   192.168.81.105     25
        127.0.0.0        255.0.0.0   Auf Verbindung         127.0.0.1    306
        127.0.0.1  255.255.255.255   Auf Verbindung         127.0.0.1    306
  127.255.255.255  255.255.255.255   Auf Verbindung         127.0.0.1    306
     192.168.81.0    255.255.255.0   Auf Verbindung    192.168.81.105    281
   192.168.81.105  255.255.255.255   Auf Verbindung    192.168.81.105    281
   192.168.81.255  255.255.255.255   Auf Verbindung    192.168.81.105    281
        224.0.0.0        240.0.0.0   Auf Verbindung         127.0.0.1    306
        224.0.0.0        240.0.0.0   Auf Verbindung    192.168.81.105    281
  255.255.255.255  255.255.255.255   Auf Verbindung         127.0.0.1    306
  255.255.255.255  255.255.255.255   Auf Verbindung    192.168.81.105    281
===========================================================================
Ständige Routen:
  Keine

Después de conectarse a la VPN, el dispositivo de red virtual se agrega al sistema:

Ethernet-Adapter LAN-Verbindung 2:

   Verbindungsspezifisches DNS-Suffix: 
   Beschreibung. . . . . . . . . . . : Cisco Systems VPN Adapter for 64-bit Windows
   Physikalische Adresse . . . . . . : 00-00-00-00-00-02
   DHCP aktiviert. . . . . . . . . . : Nein
   Autokonfiguration aktiviert . . . : Ja
   IPv4-Adresse  . . . . . . . . . . : 192.168.71.186(Bevorzugt) 
   Subnetzmaske  . . . . . . . . . . : 255.255.255.0
   Standardgateway . . . . . . . . . : 192.168.71.1
   DNS-Server  . . . . . . . . . . . : 10.2.20.12
                                       10.2.20.13
   Primärer WINS-Server. . . . . . . : 10.2.20.12
   Sekundärer WINS-Server. . . . . . : 10.2.20.13
   NetBIOS über TCP/IP . . . . . . . : Aktiviert

Drahtlos-LAN-Adapter Drahtlosnetzwerkverbindung:

   Verbindungsspezifisches DNS-Suffix: soho
   Beschreibung. . . . . . . . . . . : Intel(R) Centrino(R) Ultimate-N 6300 AGN
   Physikalische Adresse . . . . . . : 00-00-00-00-00-01
   DHCP aktiviert. . . . . . . . . . : Ja
   Autokonfiguration aktiviert . . . : Ja
   IPv4-Adresse  . . . . . . . . . . : 192.168.81.105(Bevorzugt) 
   Subnetzmaske  . . . . . . . . . . : 255.255.255.0
   Standardgateway . . . . . . . . . : 192.168.81.254
   DHCP-Server . . . . . . . . . . . : 192.168.81.254
   DNS-Server  . . . . . . . . . . . : 208.67.222.222
                                       8.8.8.8
                                       195.66.0.3
   NetBIOS über TCP/IP . . . . . . . : Aktiviert

La tabla de enrutamiento se modifica a lo siguiente:

===========================================================================
Schnittstellenliste
 22...00 00 00 00 00 02 ......Cisco Systems VPN Adapter for 64-bit Windows
 15...24 77 03 20 82 20 ......Intel(R) Centrino(R) Ultimate-N 6300 AGN
===========================================================================

IPv4-Routentabelle
===========================================================================
Aktive Routen:
     Netzwerkziel    Netzwerkmaske          Gateway    Schnittstelle Metrik
          0.0.0.0          0.0.0.0   192.168.81.254   192.168.81.105     25
          0.0.0.0          0.0.0.0     192.168.71.1   192.168.71.186     21
        127.0.0.0        255.0.0.0   Auf Verbindung         127.0.0.1    306
        127.0.0.1  255.255.255.255   Auf Verbindung         127.0.0.1    306
  127.255.255.255  255.255.255.255   Auf Verbindung         127.0.0.1    306
     192.168.71.0    255.255.255.0   Auf Verbindung    192.168.71.186    276
   192.168.71.186  255.255.255.255   Auf Verbindung    192.168.71.186    276
   192.168.71.255  255.255.255.255   Auf Verbindung    192.168.71.186    276
     192.168.81.0    255.255.255.0   Auf Verbindung    192.168.81.105    281
     192.168.81.0    255.255.255.0     192.168.71.1   192.168.71.186    281
   192.168.81.105  255.255.255.255   Auf Verbindung    192.168.81.105    281
   192.168.81.105  255.255.255.255     192.168.71.1   192.168.71.186    281
   192.168.81.254  255.255.255.255   Auf Verbindung    192.168.81.105    100
   192.168.81.255  255.255.255.255   Auf Verbindung    192.168.81.105    281
     192.168.10.5  255.255.255.255   192.168.81.254    192.168.81.105    100
        224.0.0.0        240.0.0.0   Auf Verbindung         127.0.0.1    306
        224.0.0.0        240.0.0.0   Auf Verbindung    192.168.81.105    281
        224.0.0.0        240.0.0.0   Auf Verbindung    192.168.71.186    276
  255.255.255.255  255.255.255.255   Auf Verbindung         127.0.0.1    306
  255.255.255.255  255.255.255.255   Auf Verbindung    192.168.81.105    281
  255.255.255.255  255.255.255.255   Auf Verbindung    192.168.71.186    276
===========================================================================
Ständige Routen:
  Netzwerkadresse          Netzmaske  Gatewayadresse  Metrik
          0.0.0.0          0.0.0.0     192.168.71.1       1
===========================================================================

Como puede ver, el cliente Cisco VPN agrega una ruta predeterminada que tiene un Metrik bajo y envía todo el tráfico al túnel. La ruta predeterminada anterior no se elimina, pero AFAIR simplemente no se usa debido a la Metrik más baja de la vpn. Además, la nueva ruta predeterminada se vuelve permanente, lo cual es realmente molesto, ya que no tiene sentido, después de reiniciar, el cliente vpn no se ejecutará y la ruta ya no debería estar allí. Pero quién sabe cómo funciona Cisco ;-)

Lo que me hizo comenzar este desafío es la siguiente ruta:

     192.168.10.5  255.255.255.255   192.168.81.254    192.168.81.105    100

Según tengo entendido, esta ruta hace que todo funcione, ya que esa es la ruta que todo el túnel vpn tiene para usar esta ruta para sacar el tráfico de la interfaz real. Así que pensé que no debería ser demasiado difícil modificar el enrutamiento para que el tráfico predeterminado regrese a la interfaz real hacia la puerta de enlace real y solo el tráfico de la red remota al túnel vpn.

Empiezo eliminando las rutas predeterminadas y luego agrego una nueva ruta predeterminada como estaba antes de la conexión VPN. Luego agregando una ruta específica a la red remota:

route DELETE 0.0.0.0
route ADD 0.0.0.0 MASK 0.0.0.0 192.168.81.254 IF 15
route ADD 10.2.31.0 MASK 255.255.255.0 192.168.71.1 IF 22

Después de eso, la tabla de enrutamiento me parece bien:

===========================================================================
Schnittstellenliste
 22...00 00 00 00 00 02 ......Cisco Systems VPN Adapter for 64-bit Windows
 15...00 00 00 00 00 01 ......Intel(R) Centrino(R) Ultimate-N 6300 AGN
===========================================================================

IPv4-Routentabelle
===========================================================================
Aktive Routen:
     Netzwerkziel    Netzwerkmaske          Gateway    Schnittstelle Metrik
          0.0.0.0          0.0.0.0   192.168.81.254   192.168.81.105     26
        10.2.31.0    255.255.255.0     192.168.71.1   192.168.71.186     21
        127.0.0.0        255.0.0.0   Auf Verbindung         127.0.0.1    306
        127.0.0.1  255.255.255.255   Auf Verbindung         127.0.0.1    306
  127.255.255.255  255.255.255.255   Auf Verbindung         127.0.0.1    306
     192.168.71.0    255.255.255.0   Auf Verbindung    192.168.71.186    276
   192.168.71.186  255.255.255.255   Auf Verbindung    192.168.71.186    276
   192.168.71.255  255.255.255.255   Auf Verbindung    192.168.71.186    276
     192.168.81.0    255.255.255.0   Auf Verbindung    192.168.81.105    281
     192.168.81.0    255.255.255.0     192.168.71.1   192.168.71.186    281
   192.168.81.105  255.255.255.255   Auf Verbindung    192.168.81.105    281
   192.168.81.105  255.255.255.255     192.168.71.1   192.168.71.186    281
   192.168.81.254  255.255.255.255   Auf Verbindung    192.168.81.105    100
   192.168.81.255  255.255.255.255   Auf Verbindung    192.168.81.105    281
     192.168.10.5  255.255.255.255   192.168.81.254    192.168.81.105    100
        224.0.0.0        240.0.0.0   Auf Verbindung         127.0.0.1    306
        224.0.0.0        240.0.0.0   Auf Verbindung    192.168.81.105    281
        224.0.0.0        240.0.0.0   Auf Verbindung    192.168.71.186    276
  255.255.255.255  255.255.255.255   Auf Verbindung         127.0.0.1    306
  255.255.255.255  255.255.255.255   Auf Verbindung    192.168.81.105    281
  255.255.255.255  255.255.255.255   Auf Verbindung    192.168.71.186    276
===========================================================================
Ständige Routen:
  Keine

Sin embargo, después de esta modificación puedo conectarme a la red remota perfectamente como con las rutas que agregó el cliente VPN de Cisco, pero no a Internet.

Como no veo nada malo en las rutas, revisé nuevamente si Cisco arruinó mi sistema DNS, pero eso no se modificó en la interfaz WLAN.

Ethernet-Adapter LAN-Verbindung 2:

   Verbindungsspezifisches DNS-Suffix: 
   Beschreibung. . . . . . . . . . . : Cisco Systems VPN Adapter for 64-bit Windows
   Physikalische Adresse . . . . . . : 00-00-00-00-00-02
   DHCP aktiviert. . . . . . . . . . : Nein
   Autokonfiguration aktiviert . . . : Ja
   IPv4-Adresse  . . . . . . . . . . : 192.168.71.186(Bevorzugt) 
   Subnetzmaske  . . . . . . . . . . : 255.255.255.0
   Standardgateway . . . . . . . . . : 192.168.71.1
   DNS-Server  . . . . . . . . . . . : 10.2.20.12
                                       10.2.20.13
   Primärer WINS-Server. . . . . . . : 10.2.20.12
   Sekundärer WINS-Server. . . . . . : 10.2.20.13
   NetBIOS über TCP/IP . . . . . . . : Aktiviert

Drahtlos-LAN-Adapter Drahtlosnetzwerkverbindung:

   Verbindungsspezifisches DNS-Suffix: soho
   Beschreibung. . . . . . . . . . . : Intel(R) Centrino(R) Ultimate-N 6300 AGN
   Physikalische Adresse . . . . . . : 00-00-00-00-00-01
   DHCP aktiviert. . . . . . . . . . : Ja
   Autokonfiguration aktiviert . . . : Ja
   IPv4-Adresse  . . . . . . . . . . : 192.168.81.105(Bevorzugt) 
   Subnetzmaske  . . . . . . . . . . : 255.255.255.0
   Standardgateway . . . . . . . . . : 192.168.81.254
   DHCP-Server . . . . . . . . . . . : 192.168.81.254
   DNS-Server  . . . . . . . . . . . : 208.67.222.222
                                       8.8.8.8
                                       195.66.0.3
   NetBIOS über TCP/IP . . . . . . . : Aktiviert

Aquí es donde muere mi caballo y necesito tu ayuda. ¿Hay alguien que pueda darme una pista sobre lo que extraño y/o entiendo mal? ¿Hay algún BlackHat por ahí?

Respuesta1

Llevo unos meses con el mismo problema. Tuve que desconectarme y tuve acceso a Internet. Conectarme para poder tener acceso a los recursos corporativos.... Una molestia.

Mi solución temporal fue instalar un Sonatype Nexus (proxy para dependencias) en Debian Linux y conectarme conVPN. Normalmente puedes instalarlo con apt-get/yum, etc.

Cuando esta solución no fue suficiente, instalé vpnc en mi máquina Windows con vpnc-fe http: // sourceforge.net/projects/vpncfe/ (VPNc Front-End) en la parte superior.

Mi configuración requería una configuración para una seguridad perfecta llamada "Force-NTT". Vereste hilo. Posteriormente deberás colocar el siguiente script en postconnect.bat:

[Copiar por si el hilo se cae]

¡Gracias, rodekerken! Aquí está el resultado final, no es necesario realizar retoques manuales para dividir las rutas divididas:

@echo off
REM By: capt-tagon
REM 
REM Post-Script.bat to take VPNC's Route Table into Windows 7 land. Erases bad route table entries, 
REM extracts gateway, assigned IP, Netmask, and Cisco split route entries and resubmits them to 
REM Windows 7 so the routing all works. Condensed from other entries on the VPNC-FE forae and combined
REM with information gleaned from VPNC client for Linux to find all the passed parameters useful
REM to making this work. Additional by rodekerken noted below, thank you for helping finish it out.
REM
setlocal enabledelayedexpansion
echo.
echo Post-Script Begin
echo.
REM Gather Connection Data
REM 
REM Parameters passed have space at end, see "HELP SET" at Console Prompt for explanation of
REM substring extraction
REM Strip space from TUNDEV, INTERNAL_IP4_ADDRESS, VPNGATEWAY, CISCO_SPLIT_INC
REM This will be broken if VPNC-FE is fixed to not export parameters with the trailing space.
REM 
set MyTUNDev=%TUNDEV:~0,-1%
REM By: rodekerken
REM From the top of the router table printout, look for a line like
REM 14...00 ff 5d b0 44 aa ......TAP-Win32 Adapter V9 to find the if number.
REM A way to find out the interface number automatically and extractis this:
for /f "tokens=1 delims=." %%a in ('route print ^|find "TAP-Win32"') do set MyIF=%%a
set MyIP=%INTERNAL_IP4_ADDRESS:~0,-1%
set MyMask=%INTERNAL_IP4_NETMASK:~0,-1%
set MyVPN=%VPNGATEWAY:~0,-1%
REM Number of Routing Table Entries for Split Tunnel
set MyCiscoSplit=%CISCO_SPLIT_INC:~0,-1%
REM Date Time functions
set ANSIDate=%date:~10%%date:~4,2%%date:~7,2%
set StartTime=%time:~0,2%%time:~3,2%%time:~6,2%
REM Display Connection Data
echo Tunnel Device : [%MyTUNDev%]
echo Tunnel IntFace: [%MyIF%]
echo Tunnel IPAddr : [%MyIP%]
echo Tunnel NetMask: [%MyMask%]
echo Tunnel VPN-GW : [%MyVPN%]
echo .
echo Date Connected: [%ANSIDate%]
echo Time Connected: [%StartTime%]
echo .
REM Cisco Routes are 0 index, 6 Routes = 0-5
echo Cisco Split Routes: [%MyCiscoSplit%]
REM Display Bad Route Table
echo.
echo Bad Route Table
route print | find "%MyIP%"
echo.
REM Delete Bad Split Route entries and add back with proper Gateway.
REM Extract Cisco routing table information to feed to "ROUTE ADD"
REM Number of entries passed in Array Index CISCO_SPLIT_INC 
REM For x below, value is 0 to CISCO_SPLIT_INC - 1
REM Address is passed in CISCO_SPLIT_INC_x_ADDR
REM NetMask is passed in CISCO_SPLIT_INC_x_MASK
REM
REM By: rodekerken
REM A way to loop and enumerate and evaluate the routes is like this:
set /A MyCiscoSplit-=1
for /L %%i in (0,1,%MyCiscoSplit%) do (
                set SplitAddr=CISCO_SPLIT_INC_%%i_ADDR
                set SplitMask=CISCO_SPLIT_INC_%%i_MASK
        for /f %%a in ('echo !SplitAddr!') do set SplitAddrEval=!%%a!
        for /f %%a in ('echo !SplitMask!') do set SplitMaskEval=!%%a!
        echo Route%%i !SplitAddrEval! !SplitMaskEval!
        route delete !SplitAddrEval! >nul
        route add !SplitAddrEval! mask !SplitMaskEval! %MyVPN% metric 1 if %MyIF% >nul
)
REM Display Corrected Route Table
echo.
echo Corrected Route Table
route print | find "%MyVPN%"
echo.
echo Post-Script End
echo.

También agregué estas rutas después de "PARA":

route add 1111.120.120.0 mask 255.255.255.0 0.0.0.0 metric 1 if %MyIF%
route add 1111.185.19.0 mask 255.255.255.0 0.0.0.0 metric 1 if %MyIF%
route add 10.0.0.0 mask 255.0.0.0 0.0.0.0 metric 1 if %MyIF%

[Tenga en cuenta que las dos primeras rutas tienen direcciones incorrectas/falsas. Necesitas cambiarlo de todos modos]

Para que mi script funcione repetidamente, es necesario crear un "disconnect.bat" que contenga la eliminación de rutas:

route delete 1111.120.120.0
route delete 1111.185.19.0
route delete 10.0.0.0

Sólo mis 0,02€

información relacionada