Intrusion Detection and Malware Analysis

26
Intrusion Detection and Malware Analysis Attack Overview / Network-Level Attacks Pavel Laskov Wilhelm Schickard Institute for Computer Science

Transcript of Intrusion Detection and Malware Analysis

Page 1: Intrusion Detection and Malware Analysis

Intrusion Detection and Malware AnalysisAttack Overview / Network-Level Attacks

Pavel LaskovWilhelm Schickard Institute for Computer Science

Page 2: Intrusion Detection and Malware Analysis

What is an attack?

Attack examples:

password sniffing

password guessing

phishing

social engineering

control-flow hijacking

code injection

port scanning

denial-of-service

identity spoofing

privilege escalation

man-in-the-middle

An attack is an action aimed at violation of securitygoals.

Page 3: Intrusion Detection and Malware Analysis

What is an attack?

Attack examples:

password sniffing

password guessing

phishing

social engineering

control-flow hijacking

code injection

port scanning

denial-of-service

identity spoofing

privilege escalation

man-in-the-middle

An attack is an action aimed at violation of securitygoals.

Page 4: Intrusion Detection and Malware Analysis

What is an attack?

Attack examples:

password sniffing

password guessing

phishing

social engineering

control-flow hijacking

code injection

port scanning

denial-of-service

identity spoofing

privilege escalation

man-in-the-middle

An attack is an action aimed at violation of securitygoals.

Page 5: Intrusion Detection and Malware Analysis

Security goals

Availability: data/services can be accessed as desiredIntegrity: data has not been (maliciously) alteredConfidentiality: no information has been inappropriatelydisclosedAuthentication: user or data origin is properly identifiableAccountability: actions are traceable to those responsible

Page 6: Intrusion Detection and Malware Analysis

Attack taxonomy

passive active

network host/application web

– sniffing

– man-in-the-middle

– soc. engineering

– scanning

– (D)DoS

– spoofing

– control flow hijacking

– privilege escalation

– DoS (crashing)

– code injection

– SQL injection

– identity theft

– rev. soc. engineering

Page 7: Intrusion Detection and Malware Analysis

Networking overview: OSI and TCP/IP

Page 8: Intrusion Detection and Malware Analysis

Data encapsulation

Page 9: Intrusion Detection and Malware Analysis

TCP/IP header structure

versionheaderlength type of service total length

ID flags fragment offset

time-to-live protocol header checksum

source IP address

destination IP address

options (if any)

data

0 15 16 31

20 bytes

IP packet

source port number destination port number

sequence number

acknowledgment number

headerlength reserved

URG

ACC

PSH

RST

SYN

FIN

window size

TCP checksum urgent pointer

options (if any)

data (if any)

0 15 16 31

20 bytes

TCP packet

Page 10: Intrusion Detection and Malware Analysis

UDP/IP header structure

versionheaderlength type of service total length

ID flags fragment offset

time-to-live protocol header checksum

source IP address

destination IP address

options (if any)

data

0 15 16 31

20 bytes

IP packet

source port destination port

length UDP checksum

data (if any)

0 15 16 31

8 bytes

UDP packet

Page 11: Intrusion Detection and Malware Analysis

IP fragmentation

If the content to be send (e.g., an image) exceeds 65535bytes, it is split across several packets.Fragmentation is indicated by the special flag in the IPheader and a non-zero fragment offset.

Page 12: Intrusion Detection and Malware Analysis

TCP connections

Connection setupHost A Host B

Send SYN seq=x

Receive SYN

Send SYN seq=u, ACK x+1

Receive SYN + ACK

Send ACK y+1

Receive ACK

...data

transmission

Connection terminationHost A Host B

Send FIN seq=x

Receive FIN

Send ACK x+1

Receive ACK

Send FIN seq=y, ACK x+1

Receive FIN + ACK

Send ACK y+1

Receive ACK

Page 13: Intrusion Detection and Malware Analysis

ICMP protocol

Page 14: Intrusion Detection and Malware Analysis

DNS resolution

Q: IP(www.cs.uni-tuebingen.de)?

DNS DNS

DNS

DNS de

uni-tuebingen

cs

Q: IP(www.cs.uni-tu

ebingen.de)?

Q: IP(www.cs.uni-tuebingen.de)?

Q: IP(www.cs.uni-tuebingen.de)?

A: IP(www.cs.uni-tuebingen.de)

A: IP(DNS(uni-tu

ebingen.de))

A: IP(DNS(cs.uni-tuebingen.de))A: IP(www.cs.uni-tuebingen.de)

Hierarchical domain structureRecursive queries by “local” DNS servers

Page 15: Intrusion Detection and Malware Analysis

Port scanning

Tesing whether a host is listening to a specific TCP port.Utility:

Finding out potential security vulnerabilities

Finding out potential security vulnerabilities

Status:Open: host is listening to a portClosed: host is not is listening to a portDropped: no response is received

Dangers of open ports:Exploitation of applications listening to themOS fingerprinting

Page 16: Intrusion Detection and Malware Analysis

SYN scan

Send a SYN packet to the targeted destination port.If a host replies with a RST or does not reply, the port isclosed.

If a host replies with a ACK, close the connection by RST.

Identifies open ports.

Page 17: Intrusion Detection and Malware Analysis

ACK scan

send an ACK packet to the targeted destination port.If a host replies with an RST, a port is most likely open.

If a host does not reply but an ICMP destination unreachablepacket is received, the port is filtered.

Otherwise the port is most likely closed.Identifies potentially open and filtered ports.

Page 18: Intrusion Detection and Malware Analysis

FIN scan

Send an FIN packet the targeted destination port.If an RST packet is received the port is closed.

If no response is received the port is most likely open orfiltered.

A stealthy scan: no TCP handshake.Does not work on Windows machines.

Page 19: Intrusion Detection and Malware Analysis

UDP scan

Send a UDP packet with a junk payload to a targetdestination port.If a host replies with ICMP destination unreachable, thisUDP port is closed. However a TCP port may be open!

If a host replies with a UDP data, the UDP port is open

Otherwise the port is closed or filtered.

Page 20: Intrusion Detection and Malware Analysis

Denial-of-Service (DOS) attacks

Targets:bandwidth exhaustionresource exhaustion

Motivation:commercial (extortion)political (“Cyberwar”)

Unprecedented scale:on average, 1200 attacks per day (Quelle: Arbor)consumption of 2-3% of backbone traffic

Page 21: Intrusion Detection and Malware Analysis

SYN flooding attack

Send a SYN packet to a targeted destination port and ignoreACK.Continue sending until the target dies.

What’s a difference to SYN-scan?

Page 22: Intrusion Detection and Malware Analysis

Smurf attack

ICMP echo request (ping) is used to periodically test hostconnectivity. Unless explicitly disabled in kernel settings,each ping request will be replied.Cool idea: send an ICMP echo request packet to abroadcast address in some network using a spoofed IPaddress of a victim as a source.

All hosts on the network will send a reply to the victim.

Page 23: Intrusion Detection and Malware Analysis

IP fragmentation attacks

Ping of Death:fragment an ICMP echo request packet into segments that addup to more than 65535 bytes

Teardrop:fake the fragment offsets in IP headers so that fragmentsoverlap in memory during re-assembly:

Page 24: Intrusion Detection and Malware Analysis

DNS spoofing attacks

Q: IP(www.cs.uni-tuebingen.de)?

DNS DNS

DNS

DNS de

uni-tuebingen

cs

Q: IP(www.cs.uni-tu

ebingen.de)?

Q: IP(www.cs.uni-tuebingen.de)?

Q: IP(www.cs.uni-tuebingen.de)?

A: IP(www.cs.uni-tuebingen.de)

A: IP(DNS(uni-tu

ebingen.de))

A: IP(DNS(cs.uni-tuebingen.de))

A: IP(exploits.malware.biz)

A: IP(exploits.malware.biz)

Delay the response by overloading the genuine DNS server.Send a fake response.

Page 25: Intrusion Detection and Malware Analysis

Take-home message

Although mostly straightforward,network-level attacks can still inflictsignificant damage.Most of the network attacks can beprevented by passivecountermeasures.In general, versatility of attacksrequires reactive and proactivecountermeasures as well.

Page 26: Intrusion Detection and Malware Analysis

Literature

Andrew S. Tanenbaum.Computer Networks.Pearson, 2003.

Jelena Mirkovic, Sven Dietrich, David Dittrich and PeterReiher.Internet Denial of Service: Attack and DefenseMechanisms.Prentice Hall, 2005.

James Messer.Secrets of Network Cartography: A ComprehensiveGuide to Nmap.NetworkUptime.com, 2008.