Threat Intelligence

9/18/2014
04:00 PM
Dave Piscitello
Dave Piscitello
Commentary
Connect Directly
Twitter
RSS
E-Mail vvv
100%
0%

5 Ways To Monitor DNS Traffic For Security Threats

Check out these examples of how to implement real-time or offline traffic monitoring using common commercial or open source security products.

In Monitor DNS Traffic & You Just Might Catch A RAT, I described how inspecting DNS traffic between client devices and your local recursive resolver could reveal the presence of botnets in your networks. Today, I'll share how you can monitor traffic using security systems and name resolvers you may already have deployed.

Firewalls
Let's begin at the most prevalent security system: your firewall. All firewalls should let you define rules to prevent IP spoofing. Include a rule to deny DNS queries from IP addresses outside your allocated numbers space to prevent your name resolver from being exploited as an open reflector in DDoS attacks.

Next, enable inspection of DNS traffic for suspicious byte patterns or anomalous DNS traffic to block name server software exploit attacks. Documentation describing how popular firewalls provide this feature is readily available (e.g., Palo Alto Networks, Cisco Systems, WatchGuard). Sonicwall and Palo Alto can detect and block certain DNS tunneling traffic, as well.

Intrusion detection systems
Whether you use Snort, Suricata, or OSSEC, you can compose rules to report DNS requests from unauthorized clients. You can also compose rules to count or report NXDOMAIN responses, responses containing resource records with short TTLs, DNS queries made using TCP, DNS queries to nonstandard ports, suspiciously large DNS responses, etc. Any value in any field of the DNS query or response message is basically "in play." You're essentially limited only by your imagination and mastery of DNS. Intrusion prevention services in firewalls provide permit/deny rules for many of the most common of these checks.

Traffic analyzers
Use cases for both Wireshark and Bro show that passive traffic analysis can be useful in identifying malware traffic. Capture and filter DNS traffic between your clients and your resolver, and save to a PCAP file. Create scripts to search the PCAP for the specific suspicious activities you are investigating, or use PacketQ (originally DNS2DB) to SQL query the PCAP file directly.

(Remember to block your clients from using any resolver or nonstandard port other than your local resolvers).

Passive DNS replication
This involves using sensors at resolvers to create a database that contains every DNS transaction (query/response) through a given resolver or set of resolvers. Including passive DNS data in your analysis can be instrumental in identifying malware domains, especially in cases where the malware uses algorithmically generated domain names (DGAs). Palo Alto Networks firewalls and security management systems that use Suricata as an IDS engine (like AlienVault USM or OSSIM) are examples of security systems that pair passive DNS with IPS to block known malicious domains.

Logging at your resolver
The logs of your local resolvers are a last and perhaps most obvious data source for investigating DNS traffic. With logging enabled, you can use tools like Splunk plus getwatchlist or OSSEC to collect DNS server logs and explore for known malicious domains.

Despite peppering this column with links to documentation, case studies, and examples, I've barely scratched the surface of the many ways you can monitor DNS traffic. And bear in mind that you can use several of these methods in a complementary manner. I've no doubt overlooked other products, services, or methods, so comment to add to these resources for your colleagues (with technical relevance, please).

Dave Piscitello has been involved with Internet technologies (broadband access, routing, network management, and security) for over 35 years. He left private sector consulting and his company, Core Competence, to provide security and ICT coordination for security and policy ... View Full Bio
Comment  | 
Print  | 
More Insights
Comments
Newest First  |  Oldest First  |  Threaded View
jpmanibusan
100%
0%
jpmanibusan,
User Rank: Apprentice
4/19/2015 | 12:49:00 PM
Academic Research Papers on pDNS, DGA, NXDOMAIN
Hi Dave- Nice article on a topic that continues to be largely overlooked.

For anyone looking for additional reading along these lines, check out Damballa's DGA archive here https://www.damballa.com/tag/dga/

The collaborative efforts of Damballa and Georgia Tech Applied Mathematics Ph.D researchers have been well documented over the years, and frequently presented at major security research conferences (e.g. USENIX). The academic research papers can be found online by searching for their project names: Notos, Pleiades, and ExecScent, among them.

Cheers, JP
Lucamp
100%
0%
Lucamp,
User Rank: Strategist
9/22/2014 | 7:37:48 AM
Another tool
Hi Dave,

Fantastic artcile by the way. Another tool that you can use for DNS is AIEngine (https://bitbucket.org/camp0/aiengine). We use it combinated with Redis to register Domains and works fine for us.
JamesR010
100%
0%
JamesR010,
User Rank: Strategist
9/19/2014 | 1:57:50 PM
BIND!
BIND 9.10 will do a lot of what you mention, right out of the box, and for free: ACLs, verbose logging, rate-limiting (for DDoS attack mitigation), and most importantly, Response Policy Zones. I've been using RPZ for a few months now, and it certainly lives up to its alias as "the DNS firewall". I've caught a few infected desktops trying to reach C&C servers that were NOT identified by my firewall, IDSs, Fire sec appliances, and various AV products.
Robert McDougal
100%
0%
Robert McDougal,
User Rank: Ninja
9/19/2014 | 9:51:44 AM
Re: Security Onion
I have to second the Security Onion suggestion.  Every organization not matter how small, should have an IDS running and security onion is FREE!
dougburks
100%
0%
dougburks,
User Rank: Apprentice
9/19/2014 | 6:09:38 AM
Security Onion
Hi Dave,

Great article!  You mentioned Snort, Suricata, Bro, and OSSEC.  Security Onion is a Linux distro that contains all of these tools and it also includes ELSA for easy slicing and dicing of their logs.

 

 
6 Security Trends for 2018/2019
Curtis Franklin Jr., Senior Editor at Dark Reading,  10/15/2018
Most IT Security Pros Want to Change Jobs
Dark Reading Staff 10/12/2018
4 Ways to Fight the Email Security Threat
Asaf Cidon, Vice President, Content Security Services, at Barracuda Networks,  10/15/2018
Register for Dark Reading Newsletters
White Papers
Video
Cartoon
Latest Comment: Too funny!
Current Issue
Flash Poll
The Risk Management Struggle
The Risk Management Struggle
The majority of organizations are struggling to implement a risk-based approach to security even though risk reduction has become the primary metric for measuring the effectiveness of enterprise security strategies. Read the report and get more details today!
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2018-10839
PUBLISHED: 2018-10-16
Qemu emulator <= 3.0.0 built with the NE2000 NIC emulation support is vulnerable to an integer overflow, which could lead to buffer overflow issue. It could occur when receiving packets over the network. A user inside guest could use this flaw to crash the Qemu process resulting in DoS.
CVE-2018-13399
PUBLISHED: 2018-10-16
The Microsoft Windows Installer for Atlassian Fisheye and Crucible before version 4.6.1 allows local attackers to escalate privileges because of weak permissions on the installation directory.
CVE-2018-18381
PUBLISHED: 2018-10-16
Z-BlogPHP 1.5.2.1935 (Zero) has a stored XSS Vulnerability in zb_system/function/c_system_admin.php via the Content-Type header during the uploading of image attachments.
CVE-2018-18382
PUBLISHED: 2018-10-16
Advanced HRM 1.6 allows Remote Code Execution via PHP code in a .php file to the user/update-user-avatar URI, which can be accessed through an "Update Profile" "Change Picture" (aka user/edit-profile) action.
CVE-2018-18374
PUBLISHED: 2018-10-16
XSS exists in the MetInfo 6.1.2 admin/index.php page via the anyid parameter.