NET - 01 - Internet Architecture Recap
NET - 01 - Internet Architecture Recap
https://shorturl.at/wgRDH
University of Rome Tor Vergata
ICT and Internet Engineering
A.A. 2024/2025
General Information
• Lecturers:
○ Giacomo Belocchi
○ Angelo Tulumello
• The teaching material will be uploaded to Teams
• Lectures
○ Monday, 9:30 am @ C4;
○ Tuesday, 4:00 pm @ B14;
○ Wednesday, 4:00 pm @ C4.
Course Objectives
4
Teaching Material
● This course is based on a combination of:
○ books
○ standards
○ papers
○ best practices
○ Internet pages
○ source code
○ experience
● We will provide as much material as possible on Teams
• 6 CFU exam:
○ TBD (oral or written)
• 9 CFU exam:
○ TBD (oral or written)
○ a project (picked by the student from a pool proposed by the lecturers)
• Security frameworks
• Access networks and perimeter security
• Core Networks
• End-to-end security
• Hardware and Operating Systems security
• Virtualisation and Cloud security
• Database Security
• Antivirus Software
Prerequisites
• The class has a very diverse background: if something doesn't fit, ask the
teachers!
Course Overview - Network Track
Network Track - Topics Covered (tentative)
Angelo Tulumello
source: https://www.practicalnetworking.net/stand-alone/classful-cidr-flsm-vlsm/
How long is the network part (or prefix)?
❏ From 1984 IP addresses have no information about the network prefix length
(Classless Inter Domain Routing (CIDR) addresses)
❏ An additional 32 (or 128) bit is required, namely the subnet mask
❏ The i-th bit of the subnet mask is set to
❏ 0: if the i-th bit is in the host part
❏ 1: if the i-th bit is in the network prefix
❏ Example
❏ IP address: 192.168.1.12 10111110 10101000 00000001 00001100
❏ Network Mask: 255.255.255.0 (aka /24) 11111111 11111111 11111111 00000000
IP Forwarding == i.addr):
return i
(pseudocode)
IP Forwarding ARP
request/response
Operations
(pseudocode)
ARP
request/response
process (thread)
user
space syscall()
socket
AP + router
kernel IP/TCP
domestic network
802.11 (WiFi) space
driver
PCI
NIC
From the web browser to the DNS server (same AS)
adsl
AP + router
edge router
domestic network
802.11 (WiFi)
From the web browser to the DNS server (same AS)
adsl
AP + router
edge router border
router
data center FW
adsl
AP + router
edge router border
router
AP + router
domestic network
802.11 (WiFi)
From the web browser to the web server (in another AS)
adsl
AP + router
edge router
domestic network
802.11 (WiFi)
From the web browser to the web server (in another AS)
adsl
AP + router
edge router
adsl
fiber
AP + router
edge router border Transit AS 1
router
adsl
fiber
AP + router
edge router border Transit AS 1
router
Transit AS 2
From the web browser to the web server (in another AS)
adsl
fiber
AP + router
edge router border Transit AS 1
router
Transit AS 2
Transit AS N
From the web browser to the web server (in another AS)
adsl
fiber
AP + router
edge router border Transit AS 1
router
Transit AS 2
Transit AS N
google datacenter
Layered Protocol Stack (DNS request)
DNS
resolve google.com
DNS
resolve google.com
UDP
sport: 5000, dport: 53
DNS
resolve google.com
UDP
sport: 5000, dport: 53
IP
10.0.0.100
85.18.200.200
DNS
resolve google.com
UDP
sport: 5000, dport: 53
IP
10.0.0.100
85.18.200.200
802.11
ac:de:48:00:11:22
00:50:56:c0:00:13
DNS DNS
resolve google.com resolve google.com
UDP UDP
sport: 5000, dport: 53 sport: 5000, dport: 53
IP IP
10.0.0.100 10.0.0.100
85.18.200.200 85.18.200.200
802.11 802.11
ac:de:48:00:11:22 ac:de:48:00:11:22
00:50:56:c0:00:13 00:50:56:c0:00:13
DNS DNS
resolve google.com resolve google.com
UDP UDP
sport: 5000, dport: 53 sport: 5000, dport: 53
IP IP
10.0.0.100 93.42.70.129
85.18.200.200 85.18.200.200
802.11 802.11
ac:de:48:00:11:22 ac:de:48:00:11:22
00:50:56:c0:00:13 00:50:56:c0:00:13
IP: not my address→ FWD and NAT (also source port may be changed)
Protocol Stack (DNS request - simplified)
DNS DNS
resolve google.com resolve google.com
UDP UDP
sport: 5000, dport: 53 sport: 5000, dport: 53
IP IP
10.0.0.100 93.42.70.129
85.18.200.200 85.18.200.200
802.11 802.11
ac:de:48:00:11:22 ac:de:48:00:11:22
00:50:56:c0:00:13 00:50:56:c0:00:13
upper layers are not involved (unless we have something like a firewall or proxy etc...)
Protocol Stack (DNS request - simplified)
DNS DNS
resolve google.com resolve google.com
UDP UDP
sport: 5000, dport: 53 sport: 5000, dport: 53
IP IP
10.0.0.100 93.42.70.129
85.18.200.200 85.18.200.200
802.11 ethernet
ac:de:48:00:11:22 00:50:56:c0:00:13
00:50:56:c0:00:13 00:32:11:aa:12:01
packet is sent to the NIC for TX. Let us assume the server is the next hop. MAC
addresses change accordingly
Protocol Stack (DNS request - simplified)
❏ IP does not implement any mechanism that aims at protecting the disclosure
of the content of a packet from a non authorized user
❏ Packet capture/decodification is trivial…
❏ Moreover, end users have no control over the packet path
❏ OK we trust our ISP…
❏ … but can we do the same of all other ASes traversed by the packets?
❏ But even if we had such control, have you ever heard of route
hijacking/leaking?
❏ BTW, confidentiality here is the least of the problems….
Data Integrity (i.e. received packets are not modified)
❏ IP/TCP(or UDP) implement a checksum mechanism for the header and payload
❏ Things are complicated by the fact that internet protocols implement different
“discovery” mechanisms based on dynamic mapping
❏ Examples
❏ from names to IP addresses (DNS)
❏ from IP addresses to MAC addresses (ARP)
❏ from MAC to output ports (802.3 bridging)
❏ from destination addresses to IP next hops (IP routing)
❏ These mechanisms as well were not designed with security requirements
❏ E.g.: with legacy DNS implementation we can not authenticate the name
resolutions (netgroup.uniroma2.it <> 160.80.221.15)
DNS spoofing
A practical example
❏ In the following Lab we are going to see how to exploit the previously mentioned
dynamic mapping insecurity to realize a practical attack
❏ This attack is clearly “outdated” and “inefficient”
❏ we can do the same simply with a MiTM
❏ it is meant to show the “historical” vulnerabilities
❏ it is easily prevented by implementing HTTPS
❏ Attack high level description:
❏ (mac address ⇔ ip address) insecure mapping exploited to realize a MiTM
❏ (website name ⇔ ip address) insecure mapping exploited to realize DNS
spoofing
❏ insecure website (http://netgroup.uniroma2.it) impersonification
Lab 1
Man in the middle, DNS spoofing and
website impersonification
Attack description
❏ GOAL: hijack HTTP requests through DNS spoofing
❏ Scenario
❏ Attacker in the same local network as Victim
❏ Victim’s DNS resolver 8.8.8.8
❏ DNS spoofing: netgroup.uniroma2.it → attacker’s IP address
❏ netgroup.uniroma2.it impersonification
❏ STEP 1: MiTM
❏ STEP 2: DNS request interception
❏ STEP 3: DNS reply spoofing
❏ STEP 4: web site impersonification
❏ Everything realized with open source tools and Linux
❏ Emulated environment with Linux and GNS3
Topology
defaultDNS: 8.8.8.8
netgroup.uniroma2.it
Attack insights
❏ Attacker sends spoofed ARP responses to Victim and defaultGW
❏ ARP opcode 2 unicast to bb:bb:bb:bb:bb:bb (Victim): 10.0.0.1 is @ aa:aa:aa:aa:aa:aa
❏ ARP opcode 2 unicast to cc:cc:cc:cc:cc:cc (defaultGW): 10.0.0.100 is @ aa:aa:aa:aa:aa:aa
❏ Attacker becomes the Man in the middle and redirects DNS request to 127.0.0.1
❏ iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT
❏ Attacker runs a light DNS server (dnsmasq) configured as follows:
❏ netgroup.uniroma2.it → 10.0.0.200 (DNS spoofing)
❏ «address=netgroup.uniroma2.it/10.0.0.200» into /etc/dnsmasq.d/spoof.conf
❏ anything else forwarded to 8.8.8.8
❏ «server=8.8.8.8» into /etc/dnsmasq.d/spoof.conf
❏ Attacker impersonificates netgroup.uniroma2.it
❏ website mirroring: wget --mirror --convert-links --html-extension --no- parent -l 1 --no-check-
certificate netgroup.uniroma2.it
❏ website hosted by Apache2
MiTM with python/scapy
import sys
from scapy.all import *
import time
ip_victim="10.0.0.100"
ip_router="10.0.0.1"
hw_attacker="aa:aa:aa:aa:aa:aa"
hw_router="cc:cc:cc:cc:cc:cc"
hw_victim="bb:bb:bb:bb:bb:bb"