SlideShare a Scribd company logo
1 of 97
Download to read offline
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Understanding and Preventing
Layer 2 Attacks in an IPv4 Network
BRKSEC-2202
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Agenda
 Layer 2 Attack Landscape
 Attacks and Countermeasures
‒ MAC Attacks
‒ VLAN Hopping
‒ DHCP Attacks
‒ ARP Attacks
‒ Private VLANs
‒ Spoofing Attacks
‒ General Attacks
 Summary
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Lower Levels Affect Higher Levels
 7 layer OSI model. In most cases, if one layer is hacked, communications are
compromised without the other layers being aware of the problem
 Security is only as strong as the weakest link
 When it comes to networking, Layer 2 can be a very weak link
POP3, IMAP, IM,
SSL, SSH
Physical Links
IP Addresses
Protocols/Ports
Initial Compromise
Application Stream
Compromised
Application
Presentation
Session
Transport
Network
Data Link
Physical
Application
Presentation
Session
Transport
Network
Data Link
Physical
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Agenda
 Layer 2 Attack Landscape
 Attacks and Countermeasures
‒ MAC Attacks
‒ VLAN Hopping
‒ DHCP Attacks
‒ ARP Attacks
‒ Private VLANs
‒ Spoofing Attacks
‒ General Attacks
 Summary
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
MAC Address/CAM Table Review
 CAM table stands for Content Addressable Memory
 The CAM table stores information such as MAC addresses available on
physical ports with their associated VLAN parameters
 All CAM tables have a fixed size
0000.0cXX.XXXX
48-Bit Hexadecimal Number Creates Unique L2 Address
1234.5678.9ABC
First 24-Bits = Manufacture Code
Assigned by IEEE
Second 24-Bits = Specific Interface,
Assigned by Manufacture
0000.0cXX.XXXX
All Fs = Broadcast
FFFF.FFFF.FFFF
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Normal CAM Behavior (1/3)
MAC A
Port 1
Port 2
Port 3
MAC Port
A 1
C 3
ARP for B
MAC B Is Unknown—
Flood the Frame
MAC B
MAC C
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Normal CAM Behavior (2/3)
MAC A
Port 1
Port 2
Port 3
Learn:
B Is on Port 2
Reply to MAC A
MAC Port
A 1
C 3
B 2
MAC B
MAC C
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Normal CAM Behavior (3/3)
MAC A
MAC B
MAC C
Port 1
Port 2
Port 3
Traffic A  B
B Is on Port 2
Does Not See Traffic
to B
MAC Port
A 1
B 2
C 3
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
CAM Overflow—Tools (1/2)
 macof tool since 1999
‒ About 100 lines of perl
‒ Included in “dsniff”
 Attack successful by exploiting the size limit on
CAM tables
 Macof sends flood of frames with random source MAC and IP
addresses
 Yersinia: Swiss-army knife of L2 attacks
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
CAM Overflow (2/2)
MAC A
MAC B
MAC C
Port 1
Port 2
Port 3
MAC Port
A 1
B 2
C 3
Y is on Port 3
Z is on Port 3
Y 3
Z 3
Traffic A  B
I See Traffic to B
Assume CAM Table Now Full
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
CAM Table Full
 Once the CAM table on the switch is full, traffic without a CAM
entry is flooded out every port on that VLAN
 This will turn a VLAN on a switch basically into a hub
 This attack will also fill the CAM tables of adjacent switches
10.1.1.22 -> (broadcast) ARP C Who is 10.1.1.1, 10.1.1.1 ?
10.1.1.22 -> (broadcast) ARP C Who is 10.1.1.19, 10.1.1.19 ?
10.1.1.26 -> 10.1.1.25 ICMP Echo request (ID: 256 Sequence number: 7424)  OOPS
10.1.1.25 -> 10.1.1.26 ICMP Echo reply (ID: 256 Sequence number: 7424)  OOPS
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures for MAC Attacks
Solution
 Port Security limits MAC flooding attack and
locks down port and sends an SNMP trap
00:0e:00:aa:aa:aa
00:0e:00:bb:bb:bb
132,000
Bogus MACs
Only One MAC
Addresses Allowed on
the Port: Shutdown
Port Security Limits the Amount of MACs on an Interface
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Port Security: Example Config
 Max number is not to control access, it is to protect the switch from attack
 May shutdown port or restrict incoming frames with unknown MACs
 MAC entry will age out in 2 minutes of inactivity, for laptops migrating between desks
Cisco Catalyst OS
set port security 5/1 enable
set port security 5/1 port max 10
set port security 5/1 violation {protect|restrict|shutdown}
set port security 5/1 age 2
set port security 5/1 timer-type inactivity
Cisco IOS
interface type slot/port
switchport port-security
switchport port-security maximum 10
switchport port-security violation {protect|restrict|shutdown}
switchport port-security aging time 2
switchport port-security aging type inactivity
4w6d: %PM-4-ERR_DISABLE: Psecure-Violation Error Detected on Gi3/2, Putting Gi3/2 in Err-Disable State
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Additional Features for Port Security
 Per-VLAN per-port max MAC addresses
 Restrict now will let you know something has happened — you will get an
SNMP trap.
 Rate limit SNMP traps
Cisco IOS
switchport port-security
switchport port-security maximum 3 vlan voice
switchport port-security maximum 10 vlan access
switchport port-security violation restrict
switchport port-security aging time 2
switchport port-security aging type inactivity
snmp-server enable traps port-security trap-rate 5
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures for MAC Attacks
with IP Phones
 Do not go too low with Max
allowed number
 Some switches count CDP MAC
and LLDP MAC, so Phones
consume 2 MACs.
 This feature is to protect that
switch and LAN. Make it 10, or 50,
or whatever you like, as long as
you don’t overrun the CAM table
Could Use Two or
Three MAC Addresses
Allowed on the Port:
Shutdown
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Port Security
 Port disabled by Port Security can be automatically recovered.
Minimizes admin overhead. Notification is sent, so incident is
logged
 “Sticky Port Security”, learned MACs will be saved to NVRAM.
May be good for static environments and with minimum “max
MAC count” configured
SW(Config)# switchport port-security mac-address sticky
SW# write memory
SW(Config)# errdisable recovery cause psecure-violation
SW(Config)# errdisable recovery interval seconds
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Building the Layers
 Port Security prevents
CAM attacks (and some DHCP
starvation attacks)
Port Security
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Agenda
 Layer 2 Attack Landscape
 Attacks and Countermeasures
‒ MAC Attacks
‒ VLAN Hopping
‒ DHCP Attacks
‒ ARP Attacks
‒ Private VLANs
‒ Spoofing Attacks
‒ General Attacks
 Summary
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
VLAN Hopping
At least 2 options:
1. Attacker can negotiate trunk port with Access Switch, if DTP is
left turned on
2. 802.1q Double Tagging
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Dynamic Trunk Protocol (DTP)
 DTP negotiates trunks between
switches
 If DTP is left on access port, then
attacker can form a trunk with a switch
 Trunk has access to all VLANs by
default
 IP Phone does NOT need DTP. It is
happy with CDP or LLDP carrying
VVID, then it starts sending Voice with
802.1q tag.
 Disable DTP on access ports
Dynamic
Trunk
Protocol
SW(config-if)# switchport nonegotiate
Access to
all VLANs
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Double 802.1Q Encapsulation
VLAN Hopping Attack
 Attackers Sends 802.1Q double encapsulated frames
 Switch performs only one level of decapsulation
 Unidirectional traffic only
 Works even if trunk ports are set to off
 Only works if trunk native VLAN has the same VLAN as the attacker
802.1q Frame
src mac dst mac 8100 08005 8100 96 data
1st tag 2nd tag
Strip off first,
and send out the rest
(with another tag remaining)
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Voice VLAN Access
 Normal VLAN operation
‒ VLAN 20 is native to the PC and is not tagged
‒ VLAN 10 is the voice VLAN, and is tagged with 10
VLAN 10, tagged
VLAN 20, no tag VLAN 20
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Voice VLAN Access: Attack
 Attacking voice VLAN
‒ Attacker sends 802.1Q tagged frames from the PC to the phone
‒ Traffic from the PC is now in the voice VLAN
VLAN 10
Has PC Traffic
Attacker Sends
VLAN 10 Frames
VLAN 10
VLAN 20
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
IP Phones VLAN Security
 Block voice VLAN
from PC port
 Ignore Gratuitous
ARPs (GARPs)
Configurable Options
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
IP Phone
PC Voice VLAN Access Setting
 Preventing voice VLAN attacks
‒ Enable settings for blocking PC voice VLAN access
‒ Tagged traffic will be stopped at the PC port on the phone
 Differences between phone model implementations
‒ Newer phones only block voice VLAN, allowing PC to run 802.1Q on any other VLAN
‒ All phones that run JAVA block all packets containing an 802.1Q header
‒ Low end phones don’t block anything
Attacker Sends
VLAN 10 FramesVLAN 10
VLAN 20
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Security Best Practices for
VLANs and Trunking
 Always use a dedicated VLAN ID for trunk ports native VLAN
 Tag even native VLAN on trunks, “vlan dot1q tag native”
 Do not use VLAN 1 for anything
 Disable DTP (auto-trunking) on user facing ports
 Explicitly configure trunking on infrastructure ports
 Disable “PC voice VLAN access” on phones that support it
 Disable unused ports and put them in an unused VLAN
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Quiz
Western Australia, Jack Hills ~700 km North of Perth
 The oldest dated rock on Earth (~4.4 billion years) has been found in …
 Scientists believe that Earth has been formed ~4.6 B years ago. Only a
few places on Earth are known to still have that ancient crust exposed.
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Agenda
 Layer 2 Attack Landscape
 Attacks and Countermeasures
‒ VLAN Hopping
‒ MAC Attacks
‒ DHCP Attacks
‒ ARP Attacks
‒ Private VLANs
‒ Spoofing Attacks
‒ General Attacks
 Summary
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
DHCP Function: High Level
 Server dynamically assigns IP address on demand
 Administrator creates pools of addresses available for assignment
 Address is assigned with lease time
 DHCP delivers other configuration information in options
 Similar functionality in IPv6 for DHCP
Send My Configuration InformationClient
IP Address: 10.10.10.101
Subnet Mask: 255.255.255.0
Default Routers: 10.10.10.1
DNS Servers: 192.168.10.4, 192.168.10.5
Lease Time: 10 days
Here Is Your Configuration
DHCP Server
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
DHCP Function: Lower Level
 DHCP defined by RFC 2131
DHCP Server
Client
DHCP Discover (Broadcast)
DHCP Offer (Unicast)
DHCP Request (Broadcast)
DHCP Ack (Unicast)
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
DHCP Attack Types
DHCP Starvation Attack
 Gobbler/DHCPx looks at the entire DHCP scope and tries to
lease all of the DHCP addresses available in the DHCP scope
 This is a Denial of Service DoS attack using DHCP leases
DHCP Discovery (Broadcast) x (Size of Scope)
DHCP Offer (Unicast) x (Size of Scope)
DHCP Request (Broadcast) x (Size of Scope)
DHCP Ack (Unicast) x (Size of Scope)
Client
Gobbler
DHCP
Server
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures for DHCP Attacks
DHCP Starvation Attack = Port Security
 Gobbler uses a new MAC
address to request a new
DHCP lease
 Restrict the number of
MAC addresses on
a port
 Will not be able to lease
more IP address then
MAC addresses allowed
on the port
 In the example the attacker would
get one IP address from the
DHCP server
Client
Gobbler
DHCP
Server
Cisco Catalyst OS
set port security 5/1 enable
set port security 5/1 port max 10
set port security 5/1 violation restrict
set port security 5/1 age 2
set port security 5/1 timer-type inactivity
Cisco IOS
switchport port-security
switchport port-security maximum 10
switchport port-security violation restrict
switchport port-security aging time 2
switchport port-security aging type inactivity
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
DHCP Attack Types
Rogue DHCP Server Attack
Client
DHCP
Server
Rogue Server
DHCP Discovery (Broadcast)
DHCP Offer (Unicast) from Rogue Server
DHCP Request (Broadcast)
DHCP Ack (Unicast) from Rogue Server
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
DHCP Attack Types
Rogue DHCP Server Attack
 What can the attacker do if he is the DHCP server?
IP Address: 10.10.10.101
Subnet Mask: 255.255.255.0
Default Routers: 10.10.10.10
DNS Servers: 10.10.10.10, 192.168.10.5
Lease Time: 10 days
Here Is Your Configuration
 What do you see as a potential problem with incorrect information?
Wrong default gateway—Attacker is the gateway
Wrong DNS server—Attacker is DNS server
Wrong IP address—Attacker does DOS with incorrect IP
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures for DHCP Attacks
Rogue DHCP Server = DHCP Snooping
 By default all ports in the VLAN are untrusted
Client
DHCP
ServerRogue Server
Trusted
Untrusted
Untrusted
DHCP Snooping - Enabled
DHCP Snooping Untrusted Client
Interface Commands
no ip dhcp snooping trust (Default)
ip dhcp snooping limit rate 10 (pps)
Cisco IOS
Global Commands
ip dhcp snooping vlan 4,104
no ip dhcp snooping information option
ip dhcp snooping
DHCP Snooping Trusted Server
or Uplink
BAD DHCP Responses:
offer, ack, nak
OK DHCP Responses:
offer, ack, nak
Interface Commands
ip dhcp snooping trust
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures for DHCP Attacks
Rogue DHCP Server = DHCP Snooping
 Table is built by “snooping” the DHCP reply to the client
 Entries stay in table until DHCP lease time expires
Client
DHCP
Server
Rogue Server
Trusted
Untrusted
Untrusted
DHCP Snooping-Enabled
DHCP Snooping Binding Table
sh ip dhcp snooping binding
MacAddress IpAddress Lease(sec) Type VLAN Interface
------------------ --------------- ---------- ------------- ---- --------------------
00:03:47:B5:9F:AD 10.120.4.10 193185 dhcp-snooping 4 FastEthernet3/18
BAD DHCP Responses:
offer, ack, nak
OK DHCP Responses:
offer, ack, nak
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Advanced Configuration DHCP Snooping
 DHCP binding table takes time to build after it’s turned on
 May take 3.5 days if DHCP lease time is 7 days
 Not all operating system (Linux) re DHCP on link down event
 Worth backing up this table on bootflash, ftp, tftp, etc.
 This will be important in the next section
ip dhcp snooping database tftp://172.26.168.10/tftpboot/tulledge/ngcs-4500-1-dhcpdb
ip dhcp snooping database write-delay 60
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Advanced Configuration DHCP Snooping
 Gobbler uses a unique MAC
for each DHCP request and
port security prevents
Gobbler
 What if the attack used the
same interface MAC address,
but changed the client
hardware address in the
request?
 Port security would not work
for that attack
 The switches check the
CHADDR field of the request
to make sure it matches the
hardware MAC in the DHCP
snooping binding table
 If there is not a match, the
request is dropped at the
interface
Transaction ID (XID)
OP Code
Hardware
Type
Hardware
Length HOPS
Your IP Address (YIADDR)
Seconds
Client IP Address (CIADDR)
Server IP Address (SIADDR)
Gateway IP Address (GIADDR)
Flags
Server Name (SNAME)—64 Bytes
Filename—128 Bytes
DHCP Options
Client Hardware Address (CHADDR)—16 Bytes
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Summary of DHCP Attacks
 DHCP starvation attacks can be mitigated by port security
 Rogue DHCP servers can be mitigated by DHCP snooping or
Private VLAN (PVLAN) features
 When configured with DHCP snooping, all ports in the VLAN will
be “untrusted” for DHCP replies
 Check default settings to see if the CHADDR field is being
checked during the DHCP request
 Unsupported switches can run ACLs for partial attack mitigation
(can not check the CHADDR field)
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
sh ip dhcp snooping binding
MacAddress IpAddress Lease(sec) Type VLAN Interface
------------------ --------------- ---------- ------------- ---- --------------------
00:03:47:B5:9F:AD 10.120.4.10 193185 dhcp-snooping 4 FastEthernet3/18
DHCP Snooping Capacity
 All DHCP snooping binding tables have limits
 All entries stay in the binding table until the lease runs out
 If you have a mobile work environment, reduce the lease time to
make sure the binding entries will be removed
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Building the Layers
 Port security prevents
CAM attacks and DHCP
starvation attacks
 DHCP snooping and PVLAN
prevent rogue DHCP server
attacks
DHCP
Snooping
Port Security
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Agenda
 Layer 2 Attack Landscape
 Attacks and Countermeasures
‒ VLAN Hopping
‒ MAC Attacks
‒ DHCP Attacks
‒ ARP Attacks
‒ Private VLANs
‒ Spoofing Attacks
‒ General Attacks
 Summary
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
ARP Function Review
 Before a station can talk to another station it must do an ARP
request to map the IP address to the MAC address
‒ This ARP request is broadcast using protocol ID 0806
 All computers on the subnet will receive and process the ARP
request; the station that matches the IP address in the request
will send an ARP reply
Who has
10.1.1.4?
I have
10.1.1.4 &
MAC A
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
ARP Function Review
 According to the ARP RFC, a client is allowed to send an
unsolicited ARP reply; this is called a gratuitous ARP; other hosts
on the same subnet can store this information in their ARP tables
 Anyone can claim to be the owner of any IP/MAC they like
 “ARP poisoning” use this to redirect traffic
10.1.1.1 has
MAC A
I have 10.1.1.1
MAC A
10.1.1.1 has
MAC A
10.1.1.1 has
MAC A
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
ARP Attack in Action
 Attacker “poisons” the ARP tables
10.1.1.1
MAC A
10.1.1.2
MAC B
10.1.1.3
MAC C
10.1.1.2 Is Now
MAC C
10.1.1.1 Is Now
MAC C
Gratuitous ARP Reply
10.1.1.2 has MAC C
Gratuitous ARP Reply
10.1.1.1 has MAC C
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
ARP Attack in Action
 All traffic flows through the attacker
Sending to fake
upstream GW
Receive/Transmit
Victim’s traffic
10.1.1.2
MAC B
10.1.1.3
MAC C
10.1.1.2 Is Now
MAC C
10.1.1.1 Is Now
MAC C
10.1.1.1
MAC A
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
10.1.1.2 is Now
MAC B
ARP Attack Clean Up
 Attacker corrects ARP tables entries
 Traffic flows return to normal
10.1.1.1 Is Now
MAC A
Gratuitous ARP Reply
10.1.1.2 has MAC B Gratuitous ARP Reply
10.1.1.1 has MAC A
10.1.1.2
MAC B
10.1.1.3
MAC C
10.1.1.1
MAC A
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
ARP Attack Tools
 Many tools on the net for ARP man-in-the-middle attacks
‒Dsniff, Cain & Abel, ettercap, Yersinia, etc.
 ettercap: http://ettercap.sourceforge.net/index.php
‒ Some are second or third generation of ARP attack tools
‒ Most have a very nice GUI, and is almost point and click
 All of them automatically capture the traffic/passwords of applications
‒ FTP, Telnet, SMTP, HTTP, POP, NNTP, IMAP, SNMP, LDAP,
RIP, OSPF, PPTP, MS-CHAP, SOCKS, X11, IRC, ICQ, AIM, SMB, Microsoft
SQL, etc.
 Can replace legitimate certificate with a bogus one to become man-in-
the-middle for SSL/SSH sessions
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
ARP Attack Tools
 Ettercap in action
 As you can see
runs in Windows,
Linux, Mac
 Decodes
passwords
on the fly
 This example,
telnet username/
password is
captured
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
ARP Attack Tools: SSH/SSL
 Using these tools SSL/SSH sessions can be intercepted and bogus certificate credentials
can be presented
 Once you have excepted the certificate, all SSL/SSH traffic for all SSL/SSH sites can flow
through the attacker
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures to ARP Attacks
 Dynamic ARP Inspection (DAI)
 Private VLANs (PVLANs)
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures to ARP Attacks:
Dynamic ARP Inspection  Uses the DHCP snooping
binding table information
 Dynamic ARP inspection
‒ All ARP packets must match the
IP/MAC binding table entries
‒ If they do not match entries,
drop them
Is This In My
Binding Table?
NONone Matching
ARPs are dropped
10.1.1.1
MAC A
10.1.1.2
MAC B
10.1.1.3
MAC C
Gratuitous ARP Reply
10.1.1.2 has MAC C
Gratuitous ARP Reply
10.1.1.1 has MAC C
DHCP Snooping- Enabled
Dynamic ARP Inspection- Enabled
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures to ARP Attacks:
Dynamic ARP Inspection
 Uses the information from the DHCP snooping binding table
 Looks at the MacAddress and IpAddress fields to
see if the ARP from the interface is in the binding;
if not, traffic is blocked
sh ip dhcp snooping binding
MacAddress IpAddress Lease(sec) Type VLAN Interface
------------------ --------------- ---------- ------------- ---- --------------------
00:03:47:B5:9F:AD 10.120.4.10 193185 dhcp-snooping 4 FastEthernet3/18
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures to ARP Attacks:
Dynamic ARP Inspection
 DHCP snooping had to be configured so the binding table it built
 Give enough time for DHCP snooping table to build before turning
DAI on
 DAI is configured by VLAN
 You can trust an interface like DHCP snooping
 Be careful with rate limiting—varies between platforms
Configuration of Dynamic ARP Inspection (DAI)
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures to ARP Attacks:
Dynamic ARP Inspection
Cisco IOS
Global Commands
ip dhcp snooping vlan 4,104
no ip dhcp snooping information option
ip dhcp snooping
ip arp inspection vlan 4,104
ip arp inspection log-buffer entries 1024
ip arp inspection log-buffer logs 1024 interval 10
Interface Commands
ip dhcp snooping trust
ip arp inspection trust
Cisco IOS
Interface Commands
no ip arp inspection trust
(default)
ip arp inspection limit rate 15
(pps)
Dynamic ARP Inspection Commands
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Additional Checks
 Can check for both destination or source MAC and
IP addresses
‒ Destination MAC: Checks the destination MAC address in the Ethernet
header against the target MAC address in ARP body
‒ Source MAC: Checks the source MAC address in the Ethernet header
against the sender MAC address in the ARP body
‒ IP address: Checks the ARP body for invalid and unexpected IP
addresses; addresses include 0.0.0.0, 255.255.255.255, and all IP
multicast addresses
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Cisco IOS Commands
 Each check can be enabled independently
‒ Each by themselves, or any combination of the three
 The last command overwrites the earlier command
‒ If you have dst-mac enabled and then enable src-mac, dst-mac is no longer
active
Cisco IOS
Global Commands
ip arp inspection validate dst-mac
ip arp inspection validate src-mac
ip arp inspection validate ip
Enable all commands
ip arp inspection validate src-mac dst-mac ip
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Phone ARP Features
 Block voice VLAN
from PC port
 Ignore Gratuitous
ARPs (GARPs)
These Features Were All Introduced in CCM
3.3(3), Except Signed Config Files and Disable
Web Access Which Were Introduced in CCM 4.0
Configurable Options
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Phone ARP Features
 Attacker “poisons” the
ARP table on the router 10.1.1.1
MAC A
10.1.1.2
MAC B
10.1.1.3
MAC C
10.1.1.2 Is Now
MAC C
Gratuitous ARP Reply
10.1.1.2 has MAC C Gratuitous ARP Reply
10.1.1.1 has MAC C
10.1.1.1 is STILL
MAC A — Ignore
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Phone ARP Features
 Traffic from the router to
the attacker—from the
phone to the router
 Traffic from the phone is
protected, but the router
is still vulnerable without
dynamic ARP inspection
10.1.1.2
MAC B
10.1.1.3
MAC C
10.1.1.1
MAC A
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Non-DHCP Devices
 Can use static bindings in the DHCP snooping
binding table
 Show static and dynamic entries in the DHCP snooping
binding table is different
Cisco IOS
Global Commands
ip source binding 0000.0000.0001 vlan 4 10.0.10.200 interface fastethernet 3/1
Cisco IOS
Show Commands
show ip source binding
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Binding Table Info
 No entry in the binding table — no traffic
 Wait until all devices have new leases before turning on dynamic
ARP Inspection
 Entrees stay in table until the lease runs out
 All switches have a binding size limit
‒ 3000 series switches — 2500 entrees
‒ 4000 series switches — 4000 entrees (6000 for the SupV-10GE)
‒ 6000 series switches — 16,000 entrees
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Summary of ARP Attacks
 Dynamic ARP inspection prevents ARP attacks by intercepting all
ARP requests and responses
 DHCP snooping must be configured first, otherwise there is no
binding table for dynamic ARP Inspection to use
 The DHCP snooping table is built from the DHCP replies, but you
can put in static entries
 Or you can make a static reservation on DHCP server
 Some IDS systems will watch for an unusually high amount of
ARP traffic, generate warnings
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Building the Layers
 Port security prevents
CAM attacks and DHCP
starvation attacks
 DHCP snooping prevents rogue
DHCP server attacks
 Dynamic ARP inspection
prevents current ARP attacks
 PVLANs prevent DHCP and ARP
attacks
DAI
DHCP
Snooping
Port Security
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Quiz
 By far the most expensive and rare pink diamonds are mined in …
Argyle mine, Kimberley, North-East corner of Western Australia.
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Agenda
 Layer 2 Attack Landscape
 Attacks and Countermeasures
‒ VLAN Hopping
‒ MAC Attacks
‒ DHCP Attacks
‒ ARP Attacks
‒ Private VLANs
‒ Spoofing Attacks
‒ General Attacks
 Summary
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Private VLANs as L2 Countermeasure
“P”
Promiscuous
Port
“I”
Isolated
Ports
“C”
Community
Ports
 VLANs are broadcast domains
 PVLANs break this rule, allowing only minimum required L2
connectivity
 “P” ports can talk
to everyone
 “I” ports can talk
only to “P”
 “C” ports can talk
to “P” and each
other
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Private VLANs
 Breaking L2 broadcast domain into a number of smaller sub-domains
 Still the same L3 subnet
 PCs and servers are able to talk to default GW, but not to each other,
if are on “Isolated” ports
 Effective against ARP Poisoning and DHCP Rogue Server attacks,
since no host-to-host communication allowed between Isolated ports
 Used mainly in SP co-location sites, but can be utilised in Enterprises
as well
 DAI and DHCP snooping is usually enough for Enterprise networks
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Configuring Private VLAN
“P”
Promiscuous
Port
“I”
Isolated
Ports
“C”
Community
Ports
VLAN 102
VLAN 105
Primary
VLAN 100
! Creating primary VLAN,
! which is shared among
! secondary’s
vlan 100
private-vlan primary
! Community VLAN: allows a
! “subVLAN” within a Primary VLAN
vlan 102
private-vlan community
! Isolated VLAN: Connects all
! stub hosts to router
vlan 105
private-vlan isolated
! Associating the primary with
! secondarys
vlan 100
private-vlan association 102, 105
 3 VLANs act together to form 1 PVLAN
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Agenda
 Layer 2 Attack Landscape
 Attacks and Countermeasures
‒ VLAN Hopping
‒ MAC Attacks
‒ DHCP Attacks
‒ ARP Attacks
‒ Private VLANs
‒ Spoofing Attacks
‒ General Attacks
 Summary
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Spoofing Attacks
 MAC spoofing
‒ If MACs are used for network access an attacker can gain access to the
network
‒ Also can be used to take over someone’s identity already on the
network
 IP spoofing
‒ Ping of death
‒ ICMP unreachable storm
‒ SYN flood
‒ Trusted IP addresses can be spoofed
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Spoofing Attack: MAC
 Attacker sends packets
with the incorrect source
MAC address
 If network control is by
MAC address, the
attacker now looks like
10.1.1.2
10.1.1.1
MAC A
10.1.1.2
MAC B
10.1.1.3
MAC C
Received Traffic
Source Address
10.1.1.3
MAC B
Traffic Sent with
SRC MAC B
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Spoofing Attack: IP  Attacker sends packets
with the incorrect source
IP address
 Whatever device the
packet is sent to will never
reply to the attacker
10.1.1.1
MAC A
10.1.1.2
MAC B
10.1.1.3
MAC C
Received Traffic
SRC IP 10.1.1.2
MAC C
Traffic Sent with
SRC IP 10.1.1.2
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Spoofing Attack: IP/MAC  Attacker sends packets with
the incorrect source IP and
MAC address
 Now looks like a device that
is already on the network10.1.1.1
MAC A
10.1.1.2
MAC B
10.1.1.3
MAC C
Received Traffic
Source IP
10.1.1.2
Mac B
Traffic Sent with
SRC IP 10.1.1.2
MAC B
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures to Spoofing Attacks:
IP Source Guard  Uses the DHCP
snooping binding table
information
 IP Source Guard
‒Operates just like
dynamic ARP inspection,
but looks at every packet,
not just ARP packet
Is This Is My
Binding Table?NONonmatching
Traffic Dropped
10.1.1.1
MAC A
10.1.1.3
MAC C
Received Traffic
Source IP 10.1.1.2
Mac B
10.1.1.3
MAC C
Traffic Sent with
SRC IP 10.1.1.3
MAC B
Traffic Sent with IP
10.1.1.2
Mac C
DHCP Snooping – Enabled
Dynamic ARP Insp – Enabled
IP Source Guard - Enabled
10.1.1.2
MAC B
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures to Spoofing Attacks:
IP Source Guard
 Uses the information from the DHCP snooping binding table
 Looks at the MacAddress and IpAddress fields to see
if the traffic from the interface is in the binding table, it not,
traffic is blocked
sh ip dhcp snooping binding
MacAddress IpAddress Lease(sec) Type VLAN Interface
------------------ --------------- ---------- ------------- ---- --------------------
00:03:47:B5:9F:AD 10.120.4.10 193185 dhcp-snooping 4 FastEthernet3/18
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures to Spoofing Attacks:
IP Source Guard
 DHCP snooping had to be configured so the binding table it built
 Give enough time for DHCP snooping binding table to get populated!
 IP Source Guard is configured by port
 IP Source Guard with MAC does not learn the MAC from the device connected
to the switch, it learns it from the DHCP offer
 Not many DHCP servers that support Option 82 for DHCP
 MS Server 2012 DHCP servers now supports Option 82 Field
 If you do not have an Option 82-enabled DHCP you most likely will not get an
IP address on the client
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Clearing Up Source Guard
 MAC and IP checking can be turned on separately or together
‒ For IP
Will work with the information in the binding table
‒ For MAC
Must have an Option 82-enabled DHCP server
(from MS servers, only MS Server 2012 supports Option 82)
Have to change all router configuration to support Option 82
All Layer 3 devices between the DHCP clietn and the DHCP server need to be
configured to trust the Option 82 DHCP: ip dhcp relay information trust
 Most enterprises do not need to check the MAC address with IPSG
‒ There are no known, good attacks that can use this information in
an enterprise network
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Countermeasures to Spoofing Attacks:
IP Source Guard
Cisco IOS
Global Commands
ip dhcp snooping vlan 4,104
ip dhcp snooping information option
ip dhcp snooping
Interface Commands
ip verify source vlan dhcp-snooping
port-security
IP Source Guard Configuration
IP and MAC Checking (Opt 82)
Cisco IOS
Global Commands
ip dhcp snooping vlan 4,104
no ip dhcp snooping information option
ip dhcp snooping
Interface Commands
ip verify source vlan dhcp-snooping
IP Source Guard Configuration
IP Checking Only (No Opt 82)
What most Enterprises Will Run
IP Source Guard
Static IP addresses can be learned, but only used for IP Source Guard
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Building the Layers
 Port security prevents
CAM attacks and DHCP starvation
attacks
 DHCP snooping and PVLANs prevent
rogue DHCP server attacks
 Dynamic ARP Inspection and PVLANs
prevent current ARP attacks
 IP Source Guard prevents IP/MAC
spoofing
IPSG
DAI
DHCP
Snooping
Port Security
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Agenda
 Layer 2 Attack Landscape
 Attacks and Countermeasures
‒ VLAN Hopping
‒ MAC Attacks
‒ DHCP Attacks
‒ ARP Attacks
‒ Private VLANs
‒ Spoofing Attacks
‒ Attacks on other protocols
 Summary
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Other Protocols?
 Yersinia can help you with:
‒ CDP
‒ DHCP
‒ 802.1Q
‒ 802.1X
‒ DTP
‒ HSRP
‒ STP
‒ VTP
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Spanning Tree Basics
 STP purpose: to maintain loop-free topologies in a redundant Layer 2 infrastructure
 STP is very simple; messages are sent using Bridge Protocol Data Units (BPDUs);
basic messages include: configuration, topology change
notification/acknowledgment (TCN/TCA); most have no “payload”
 Avoiding loops ensures broadcast traffic does not become storms
A ‘Tree-Like’,
Loop-Free Topology
Is Established from
the Perspective of
the Root Bridge
A Switch Is
Elected as Root
Root Selection Is Based on
the Lowest Configured
Priority
of Any Switch 0–65535
X
Root
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Access Switches
RootRoot
X Blocked
Spanning Tree Attack Example
 Send BPDU messages to
become root bridge
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Spanning Tree Attack Example
 Send BPDU messages to become root
bridge
‒The attacker then sees frames he shouldn’t
MITM, DoS, etc. all possible
Any attack is very sensitive to
the original topology, trunking,
PVST, etc.
Although STP takes link speed into consideration, it
is always done from the perspective of the root
bridge; taking a Gb backbone to half-duplex
10 Mb was verified
Requires attacker is dual homed to two different
switches (with a hub, it can
be done with just one interface on the attacking
host)
Access Switches
RootRoot
Root
X
Blocked
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
STP Attack Mitigation
 Try to design loop-free topologies where ever possible,
so you do not need STP
 Don’t disable STP, introducing a loop would become
another attack
 BPDU guard
 Should be run on all user facing ports and infrastructure
facing ports
‒ Disables ports using portfast upon detection of a BPDU message on the port
‒ Globally enabled on all ports running portfast
 Available since long time ago
CatOS> (enable)set spantree portfast bpdu-guard enable
IOS(config)#spanning-tree portfast bpduguard
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
STP Attack Mitigation
 Root Guard
‒ Disables ports who would become the root bridge due to their BPDU
advertisement
‒ Configured on a per port basis
‒ Available since long time ago
CatOS> (enable) set spantree guard root 1/1
IOS(config)#spanning-tree guard root (or rootguard)
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Switch Management
 Management can be your weakest link
‒ All the great mitigation techniques we talked about aren’t worth much if the attacker telnets into your switch
and disables them
 Most of the network management protocols we know and love are insecure
(syslog, SNMP, TFTP, telnet, FTP, etc.)
 Consider secure variants of these protocols (SSH, SCP, SSL, OTP etc.),
and/or out of band (OOB) management
‒ Put the management VLAN into a dedicated nonstandard VLAN where nothing but management traffic
resides
‒ Consider physically backhauling this interface to your management network
 When OOB management is not possible, at least limit access to the
management protocols using the “set ip permit” lists on the management
protocols
 SSH is available on most Catalyst switches since long time ago
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Agenda
 Layer 2 Attack Landscape
 Attacks and Countermeasures
‒ VLAN Hopping
‒ MAC Attacks
‒ DHCP Attacks
‒ ARP Attacks
‒ Private VLANs
‒ Spoofing Attacks
‒ General Attacks
 Summary
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
The One Thing to Remember
 If you do not have a binding table entry, you will not allow traffic
from that port with these features enabled
‒ Dynamic ARP inspection
‒ IP Source Guard
 Give enough time for DHCP binding table to get populated, e.g.
half lease time.
 Would be wise to test and understand before deployment
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Layer 2 Security Best Practices (1/2)
 Always use a dedicated VLAN ID for all trunk ports
 Do not use VLAN 1 for anything
 Set all user ports to non-trunking
 Deploy port-security where possible for user ports
 Have a plan for the ARP security issues in your
network (ARP inspection, IDS, etc.)
 Manage switches in as secure a manner as possible (SSH, OOB,
permit lists, etc.)
 Selectively use SNMP and treat community strings
like root passwords
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Layer 2 Security Best Practices (2/2)
 Enable STP attack mitigation
(BPDU Guard, Root Guard)
 Enable DHCP snooping
 Consider using PVLANs where appropriate
 Use MD5 authentication for VTP
 Use CDP only where necessary — with phones it is needed
 Disable all unused ports and put them in an unused VLAN
All of the Preceding Features Are Dependent
on Your Own Security Policy
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Reference Materials
 SAFE Blueprints
‒ http://www.cisco.com/go/safe/
 Cisco Catalyst® 3750
‒ http://www.cisco.com/univercd/cc/td/doc/product/lan/cat3750/index.htm
 Cisco Catalyst 4000
‒ http://www.cisco.com/univercd/cc/td/doc/product/lan/cat4000/index.htm
 Cisco Catalyst 6500
‒ Cisco Catalyst OS and Cisco IOS®
‒ http://www.cisco.com/univercd/cc/td/doc/product/lan/cat6000/
 IP Phones
‒ http://www.cisco.com/univercd/cc/td/doc/product/voice/c_ipphon/index.htm
 Data Center
‒ http://www.cisco.com/en/US/netsol/ns656/networking_solutions_design_guidances_list.html#anchor3
 All SRNDs (System Network Reference Designs)
‒ http://www.cisco.com/go/srnd/
Q & A
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public
Complete Your Online Session
Evaluation
Give us your feedback and receive
a Cisco Live 2013 Polo Shirt!
Complete your Overall Event Survey and 5
Session Evaluations.
 Directly from your mobile device on the
Cisco Live Mobile App
 By visiting the Cisco Live Mobile Site
www.ciscoliveaustralia.com/mobile
 Visit any Cisco Live Internet Station located
throughout the venue
Polo Shirts can be collected in the World of
Solutions on Friday 8 March 12:00pm-2:00pm
Don’t forget to activate your
Cisco Live 365 account for
access to all session material,
96
communities, and on-demand and live activities throughout
the year. Log into your Cisco Live portal and click the
"Enter Cisco Live 365" button.
www.ciscoliveaustralia.com/portal/login.ww
© 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public

More Related Content

What's hot

Firewalls and packet filters
Firewalls and packet filtersFirewalls and packet filters
Firewalls and packet filtersMOHIT AGARWAL
 
Firewall and Types of firewall
Firewall and Types of firewallFirewall and Types of firewall
Firewall and Types of firewallCoder Tech
 
CCNA ppt Day 1
CCNA ppt Day 1CCNA ppt Day 1
CCNA ppt Day 1VISHNU N
 
Hot standby router protocol (hsrp) using
Hot standby router protocol (hsrp) usingHot standby router protocol (hsrp) using
Hot standby router protocol (hsrp) usingShubhiGupta94
 
CCNA 2 Routing and Switching v5.0 Chapter 11
CCNA 2 Routing and Switching v5.0 Chapter 11CCNA 2 Routing and Switching v5.0 Chapter 11
CCNA 2 Routing and Switching v5.0 Chapter 11Nil Menon
 
IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6Adeel Rasheed
 
Access control list [1]
Access control list [1]Access control list [1]
Access control list [1]Summit Bisht
 
Building DataCenter networks with VXLAN BGP-EVPN
Building DataCenter networks with VXLAN BGP-EVPNBuilding DataCenter networks with VXLAN BGP-EVPN
Building DataCenter networks with VXLAN BGP-EVPNCisco Canada
 
Subnetting Presentation
Subnetting PresentationSubnetting Presentation
Subnetting PresentationTouhidul Fahim
 
An overview of access control
An overview of access controlAn overview of access control
An overview of access controlElimity
 
CCNA 2 Routing and Switching v5.0 Chapter 8
CCNA 2 Routing and Switching v5.0 Chapter 8CCNA 2 Routing and Switching v5.0 Chapter 8
CCNA 2 Routing and Switching v5.0 Chapter 8Nil Menon
 
CCNAv5 - S2: Chapter1 Introsuction to switched networks
CCNAv5 - S2: Chapter1 Introsuction to switched networksCCNAv5 - S2: Chapter1 Introsuction to switched networks
CCNAv5 - S2: Chapter1 Introsuction to switched networksVuz Dở Hơi
 

What's hot (20)

Vpn ppt
Vpn pptVpn ppt
Vpn ppt
 
Firewalls and packet filters
Firewalls and packet filtersFirewalls and packet filters
Firewalls and packet filters
 
Firewall and Types of firewall
Firewall and Types of firewallFirewall and Types of firewall
Firewall and Types of firewall
 
CCNA ppt Day 1
CCNA ppt Day 1CCNA ppt Day 1
CCNA ppt Day 1
 
Vlsm
VlsmVlsm
Vlsm
 
Hot standby router protocol (hsrp) using
Hot standby router protocol (hsrp) usingHot standby router protocol (hsrp) using
Hot standby router protocol (hsrp) using
 
Subnetting
SubnettingSubnetting
Subnetting
 
Subnet calculation Tutorial
Subnet calculation TutorialSubnet calculation Tutorial
Subnet calculation Tutorial
 
CCNA 2 Routing and Switching v5.0 Chapter 11
CCNA 2 Routing and Switching v5.0 Chapter 11CCNA 2 Routing and Switching v5.0 Chapter 11
CCNA 2 Routing and Switching v5.0 Chapter 11
 
IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6
 
Access control list [1]
Access control list [1]Access control list [1]
Access control list [1]
 
Building DataCenter networks with VXLAN BGP-EVPN
Building DataCenter networks with VXLAN BGP-EVPNBuilding DataCenter networks with VXLAN BGP-EVPN
Building DataCenter networks with VXLAN BGP-EVPN
 
Ip address and subnetting
Ip address and subnettingIp address and subnetting
Ip address and subnetting
 
Subnetting Presentation
Subnetting PresentationSubnetting Presentation
Subnetting Presentation
 
Secure Network Design
Secure Network DesignSecure Network Design
Secure Network Design
 
An overview of access control
An overview of access controlAn overview of access control
An overview of access control
 
CCNA 2 Routing and Switching v5.0 Chapter 8
CCNA 2 Routing and Switching v5.0 Chapter 8CCNA 2 Routing and Switching v5.0 Chapter 8
CCNA 2 Routing and Switching v5.0 Chapter 8
 
CCNAv5 - S2: Chapter1 Introsuction to switched networks
CCNAv5 - S2: Chapter1 Introsuction to switched networksCCNAv5 - S2: Chapter1 Introsuction to switched networks
CCNAv5 - S2: Chapter1 Introsuction to switched networks
 
Sub Netting
Sub NettingSub Netting
Sub Netting
 
What is Network Address Translation (NAT)
What is Network Address Translation (NAT)What is Network Address Translation (NAT)
What is Network Address Translation (NAT)
 

Similar to Understanding and Preventing Layer 2 Attacks

CCNA Security 07-Securing the local area network
CCNA Security 07-Securing the local area networkCCNA Security 07-Securing the local area network
CCNA Security 07-Securing the local area networkAhmed Habib
 
Mitigating Layer2 Attacks
Mitigating Layer2 AttacksMitigating Layer2 Attacks
Mitigating Layer2 Attacksdkaya
 
Cisco Switch Security
Cisco Switch SecurityCisco Switch Security
Cisco Switch Securitydkaya
 
Deploying Carrier Ethernet Features on Cisco ASR 9000
Deploying Carrier Ethernet Features on Cisco ASR 9000Deploying Carrier Ethernet Features on Cisco ASR 9000
Deploying Carrier Ethernet Features on Cisco ASR 9000Vinod Kumar Balasubramanyam
 
Cisco systems hacking layer 2 ethernet switches
Cisco systems   hacking layer 2 ethernet switchesCisco systems   hacking layer 2 ethernet switches
Cisco systems hacking layer 2 ethernet switchesKJ Savaliya
 
Hacking Layer 2 - Enthernet Switcher Hacking Countermeasures.
Hacking Layer 2 - Enthernet Switcher Hacking Countermeasures.Hacking Layer 2 - Enthernet Switcher Hacking Countermeasures.
Hacking Layer 2 - Enthernet Switcher Hacking Countermeasures.Sumutiu Marius
 
Network Security - Layer 2
Network Security - Layer 2Network Security - Layer 2
Network Security - Layer 2samis
 
CCNA - Switching Concepts made easy
CCNA - Switching Concepts made easyCCNA - Switching Concepts made easy
CCNA - Switching Concepts made easysushmil123
 
Brk 135 t-ccna_switching
Brk 135 t-ccna_switchingBrk 135 t-ccna_switching
Brk 135 t-ccna_switchingparthasn83
 
Giai phap bao mat - so sanh switch bao mat cua HDN va switch cua Cisco
Giai phap bao mat - so sanh switch bao mat cua HDN va switch cua CiscoGiai phap bao mat - so sanh switch bao mat cua HDN va switch cua Cisco
Giai phap bao mat - so sanh switch bao mat cua HDN va switch cua CiscoTran Thanh Song
 
BRKRST-3068 Troubleshooting Catalyst 2K and 3K.pdf
BRKRST-3068  Troubleshooting Catalyst 2K and 3K.pdfBRKRST-3068  Troubleshooting Catalyst 2K and 3K.pdf
BRKRST-3068 Troubleshooting Catalyst 2K and 3K.pdfssusercbaa33
 
ACIT - CCNA Training Course Topic - Switch Stp ACIT
ACIT - CCNA Training Course Topic - Switch Stp ACITACIT - CCNA Training Course Topic - Switch Stp ACIT
ACIT - CCNA Training Course Topic - Switch Stp ACITSleek International
 
2.2.4.9 packet tracer configuring switch port security instructions - ig
2.2.4.9 packet tracer   configuring switch port security instructions - ig2.2.4.9 packet tracer   configuring switch port security instructions - ig
2.2.4.9 packet tracer configuring switch port security instructions - igAlex Ramirez
 

Similar to Understanding and Preventing Layer 2 Attacks (20)

CCNA Security 07-Securing the local area network
CCNA Security 07-Securing the local area networkCCNA Security 07-Securing the local area network
CCNA Security 07-Securing the local area network
 
L2 Attacks.pdf
L2 Attacks.pdfL2 Attacks.pdf
L2 Attacks.pdf
 
Mitigating Layer2 Attacks
Mitigating Layer2 AttacksMitigating Layer2 Attacks
Mitigating Layer2 Attacks
 
Cisco Switch Security
Cisco Switch SecurityCisco Switch Security
Cisco Switch Security
 
Ch6
Ch6Ch6
Ch6
 
Deploying Carrier Ethernet Features on Cisco ASR 9000
Deploying Carrier Ethernet Features on Cisco ASR 9000Deploying Carrier Ethernet Features on Cisco ASR 9000
Deploying Carrier Ethernet Features on Cisco ASR 9000
 
Deploying Carrier Ethernet features on ASR 9000
Deploying Carrier Ethernet features on ASR 9000Deploying Carrier Ethernet features on ASR 9000
Deploying Carrier Ethernet features on ASR 9000
 
Cisco systems hacking layer 2 ethernet switches
Cisco systems   hacking layer 2 ethernet switchesCisco systems   hacking layer 2 ethernet switches
Cisco systems hacking layer 2 ethernet switches
 
Hacking Layer 2 - Enthernet Switcher Hacking Countermeasures.
Hacking Layer 2 - Enthernet Switcher Hacking Countermeasures.Hacking Layer 2 - Enthernet Switcher Hacking Countermeasures.
Hacking Layer 2 - Enthernet Switcher Hacking Countermeasures.
 
Network Security - Layer 2
Network Security - Layer 2Network Security - Layer 2
Network Security - Layer 2
 
CCNA - Switching Concepts made easy
CCNA - Switching Concepts made easyCCNA - Switching Concepts made easy
CCNA - Switching Concepts made easy
 
Day 13.1..1 catalyst switch
Day 13.1..1 catalyst switchDay 13.1..1 catalyst switch
Day 13.1..1 catalyst switch
 
Hacking L2 Switches
Hacking L2 SwitchesHacking L2 Switches
Hacking L2 Switches
 
Icnd210 s02l01
Icnd210 s02l01Icnd210 s02l01
Icnd210 s02l01
 
Brk 135 t-ccna_switching
Brk 135 t-ccna_switchingBrk 135 t-ccna_switching
Brk 135 t-ccna_switching
 
Giai phap bao mat - so sanh switch bao mat cua HDN va switch cua Cisco
Giai phap bao mat - so sanh switch bao mat cua HDN va switch cua CiscoGiai phap bao mat - so sanh switch bao mat cua HDN va switch cua Cisco
Giai phap bao mat - so sanh switch bao mat cua HDN va switch cua Cisco
 
BRKRST-3068 Troubleshooting Catalyst 2K and 3K.pdf
BRKRST-3068  Troubleshooting Catalyst 2K and 3K.pdfBRKRST-3068  Troubleshooting Catalyst 2K and 3K.pdf
BRKRST-3068 Troubleshooting Catalyst 2K and 3K.pdf
 
ACIT - CCNA Training Course Topic - Switch Stp ACIT
ACIT - CCNA Training Course Topic - Switch Stp ACITACIT - CCNA Training Course Topic - Switch Stp ACIT
ACIT - CCNA Training Course Topic - Switch Stp ACIT
 
2.2.4.9 packet tracer configuring switch port security instructions - ig
2.2.4.9 packet tracer   configuring switch port security instructions - ig2.2.4.9 packet tracer   configuring switch port security instructions - ig
2.2.4.9 packet tracer configuring switch port security instructions - ig
 
1-300-206 (SENSS)=Firewall (642-618)
1-300-206 (SENSS)=Firewall (642-618) 1-300-206 (SENSS)=Firewall (642-618)
1-300-206 (SENSS)=Firewall (642-618)
 

Recently uploaded

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Understanding and Preventing Layer 2 Attacks

  • 1.
  • 2. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Understanding and Preventing Layer 2 Attacks in an IPv4 Network BRKSEC-2202
  • 3. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Agenda  Layer 2 Attack Landscape  Attacks and Countermeasures ‒ MAC Attacks ‒ VLAN Hopping ‒ DHCP Attacks ‒ ARP Attacks ‒ Private VLANs ‒ Spoofing Attacks ‒ General Attacks  Summary
  • 4. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Lower Levels Affect Higher Levels  7 layer OSI model. In most cases, if one layer is hacked, communications are compromised without the other layers being aware of the problem  Security is only as strong as the weakest link  When it comes to networking, Layer 2 can be a very weak link POP3, IMAP, IM, SSL, SSH Physical Links IP Addresses Protocols/Ports Initial Compromise Application Stream Compromised Application Presentation Session Transport Network Data Link Physical Application Presentation Session Transport Network Data Link Physical
  • 5. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Agenda  Layer 2 Attack Landscape  Attacks and Countermeasures ‒ MAC Attacks ‒ VLAN Hopping ‒ DHCP Attacks ‒ ARP Attacks ‒ Private VLANs ‒ Spoofing Attacks ‒ General Attacks  Summary
  • 6. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public MAC Address/CAM Table Review  CAM table stands for Content Addressable Memory  The CAM table stores information such as MAC addresses available on physical ports with their associated VLAN parameters  All CAM tables have a fixed size 0000.0cXX.XXXX 48-Bit Hexadecimal Number Creates Unique L2 Address 1234.5678.9ABC First 24-Bits = Manufacture Code Assigned by IEEE Second 24-Bits = Specific Interface, Assigned by Manufacture 0000.0cXX.XXXX All Fs = Broadcast FFFF.FFFF.FFFF
  • 7. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Normal CAM Behavior (1/3) MAC A Port 1 Port 2 Port 3 MAC Port A 1 C 3 ARP for B MAC B Is Unknown— Flood the Frame MAC B MAC C
  • 8. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Normal CAM Behavior (2/3) MAC A Port 1 Port 2 Port 3 Learn: B Is on Port 2 Reply to MAC A MAC Port A 1 C 3 B 2 MAC B MAC C
  • 9. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Normal CAM Behavior (3/3) MAC A MAC B MAC C Port 1 Port 2 Port 3 Traffic A  B B Is on Port 2 Does Not See Traffic to B MAC Port A 1 B 2 C 3
  • 10. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public CAM Overflow—Tools (1/2)  macof tool since 1999 ‒ About 100 lines of perl ‒ Included in “dsniff”  Attack successful by exploiting the size limit on CAM tables  Macof sends flood of frames with random source MAC and IP addresses  Yersinia: Swiss-army knife of L2 attacks
  • 11. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public CAM Overflow (2/2) MAC A MAC B MAC C Port 1 Port 2 Port 3 MAC Port A 1 B 2 C 3 Y is on Port 3 Z is on Port 3 Y 3 Z 3 Traffic A  B I See Traffic to B Assume CAM Table Now Full
  • 12. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public CAM Table Full  Once the CAM table on the switch is full, traffic without a CAM entry is flooded out every port on that VLAN  This will turn a VLAN on a switch basically into a hub  This attack will also fill the CAM tables of adjacent switches 10.1.1.22 -> (broadcast) ARP C Who is 10.1.1.1, 10.1.1.1 ? 10.1.1.22 -> (broadcast) ARP C Who is 10.1.1.19, 10.1.1.19 ? 10.1.1.26 -> 10.1.1.25 ICMP Echo request (ID: 256 Sequence number: 7424)  OOPS 10.1.1.25 -> 10.1.1.26 ICMP Echo reply (ID: 256 Sequence number: 7424)  OOPS
  • 13. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures for MAC Attacks Solution  Port Security limits MAC flooding attack and locks down port and sends an SNMP trap 00:0e:00:aa:aa:aa 00:0e:00:bb:bb:bb 132,000 Bogus MACs Only One MAC Addresses Allowed on the Port: Shutdown Port Security Limits the Amount of MACs on an Interface
  • 14. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Port Security: Example Config  Max number is not to control access, it is to protect the switch from attack  May shutdown port or restrict incoming frames with unknown MACs  MAC entry will age out in 2 minutes of inactivity, for laptops migrating between desks Cisco Catalyst OS set port security 5/1 enable set port security 5/1 port max 10 set port security 5/1 violation {protect|restrict|shutdown} set port security 5/1 age 2 set port security 5/1 timer-type inactivity Cisco IOS interface type slot/port switchport port-security switchport port-security maximum 10 switchport port-security violation {protect|restrict|shutdown} switchport port-security aging time 2 switchport port-security aging type inactivity 4w6d: %PM-4-ERR_DISABLE: Psecure-Violation Error Detected on Gi3/2, Putting Gi3/2 in Err-Disable State
  • 15. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Additional Features for Port Security  Per-VLAN per-port max MAC addresses  Restrict now will let you know something has happened — you will get an SNMP trap.  Rate limit SNMP traps Cisco IOS switchport port-security switchport port-security maximum 3 vlan voice switchport port-security maximum 10 vlan access switchport port-security violation restrict switchport port-security aging time 2 switchport port-security aging type inactivity snmp-server enable traps port-security trap-rate 5
  • 16. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures for MAC Attacks with IP Phones  Do not go too low with Max allowed number  Some switches count CDP MAC and LLDP MAC, so Phones consume 2 MACs.  This feature is to protect that switch and LAN. Make it 10, or 50, or whatever you like, as long as you don’t overrun the CAM table Could Use Two or Three MAC Addresses Allowed on the Port: Shutdown
  • 17. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Port Security  Port disabled by Port Security can be automatically recovered. Minimizes admin overhead. Notification is sent, so incident is logged  “Sticky Port Security”, learned MACs will be saved to NVRAM. May be good for static environments and with minimum “max MAC count” configured SW(Config)# switchport port-security mac-address sticky SW# write memory SW(Config)# errdisable recovery cause psecure-violation SW(Config)# errdisable recovery interval seconds
  • 18. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Building the Layers  Port Security prevents CAM attacks (and some DHCP starvation attacks) Port Security
  • 19. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Agenda  Layer 2 Attack Landscape  Attacks and Countermeasures ‒ MAC Attacks ‒ VLAN Hopping ‒ DHCP Attacks ‒ ARP Attacks ‒ Private VLANs ‒ Spoofing Attacks ‒ General Attacks  Summary
  • 20. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public VLAN Hopping At least 2 options: 1. Attacker can negotiate trunk port with Access Switch, if DTP is left turned on 2. 802.1q Double Tagging
  • 21. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Dynamic Trunk Protocol (DTP)  DTP negotiates trunks between switches  If DTP is left on access port, then attacker can form a trunk with a switch  Trunk has access to all VLANs by default  IP Phone does NOT need DTP. It is happy with CDP or LLDP carrying VVID, then it starts sending Voice with 802.1q tag.  Disable DTP on access ports Dynamic Trunk Protocol SW(config-if)# switchport nonegotiate Access to all VLANs
  • 22. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Double 802.1Q Encapsulation VLAN Hopping Attack  Attackers Sends 802.1Q double encapsulated frames  Switch performs only one level of decapsulation  Unidirectional traffic only  Works even if trunk ports are set to off  Only works if trunk native VLAN has the same VLAN as the attacker 802.1q Frame src mac dst mac 8100 08005 8100 96 data 1st tag 2nd tag Strip off first, and send out the rest (with another tag remaining)
  • 23. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Voice VLAN Access  Normal VLAN operation ‒ VLAN 20 is native to the PC and is not tagged ‒ VLAN 10 is the voice VLAN, and is tagged with 10 VLAN 10, tagged VLAN 20, no tag VLAN 20
  • 24. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Voice VLAN Access: Attack  Attacking voice VLAN ‒ Attacker sends 802.1Q tagged frames from the PC to the phone ‒ Traffic from the PC is now in the voice VLAN VLAN 10 Has PC Traffic Attacker Sends VLAN 10 Frames VLAN 10 VLAN 20
  • 25. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public IP Phones VLAN Security  Block voice VLAN from PC port  Ignore Gratuitous ARPs (GARPs) Configurable Options
  • 26. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public IP Phone PC Voice VLAN Access Setting  Preventing voice VLAN attacks ‒ Enable settings for blocking PC voice VLAN access ‒ Tagged traffic will be stopped at the PC port on the phone  Differences between phone model implementations ‒ Newer phones only block voice VLAN, allowing PC to run 802.1Q on any other VLAN ‒ All phones that run JAVA block all packets containing an 802.1Q header ‒ Low end phones don’t block anything Attacker Sends VLAN 10 FramesVLAN 10 VLAN 20
  • 27. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Security Best Practices for VLANs and Trunking  Always use a dedicated VLAN ID for trunk ports native VLAN  Tag even native VLAN on trunks, “vlan dot1q tag native”  Do not use VLAN 1 for anything  Disable DTP (auto-trunking) on user facing ports  Explicitly configure trunking on infrastructure ports  Disable “PC voice VLAN access” on phones that support it  Disable unused ports and put them in an unused VLAN
  • 28. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Quiz Western Australia, Jack Hills ~700 km North of Perth  The oldest dated rock on Earth (~4.4 billion years) has been found in …  Scientists believe that Earth has been formed ~4.6 B years ago. Only a few places on Earth are known to still have that ancient crust exposed.
  • 29. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Agenda  Layer 2 Attack Landscape  Attacks and Countermeasures ‒ VLAN Hopping ‒ MAC Attacks ‒ DHCP Attacks ‒ ARP Attacks ‒ Private VLANs ‒ Spoofing Attacks ‒ General Attacks  Summary
  • 30. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public DHCP Function: High Level  Server dynamically assigns IP address on demand  Administrator creates pools of addresses available for assignment  Address is assigned with lease time  DHCP delivers other configuration information in options  Similar functionality in IPv6 for DHCP Send My Configuration InformationClient IP Address: 10.10.10.101 Subnet Mask: 255.255.255.0 Default Routers: 10.10.10.1 DNS Servers: 192.168.10.4, 192.168.10.5 Lease Time: 10 days Here Is Your Configuration DHCP Server
  • 31. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public DHCP Function: Lower Level  DHCP defined by RFC 2131 DHCP Server Client DHCP Discover (Broadcast) DHCP Offer (Unicast) DHCP Request (Broadcast) DHCP Ack (Unicast)
  • 32. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public DHCP Attack Types DHCP Starvation Attack  Gobbler/DHCPx looks at the entire DHCP scope and tries to lease all of the DHCP addresses available in the DHCP scope  This is a Denial of Service DoS attack using DHCP leases DHCP Discovery (Broadcast) x (Size of Scope) DHCP Offer (Unicast) x (Size of Scope) DHCP Request (Broadcast) x (Size of Scope) DHCP Ack (Unicast) x (Size of Scope) Client Gobbler DHCP Server
  • 33. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures for DHCP Attacks DHCP Starvation Attack = Port Security  Gobbler uses a new MAC address to request a new DHCP lease  Restrict the number of MAC addresses on a port  Will not be able to lease more IP address then MAC addresses allowed on the port  In the example the attacker would get one IP address from the DHCP server Client Gobbler DHCP Server Cisco Catalyst OS set port security 5/1 enable set port security 5/1 port max 10 set port security 5/1 violation restrict set port security 5/1 age 2 set port security 5/1 timer-type inactivity Cisco IOS switchport port-security switchport port-security maximum 10 switchport port-security violation restrict switchport port-security aging time 2 switchport port-security aging type inactivity
  • 34. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public DHCP Attack Types Rogue DHCP Server Attack Client DHCP Server Rogue Server DHCP Discovery (Broadcast) DHCP Offer (Unicast) from Rogue Server DHCP Request (Broadcast) DHCP Ack (Unicast) from Rogue Server
  • 35. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public DHCP Attack Types Rogue DHCP Server Attack  What can the attacker do if he is the DHCP server? IP Address: 10.10.10.101 Subnet Mask: 255.255.255.0 Default Routers: 10.10.10.10 DNS Servers: 10.10.10.10, 192.168.10.5 Lease Time: 10 days Here Is Your Configuration  What do you see as a potential problem with incorrect information? Wrong default gateway—Attacker is the gateway Wrong DNS server—Attacker is DNS server Wrong IP address—Attacker does DOS with incorrect IP
  • 36. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures for DHCP Attacks Rogue DHCP Server = DHCP Snooping  By default all ports in the VLAN are untrusted Client DHCP ServerRogue Server Trusted Untrusted Untrusted DHCP Snooping - Enabled DHCP Snooping Untrusted Client Interface Commands no ip dhcp snooping trust (Default) ip dhcp snooping limit rate 10 (pps) Cisco IOS Global Commands ip dhcp snooping vlan 4,104 no ip dhcp snooping information option ip dhcp snooping DHCP Snooping Trusted Server or Uplink BAD DHCP Responses: offer, ack, nak OK DHCP Responses: offer, ack, nak Interface Commands ip dhcp snooping trust
  • 37. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures for DHCP Attacks Rogue DHCP Server = DHCP Snooping  Table is built by “snooping” the DHCP reply to the client  Entries stay in table until DHCP lease time expires Client DHCP Server Rogue Server Trusted Untrusted Untrusted DHCP Snooping-Enabled DHCP Snooping Binding Table sh ip dhcp snooping binding MacAddress IpAddress Lease(sec) Type VLAN Interface ------------------ --------------- ---------- ------------- ---- -------------------- 00:03:47:B5:9F:AD 10.120.4.10 193185 dhcp-snooping 4 FastEthernet3/18 BAD DHCP Responses: offer, ack, nak OK DHCP Responses: offer, ack, nak
  • 38. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Advanced Configuration DHCP Snooping  DHCP binding table takes time to build after it’s turned on  May take 3.5 days if DHCP lease time is 7 days  Not all operating system (Linux) re DHCP on link down event  Worth backing up this table on bootflash, ftp, tftp, etc.  This will be important in the next section ip dhcp snooping database tftp://172.26.168.10/tftpboot/tulledge/ngcs-4500-1-dhcpdb ip dhcp snooping database write-delay 60
  • 39. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Advanced Configuration DHCP Snooping  Gobbler uses a unique MAC for each DHCP request and port security prevents Gobbler  What if the attack used the same interface MAC address, but changed the client hardware address in the request?  Port security would not work for that attack  The switches check the CHADDR field of the request to make sure it matches the hardware MAC in the DHCP snooping binding table  If there is not a match, the request is dropped at the interface Transaction ID (XID) OP Code Hardware Type Hardware Length HOPS Your IP Address (YIADDR) Seconds Client IP Address (CIADDR) Server IP Address (SIADDR) Gateway IP Address (GIADDR) Flags Server Name (SNAME)—64 Bytes Filename—128 Bytes DHCP Options Client Hardware Address (CHADDR)—16 Bytes
  • 40. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Summary of DHCP Attacks  DHCP starvation attacks can be mitigated by port security  Rogue DHCP servers can be mitigated by DHCP snooping or Private VLAN (PVLAN) features  When configured with DHCP snooping, all ports in the VLAN will be “untrusted” for DHCP replies  Check default settings to see if the CHADDR field is being checked during the DHCP request  Unsupported switches can run ACLs for partial attack mitigation (can not check the CHADDR field)
  • 41. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public sh ip dhcp snooping binding MacAddress IpAddress Lease(sec) Type VLAN Interface ------------------ --------------- ---------- ------------- ---- -------------------- 00:03:47:B5:9F:AD 10.120.4.10 193185 dhcp-snooping 4 FastEthernet3/18 DHCP Snooping Capacity  All DHCP snooping binding tables have limits  All entries stay in the binding table until the lease runs out  If you have a mobile work environment, reduce the lease time to make sure the binding entries will be removed
  • 42. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Building the Layers  Port security prevents CAM attacks and DHCP starvation attacks  DHCP snooping and PVLAN prevent rogue DHCP server attacks DHCP Snooping Port Security
  • 43. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Agenda  Layer 2 Attack Landscape  Attacks and Countermeasures ‒ VLAN Hopping ‒ MAC Attacks ‒ DHCP Attacks ‒ ARP Attacks ‒ Private VLANs ‒ Spoofing Attacks ‒ General Attacks  Summary
  • 44. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public ARP Function Review  Before a station can talk to another station it must do an ARP request to map the IP address to the MAC address ‒ This ARP request is broadcast using protocol ID 0806  All computers on the subnet will receive and process the ARP request; the station that matches the IP address in the request will send an ARP reply Who has 10.1.1.4? I have 10.1.1.4 & MAC A
  • 45. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public ARP Function Review  According to the ARP RFC, a client is allowed to send an unsolicited ARP reply; this is called a gratuitous ARP; other hosts on the same subnet can store this information in their ARP tables  Anyone can claim to be the owner of any IP/MAC they like  “ARP poisoning” use this to redirect traffic 10.1.1.1 has MAC A I have 10.1.1.1 MAC A 10.1.1.1 has MAC A 10.1.1.1 has MAC A
  • 46. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public ARP Attack in Action  Attacker “poisons” the ARP tables 10.1.1.1 MAC A 10.1.1.2 MAC B 10.1.1.3 MAC C 10.1.1.2 Is Now MAC C 10.1.1.1 Is Now MAC C Gratuitous ARP Reply 10.1.1.2 has MAC C Gratuitous ARP Reply 10.1.1.1 has MAC C
  • 47. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public ARP Attack in Action  All traffic flows through the attacker Sending to fake upstream GW Receive/Transmit Victim’s traffic 10.1.1.2 MAC B 10.1.1.3 MAC C 10.1.1.2 Is Now MAC C 10.1.1.1 Is Now MAC C 10.1.1.1 MAC A
  • 48. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public 10.1.1.2 is Now MAC B ARP Attack Clean Up  Attacker corrects ARP tables entries  Traffic flows return to normal 10.1.1.1 Is Now MAC A Gratuitous ARP Reply 10.1.1.2 has MAC B Gratuitous ARP Reply 10.1.1.1 has MAC A 10.1.1.2 MAC B 10.1.1.3 MAC C 10.1.1.1 MAC A
  • 49. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public ARP Attack Tools  Many tools on the net for ARP man-in-the-middle attacks ‒Dsniff, Cain & Abel, ettercap, Yersinia, etc.  ettercap: http://ettercap.sourceforge.net/index.php ‒ Some are second or third generation of ARP attack tools ‒ Most have a very nice GUI, and is almost point and click  All of them automatically capture the traffic/passwords of applications ‒ FTP, Telnet, SMTP, HTTP, POP, NNTP, IMAP, SNMP, LDAP, RIP, OSPF, PPTP, MS-CHAP, SOCKS, X11, IRC, ICQ, AIM, SMB, Microsoft SQL, etc.  Can replace legitimate certificate with a bogus one to become man-in- the-middle for SSL/SSH sessions
  • 50. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public ARP Attack Tools  Ettercap in action  As you can see runs in Windows, Linux, Mac  Decodes passwords on the fly  This example, telnet username/ password is captured
  • 51. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public ARP Attack Tools: SSH/SSL  Using these tools SSL/SSH sessions can be intercepted and bogus certificate credentials can be presented  Once you have excepted the certificate, all SSL/SSH traffic for all SSL/SSH sites can flow through the attacker
  • 52. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures to ARP Attacks  Dynamic ARP Inspection (DAI)  Private VLANs (PVLANs)
  • 53. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures to ARP Attacks: Dynamic ARP Inspection  Uses the DHCP snooping binding table information  Dynamic ARP inspection ‒ All ARP packets must match the IP/MAC binding table entries ‒ If they do not match entries, drop them Is This In My Binding Table? NONone Matching ARPs are dropped 10.1.1.1 MAC A 10.1.1.2 MAC B 10.1.1.3 MAC C Gratuitous ARP Reply 10.1.1.2 has MAC C Gratuitous ARP Reply 10.1.1.1 has MAC C DHCP Snooping- Enabled Dynamic ARP Inspection- Enabled
  • 54. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures to ARP Attacks: Dynamic ARP Inspection  Uses the information from the DHCP snooping binding table  Looks at the MacAddress and IpAddress fields to see if the ARP from the interface is in the binding; if not, traffic is blocked sh ip dhcp snooping binding MacAddress IpAddress Lease(sec) Type VLAN Interface ------------------ --------------- ---------- ------------- ---- -------------------- 00:03:47:B5:9F:AD 10.120.4.10 193185 dhcp-snooping 4 FastEthernet3/18
  • 55. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures to ARP Attacks: Dynamic ARP Inspection  DHCP snooping had to be configured so the binding table it built  Give enough time for DHCP snooping table to build before turning DAI on  DAI is configured by VLAN  You can trust an interface like DHCP snooping  Be careful with rate limiting—varies between platforms Configuration of Dynamic ARP Inspection (DAI)
  • 56. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures to ARP Attacks: Dynamic ARP Inspection Cisco IOS Global Commands ip dhcp snooping vlan 4,104 no ip dhcp snooping information option ip dhcp snooping ip arp inspection vlan 4,104 ip arp inspection log-buffer entries 1024 ip arp inspection log-buffer logs 1024 interval 10 Interface Commands ip dhcp snooping trust ip arp inspection trust Cisco IOS Interface Commands no ip arp inspection trust (default) ip arp inspection limit rate 15 (pps) Dynamic ARP Inspection Commands
  • 57. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Additional Checks  Can check for both destination or source MAC and IP addresses ‒ Destination MAC: Checks the destination MAC address in the Ethernet header against the target MAC address in ARP body ‒ Source MAC: Checks the source MAC address in the Ethernet header against the sender MAC address in the ARP body ‒ IP address: Checks the ARP body for invalid and unexpected IP addresses; addresses include 0.0.0.0, 255.255.255.255, and all IP multicast addresses
  • 58. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Cisco IOS Commands  Each check can be enabled independently ‒ Each by themselves, or any combination of the three  The last command overwrites the earlier command ‒ If you have dst-mac enabled and then enable src-mac, dst-mac is no longer active Cisco IOS Global Commands ip arp inspection validate dst-mac ip arp inspection validate src-mac ip arp inspection validate ip Enable all commands ip arp inspection validate src-mac dst-mac ip
  • 59. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Phone ARP Features  Block voice VLAN from PC port  Ignore Gratuitous ARPs (GARPs) These Features Were All Introduced in CCM 3.3(3), Except Signed Config Files and Disable Web Access Which Were Introduced in CCM 4.0 Configurable Options
  • 60. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Phone ARP Features  Attacker “poisons” the ARP table on the router 10.1.1.1 MAC A 10.1.1.2 MAC B 10.1.1.3 MAC C 10.1.1.2 Is Now MAC C Gratuitous ARP Reply 10.1.1.2 has MAC C Gratuitous ARP Reply 10.1.1.1 has MAC C 10.1.1.1 is STILL MAC A — Ignore
  • 61. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Phone ARP Features  Traffic from the router to the attacker—from the phone to the router  Traffic from the phone is protected, but the router is still vulnerable without dynamic ARP inspection 10.1.1.2 MAC B 10.1.1.3 MAC C 10.1.1.1 MAC A
  • 62. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Non-DHCP Devices  Can use static bindings in the DHCP snooping binding table  Show static and dynamic entries in the DHCP snooping binding table is different Cisco IOS Global Commands ip source binding 0000.0000.0001 vlan 4 10.0.10.200 interface fastethernet 3/1 Cisco IOS Show Commands show ip source binding
  • 63. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Binding Table Info  No entry in the binding table — no traffic  Wait until all devices have new leases before turning on dynamic ARP Inspection  Entrees stay in table until the lease runs out  All switches have a binding size limit ‒ 3000 series switches — 2500 entrees ‒ 4000 series switches — 4000 entrees (6000 for the SupV-10GE) ‒ 6000 series switches — 16,000 entrees
  • 64. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Summary of ARP Attacks  Dynamic ARP inspection prevents ARP attacks by intercepting all ARP requests and responses  DHCP snooping must be configured first, otherwise there is no binding table for dynamic ARP Inspection to use  The DHCP snooping table is built from the DHCP replies, but you can put in static entries  Or you can make a static reservation on DHCP server  Some IDS systems will watch for an unusually high amount of ARP traffic, generate warnings
  • 65. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Building the Layers  Port security prevents CAM attacks and DHCP starvation attacks  DHCP snooping prevents rogue DHCP server attacks  Dynamic ARP inspection prevents current ARP attacks  PVLANs prevent DHCP and ARP attacks DAI DHCP Snooping Port Security
  • 66. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Quiz  By far the most expensive and rare pink diamonds are mined in … Argyle mine, Kimberley, North-East corner of Western Australia.
  • 67. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Agenda  Layer 2 Attack Landscape  Attacks and Countermeasures ‒ VLAN Hopping ‒ MAC Attacks ‒ DHCP Attacks ‒ ARP Attacks ‒ Private VLANs ‒ Spoofing Attacks ‒ General Attacks  Summary
  • 68. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Private VLANs as L2 Countermeasure “P” Promiscuous Port “I” Isolated Ports “C” Community Ports  VLANs are broadcast domains  PVLANs break this rule, allowing only minimum required L2 connectivity  “P” ports can talk to everyone  “I” ports can talk only to “P”  “C” ports can talk to “P” and each other
  • 69. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Private VLANs  Breaking L2 broadcast domain into a number of smaller sub-domains  Still the same L3 subnet  PCs and servers are able to talk to default GW, but not to each other, if are on “Isolated” ports  Effective against ARP Poisoning and DHCP Rogue Server attacks, since no host-to-host communication allowed between Isolated ports  Used mainly in SP co-location sites, but can be utilised in Enterprises as well  DAI and DHCP snooping is usually enough for Enterprise networks
  • 70. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Configuring Private VLAN “P” Promiscuous Port “I” Isolated Ports “C” Community Ports VLAN 102 VLAN 105 Primary VLAN 100 ! Creating primary VLAN, ! which is shared among ! secondary’s vlan 100 private-vlan primary ! Community VLAN: allows a ! “subVLAN” within a Primary VLAN vlan 102 private-vlan community ! Isolated VLAN: Connects all ! stub hosts to router vlan 105 private-vlan isolated ! Associating the primary with ! secondarys vlan 100 private-vlan association 102, 105  3 VLANs act together to form 1 PVLAN
  • 71. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Agenda  Layer 2 Attack Landscape  Attacks and Countermeasures ‒ VLAN Hopping ‒ MAC Attacks ‒ DHCP Attacks ‒ ARP Attacks ‒ Private VLANs ‒ Spoofing Attacks ‒ General Attacks  Summary
  • 72. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Spoofing Attacks  MAC spoofing ‒ If MACs are used for network access an attacker can gain access to the network ‒ Also can be used to take over someone’s identity already on the network  IP spoofing ‒ Ping of death ‒ ICMP unreachable storm ‒ SYN flood ‒ Trusted IP addresses can be spoofed
  • 73. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Spoofing Attack: MAC  Attacker sends packets with the incorrect source MAC address  If network control is by MAC address, the attacker now looks like 10.1.1.2 10.1.1.1 MAC A 10.1.1.2 MAC B 10.1.1.3 MAC C Received Traffic Source Address 10.1.1.3 MAC B Traffic Sent with SRC MAC B
  • 74. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Spoofing Attack: IP  Attacker sends packets with the incorrect source IP address  Whatever device the packet is sent to will never reply to the attacker 10.1.1.1 MAC A 10.1.1.2 MAC B 10.1.1.3 MAC C Received Traffic SRC IP 10.1.1.2 MAC C Traffic Sent with SRC IP 10.1.1.2
  • 75. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Spoofing Attack: IP/MAC  Attacker sends packets with the incorrect source IP and MAC address  Now looks like a device that is already on the network10.1.1.1 MAC A 10.1.1.2 MAC B 10.1.1.3 MAC C Received Traffic Source IP 10.1.1.2 Mac B Traffic Sent with SRC IP 10.1.1.2 MAC B
  • 76. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures to Spoofing Attacks: IP Source Guard  Uses the DHCP snooping binding table information  IP Source Guard ‒Operates just like dynamic ARP inspection, but looks at every packet, not just ARP packet Is This Is My Binding Table?NONonmatching Traffic Dropped 10.1.1.1 MAC A 10.1.1.3 MAC C Received Traffic Source IP 10.1.1.2 Mac B 10.1.1.3 MAC C Traffic Sent with SRC IP 10.1.1.3 MAC B Traffic Sent with IP 10.1.1.2 Mac C DHCP Snooping – Enabled Dynamic ARP Insp – Enabled IP Source Guard - Enabled 10.1.1.2 MAC B
  • 77. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures to Spoofing Attacks: IP Source Guard  Uses the information from the DHCP snooping binding table  Looks at the MacAddress and IpAddress fields to see if the traffic from the interface is in the binding table, it not, traffic is blocked sh ip dhcp snooping binding MacAddress IpAddress Lease(sec) Type VLAN Interface ------------------ --------------- ---------- ------------- ---- -------------------- 00:03:47:B5:9F:AD 10.120.4.10 193185 dhcp-snooping 4 FastEthernet3/18
  • 78. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures to Spoofing Attacks: IP Source Guard  DHCP snooping had to be configured so the binding table it built  Give enough time for DHCP snooping binding table to get populated!  IP Source Guard is configured by port  IP Source Guard with MAC does not learn the MAC from the device connected to the switch, it learns it from the DHCP offer  Not many DHCP servers that support Option 82 for DHCP  MS Server 2012 DHCP servers now supports Option 82 Field  If you do not have an Option 82-enabled DHCP you most likely will not get an IP address on the client
  • 79. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Clearing Up Source Guard  MAC and IP checking can be turned on separately or together ‒ For IP Will work with the information in the binding table ‒ For MAC Must have an Option 82-enabled DHCP server (from MS servers, only MS Server 2012 supports Option 82) Have to change all router configuration to support Option 82 All Layer 3 devices between the DHCP clietn and the DHCP server need to be configured to trust the Option 82 DHCP: ip dhcp relay information trust  Most enterprises do not need to check the MAC address with IPSG ‒ There are no known, good attacks that can use this information in an enterprise network
  • 80. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Countermeasures to Spoofing Attacks: IP Source Guard Cisco IOS Global Commands ip dhcp snooping vlan 4,104 ip dhcp snooping information option ip dhcp snooping Interface Commands ip verify source vlan dhcp-snooping port-security IP Source Guard Configuration IP and MAC Checking (Opt 82) Cisco IOS Global Commands ip dhcp snooping vlan 4,104 no ip dhcp snooping information option ip dhcp snooping Interface Commands ip verify source vlan dhcp-snooping IP Source Guard Configuration IP Checking Only (No Opt 82) What most Enterprises Will Run IP Source Guard Static IP addresses can be learned, but only used for IP Source Guard
  • 81. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Building the Layers  Port security prevents CAM attacks and DHCP starvation attacks  DHCP snooping and PVLANs prevent rogue DHCP server attacks  Dynamic ARP Inspection and PVLANs prevent current ARP attacks  IP Source Guard prevents IP/MAC spoofing IPSG DAI DHCP Snooping Port Security
  • 82. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Agenda  Layer 2 Attack Landscape  Attacks and Countermeasures ‒ VLAN Hopping ‒ MAC Attacks ‒ DHCP Attacks ‒ ARP Attacks ‒ Private VLANs ‒ Spoofing Attacks ‒ Attacks on other protocols  Summary
  • 83. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Other Protocols?  Yersinia can help you with: ‒ CDP ‒ DHCP ‒ 802.1Q ‒ 802.1X ‒ DTP ‒ HSRP ‒ STP ‒ VTP
  • 84. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Spanning Tree Basics  STP purpose: to maintain loop-free topologies in a redundant Layer 2 infrastructure  STP is very simple; messages are sent using Bridge Protocol Data Units (BPDUs); basic messages include: configuration, topology change notification/acknowledgment (TCN/TCA); most have no “payload”  Avoiding loops ensures broadcast traffic does not become storms A ‘Tree-Like’, Loop-Free Topology Is Established from the Perspective of the Root Bridge A Switch Is Elected as Root Root Selection Is Based on the Lowest Configured Priority of Any Switch 0–65535 X Root
  • 85. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Access Switches RootRoot X Blocked Spanning Tree Attack Example  Send BPDU messages to become root bridge
  • 86. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Spanning Tree Attack Example  Send BPDU messages to become root bridge ‒The attacker then sees frames he shouldn’t MITM, DoS, etc. all possible Any attack is very sensitive to the original topology, trunking, PVST, etc. Although STP takes link speed into consideration, it is always done from the perspective of the root bridge; taking a Gb backbone to half-duplex 10 Mb was verified Requires attacker is dual homed to two different switches (with a hub, it can be done with just one interface on the attacking host) Access Switches RootRoot Root X Blocked
  • 87. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public STP Attack Mitigation  Try to design loop-free topologies where ever possible, so you do not need STP  Don’t disable STP, introducing a loop would become another attack  BPDU guard  Should be run on all user facing ports and infrastructure facing ports ‒ Disables ports using portfast upon detection of a BPDU message on the port ‒ Globally enabled on all ports running portfast  Available since long time ago CatOS> (enable)set spantree portfast bpdu-guard enable IOS(config)#spanning-tree portfast bpduguard
  • 88. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public STP Attack Mitigation  Root Guard ‒ Disables ports who would become the root bridge due to their BPDU advertisement ‒ Configured on a per port basis ‒ Available since long time ago CatOS> (enable) set spantree guard root 1/1 IOS(config)#spanning-tree guard root (or rootguard)
  • 89. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Switch Management  Management can be your weakest link ‒ All the great mitigation techniques we talked about aren’t worth much if the attacker telnets into your switch and disables them  Most of the network management protocols we know and love are insecure (syslog, SNMP, TFTP, telnet, FTP, etc.)  Consider secure variants of these protocols (SSH, SCP, SSL, OTP etc.), and/or out of band (OOB) management ‒ Put the management VLAN into a dedicated nonstandard VLAN where nothing but management traffic resides ‒ Consider physically backhauling this interface to your management network  When OOB management is not possible, at least limit access to the management protocols using the “set ip permit” lists on the management protocols  SSH is available on most Catalyst switches since long time ago
  • 90. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Agenda  Layer 2 Attack Landscape  Attacks and Countermeasures ‒ VLAN Hopping ‒ MAC Attacks ‒ DHCP Attacks ‒ ARP Attacks ‒ Private VLANs ‒ Spoofing Attacks ‒ General Attacks  Summary
  • 91. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public The One Thing to Remember  If you do not have a binding table entry, you will not allow traffic from that port with these features enabled ‒ Dynamic ARP inspection ‒ IP Source Guard  Give enough time for DHCP binding table to get populated, e.g. half lease time.  Would be wise to test and understand before deployment
  • 92. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Layer 2 Security Best Practices (1/2)  Always use a dedicated VLAN ID for all trunk ports  Do not use VLAN 1 for anything  Set all user ports to non-trunking  Deploy port-security where possible for user ports  Have a plan for the ARP security issues in your network (ARP inspection, IDS, etc.)  Manage switches in as secure a manner as possible (SSH, OOB, permit lists, etc.)  Selectively use SNMP and treat community strings like root passwords
  • 93. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Layer 2 Security Best Practices (2/2)  Enable STP attack mitigation (BPDU Guard, Root Guard)  Enable DHCP snooping  Consider using PVLANs where appropriate  Use MD5 authentication for VTP  Use CDP only where necessary — with phones it is needed  Disable all unused ports and put them in an unused VLAN All of the Preceding Features Are Dependent on Your Own Security Policy
  • 94. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Reference Materials  SAFE Blueprints ‒ http://www.cisco.com/go/safe/  Cisco Catalyst® 3750 ‒ http://www.cisco.com/univercd/cc/td/doc/product/lan/cat3750/index.htm  Cisco Catalyst 4000 ‒ http://www.cisco.com/univercd/cc/td/doc/product/lan/cat4000/index.htm  Cisco Catalyst 6500 ‒ Cisco Catalyst OS and Cisco IOS® ‒ http://www.cisco.com/univercd/cc/td/doc/product/lan/cat6000/  IP Phones ‒ http://www.cisco.com/univercd/cc/td/doc/product/voice/c_ipphon/index.htm  Data Center ‒ http://www.cisco.com/en/US/netsol/ns656/networking_solutions_design_guidances_list.html#anchor3  All SRNDs (System Network Reference Designs) ‒ http://www.cisco.com/go/srnd/
  • 95. Q & A
  • 96. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public Complete Your Online Session Evaluation Give us your feedback and receive a Cisco Live 2013 Polo Shirt! Complete your Overall Event Survey and 5 Session Evaluations.  Directly from your mobile device on the Cisco Live Mobile App  By visiting the Cisco Live Mobile Site www.ciscoliveaustralia.com/mobile  Visit any Cisco Live Internet Station located throughout the venue Polo Shirts can be collected in the World of Solutions on Friday 8 March 12:00pm-2:00pm Don’t forget to activate your Cisco Live 365 account for access to all session material, 96 communities, and on-demand and live activities throughout the year. Log into your Cisco Live portal and click the "Enter Cisco Live 365" button. www.ciscoliveaustralia.com/portal/login.ww
  • 97. © 2013 Cisco and/or its affiliates. All rights reserved.BRKSEC-2202 Cisco Public