module-4-p
module-4-p
Networks and
Scanning
This Week’s Objectives
• Understand key concepts and protocols in
computer networks
o OSI layers
o Ethernet/ARP/DHCP
o IP/TCP/UDP/ICMP
o DNS
• Understand network and host scanning
2
The Internet
129.127.120.7
Physical How do bits get translated into electrical, optical, or radio signals
Packet Encapsulation
IP TCP TCP
HTTP Request
Ethernet (IEEE 802.3)
Most common Link Layer Protocol. Let’s you send packets to other local hosts.
• Every packet has an IP header that indicates its sender and receiver
19
DHCP Interaction (simplified)
Argon
00:a0:24:71:e4:44 DHCP Server
DHCP Request
00:a0:24:71:e4:44
Sent to 255.255.255.255
Argon
128.143.137.144
00:a0:24:71:e4:44 DHCP Server
DHCP Response:
IP address: 128.143.137.144
Default gateway: 128.143.137.1
Netmask: 255.255.0.0
20
The Internet Control Message Protocol
IP payload
21
ICMP Query message
ICMP query:
• Request sent by host to a router or host
• Reply sent back to querying host
22
Protocol Layering
How does Application
structure data?
HTTP,
5 Application Messages
SMTP…
TCP/
4 Transport Segment Port #
UDP
Ethernet, Mac
2 Data Link Frames
Wifi Address
10 Base T,
1 Physical Bits N/a
802.11
Physical Data Link Network Transport Application
Transport Layer Functions
Reliability
Multiplexing
Segmentation
Flow Control
Error detection and Correction
UDP (User Datagram Protocol)
Characteristics: Application:
1. Short 1. DNS, DHCP
2. Unreliable 2. Live streaming
3. Fast (low latency) 3. VoIP
TCP (Transmission Control Protocol)
1. 3 handshakes Application:
2. Slow
3. Reliable a. HTTP, SMTP
b. File transferring
a. Error checking c. Video streaming
b. Retransmission
sender receiver
multiplex demultiplex
Application
P2
Application
P1 P5 P3 P4
Transport Transport
Network Network
Physical Physical
multiplex demultiplex
chrome web server
port 61243 port 80
mail server
port 993
file server
outloook port 21
port 60421
multiplex demultiplex
gathering data from deliver packet to a
multiple process, and correct process
envelop with headers
chrome Apache web server
port 61243 port 80
data
12 13 14
sender receiver
seq # = 11
send pkt1 ack # = …
seq # = 12
receive ack1
ack # =…
send pkt2
seq # = … receive pkt2
ack # = 13 send ack2
receive ack2
seq # = 13
send pkt3
ack # = …
…
receive pkt3
…
Segmentation (Transport Layer):
Port Application
80 HTTP (Web)
443 HTTPS (Web)
25 SMTP (mail)
67 DHCP (host config)
22 SSH (secure shell)
23 Telnet
UDP (User Datagram Protocol)
32
DNS Record
A DNS server has a set of records it authoritatively knows about
name servers
Caching
• DNS responses are cached
• Quick response for repeated translations
IP addresses of live
(Network) scanning is an systems
intense and methodical
Operating system
process of uncovering the versions
structure of the network
(including firewalls), hosts MAC addresses
and applications on it.
Service information
• Require good
understanding of network
Port data
protocols
• Used by both attackers
and defenders etc
Current Scanners
ZMap
5
Host Discovery - Port Scanning
• Finding applications that listen on ports
• Use TCP fingerprinting to find out OS type
• Send various packets:
o Establish and tear down TCP connection
o Half-open and tear down TCP connection
o Send invalid TCP packets: FIN, Null, Xmas scan
o Send TCP ACK packets – find firewall holes
o Send ICMP packets
o Others (not covered in this course): FTP bounce scans,
Find Remote Procedure Call (RPC) applications
TCP Full Connect Scan
Utilises the three-way handshake
Completed handshake
indicates open port
Incomplete handshake
indicates closed
Scan gives most accurate
picture of port status
www
1. ICMP_ECHO to www.target.com
TTL=1
A R1 R2 R3 DB
1a. ICMP_TIME_EXCEEDED
from R1
www
1. ICMP_ECHO to www.target.com
TTL=2
A R1 R2 R3 DB
1a. ICMP_TIME_EXCEEDED
from R2
target.com
A: R1-R2 is on my path to www.target.com!
Network Mapping with Traceroute
A R1 R2 R3 DB