Skip to content
Snippets Groups Projects
Commit 282ef2d7 authored by iliya's avatar iliya
Browse files

feat: working on last part of the lab

parent 4080e6ee
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,11 @@ $(TARGET): $(MD) $(METADATA)
$(TEX): $(MD)
pandoc -s $^ -o $@ $(OPTIONS) $(PDFOPTIONS)
.PHONY: clean
clean:
rm -f *.pdf content/*.tex
.PHONY: rebuild
rebuild: clean all
......@@ -132,7 +132,7 @@ ip link set dev eth0 addr 00:00:00:00:00:03
exit
```
## Attaque du LAN par macflooding
### Attaque du LAN par macflooding
1. Une attaque par "macflooding" consiste à remplir la mémoire CAM (_Content
Addressable Memory_) des switches en remplissant la table des adresses MACs
......@@ -161,4 +161,90 @@ attente de la quantité spécifiée en ms entre chaque envoie de paquets.
pleine. Par conséquent aucune nouvelle entrée ne sera ajoutée et les paquets de
ces nouvelles entrées seront floodés sur tous les ports. Le switch passe en mode
`fail-open` de que la table MAC d'un switch a atteint sa capacité de stockage
maximale d'adresses MAC, en l'occurrence la quantité maximale est de $2^{13} == 8192$
maximale d'adresses MAC, en l'occurrence la quantité maximale est de $2^{13} = 8192$
6. Oui, en théorie il est possible de voir les messages ICMP qui transitent entre
H1 et H3 car suite au fait que le switch est passé en mode _"fail-open"_, c'est-à-dire
que tous paquets dont la source est une adresse MAC qui n'est pas connu par
la table d'adresse MAC du switch, sera copié sur tous les ports.
7. Sur la capture d'écran ci-dessous, on peut effectivement remarquer que le paquet
ICMP envoyé depuis H2 à H3 est bien visible sur le lien H1 $\Rightarrow$ S1.
![Capture wireshark entre H1 et S1 des paquets ICMP entre H2 et H3](../figs/traffic_h2_h3_on_h1_s1.png)
8. Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis.
## Protection du LAN
### Port Security (Trunk)
```CiscoIOS
Switch#
Switch#conf t
Switch(config)#interface type slot/port // Selects the LAN port to configure
Switch(config-if)#switchport // Configures the port as a Layer 2 port
Switch(config-if)#switchport trunk encapsulation {is1 | dot1q} // Configures the
// encapsulation, which configures the Layer 2 switching port as either an ISL or
// 802.1Q trunk
Switch(config-if)#switchport mode trunk // Configures the port to trunk unconditionally
Switch(config-if)#switchport nonegotiate // Configures the trunk not to use DTP
Switch(config-if)#switchport port-security maximum n_addresses vlan {vlan_ID | vlan_range}
// Enables port security on trunk and sets the maximum number of secure MAC addresses for the
// port (default 1).
Switch(config-if)#no switchport port-security // Disables port security on trunk
Switch(config-if)#do show port-security interface type slot/port | include Port
Security // Verifies the configuration
```
`type slot/port` est ex.: `GigabitEthernet 0/0`
### Port Security (Access Port)
```CiscoIOS
Switch#
Switch#conf t
Switch(config)#interface type slot/port // Selects the LAN port to configure
Switch(config-if)#switchport // Configures the port as a Layer 2 port
Switch(config-if)#switchport mode access // Configures the port as a Layer 2 access
// port
Switch(config-if)#switchport port-security maximum n_addresses vlan {vlan_ID | vlan_range}
// Enables port security on trunk and sets the maximum number of secure MAC addresses for the
// port (default 1).
Switch(config-if)#no switchport port-security // Disables port security on trunk
Switch(config-if)#do show port-security interface type slot/port | include Port
Security // Verifies the configuration
```
`type slot/port` est ex.: `GigabitEthernet 0/0`
### Configuration interface GigabitEthernet 0/0
```CiscoIOS
Switch#
Switch#conf t
Switch(config)#interface GigabitEthernet 0/0
Switch(config-if)#switchport
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport nonegotiate
Switch(config-if)#switchport port-security maximum 8
Switch(config-if)#switchport port-security violation shutdown
Switch(config-if)#switchport port-security aging time 1
Switch(config-if)#no shutdown
============= Config checks =============
Switch(config-if)#do show port-security interface GigabitEthernet 0/0 | include Port Security
Switch(config-if)#do show port-security interface GigabitEthernet 0/0 | include Maximum
Switch(config-if)#do show port-security interface GigabitEthernet 0/0 | include shutdown
Switch#show port-security interface GigabitEthernet 0/0
=========================================
```
### Port Security Violation Mode on a Port
figs/traffic_h2_h3_on_h1_s1.png

169 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment