Documentos de Académico
Documentos de Profesional
Documentos de Cultura
SEGURIDAD EN LAS
TELECOMUNICACIONES -
MGSI
TRABAJO DE FIN DE CURSO
ERICK JOSÉ DELGADILLO LOÁISIGA
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
Introducción
Objetivo
Creamos en el eve el siguiente diagrama con todos los puntos de interconexion de los puertos.
Dado el siguiente esquema de RED implementado en él EVE, realice los siguientes ítems:
1. Optimizar
2. Asegurar los Switch
3. Asegurar ROUTER
4. INTER VLAN ROUTER_ON_STICK
5. Listas de acceso (ACL) para los siguientes elementos:
a. Denegación de FTP
b. Aceptación de PING (ECHO_REQUEST)
6. Realización de ataque DHCP Spoofing
7. Aplicación de Remediación a los SWITCHS
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
1. Optimizar
Para la implementación de este ítem usaremos el protocolo SPANNING-TREE para los 3 Switch que se
encuentran en el EVE, primeramente, validaremos el orden de los Switch y luego estableceremos en
base a las necesidades el ROOT BRIDGE en el spanning-tree.
Para el Switch01
22
Switch>enable
Switch#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname switch01
switch01(config)#exit
switch01#
*Feb 3 20:55:21.690: %SYS-5-CONFIG_I: Configured from console by console
switch01#show span
switch01#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address aabb.cc00.2000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address aabb.cc00.2000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0 Desg FWD 100 128.1 Shr
Et0/1 Desg FWD 100 128.2 Shr
Et0/2 Desg FWD 100 128.3 Shr
Et0/3 Desg FWD 100 128.4 Shr
Para el Switch02
Switch>enable
Switch#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname switch02
switch02(config)#exit
switch02#show
*Feb 3 20:56:03.849: %SYS-5-CONFIG_I: Configured from console by console
switch02#show spa
VLAN0001
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
Switch(config)#hostname switch03
switch03(config)#exit
switch03#s
*Feb 3 20:54:28.488: %SYS-5-CONFIG_I: Configured from console by console
switch03#show spa
switch03#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address aabb.cc00.2000
Cost 100
Port 3 (Ethernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address aabb.cc00.4000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 15 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0 Desg FWD 100 128.1 Shr
Et0/1 Altn BLK 100 128.2 Shr
Et0/2 Root LRN 100 128.3 Shr
Et0/3 Desg FWD 100 128.4 Shr
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
switch03#conf ter
switch03#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch03(config)#span
switch03(config)#spanning-tree vlan 1 root pr
22
switch03(config)#spanning-tree vlan 1 root primary
switch03(config)#exit
switch03#s
*Feb 3 21:28:24.967: %SYS-5-CONFIG_I: Configured from console by console
switch03#show spa
switch03#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 24577
Address aabb.cc00.4000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 24577 (priority 24576 sys-id-ext 1)
Address aabb.cc00.4000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 15 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0 Desg FWD 100 128.1 Shr
Et0/1 Desg LIS 100 128.2 Shr
Et0/2 Desg FWD 100 128.3 Shr
Et0/3 Desg FWD 100 128.4 Shr
switch03#wr
Building configuration...
Compressed configuration from 1184 bytes to 790 bytes[OK]
switch03#
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
Para el Switch01
switch01>enable
22
switch01#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
switch01(config)#
switch01(config)#enable secret class
switch01(config)#
switch01(config)#line vty 0 4
switch01(config-line)#
switch01(config-line)#password cisco
switch01(config-line)#
switch01(config-line)#login
switch01(config-line)#
switch01(config-line)# exit
Para el Switch02
switch02>enable
switch02#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
switch02(config)#
switch02(config)#enable secret class
switch02(config)#
switch02(config)#line vty 0 4
switch02(config-line)#
switch02(config-line)#password cisco
switch02(config-line)#
switch02(config-line)#login
switch02(config-line)#
switch02(config-line)# exit
Para el Switch03
switch03#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
switch03(config)#
switch03(config)#enable secret class
switch03(config)#
switch03(config)#line vty 0 4
switch03(config-line)#
switch03(config-line)#password cisco
switch03(config-line)#
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
switch03(config-line)#login
switch03(config-line)#exit
switch03(config)#
switch03(config)#exit
switch03#
22
3. Asegurar ROUTER
Para el Router1
Router(config)#
Router(config)#Hostname Router1
Router1(config)#
Router1(config)#enable secret class
Router1(config)#
En este ítem procederemos a la creación de las vlans en los switch01, Switch02 y Switch03, asi mismo
crearemos los DHCP scopes para las vlans en el Router usando subinterfaces
Creación de vlan y configuración de puertos en modo acceso y modo trunk, asignación de puertos a las
vlan
Para el Switch01
Creacion de vlan
switch01#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
switch01(config)#vlan 30
switch01(config-vlan)#name vlanB
switch01(config)#vlan 20
switch01(config-vlan)#name
switch01(config-vlan)#name vlanA
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
switch01(config-vlan)#exit
switch01(config)#
switch01(config)#interface range ethernet 0/0 - 1
switch01(config-if-range)# 22
switch01(config-if-range)#switchport mode access
switch01(config-if-range)#
switch01(config-if-range)#switchport trunk encapsulation dot1q
switch01(config-if-range)#switchport mode trunk
*Feb 3 22:02:07.106: %SPANTREE-7-RECV_1Q_NON_TRUNK: Received 802.1Q BPDU on non trunk
Ethernet0/1 VLAN1.
*Feb 3 22:02:07.106: %SPANTREE-7-BLOCK_PORT_TYPE: Blocking Ethernet0/1 on VLAN0001.
Inconsistent port type.
switch01(config-if-range)#switchport mode trunk
*Feb 3 22:02:08.013: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up
switch01(config-if-range)#switchport mode trunk
*Feb 3 22:02:09.045: %LINK-3-UPDOWN: Interface Vlan30, changed state to up
switch01(config-if-range)#switchport mode trunk
switch01(config-if-range)#
*Feb 3 22:02:18.813: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state
to down
switch01(config-if-range)#
*Feb 3 22:02:21.820: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state
to up
switch01(config-if-range)#exit
switch01(config)#int et0/2
switch01(config-if)#shutdown
switch01(config-if)#
*Feb 8 05:21:27.355: %LINK-5-CHANGED: Interface Ethernet0/2, changed state to administratively
down
switch01(config-if)#switchport mode access
switch01(config-if)#switchport access vlan 30
switch01(config-if)#Switchport port-security maximum 4
switch01(config-if)#Switchport port-security mac-address sticky
switch01(config-if)#no shutdown
switch01(config-if)#
*Feb 8 05:22:32.310: %LINK-3-UPDOWN: Interface Ethernet0/2, changed state to up
*Feb 8 05:22:33.311: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed state
to up
switch01(config-if)#exit
switch01(config)#interface et0/3
switch01(config-if)#switchport mode access
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
22
Para el Switch02
Creación de vlan
switch02#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
switch02(config)#vlan 30
switch02(config-vlan)#name vlanB
switch02(config)#vlan 20
switch02(config-vlan)#name
switch02(config-vlan)#name vlanA
switch02(config-vlan)#exit
switch02(config)#
switch02(config)#interface range ethernet 0/0 - 1
switch02(config-if-range)#
switch02(config-if-range)#switchport mode access
switch02(config-if-range)#
switch02(config-if-range)#switchport trunk encapsulation dot1q
switch02(config-if-range)#
switch02(config-if-range)#switchport mode trunk
switch02(config-if-range)#
switch02(config-if-range)#
*Feb 3 21:26:24.568: %SPANTREE-7-RECV_1Q_NON_TRUNK: Received 802.1Q BPDU on non trunk
Ethernet0/0 VLAN1.
*Feb 3 21:26:24.568: %SPANTREE-7-BLOCK_PORT_TYPE: Blocking Ethernet0/0 on VLAN0001.
Inconsistent port type.
switch02(config-if-range)#
*Feb 3 21:26:25.471: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
*Feb 3 21:26:25.549: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state
to down
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
22
Para el Switch03
Creación de vlan
switch03#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
switch03(config)#vlan 30
switch03(config-vlan)#name vlanB
switch03(config)#vlan 20
switch03(config-vlan)#name
switch03(config-vlan)#name vlanA
switch03(config-vlan)#exit
switch03#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
switch03(config)#interface et0/0
switch03(config-if)#switchport mode access
switch03(config-if)#switchport access vlan 30
22
switch03(config-if)#switchport port-security maximum 4
switch03(config-if)#no shutdown
switch03(config-if)#exit
switch03(config)#exit
vlanB
Router1(config-subif)#exit
Router1(config)#interface et0/0.1
Router1(config-subif)#encapsulation dot1
Router1(config-subif)#encapsulation dot1Q 30 22
vlanA
Router1>enable
Password:
Router1#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface et0/0.2
Router1(config-subif)#en
Router1(config-subif)#encapsulation do
Router1(config-subif)#encapsulation dot1Q 20
Router1(config-subif)#ip ad
Router1(config-subif)#ip addr
Router1(config-subif)#ip address 192.168.20.1 255.255.255.0
Router1(config-subif)#exit
Router1(config)#exit
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
Puesta en marcha de las pruebas de implementación de DHCP en los clientes PC01, PC02, PC03 y KALI
Validación de asignación de los números ip recibidos del router en base a la vlan a la que pertenecen
PC01
22
PC02
PC03
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
Para el equipo KALI usamos el nodo tipo Cloud3, este nos permitirá asignarle a la vmnet2 de vmware el
IP asignado al nodo KAL, el cual se encuentra en la interfaz ethernet 3 del Switch01.
22
Se cambia la configuración del puerto eth0 de Kali a DHCP, esto debido a que el recibirá el IP a través del
router1, para la realización de este proceso se accede y se edita el archivo que se encuentra en
/etc/network/interfaces
22
A continuación, creamos las listas con los parámetros necesarios para los siguientes procesos:
22
a. Denegación de FTP
Router1#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface et0/0
Router1(config-if)#access-list 101 deny tcp any any eq ftp
Router1(config)#interface et0/0
Router1(config-if)#access-list 101 deny tcp any any eq ftp-data
Router1(config)#interface et0/0
Router1(config-if)#access-list 101 permit ip any any
Router1(config)#exit
Router1#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#acc
Router1(config)#access-list 102 per
Router1(config)#access-list 102 permit icmp any any ec
Router1(config)#access-list 102 permit icmp any any echo-re
Router1(config)#access-list 102 permit icmp any any echo-reply
Router1(config)#interfa
Router1(config)#interface et0/0
Router1(config-if)#ip acce
Router1(config-if)#ip access-group 102 in
Router1(config-if)#exit
Router1(config)#exit
Inicialmente un host cliente debe enviar al Broadcast de la red un paquete “DISCOVERY” para
22
solicitar se le asignen y envíen los parámetros de configuración
Cada servidor DHCP de la red, recibe el mensaje y responde con un paquete “OFFER” en el que
incluye información relativa a la configuración asignada.
El cliente puede seleccionar total o parcialmente los parámetros recibidos y responder con un
mensaje “REQUEST” solicitando se le asignen dichos parámetros.
Finalmente, el servidor valida la asignación de estos parámetros y responde con un mensaje “DHCP
ACK” indicando al cliente que la configuración ha sido reservada.
El escenario más Simple toma lugar cuando un atacante inicia una instancia de servidor DHCP en la LAN
ofreciendo configuraciones IP a los host que lo soliciten. En este punto, el atacante entra en condición
de carrera con el DHCP legítimo de la red.
Es posible que unas veces un host tome la configuración del Atacante y otras las del DHCP legítimo.
El atacante debe conocer la configuración de la red y podrá simular una asignación correcta al host, de
este modo el Atacante se convierte en la puerta de enlace predeterminada del host y gana una posición
de intermediario.
Para la implementación de este ataque usaremos yersinia que se encuentra dentro del KALI, para lo cual
iniciamos el yersinia, validamos que el IP obtenido sea desde el ROUTER1 y procedemos a lanzar el
ataque.
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
Validamos los IP que se van asignado desde el ROUTER usando el comando show ip dhcp binding
22
22
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
La otra forma es utilizar DHCP Snooping, básicamente, se basa en definir en los switchs los puertos sobre
los que el tráfico del DHCP server confiable puede transitar, los que nosotros consideramos que
definimos como “trust.
Para el Switch01
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
Para el Switch02
22
Para el Switch03
Erick José Delgadillo Loáisiga
SEGURIDAD EN LAS TELECOMUNICACIONES -MGSI
22