Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##########################################################################################################
- Pregunta 1:
- Antes de configurar el Wireshark con las claves usadas en las Security Associations, enumera qué campos se pueden ver de la cabecera AH y de la cabecera ESP:
- Authentication Header
- Next Header: Encap Security Payload (0x32)
- Length: 24
- AH SPI: 0x00000200
- AH Sequence: 1
- AH ICV: a1213e0fa0fc55295ae42b39
- Encapsulating Security Payload
- ESP SPI: 0x00000201 (513)
- ESP Sequence: 1
- ##########################################################################################################
- Pregunta 2:
- ¿Qué es el campo SPI y para qué sirve? ¿Qué tamaño tiene (en bytes)?
- El campo SPI(Security Parameters Index) identifica una asociación de seguridad y tiene una longitud de 4bytes.
- ##########################################################################################################
- Pregunta 3:
- Para los siguientes SPI, identifica dirección de origen, destino, y protocolo asociado (AH o ESP): SPI 0x200, SPI 0x201, SPI 0x300, SPI 0x301:
- SPI 0x200
- Dirección origen: 192.168.177.47
- Dirección destino: 192.168.177.48
- Protocolo asociado: AH
- SPI 0x201
- Dirección origen: 192.168.177.47
- Dirección destino: 192.168.177.48
- Protocolo asociado: ESP
- SPI 0x300
- Dirección origen: 192.168.177.48
- Dirección destino: 192.168.177.47
- Protocolo asociado: AH
- SPI 0x301
- Dirección origen: 192.168.177.48
- Dirección destino: 192.168.177.47
- Protocolo asociado: ESP
- ##########################################################################################################
- Pregunta 4:
- ¿Para qué sirve el campo Sequence?
- Se trata de un valor monótono creciente con una longitud de 32 bits. Proporciona una función anti-repetición para evitar posibles ataques de este tipo.
- ##########################################################################################################
- Pregunta 5:
- En la cabecera AH, ¿Qué es el campo AH ICV?
- Se trata del valor de Comprobación de Integridad (Integrity Check Value, ICV) es un campo de longitud variable (debe ser un número de palabras de 32 bits) normalmente un hash MD5 o SHA-1 y su función es detectar cambios accidentales en una secuencia de datos para proteger la integridad de estos.
- Se transmite el dato junto con su valor hash, de esta forma el receptor puede calcular dicho valor y compararlo así con el valor hash recibido.
- ##########################################################################################################
- Pregunta 6:
- Configura el Wireshark con las claves para ESP usadas en las Security Associations. ¿Qué campos nuevos aparecen?
- Encapsulating Security Payload
- ESP IV: cd8bf606c2de5f1c
- Pad
- ESP Pad Length: 6
- Next header: ICMP (0x01)
- NULL Authentication
- Good: True
- Bad: False
- Internet Control Message Protocol
- Type: 8 (Echo (ping) request)
- Code: 0
- Checksum: 0x03b8 [correct]
- Identifier (BE): 1892 (0x0764)
- Identifier (LE): 25607 (0x6407)
- Sequence number (BE): 1 (0x0001)
- Sequence number (LE): 256 (0x0100)
- Response frame: 2
- Timestamp from icmp data: May 12, 2014 19:24:46.000000000 Hora de verano romance
- Timestamp from icmp data (relative): 0.311063000 seconds
- Data (48 bytes)
- Data: dab8040000000000101112131415161718191a1b1c1d1e1f...
- Length: 48
- ##########################################################################################################
- ?????????????¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿
- Pregunta 7:
- ¿Qué es el campo "ESP IV"? ¿Para qué sirve? ¿Porqué tiene esa longitud?
- El campo ESP IV(ESP Initialization Vector) es un vector de iniciación que sirve para
- ????
- ESP IV: d84064061c1dbc13
- ##########################################################################################################
- Pregunta 8:
- ¿Porqué es necesario usar Padding? ¿Cómo es el método de Padding usado en la cabecera ESP?
- El padding es un espacio adicional que se incluye porque los algoritmos criptográficos basados en bloque pueden requerir espacios diferentes. Al utilizar padding se aumentan los datos de la carga útil hasta el tamaño que tenga un bloque cifrado, quedando así alineado con el siguiente campo.
- El método de padding utilizado en la cabecera ESP (01 02 03 04 05 06) parece coincidir con ISO 10126 donde observamos el valor 06 que indica la longitud en el ultimo byte, aunque el resto de byte no parecen ser aleatorios no corresponde con ningún otro esquema estudiado.
- ##########################################################################################################
- ##########################################################################################################
- Problema practica: estaba esp+ah y cogia ese spi antes que coger solo esp (conflicto de spi)
- Ejercicio 2:
- 192.168.177.91 192.168.177.75 ah 0x01020091 0xd2516046225083dc1a1a30b8d65ac606
- 192.168.177.91 192.168.177.75 esp 0x02020091 0xf64ddcd81e590e83b8a6805acf1291ea
- 192.168.177.91 192.168.177.75 esp+a 0x03020091 0xac3400064f903a62741ae7c76efacaf0
- ----------------------------------------------------------------------------------
- 192.168.177.75 192.168.177.91 ah!!! 0x01010091 0xa9058df93e2c80490d318372d141dc18
- 192.168.177.75 192.168.177.91 esp!! 0x02010091 0x12358262f472ece07311286c3cd755d6
- 192.168.177.75 192.168.177.91 esp+a 0x03010091 0x0218ea14d76ba63246c460ad65e13992
- #######################################################################
- ping 192.168.177.75
- Ejercicio 2: nano /etc/ipsec-tools.conf
- # Security Policies
- spdadd 192.168.177.91 192.168.177.75 any
- -P out ipsec
- esp/transport//require;
- spdadd 192.168.177.75 192.168.177.91 any
- -P in ipsec
- esp/transport//require;
- #Security Associations
- add 192.168.177.75 192.168.177.91 esp 0x02010091
- -m transport -r 4
- -E aes-cbc 0x12358262f472ece07311286c3cd755d6;
- add 192.168.177.91 192.168.177.75 esp 0x02020091
- -m transport -r 4
- -E aes-cbc 0xf64ddcd81e590e83b8a6805acf1291ea;
- #######################################################################
- Filtro wireshark:
- ip.addr==192.168.177.92
- #######################################################################
- sudo nano /etc/network/interfaces
- # This file describes the network interfaces available on your system
- # and how to activate them. For more information, see interfaces(5).
- # The loopback network interface
- auto lo
- iface lo inet loopback
- # The primary network interface
- auto eth0
- iface eth0 inet static
- address 192.168.177.91
- netmask 255.255.254.0
- gateway 192.168.177.254
- dns-nameservers 150.214.57.7 150.214.57.8 150.214.40.11 150.214.40$
- #iface eth0 inet dhcp
- ############################################
- sudo /etc/init.d/networking restart
- sudo reboot
- ###############################################
- ifconfig
- eth0 Link encap:Ethernet HWaddr 00:0c:29:2f:9b:9f
- inet addr:192.168.177.91 Bcast:192.168.177.255 Mask:255.255.254.0
- inet6 addr: fe80::20c:29ff:fe2f:9b9f/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:779 errors:0 dropped:0 overruns:0 frame:0
- TX packets:140 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:71383 (71.3 KB) TX bytes:16275 (16.2 KB)
- lo Link encap:Local Loopback
- inet addr:127.0.0.1 Mask:255.0.0.0
- inet6 addr: ::1/128 Scope:Host
- UP LOOPBACK RUNNING MTU:65536 Metric:1
- RX packets:50 errors:0 dropped:0 overruns:0 frame:0
- TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:4478 (4.4 KB) TX bytes:4478 (4.4 KB)
- ####################################################
- root@ubuntu:/home/alumno# ping 192.168.177.166
- root@ubuntu:/home/alumno# /etc/ipsec-tools.conf
- root@ubuntu:/home/alumno# nano /etc/ipsec-tools.conf
- ###########################################
- /etc/ipsec-tools.conf
- ###########################################
- #!/usr/sbin/setkey -f
- # NOTE: Do not use this file if you use racoon with racoon-tool
- # utility. racoon-tool will setup SAs and SPDs automatically using
- # /etc/racoon/racoon-tool.conf configuration.
- #
- ## Flush the SAD and SPD
- flush;
- spdflush;
- # Security Policies
- spdadd 192.168.177.12 192.168.177.166 any
- -P out ipsec
- esp/transport//require;
- # Security Policies
- spdadd 192.168.177.166 192.168.177.12 any
- -P in ipsec
- esp/transport//require;
- # Security Associations
- add 192.168.177.12 192.168.177.166 esp 0x12345678
- -m transport -r 4
- -E aes-cbc 0x56fec3445ff820f116f8701e1abf6c37;
- add 192.168.177.166 192.168.177.12 esp 0x12345678
- -m transport -r 4
- -E aes-cbc 0x56fec3445ff820f116f8701e1abf6c37;
- ##################################################################
- root@ubuntu:/home/alumno# setkey -D
- 192.168.177.166 192.168.177.12
- ah mode=transport spi=305419896(0x12345678) reqid=0(0x00000000)
- A: hmac-sha1 b9bf971b dab9a41d 5ceb2ae4 641dd215 101f44a8
- seq=0x00000000 replay=4 flags=0x00000000 state=mature
- created: Apr 27 02:09:59 2015 current: Apr 27 02:20:25 2015
- diff: 626(s) hard: 0(s) soft: 0(s)
- last: Apr 27 02:13:47 2015 hard: 0(s) soft: 0(s)
- current: 3008(bytes) hard: 0(bytes) soft: 0(bytes)
- allocated: 47 hard: 0 soft: 0
- sadb_seq=1 pid=2098 refcnt=0
- 192.168.177.12 192.168.177.166
- ah mode=transport spi=305419896(0x12345678) reqid=0(0x00000000)
- A: hmac-sha1 b9bf971b dab9a41d 5ceb2ae4 641dd215 101f44a8
- seq=0x00000000 replay=4 flags=0x00000000 state=mature
- created: Apr 27 02:09:59 2015 current: Apr 27 02:20:25 2015
- diff: 626(s) hard: 0(s) soft: 0(s)
- last: Apr 27 02:10:21 2015 hard: 0(s) soft: 0(s)
- current: 3456(bytes) hard: 0(bytes) soft: 0(bytes)
- allocated: 54 hard: 0 soft: 0
- sadb_seq=0 pid=2098 refcnt=0
- ##########################################################################
- root@ubuntu:/home/alumno# setkey -DP
- 192.168.177.166[any] 192.168.177.12[any] 255
- fwd prio def ipsec
- ah/transport//require
- created: Apr 27 02:09:59 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=1058 seq=1 pid=2099
- refcnt=1
- 192.168.177.166[any] 192.168.177.12[any] 255
- in prio def ipsec
- ah/transport//require
- created: Apr 27 02:09:59 2015 lastused: Apr 27 02:14:30 2015
- lifetime: 0(s) validtime: 0(s)
- spid=1048 seq=2 pid=2099
- refcnt=1
- 192.168.177.12[any] 192.168.177.166[any] 255
- out prio def ipsec
- ah/transport//require
- created: Apr 27 02:09:59 2015 lastused: Apr 27 02:14:30 2015
- lifetime: 0(s) validtime: 0(s)
- spid=1041 seq=3 pid=2099
- refcnt=1
- (per-socket policy)
- out(socket) none
- created: Apr 27 00:20:27 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=156 seq=4 pid=2099
- refcnt=1
- (per-socket policy)
- in(socket) none
- created: Apr 27 00:20:27 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=147 seq=5 pid=2099
- refcnt=1
- (per-socket policy)
- out(socket) none
- created: Apr 27 00:20:27 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=140 seq=6 pid=2099
- refcnt=1
- (per-socket policy)
- in(socket) none
- created: Apr 27 00:20:27 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=131 seq=7 pid=2099
- refcnt=1
- (per-socket policy)
- out(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=124 seq=8 pid=2099
- refcnt=1
- (per-socket policy)
- in(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=115 seq=9 pid=2099
- refcnt=1
- (per-socket policy)
- out(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=108 seq=10 pid=2099
- refcnt=1
- (per-socket policy)
- in(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=99 seq=11 pid=2099
- refcnt=1
- (per-socket policy)
- out(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=92 seq=12 pid=2099
- refcnt=1
- (per-socket policy)
- in(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=83 seq=13 pid=2099
- refcnt=1
- (per-socket policy)
- out(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=76 seq=14 pid=2099
- refcnt=1
- (per-socket policy)
- in(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=67 seq=15 pid=2099
- refcnt=1
- (per-socket policy)
- out(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=60 seq=16 pid=2099
- refcnt=1
- (per-socket policy)
- in(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=51 seq=17 pid=2099
- refcnt=1
- (per-socket policy)
- out(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=44 seq=18 pid=2099
- refcnt=1
- (per-socket policy)
- in(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=35 seq=19 pid=2099
- refcnt=1
- (per-socket policy)
- out(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=28 seq=20 pid=2099
- refcnt=1
- (per-socket policy)
- in(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=19 seq=21 pid=2099
- refcnt=1
- (per-socket policy)
- out(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=12 seq=22 pid=2099
- refcnt=1
- (per-socket policy)
- in(socket) none
- created: Apr 27 00:20:24 2015 lastused:
- lifetime: 0(s) validtime: 0(s)
- spid=3 seq=0 pid=2099
- refcnt=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement