Sniffing is capturing packets as they pass on the wire to review for interesting information
MAC (Media Access Control) - physical or burned-in address - assigned to NIC for communications at the Data Link layer
48 bits long
Displayed as 12 hex characters separated by colons
First half of address is the organizationally unique identifier - identifies manufacurer
Second half ensures no two cards on a subnet will have the same address
NICs normally only process signals meant for it
Promiscuous mode - NIC must be in this setting to look at all frames passing on the wire
CSMA/CD - Carrier Sense Multiple Access/Collision Detection - used over Ethernet to decide who can talk
Collision Domains
Traffic from your NIC (regardless of mode) can only be seen within the same collision domain
Hubs by default have one collision domain
Switches have a collision domain for each port
Protocols Susceptible
SMTP is sent in plain text and is viewable over the wire. SMTP v3 limits the information you can get, but you can still see it.
FTP sends user ID and password in clear text
TFTP passes everything in clear text
IMAP, POP3, NNTP and HTTP all send over clear text data
TCP shows sequence numbers (usable in session hijacking)
TCP and UCP show open ports
IP shows source and destination addresses
ARP
Stands for Address Resolution Protocol
Resolves IP address to a MAC address
Packets are ARP_REQUEST and ARP_REPLY
Each computer maintains it’s own ARP cache, which can be poisoned
Commands
arp -a - displays current ARP cache
arp -d * - clears ARP cache
Works on a broadcast basis - both requests and replies are broadcast to everyone
Gratuitous ARP - special packet to update ARP cache even without a request
This is used to poison cache on other machines
IPv6
Uses 128-bit address
Has eight groups of four hexadecimal digits
Sections with all 0s can be shorted to nothing (just has start and end colons)
Double colon can only be used once
Loopback address is ::1
IPv6 Address Type
Description
Unicast
Addressed and intended for one host interface
Multicast
Addressed for multiple host interfaces
Anycast
Large number of hosts can receive; nearest host opens
IPv6 Scopes
Description
Link local
Applies only to hosts on the same subnet (Address block fe80::/10)
Site local
Applies to hosts within the same organization (Address block FEC0::/10)
Global
Includes everything
Scope applies for multicast and anycast
Traditional network scanning is computationally less feasible
Wiretapping
Lawful interception - legally intercepting communications between two parties
Active - interjecting something into the communication
Passive - only monitors and records the data
PRISM - system used by NSA to wiretap external data coming into US
Active and Passive Sniffing
Passive sniffing - watching network traffic without interaction; only works for same collision domain
Active sniffing - uses methods to make a switch send traffic to you even though it isn’t destined for your machine
Span port - switch configuration that makes the switch send a copy of all frames from other ports to a specific port
Not all switches have the ability to do this
Modern switches sometimes don’t allow span ports to send data - you can only listen
Network tap - special port on a switch that allows the connected device to see all traffic
Port mirroring - another word for span port
MAC Flooding
Switches either flood or forward data
If a switch doesn’t know what MAC address is on a port, it will flood the data until it finds out
CAM Table - the table on a switch that stores which MAC address is on which port
If table is empty or full, everything is sent to all ports
This works by sending so many MAC addresses to the CAM table that it can’t keep up
Tools
Etherflood
Macof
Switch port stealing - tries to update information regarding a specific port in a race condition
MAC Flooding will often destroy the switch before you get anything useful, doesn’t last long and it will get you noticed. Also, most modern switches protect against this.
ARP Poisioning
Also called ARP spoofing or gratuitous ARP
This can trigger alerts because of the constant need to keep updating the ARP cache of machines
Changes the cache of machines so that packets are sent to you instead of the intended target
Countermeasures
Dynamic ARP Inspection using DHCP snooping
XArp can also watch for this
Default gateway MAC can also be added permanently into each machine’s cache
Tools
Cain and Abel
WinArpAttacker
Ufasoft
dsniff
DHCP Starvation
Attempt to exhaust all available addresses from the server
Attacker sends so many requests that the address space allocated is exhausted