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
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
{cermak|celeda|vykopal}@ics.muni.cz 20th Eunice Open European Summer School and Conference 2014 1-5 September 2014, Rennes, France
Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 2 / 21
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
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
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
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
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
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
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
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
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
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
Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 6 / 21
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
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
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
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
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
Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 9 / 21
Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 10 / 21
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
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
Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 12 / 21
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
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
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
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
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
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
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
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
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
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
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
Milan Čermák et al. Detection of DNS Traffic Anomalies in Large Networks 19 / 21
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
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