Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology...

44
Anomaly Detection in Communication Networks Prof. D. J. Parish High Speed networks Group Department of Electronic and Electrical Engineering [email protected] Loughborough University

Transcript of Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology...

Page 1: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Anomaly Detection in Communication Networks

Prof. D. J. Parish High Speed networks Group Department of Electronic and Electrical Engineering [email protected] Loughborough University

Page 2: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Overview u  Introduction u  Background u  What is an anomaly in the context of a communication

network? Network Traffic Characteristics Intrusion Detection Exception Detection

u  Anomaly detection approaches. –  Rule Based –  Window Based –  KS Statistic –  Others

§  Performance Metrics u  Examples u  Summary

Page 3: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Classical Model

������������������

� �������������

�� �������������

������� �� �����

����

� ���������

n  Anomaly - unusual event

n  Conventional mathematical model n  Outlier of a distribution n  Empirical distribution deviates from the model

distribution

3

Page 4: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Anomaly Approach

Page 5: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Common Problems

u Collecting the data u  Source, location, number

u FPs, FNs, u Learning Normal u Identifying a Change u Updating

Page 6: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Generic Approach

Collect Measure-

ments Pre-process/

Filter Intelligent

Processing

Network Performance Data

Page 7: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Types of Anomalies in Communication Network Data

u Performance related Data. – Delay, Throughput, loss, Faults, Routing

Changes u Security related.

– Intrusions; Misuse(?), DDoS u Content related.

– Application usage, Data Type/Content

Page 8: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Network Traffic Characteristics

u Bandwidth – Average, Peak etc. u Delay – Absolute and Variance.

u Loss.

The end-to-end delay of a packet can be given by:

D + W.

Where D is a fixed element of delay and W is a variable element of delay.

The inter-arrival time of two packets at a receiver can be given by:

[ ]( ) [ ]( )21Delta WDWD +−+=

Page 9: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Anomalies in Network Traffic Measurements

u Results used to provide delay and loss measures for BT Operations.

u Identifies changes in performance- termed Exceptions.

Page 10: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Example Data Exception- Step

Step Changes

0

10000

20000

30000

40000

50000

60000

70000

8000050% small50% large95% small95% large99% small99% large

Page 11: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Example Data Exception- Time of Day Delay Variation

A Change in Time of Day Variation

0

10000

20000

30000

40000

50000

60000

70000

50% small50% large95% small95% large99% small99% large

Page 12: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Intrusion Definitions (Computer)

“An incident of unauthorized access to data or an automated information system” “To compromise a computer system by breaking the security of such a system or causing it to enter into an insecure state”

Page 13: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

u A Active Process in which various aspects of a computer and network system are monitored and analysed for evidence of intrusion

u Passive elements needed as well for prevention such as checking password strength etc.

Page 14: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

IDS Characteristics CHARACTERISTIC DEFINITION CATEGORY

Source of Information Defines from where the

information used by IDSs is gathered.

Network-based

Host-based

Router-based

Learning Approach Defines how IDSs learn the difference between normal and malicious

information.

Supervised

Unsupervised

Detection Systems Cooperation

Defines the level of cooperation between

different IDSs.

Autonomous

Cooperative

Cooperative Systems Deployment

Defines the way cooperative IDSs share

the information.

Centralised

Hieratical

Distributed

Detection Timing Defines how long takes

to implement the intrusions detection.

Off-Line

On-Line

Detection Methodology Defines the

methodology utilised to implement the

intrusions detection.

Misuse

Anomaly

Hybrid

Page 15: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

How can Intrusion Occur?

u Often Two Phases: – 1. Penetration

u Trojan via Email u Worm via an Open Port

– 2. Exploitation u Compromising the Target via an Exploit u Buffer OverFlow Example

Page 16: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Buffer OverFlow Attack

PIYMM Y D A T A

B A D I P

B A D A T AD B A D I P

Buffer 1 Buffer 2

Buffer 1 Overflow

Oversize Malicious Data

Page 17: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Identifying Anomalies in Communication Networks

u Rule Based (Misuse Detection) u Window Based Algorithms u KS (Kolmogorov–Smirnov) Statistic u Data Mining (including Clustering

Algorithms)

Page 18: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Detecting Intrusion

u Two Fundamental Approaches: – Rule Based (E.g. Snort) – Free ID software – Windows, Linux

– Anomaly Based: – Often uses AI algorithms including – Baysian Belief, ANN, GA, Data Mining, – Case Based Reasoning

Page 19: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Rule Based IDS

u Snort: (from http://www.snort.org/snort)

“Snort can perform protocol analysis and content searching/matching. It can be used to detect a variety of attacks and probes, such as buffer overflows, stealth port scans, CGI attacks, SMB probes, OS fingerprinting attempts, and much more. It uses a flexible rules language to describe traffic that it should collect or pass, as well as a detection engine that utilizes a modular plug-in architecture”

Page 20: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Example Snort Rules

alert tcp $TELNET_SERVERS 23 -> $EXTERNAL_NET any (msg:"TELNET Attempted SU from wrong group"; flow:

from_server,established; content:"to su root"; nocase; classtype:attempted-admin; sid:715; rev:6;)

• The variable $TELNET_SERVERS is defined in snort.conf file and shows a list of Telnet servers.

• Port number 23 is used in the rule, which means that the rule will be applied to TCP traffic going from port 23. The rule checks only response from Telnet servers, not the requests.

• The variable $EXTERNAL_NET is defined in the snort.conf file and shows all addresses which are outside the private network. The rule will apply to those telnet sessions which originate from outside of the private network. If someone from the internal network starts a Telnet session, the rule will not detect that traffic.

• The flow keyword is used to apply this rule only to an established connection and traffic flowing from the server.

• The content keyword shows that an alert will be generated when a packet contains “to su root”.

• The nocase keyword allows the rule to ignore case of letters while matching the content. • The classtype keyword is used to assign a class to the rule. The attempted-admin class is

defined with a default priority in classification.config file. • The rule ID is 715.

• The rev keyword is used to show version of the rule.

Page 21: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Window Based Approaches

Page 22: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

The KS Statistic

u A non-parametric (i.e. Distribution type does not matter) test of similarity between two distributions.

Page 23: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

u  The Kolmogorov-Smirnov test statistic is defined as

u  D=max1≤i≤N(F(Yi)−i−1N,iN−F(Yi))

u  where F is the theoretical cumulative distribution of the distribution being tested which must be a continuous distribution (i.e., no discrete distributions such as the binomial or Poisson), and it must be fully specified (i.e., the location, scale, and shape parameters cannot be estimated from the data).

Page 24: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Using the KS Test

Delay Graph with KS Statistic (1)route 4to10

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18

1.48

10.9

20.3

29.7

39.1

48.5

57.9

67.4

76.8

86.5 96 105

115

124

134

143

153

163

172

181

191

200

210

219

228

238

247

257

267

276

286

295

305

314

324

333

Time (hours)

Del

ay (s

econ

ds)

0

0.5

1

1.5

2

2.5

3

3.5

4

DelayKS Value

Page 25: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Classifing the Detection

K-S Test (Kolmogorov-

Smirnov)

Neural Network

Data Classified Exception

Possible Exception

Page 26: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Using a Neural Network

Page 27: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Using a Neural Network

Classification Accuracy

0

20

40

60

80

100

120

Weekend Begin Weekend End Step Up Step Down ToD Up ToD Down Spike

Exception Type

Perc

enta

ge C

orre

ct

IdentificationRejection

Page 28: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Anomaly Approach Using Data Mining

Page 29: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Clustering Algorithm for DoS

Page 30: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

DDoS Abnormalities

Page 31: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Anomaly Example – Data Rate

Page 32: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Anomaly Example – Average Packet Size

Page 33: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Anomaly Example – Destination Count

Page 34: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Anomaly Example – FIN Count

Page 35: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Anomaly Example – Ack Count

Page 36: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Anomaly TTL - 63

Page 37: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Example Detection Metric (IP Subnet Value)

Page 38: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

2nd Example – TCP Syn Flags/Sec

Page 39: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Relative Importance of Detection Metrics

Page 40: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Performance Assessment

u  True Positive (𝑇𝑃) refers to one attack frame ) refers to one attack frame that has been correctly classified as malicious.

u  True Negative (𝑇𝑁) refers to one non-attack ) refers to one non-attack frame that has been correctly classified as legal frames.

u  False Positive (𝐹𝑃) refers to one non-attack ) refers to one non-attack frame that has been misclassified as malicious.

u  False Negative (𝐹𝑁) refers to one attack frame ) refers to one attack frame that has been misclassified as legal frames.

Page 41: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

u  Detection Rate (𝐷𝑅) is the proportion of attack frames ) is the proportion of attack frames correctly classified as malicious, among all the attack frames.

u 𝐷𝑅  (%)= 𝑇𝑃/𝐹𝑁+𝑇𝑃 

u  False Positive Rate ( 𝐹𝑃↓𝑅𝑎𝑡𝑒 ) is the proportion of non-attack frames misclassified as malicious, among all the evaluated frames.

u  𝐹𝑃↓𝑅𝑎𝑡𝑒   (%)= 𝐹𝑃/𝑇𝑃+𝐹𝑃+𝑇𝑁+𝐹𝑁 

u  False Negative Rate ( 𝐹𝑁↓𝑅𝑎𝑡𝑒 ) is the proportion of attack frames misclassified as legal, among all the attack frames.

u  𝐹𝑁↓𝑅𝑎𝑡𝑒   (%)= 𝐹𝑁/𝑇𝑃+𝐹𝑁 

Page 42: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

•  Overall Success Rate (𝑂𝑆𝑅) or 𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 is the proportion of the total number ) or 𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 is the proportion of the total number is the proportion of the total number

of frames correctly classified, among all the evaluated frames.

u 𝑂𝑆𝑅  (%)= 𝑇𝑁+𝑇𝑃/𝑇𝑃+𝐹𝑃+𝑇𝑁+𝐹𝑁 

 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 or 𝑅𝑒𝑐𝑎𝑙𝑙 is the proportion of attack frames correctly classified as or 𝑅𝑒𝑐𝑎𝑙𝑙 is the proportion of attack frames correctly classified as is the proportion of attack frames correctly classified as

malicious, among all the alarms generated.

u 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛  (%)= 𝑇𝑃/𝑇𝑃+𝐹𝑃 

 𝐹–𝑆𝑐𝑜𝑟𝑒 or 𝐹–𝑀𝑒𝑎𝑠𝑢𝑟𝑒 is a tradeoff between Precision and DR. The or 𝐹–𝑀𝑒𝑎𝑠𝑢𝑟𝑒 is a tradeoff between Precision and DR. The is a tradeoff between Precision and DR. The

𝐹–𝑆𝑐𝑜𝑟𝑒 produces a high result when 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 and DR are both produces a high result when 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 and DR are both and DR are both

balanced [33] [97]. The higher the 𝐹–𝑆𝑐𝑜𝑟𝑒, the better the 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 and , the better the 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 and and

the DR.

u 𝐹–𝑆𝑐𝑜𝑟𝑒  (%)= 2∗𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛∗𝐷𝑅/𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛+𝐷𝑅 

Page 43: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Summary and Conclusions

Page 44: Anomaly Detection in Communication Networks · Detection Methodology Defines the methodology utilised to implement the intrusions detection. Misuse Anomaly ... DDoS Abnormalities

Review Questions

1.  Which AI approach may be best for the following scenarios?

u  Determining which, of a number of groups, a particular pattern

of an attack belongs to.

u  Combining the outputs of a number of different IDSs into a

single result.