Common Network Attacks: David J. Marchette
Common Network Attacks: David J. Marchette
David J. Marchette
[email protected]
< > - +
Common Network Attacks – p.1/96
Outline
< > - +
Common Network Attacks – p.2/96
Terminology
< > - +
Common Network Attacks – p.3/96
Terminology
< > - +
Common Network Attacks – p.4/96
References
< > - +
Common Network Attacks – p.5/96
Outline of an Attack
< > - +
Common Network Attacks – p.6/96
Comments on Attack Outline
< > - +
Common Network Attacks – p.7/96
Attack Types
< > - +
Common Network Attacks – p.8/96
DOS: Land Attack
< > - +
Common Network Attacks – p.9/96
DOS: Ping of Death
< > - +
Common Network Attacks – p.10/96
DOS: Teardrop
< > - +
Common Network Attacks – p.11/96
More Attacks with Fragments
< > - +
Common Network Attacks – p.12/96
DOS: UDP Storm
< > - +
Common Network Attacks – p.13/96
Notes on “Old Attacks”
< > - +
Common Network Attacks – p.14/96
Notes on “Old Attacks”
Note that code reuse and poor programming habits can make
some old attacks viable again.
How might one have designed a system that would detect the
above attacks before they were known?
< > - +
Common Network Attacks – p.15/96
DOS: SYN Flood
< > - +
Common Network Attacks – p.16/96
DOS: SYN Flood
Note that the packets needn’t have the source address of the
attacker. In fact, they should have an unreachable source to
ensure that the SYN/ACKs are never answered.
In actual implementations, the attack usually does not use
unreachable sources, but rather selects the sources at random (or
arbitrarily).
< > - +
Common Network Attacks – p.17/96
DOS: Process Table
< > - +
Common Network Attacks – p.18/96
DOS: Process Table Notes
Note that the attacker must appear in the source IP address, since
it must answer the SYN/ACKs. But if it’s clever, it need not fork
any processes.
This is a good attack to implement as a distributed denial of
service. By using many compromised computers, the attacker
hides his identity while multiplying the effectiveness of the attack.
< > - +
Common Network Attacks – p.19/96
DOS: Targa3
< > - +
Common Network Attacks – p.20/96
DOS: Targa3 Notes
The attacker need not appear in the source IP, since it doesn’t
need to handle any responses.
There need be no particular pattern to the malformed packets.
However, patterns in these might provide a way to fingerprint the
attack software.
< > - +
Common Network Attacks – p.21/96
DOS: Smurf
< > - +
Common Network Attacks – p.22/96
DOS: Smurf Picture
Intermediary Network
172.16.x.x
Attacker Target
< > - +
Common Network Attacks – p.23/96
DOS: Smurf Picture
Intermediary Network
172.16.x.x
Attacker Target
< > - +
Common Network Attacks – p.23/96
DOS: Smurf Picture
Intermediary Network
172.16.x.x
Attacker Target
< > - +
Common Network Attacks – p.24/96
DOS Notes
< > - +
Common Network Attacks – p.25/96
Network Mapping
< > - +
Common Network Attacks – p.26/96
Network Mapping Light
ping 10.10.255.255.
If this works, every machine on 10.10.xxx.xxx will respond.
It probably won’t work.
Many organizations don’t allow broadcast packets through their
firewalls.
If it did work, it would probably flood your machine, and produce a
denial of service against yourself!
< > - +
Common Network Attacks – p.27/96
Network Mapping the Hard Way
ping 10.10.1.1.
ping 10.10.1.2.
ping 10.10.1.3. · · ·
Can be automated, and will work, assuming it isn’t blocked by a
firewall.
It is extremely easy to detect.
It can take a while to go through all the possible addresses.
To this day people (script kiddies) will do this.
< > - +
Common Network Attacks – p.28/96
Stealthy Network Mapping
< > - +
Common Network Attacks – p.29/96
Stealthy Network Mapping
6. Using different packets for the scan (some icmp, some udp, etc.).
7. Only scan a subset of the network.
< > - +
Common Network Attacks – p.30/96
Inverse Mapping
Uses the Internet error mechanism to the attacker’s advantage.
Example:
Send a TCP packet with the RESET flag set.
If the packet reaches its destination, the packet is dropped.
If the final router cannot deliver the packet, it sends back a
“host unreachable” (ICMP) error message.
The packets that don’t generate a response went to machines that
exist.
< > - +
Common Network Attacks – p.31/96
Inverse Mapping Example
Attacker sends RESET packets.
V6
V5
A V4
V3
V2
V1
< > - +
Common Network Attacks – p.32/96
Inverse Mapping Example
Router sends Host Unreachable responses.
V6
V5
A V4
V3
V2
V1
< > - +
Common Network Attacks – p.32/96
Inverse Mapping Example
Attacker knows the victim’s machines.
V6
V5
A V4
V3
V2
V1
< > - +
Common Network Attacks – p.32/96
Inverse Mapping Notes
< > - +
Common Network Attacks – p.33/96
Inverse Mapping Notes
Look for many RESET packets from the same machine to many
machines.
Drop RESET packets without a response if they are to IP
addresses that aren’t populated.
< > - +
Common Network Attacks – p.34/96
Port Mapping
< > - +
Common Network Attacks – p.35/96
Port Mapping
< > - +
Common Network Attacks – p.36/96
Stealthy Port Mapping
< > - +
Common Network Attacks – p.37/96
Patsies (Idle Scan)
< > - +
Common Network Attacks – p.38/96
What to do about Patsies
< > - +
Common Network Attacks – p.39/96
Downsides
< > - +
Common Network Attacks – p.40/96
Fingerprinting (Active)
< > - +
Common Network Attacks – p.41/96
Fingerprinting (Active)
< > - +
Common Network Attacks – p.42/96
Fingerprinting (Passive)
< > - +
Common Network Attacks – p.43/96
Fingerprinting (Passive)
< > - +
Common Network Attacks – p.44/96
A Comment about TTL
Note that you never see the TTL value set by the remote machine.
You see the TTL decremented by an unknown number of routers.
So, you observe T − δ where T is the original TTL and δ is a
random positive integer.
< > - +
Common Network Attacks – p.45/96
A Comment about Source Ports
< > - +
Common Network Attacks – p.46/96
TCP Hijacking
< > - +
Common Network Attacks – p.47/96
TCP Hijacking Setup
< > - +
Common Network Attacks – p.48/96
TCP Hijacking Details
< > - +
Common Network Attacks – p.49/96
TCP Hijacking Details
< > - +
Common Network Attacks – p.50/96
TCP Hijacking Example
Machine A Machine B
Attacker
Machine A Machine B
Attacker
Machine A Machine B
Attacker
Machine A Machine B
Attacker
Machine A Machine B
Attacker
A sends SYN/ACK to B
which is ignored since B is down.
< > - +
Common Network Attacks – p.51/96
TCP Hijacking Example
Machine A Machine B
Attacker
Machine A Machine B
Attacker
Machine A Machine B
X
echo “++” > .rhosts
Attacker
Don’t be trusting.
Use a hard to predict sequence number generator.
Watch for sequence number guessing attempts.
Block all access to attackers at the firewall (if it SYN floods, block
it).
This last is potentially dangerous (what if the SYN flood appears
to come from your ISP?).
< > - +
Common Network Attacks – p.52/96
Are Sequence Numbers Predictable?
2e+09
1e+09
0e+00
y[,2]
−1e+09
−2e+09
−3e+09
y[,1]
< > - +
Common Network Attacks – p.53/96
Are Sequence Numbers Predictable?
2e+09
1e+09
0e+00
y[,2]
−1e+09
−2e+09
−3e+09
y[,1]
< > - +
Common Network Attacks – p.54/96
Are Sequence Numbers Predictable?
4e+09
3e+09
2e+09
1e+09
y[,2]
0e+00
−1e+09
−2e+09
y[,1]
< > - +
Common Network Attacks – p.55/96
SHADOW
< > - +
Common Network Attacks – p.56/96
SHADOW
Headers filtered with tcpdump filters and perl scripts and sent to a
web page.
Analyst reviews the web page and reports attacks or suspicious
activity.
Includes ability to search past data, do whois lookups, and nmap
machines.
< > - +
Common Network Attacks – p.57/96
SHADOW
Collects some statistics on traffic.
Newest version allows some reduction:
10.10.10.31 -> 192.78.[1-255].[1-78].22
10.10.10.31 -> 192.78.8.52.[0-65535]
Automates some of the tedium of generating reports.
Relies on the analyst for all decisions.
Not “real time”. Always at least 1 hour after the fact. Does not take
any action. Purely a monitoring system.
< > - +
Common Network Attacks – p.58/96
Typical SHADOW Installation
Sensor Analysis
Firewall
Internet
Internal Network
< > - +
Common Network Attacks – p.59/96
SHADOW Advantages
It’s free.
It is easily configurable to one’s network.
It looks at all the traffic (headers) coming in or going out of the
network.
Simple web interface for the analyst.
SANS has many classes that are based around the SHADOW
idea.
Quickly points out misconfigurations on your network.
Supports multiple sensors.
< > - +
Common Network Attacks – p.60/96
SHADOW Disadvantages
< > - +
Common Network Attacks – p.61/96
SHADOW Disadvantages
< > - +
Common Network Attacks – p.62/96
EMERALD
< > - +
Common Network Attacks – p.63/96
EMERALD
< > - +
Common Network Attacks – p.64/96
EMERALD Monitors
< > - +
Common Network Attacks – p.65/96
EMERALD Monitors
< > - +
Common Network Attacks – p.66/96
Signature Engine
< > - +
Common Network Attacks – p.67/96
Profiler
< > - +
Common Network Attacks – p.68/96
Resolver
< > - +
Common Network Attacks – p.69/96
Resource Object
Contains all the information about data feeds, rule sets, etc.
Essentially the configuration mechanism for the module.
< > - +
Common Network Attacks – p.70/96
Service Monitors
< > - +
Common Network Attacks – p.71/96
Domain Monitors
< > - +
Common Network Attacks – p.72/96
Enterprise Monitors
< > - +
Common Network Attacks – p.73/96
ADAM
< > - +
Common Network Attacks – p.74/96
Association Rules
< > - +
Common Network Attacks – p.75/96
Association Rules
< > - +
Common Network Attacks – p.76/96
ADAM Processing
Three modules:
Preprocessing engine.
Data Mining (rule set extraction) engine.
Classification Engine.
Involves a training phase and a detection phase.
< > - +
Common Network Attacks – p.77/96
ADAM Processing
Looks for “static” rules: things that have high support in the whole
data set. Global patterns.
Also looks for “dynamic” rules: uses a sliding window to look for
local patterns.
Uses header fields:
Time.
Source/Destination IP.
Source/Destination port.
TCP flags.
< > - +
Common Network Attacks – p.78/96
Performance
Emerald and ADAM were first and second in the 1999 DARPA
evaluation (by some measures).
This was a test on simulated data.
Researchers were given a data set with truth (attacks and normal
traffic notated).
Researchers were then given a test set without truth, and had to
detect the attacks.
No system performed perfectly. One could argue that none
performed adequately.
< > - +
Common Network Attacks – p.79/96
SANS Top 20 List
http://www.sans.org/top20/
< > - +
Common Network Attacks – p.80/96
An Example Microsoft FAQ
< > - +
Common Network Attacks – p.81/96
Continued
< > - +
Common Network Attacks – p.82/96
Continued
< > - +
Common Network Attacks – p.83/96
Continued
< > - +
Common Network Attacks – p.84/96
Continued
< > - +
Common Network Attacks – p.85/96
Continued
< > - +
Common Network Attacks – p.86/96
Continued
The update removes the vulnerability by modifying the way that Print
< > - +
Common Network Attacks – p.87/96
Utilities
nmap.
p0f.
snort.
< > - +
Common Network Attacks – p.88/96
Nmap
< > - +
Common Network Attacks – p.89/96
Nmap Example
< > - +
Common Network Attacks – p.90/96
Nmap Example
< > - +
Common Network Attacks – p.91/96
Nmap Example
< > - +
Common Network Attacks – p.92/96
Nmap Example
Port State Protocol Service
1 open tcp tcpmux
9 open tcp discard
13 open tcp daytime
21 open tcp ftp
22 open tcp ssh
23 open tcp telnet
25 open tcp smtp
37 open tcp time
80 open tcp www
111 open tcp sunrpc
513 open tcp login
< > - +
Common Network Attacks – p.93/96
Nmap Example
< > - +
Common Network Attacks – p.94/96
p0f
http://lcamtuf.coredump.cx/p0f.shtml
< > - +
Common Network Attacks – p.95/96
snort
http://www.snort.org
< > - +
Common Network Attacks – p.96/96