17 Intru Firewalls PDF
17 Intru Firewalls PDF
Router
1
TCP Protocol Stack Data Formats
TCP Header
Application protocol
Application Application Application message - data
Application message
TCP, UDP protocol
Transport Transport Transport (TCP, UDP) segment TCP data TCP data TCP data
IP protocol IP protocol
Network IP Network Network (IP) packet
IP TCP data
ISO OSI 7 Layer Network Reference Model Screening router for packet filtering
Application Application
Presentation Presentation
Session Session
Transport Transport
Network Network Network
2
Source/Destination Address Forgery Port numbering
TCP connection
• Server port is number less than 1024
• Client port is number between 1024 and 16383
Permanent assignment
• Ports <1024 assigned permanently
– 20,21 for FTP 23 for Telnet
– 25 for server SMTP 80 for HTTP
Variable use
• Ports >1024 must be available for client to make any
connection
• This presents a limitation for stateless packet filtering
– If client wants to use port 2048, firewall must allow incoming
traffic on this port
• Better: stateful filtering knows outgoing requests
– Only allow incoming traffic on high port to a machine that has
initiated an outgoing request on low port
Can block external request to internal server based on port number Internal request to external server will use known port out, high port in
23 1234
Y Server acknowledges
3
FTP Normal Fragmentation
FTP Server FTP Client
20 21
X Client opens Data Command 5150 5151
command
channel to server; X
tells server 5151”
“PORT
second port
number
Y Server Y
acknowledges Z “OK”
DATA C
Z Server opens HANNE
L
data channel to
client’s second
port [
[ Client TCP ACK
acknowledges
4
Dual Homed Host Architecture Firewall mechanism
Firewall runs set of proxy programs
• Proxies filter incoming, outgoing packets
• All incoming traffic directed to firewall
• All outgoing traffic appears to come from firewall
Policy embedded in proxy programs
Two kinds of proxies
• Application-level proxies
– Tailored to http, ftp, smtp, etc.
• Circuit-level proxies
– Decisions based on header information
5
Securify Problems with Firewalls
Performance
• Firewalls may interfere with network use
Limitations
• They don't solve the real problems
– Buggy software
– Bad protocols
• Generally cannot prevent Denial of Service
• Do not prevent insider attacks
Administration
• Many commercial firewalls permit verycomplex configurations
6
Sample Traffic shaping functions
Classify and analyze traffic
• Classify by IP address and port number
• Use application-specific information (layer 7)
Control traffic
• Selectively slow certain classes of traffic
Monitor network performance
• Collect performance data, used to improve policies
Network resilience
• Active traffic management can provide resilience to
DoS attacks, at least within the enterprise network
• Aimster • H.323
5 Session • AudioGalaxy • RTP-I/RTCP-I
• Enables efficient bandwidth use
• CuteMX • PASV FTP
4 Transport • DirectConnect • HTTP
Most Routers
• Gnutella
Switches
• Real
3 Network • Hotline • WinMedia Rate shaped P2P capped ¾
• iMesh • Shoutcast at 300kbps
2 Data Link • KaZaA/Morpheus • MPEG
• Napster • Quicktime Rate shaped HTTP/SSL ¾
1 Physical • ScourExchange • RTSP to give better performance
• Tripnosis…. • Chatting Apps
• Games
– Tripwire
• Look for attack in progress
– Network traffic patterns
– System calls, other system events
No Shaping Shaping
7
Tripwire Is Tripwire too late?
Outline of standard attack Typical attack on server
• Gain user access to system • Gain access
• Gain root access • Install backdoor
• Replace system binaries to set up backdoor – This can be in memory, not on disk!!
• Use backdoor for future activities • Use it
Tripwire detection point: system binaries Tripwire
• Compute hash of key system binaries • Is a good idea
• Compare current hash to hash stored earlier • Wont catch attacks that don’t change system files
• Report problem if hash is different • Detects a compromise that has happened
• Store reference hash codes on read-only medium
Remember: Defense in depth
8
Rootkit covers its tracks Detecting rootkit on system
Modifies netstat, ps, ls, du, ifconfig, login Sad way to find out
• Modified binaries hide new files used by rootkit • Disk is full of sniffer logs
• Modified login allows attacker to return for Manual confirmation
passwords • Reinstall clean ps and see what processes are
running
Rootkit fools simple Tripwire checksum
• Modified binaries have same checksum
Automatic detection
• Rootkit does not alter the data structures normally
• But a better hash would be able to detect rootkit used by netstat, ps, ls, du, ifconfig
• Host-based intrusion detection can find rootkit files
– As long as an update version of Rootkit does not disable
your intrusion detection system …
9
Difficulties in intrusion detection Strategic Intrusion Assessment [Lunt]
10