1/100
Looks like no tags are added yet.
What is a protocol?
A set of rules (basically a deterministic algorithm/program) that says what to do with a message
Why do we have lots of different protocols?
To bridge the gap between different parts of the network stack
Which layer does ARP handle in the simplified stack?
LAN routing (link layer)
Which layer does IP handle in the simplified stack?
Internet routing
Which layer does TCP handle in the simplified stack?
Reliability (TLS above it gives security and HTTPS is the application layer)
IP address - which layer and who decides it?
Network layer. Allocated by someone (an admin or a pool allocator). Devices do not pick their own
MAC address - which layer and who decides it?
Data link layer. Assigned at manufacture and put in the device memory
Which addresses do high level vs low level protocols use?
High level protocols use IP addresses. Low level protocols use MAC addresses
What does ARP stand for?
Address Resolution Protocol
What does ARP do?
Maps IP addresses (network layer) to MAC addresses (data link layer)
What two mechanisms is ARP based on?
Broadcast messages and local caching
Define broadcast (ARP context)
Shouting a message to every device on the network
Define caching (ARP context)
Saving the answer in memory so you do not need to ask again
Which security properties does ARP lack?
Confidentiality + integrity + authentication (designed when everyone was assumed honest)
Which RFC defines ARP?
RFC 826
What does an ARP request say and how is it sent?
Who has
What does an ARP reply say and how is it sent?
Who answers an ARP request?
Only the machine that owns the requested IP. Everyone else ignores it
What does the requesting machine do with an ARP reply?
Saves it in its ARP cache
Command to display the ARP table?
arp -a (works on Linux and Windows and OSX)
Command to flush the ARP cache (Windows)?
arp -a -d
Dynamic vs static ARP cache entries?
Dynamic = learned by running ARP. Static = hand-written by an administrator
Another name for ARP cache poisoning?
ARP spoofing
What is ARP cache poisoning?
Filling a machine's ARP cache with false IP-to-MAC mappings
Why is ARP cache poisoning possible? (4 reasons)
1 Table updates on ANY reply. 2 Requests are not tracked (stateless). 3 Replies are not authenticated. 4 Machines simply trust each other
What is a gratuitous ARP reply?
An unsolicited ARP reply that nobody asked for. Used to poison caches
Is a machine's ARP cache updated only after it sent a request?
No. Implementations are stateless so it updates on any reply even if it never asked
Trusted vs trustworthy?
Trusted = we assume it tells the truth. Trustworthy = it actually does. ARP machines are only trusted
Describe the ARP poisoning attack on Alice and Bob
Eve tells Bob that Alice's IP is at Eve's MAC and tells Alice that Bob's IP is at Eve's MAC. Their traffic then flows through Eve
What type of attack does ARP poisoning enable?
Mal actor-in-the-middle (MITM) attack on a LAN and so eavesdropping
Defence against ARP poisoning and its drawback?
Static ARP entries cannot be overwritten. But they are almost impossible to manage and do not scale (every IP change needs updating on every machine)
Why does a router have two interfaces?
One inside (LAN) address and one outside (Internet-facing) address
What happens to private LAN IP addresses at the gateway?
They are only valid inside the private network and get dropped at the router
List the 4 IP vulnerabilities
Unencrypted transmission + no source authentication + no integrity checking + no bandwidth constraints
Unencrypted IP transmission leads to what?
Eavesdropping at any intermediate host during routing
What is IP spoofing?
The sender writes any source address they like in the packet header. Hard to trace back to the attacker
Why can an attacker change an IP packet without detection?
No integrity checking - they can edit header and payload and recompute the checksums themselves
Attacks enabled by no IP integrity?
Content forgeries + redirections + mal actor-in-the-middle attacks
Attacks enabled by no bandwidth constraints?
Denial of service by injecting a huge number of packets. Broadcast addresses give extra leverage
The 4 network attack types in the diagrams
Wiretapping (sniffing) + Creation (spoofing) + Tampering (active) + Block (DoS)
Why is IP level blocking easy for an adversary?
All routing info is in the header so it cannot be hidden. They can drop any packet going to a chosen destination
Is UDP stateful?
No - it is stateless. Send the packet and forget it
Is UDP reliable?
No - it is an unreliable datagram protocol with no delivery guarantees or acknowledgments
What layer is UDP at?
Transport layer (built on top of IP)
Why is UDP efficient?
No acknowledgments or delivery guarantees or connection state
What must apps using UDP be ready for?
Corrupted and lost data
UDP header size and fields?
8 bytes: source port + destination port + length + checksum
Typical UDP uses and why packet loss is OK
VoIP + streaming video + streaming audio. Our eyes and ears fill in small gaps
Can UDP serve multiple apps on one host?
Yes - through port numbers
What does TCP stand for?
Transmission Control Protocol
Main properties of TCP
Reliable + in-order delivery + stateful + supports multiple applications on one host (via ports)
Protocols built on top of TCP?
HTTP and SSH
Is TCP stateful?
Yes - it keeps track of connection state in memory (e.g. where it is in the handshake and how many packets are pending)
How does TCP keep packets in order?
Each packet gets a sequence number so the receiver can reorder them (packets may take different paths and arrive out of order)
What happens every time TCP receives a packet?
It sends an acknowledgement (ACK)
What if an ACK is lost or never arrives?
The sender waits (timer) and then retransmits the packet
How does TCP adapt its sending speed?
Fast ACKs mean it speeds up. Slow ACKs mean it slows down. No ACKs mean it waits and resends
What do ACKs and window size let TCP track?
Packet loss + network congestion + flow control
How does TCP check for errors?
A 16-bit checksum of the data and parts of the header (including source and destination)
What is a port?
A 16-bit number identifying which application/service on a host the data is directed to (apartment door analogy)
How is a port written with an IP?
After the address with a colon e.g. 192.168.0.1:80 or example.co.uk:8080
Which ports does the TCP header contain?
Both a source port and a destination port
Port range 0-1023
Well-known/reserved for known protocols
Port range 1024-49151
User (registered) ports - free for anyone to use e.g. a game server
Port range 49152 and above
Dynamic ports
Port for SSH
22
Port for HTTP
80
Port for HTTPS
443
List the fields of the TCP header
Source port + destination port + sequence number + acknowledgment number + offset + reserved + flags + window size + checksum + urgent pointer + options then payload
How big is the TCP header (before options and payload)?
160 bits (5 rows of 32 bits)
How are TCP connections established?
Three-way handshake (usually the client initiates and the server is a passive listener)
Step 1 of the TCP handshake
Client sends SYN with Seq = x
Step 2 of the TCP handshake
Server replies SYN-ACK with Seq = y and Ack = x + 1
Step 3 of the TCP handshake
Client replies ACK with Seq = x + 1 and Ack = y + 1
What does SYN stand for and do?
Synchronize - carries the initial sequence number
What is exchanged during the handshake?
Initial sequence numbers
Why the +1 in ACK numbers?
It tells the other side which sequence number/connection is being acknowledged
Describe a SYN flooding attack
Attacker sends thousands of SYN packets and never answers the SYN-ACKs. The victim keeps half-open connections until its state table is full and it drops new legit connections
What is a half-open connection?
Server has sent SYN-ACK and is waiting for the final ACK
Why does SYN flooding work?
TCP is stateful so the victim must store state for every connection request
Problem 1 with basic SYN flooding for the attacker
Attribution - their own IP is in the packets so they are easy to trace and block
Problem 2 with basic SYN flooding for the attacker
Bandwidth - they use their own bandwidth which is likely smaller than the server's
SYN flooding is effective against what?
Small targets (e.g. a home game server)
SYN flooding is NOT effective against what?
Large targets (e.g. a company website with DoS protection like Cloudflare)
How does spoofing improve SYN flooding?
Forge a random source address in each SYN. Harder to trace and the SYN-ACKs go to another computer so it uses less attacker bandwidth
Side effect of spoofed SYN floods on others?
The SYN-ACKs hit innocent third-party computers
Defence against spoofed source addresses?
Ingress filtering - drop packets leaving a network with source addresses outside its own range (assumes the network is not adversarial)
What does ICMP stand for?
Internet Control Message Protocol
What is ping?
An ICMP echo request. The remote host replies to say it is online
What is smurfing?
A DoS reflection attack using ICMP ping sent to a broadcast address (directed broadcast)
What is a Smurf amplifier?
A network that replies to pings sent to its broadcast address
Example broadcast address?
10.01.34.255 (last octet 255)
Smurf attack steps
1 Forge a ping with the VICTIM's IP as source. 2 Send it to the amplifier's broadcast address. 3 Every host replies to the victim
Why is smurfing an amplification attack?
One small ping becomes hundreds or thousands of replies (e.g. 1000 hosts = 1000 replies) using other people's bandwidth
Why is smurfing called a reflection attack?
The attack traffic is bounced off many third-party machines onto the victim
Defence against Smurf attacks?
Fix badly configured LANs so they do not respond to broadcast pings. Blacklist known Smurf amplifier networks (e.g. the Smurf Amplifier Registry)
SYN flood vs Smurf - what exhausts the victim?
SYN flood exhausts the state table (memory). Smurf exhausts bandwidth
Root cause of all these attacks
Network protocols have no built-in confidentiality or integrity or authentication - everyone trusts the packet header
Why are network protocols sent in plaintext?
Networks need plain readable headers to talk to each other
How will we fix the lack of security later in the course?
Mostly cryptography (e.g. TLS at the application layer) plus extra non-crypto layers of security