Detection of DNS Traffic Anomalies in Large Networks Milan ermk, - - PowerPoint PPT Presentation

detection of dns traffic anomalies in large networks
SMART_READER_LITE
LIVE PREVIEW

Detection of DNS Traffic Anomalies in Large Networks Milan ermk, - - PowerPoint PPT Presentation

Detection of DNS Traffic Anomalies in Large Networks Milan ermk, Pavel eleda, Jan Vykopal {cermak|celeda|vykopal}@ics.muni.cz 20th Eunice Open European Summer School and Conference 2014 1-5 September 2014, Rennes, France Part I


slide-1
SLIDE 1

Detection of DNS Traffic Anomalies in Large Networks

Milan Čermák, Pavel Čeleda, Jan Vykopal

{cermak|celeda|vykopal}@ics.muni.cz 20th Eunice Open European Summer School and Conference 2014 1-5 September 2014, Rennes, France

slide-2
SLIDE 2

Part I Introduction

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 2 / 21

slide-3
SLIDE 3

Motivation

Almost every Internet communication is preceded by a translation of a domain name to an IP address.

Computer DNS Resolver Root DNS TLD DNS Autoritative DNS for a domain Web Server Web Server

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 3 / 21

slide-4
SLIDE 4

Motivation

Almost every Internet communication is preceded by a translation of a domain name to an IP address.

Computer DNS Resolver Root DNS TLD DNS Autoritative DNS for a domain Web Server Web Server

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 3 / 21

slide-5
SLIDE 5

Motivation

Almost every Internet communication is preceded by a translation of a domain name to an IP address.

Computer DNS Resolver Root DNS TLD DNS Autoritative DNS for a domain Web Server Web Server

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 3 / 21

slide-6
SLIDE 6

Motivation

Almost every Internet communication is preceded by a translation of a domain name to an IP address.

Computer DNS Resolver Root DNS TLD DNS Autoritative DNS for a domain Web Server Web Server

DNS Traffic Monitoring Benefits DNS packets are not encrypted. Knowledge of a queried domain can extend capabilities of current anomaly detection methods. Possibility to detect anomalies in a DNS traffic itself.

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 3 / 21

slide-7
SLIDE 7

DNS Traffic Attacks and Anomalies

Malicious domains queries

Botnet C&C (domain-flux and fast-flux domains), Malware spread, . . .

Amplification DDoS attacks And many others . . .

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 4 / 21

slide-8
SLIDE 8

DNS Traffic Attacks and Anomalies

Malicious domains queries

Botnet C&C (domain-flux and fast-flux domains), Malware spread, . . .

Amplification DDoS attacks And many others . . .

Attacker DNS DNS DNS Query:7fkfkfkfa.com7ANY Source7IP:7192.168.254.6 Size:7727B

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 4 / 21

slide-9
SLIDE 9

DNS Traffic Attacks and Anomalies

Malicious domains queries

Botnet C&C (domain-flux and fast-flux domains), Malware spread, . . .

Amplification DDoS attacks And many others . . .

Attacker Victim 192.168.254.6 DNS DNS DNS Query:zfkfkfkfa.comzANY SourcezIP:z192.168.254.6 Size:z72zB Answer:z204.46.43.28z... DstzIP:z192.168.254.6 Size:z4015zB

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 4 / 21

slide-10
SLIDE 10

Research Questions

1

How can DNS traffic be effectively analysed in large networks?

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 5 / 21

slide-11
SLIDE 11

Research Questions

1

How can DNS traffic be effectively analysed in large networks?

2

What are the differences in the analysis of DNS traffic using standard and extended flow records?

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 5 / 21

slide-12
SLIDE 12

Research Questions

1

How can DNS traffic be effectively analysed in large networks?

2

What are the differences in the analysis of DNS traffic using standard and extended flow records?

3

What are the advantages of combinating DNS traffic information with flow records for network anomaly detection?

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 5 / 21

slide-13
SLIDE 13

Part II DNS Traffic Monitoring

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 6 / 21

slide-14
SLIDE 14

Flow Based DNS Traffic Monitoring

FlowAdata SrcA&ADstAIPAaddress SrcA&ADstAport ProtocolAnumber Duration NumberAofApackets SumAofAbytes

DNS Server Flow Collector FlowARecord Flow Probe TAP Internet

Standard Flow Record F = (IPsrc, IPdst, Psrc, Pdst, Prot, Tstart, Tdur, Pckts, Octs, Flags)

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 7 / 21

slide-15
SLIDE 15

Flow Based DNS Traffic Monitoring

FlowAdata SrcA&ADstAIPAaddress SrcA&ADstAport ProtocolAnumber Duration NumberAofApackets SumAofAbytes

DNS Server Flow Collector FlowARecord Flow Probe TAP Internet

Standard Flow Record F = (IPsrc, IPdst, Psrc, Pdst, Prot, Tstart, Tdur, Pckts, Octs, Flags) DNS Flow Record FDNS = (Qname, Qtype, Rcode, Rdata)

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 7 / 21

slide-16
SLIDE 16

Flow Based DNS Traffic Monitoring

Flow data Src & Dst IP address Src & Dst port Protocol number Duration Number of packets Sum of bytes Qname & Qtype Rcode Rdata

DNS Server Flow Collector Extended Flow Record Flow Probe TAP Internet

Extended Flow Record Fext = F ·FDNS = (IPsrc, IPdst, Psrc, Pdst, Prot, Tstart, Tdur, Pckts, Octs, Flags, Qname, Qtype, Rcode, Rdata)

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 7 / 21

slide-17
SLIDE 17

Flow Based DNS Traffic Monitoring

Cumulative Distribution Function of DNS Packets per Flow

0.98 0.99 1.00 1 10 100 P[X<=x]

DNSnQueriesn-nUDPndstnportn53 DNSnAnswersn-nUDPnsrcnportn53n Packets

Up to 99 % of flows with port 53 contain only one packet. ⇒ Flow aggregation is not used.

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 8 / 21

slide-18
SLIDE 18

Extended Flow Expiration Algorithm

GenerateExtendedFlow (incoming packet)

1

Parse flow information F from incoming packet header.

2

Check if incoming packet contains a valid DNS header.

3

Parse DNS packet and create a flow record Fext = F · FDNS.

4

Export a flow record Fext without storing in a flow cache.

5

Otherwise update flow record F in a flow cache. Main Contribution Significant reduction of flow cache memory

  • ccupation due to immediate export of a flow record. !

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 9 / 21

slide-19
SLIDE 19

Part III DNS Traffic Anomaly Detection Using Standard Flows

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 10 / 21

slide-20
SLIDE 20

Amplification DDoS Attack

LAN Internet

TAP Flow Probe Web Server Attacker Rogue DNS Resolver

The attack is characterised by a large amount of same queries with spoofed IP address.

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 11 / 21

slide-21
SLIDE 21

Amplification DDoS Attack

LAN Internet

TAP Flow Probe Web Server Attacker Rogue DNS Resolver

The attack is characterised by a large amount of same queries with spoofed IP address. Detection Method Increasing count of flows, with high bytes-per-packet ratio and the source port 53. Access control lists reflecting network security policy. Usually threshold adjustment is required.

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 11 / 21

slide-22
SLIDE 22

Part IV DNS Traffic Anomaly Detection Using Extended Flows

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 12 / 21

slide-23
SLIDE 23

Amplification DDoS Attack

LAN Internet

TAP Flow Probe Web Server Attacker Rogue DNS Resolver

Detection Method Malware infected device or misconfigured DNS resolver recognition instead of using basic flow statistics.

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 13 / 21

slide-24
SLIDE 24

Amplification DDoS Attack

LAN Internet

TAP Flow Probe Web Server Attacker Rogue DNS Resolver

Detection Method Malware infected device or misconfigured DNS resolver recognition instead of using basic flow statistics. ⇒ The problem is to distinguish a regular DNS server responding to a query containing a local domain.

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 13 / 21

slide-25
SLIDE 25

Amplification DDoS Attack

DetectOpenDNSResolver (DNS response)

1

Request all information about a domain Fext.Qname in the response by ANY query type.

2

Check if the result contains at least one IP address from a local network.

3

If yes, then add domain to a whitelist of local domains.

4

Otherwise report Fext.IPsrc as open DNS resolver.

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 14 / 21

slide-26
SLIDE 26

Amplification DDoS Attack

DetectOpenDNSResolver (DNS response)

1

Request all information about a domain Fext.Qname in the response by ANY query type.

2

Check if the result contains at least one IP address from a local network.

3

If yes, then add domain to a whitelist of local domains.

4

Otherwise report Fext.IPsrc as open DNS resolver.

Detection Results

Proposed algorithm Open Resolver Scanning Project

20 40 60 80 100 120 140 160 180 200 220

Detections Matching results

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 14 / 21

slide-27
SLIDE 27

External DNS Resolver Usage Detection

LAN Internet

TAP Flow Probe DNS Resolver Client DNS Resolver

Usage of an external DNS resolver may cause delay and also presents a security risk if the external DNS resolver responds with fraudulent IP addresses. Detection Method In well-maintained networks is based on access control lists. In not well-maintained networks is a problem to distinguish between a client device and a local DNS resolver.

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 15 / 21

slide-28
SLIDE 28

External DNS Resolver Usage Detection

DetectExternalDNS (DNS response)

1

Get time of the response Fext.Tstart and IP address of queried domain Fext.Rdata.

2

Check if client Fext.IPdst visits queried domain during Fext.Tstart + 2 sec.

3

If yes, then return client Fext.IPdst as device using external DNS resolver.

5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 Total number of clients

June July September October November December # Clients using external DNS Typing errors Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 16 / 21

slide-29
SLIDE 29

External DNS Resolver Usage Detection

DetectExternalDNS (DNS response)

1

Get time of the response Fext.Tstart and IP address of queried domain Fext.Rdata.

2

Check if client Fext.IPdst visits queried domain during Fext.Tstart + 2 sec.

3

If yes, then return client Fext.IPdst as device using external DNS resolver.

Detection Results

5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 Total number of clients

June July September October November December # Clients using external DNS Typing errors Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 16 / 21

slide-30
SLIDE 30

Malware Domains Query Detection

LAN Internet

TAP Flow Probe DNS Resolver Client DNS Resolver

DNS queries generated by botnets (command and control center) or domains used for a malware spreading. Detection Method Check all queried domains whether they are occurred in any malware domains blacklist.

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 17 / 21

slide-31
SLIDE 31

Malware Domains Query Detection

LAN Internet

TAP Flow Probe DNS Resolver Client DNS Resolver

DNS queries generated by botnets (command and control center) or domains used for a malware spreading. Detection Method Check all queried domains whether they are occurred in any malware domains blacklist. ⇒ Testing all queried domains may be very time consuming.

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 17 / 21

slide-32
SLIDE 32

Malware Domains Query Detection

GetMalwareAffectedDevices ()

1

Detect device querying the domain Fext.Qname = dns.msftncsi.com.

2

Select next N queried domains.

3

Exclude domains occurring in the Alexa top domains list.

4

Check the rest of domains if they are in blacklists.

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 18 / 21

slide-33
SLIDE 33

Malware Domains Query Detection

GetMalwareAffectedDevices ()

1

Detect device querying the domain Fext.Qname = dns.msftncsi.com.

2

Select next N queried domains.

3

Exclude domains occurring in the Alexa top domains list.

4

Check the rest of domains if they are in blacklists. Detection Results Domain Number of blacklists habble.ru 6 www.softosystem.com 7 cybeitrapp.info 5 telemetry.tanzuki.net 5 cybermindtool.info 4

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 18 / 21

slide-34
SLIDE 34

Part V Conclusion

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 19 / 21

slide-35
SLIDE 35

Conclusion

DNS information does not affect the privacy of users. IP flows represents optimal choice for a large scale network monitoring. Proposed updated DNS flow exporting algorithm saving a flow cache and exporting only necessary DNS packet fields. New network anomaly detection algorithms using DNS extended flows.

https://is.muni.cz/publication/1131184?lang=en

Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 20 / 21

slide-36
SLIDE 36

Thank You For Your Attention!

Detection of DNS Traffic Anomalies in Large Networks

Milan Čermák

cermak@ics.muni.cz

Pavel Čeleda

celeda@ics.muni.cz

Jan Vykopal

vykopal@ics.muni.cz

Computer DNS Resolver Root DNS TLD DNS Autoritative DNS for a domain Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 21 / 21