diff --git a/Makefile b/Makefile index 7b1bc16c72174862e2b766855001900bb6e38189..c0194841db19f5a3a33166b6bf09dc23b4417d7b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/content/01_labo1_macflooding.md b/content/01_labo1_macflooding.md index a1384ed4ae1dafc0744a793c7d07324085540a61..e258a4d5756c4de2d1c25699d1a6cb442954b9c9 100644 --- a/content/01_labo1_macflooding.md +++ b/content/01_labo1_macflooding.md @@ -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. + + + +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 +``` + +où `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 +``` + +où `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 diff --git a/figs/traffic_h2_h3_on_h1_s1.png b/figs/traffic_h2_h3_on_h1_s1.png new file mode 100644 index 0000000000000000000000000000000000000000..ce051ff7257df6b77e1145a77f7b3f6a082c746b Binary files /dev/null and b/figs/traffic_h2_h3_on_h1_s1.png differ