Current Issues of Malicious Domains Blocking
Total Page:16
File Type:pdf, Size:1020Kb
Current Issues of Malicious Domains Blocking Stanislav Spaˇ cekˇ ∗y, Martin Lastoviˇ ckaˇ ∗y, Martin Horak´ ∗ and Toma´sˇ Plesn´ık∗ ∗Masaryk University, Institute of Computer Science, Brno, Czech Republic yMasaryk University, Faculty of Informatics, Brno, Czech Republic Email: fspaceks|lastovicka|horak|[email protected] Abstract—Cyberattackers often use the Domain Name System such as China, North Korea, Iran, etc. which implement DNS (DNS) in their activities. Botnet C&C servers and phishing blocking to block websites belonging to their political oppo- websites both use DNS to facilitate connection to or from its sition, independent media, etc. On the other hand, there are victims, while the protocol does not contain any security coun- termeasures to thwart such behavior. In this paper, we examine non-authoritarian countries which also have motives for using capabilities of a DNS firewall that would be able to filter access DNS filtering. Rationales of these countries can be blocking of from the protected network to known malicious domains on the obscene content, defamation, harassment, state security con- outside network. Considering the needs of Computer Security cerns, or intellectual property protection. For example, Internet Incident Response Teams (CSIRTs), we formulated functional Service Providers (ISPs) in the Czech Republic are obliged requirements that a DNS firewall should fulfill to fit the role of a cybersecurity tool. Starting from these requirements, we devel- to block websites providing non-permitted Internet gambling oped a DNS firewall based on the DNS Response Policy Zones according to the Act On Gambling [4]. It is important to technology, the only suitable open source technology available point out that in non-authoritarian countries are these activities yet. However, we encountered several essential limitations in the regulated by the law and legal requirements for their usage are DNS RPZ technology during the testing period. Still, our testing very strict which should rule out their abuse. results show that simple DNS firewall can prevent attacks not detected by other cybersecurity tools. We discuss the limitations In this paper, we focus on technological aspects of this and propose possible solutions so that the DNS firewall might be measure, having in mind that a DNS firewall must also provide used as a more complex cybersecurity tool in the future. Lessons supplementary functions like management access and auditing learned from the deployment show that while the DNS firewall to fit among other cybersecurity tools. In cooperation with can indeed be used to block access to malicious domains, it cannot yet satisfy all the requirements of cybersecurity teams. our cybersecurity incident handlers, we formulated functional requirements that should cover the needs of any Computer I. INTRODUCTION Security Incident Response Team (CSIRT): The Domain Name System (DNS) is being widely taken • Domain Blocking – The DNS firewall must be able advantage of by various cyberattackers for years now. With to block translation of blacklisted malicious domains. no level of security control, the DNS translates a known The blocking of domain translation effectively disrupts malicious domain when queried as well as a benign one. The C&C infrastructure of botnets and prevents users from attackers are aware of it and use domain names as aliases for interacting with malicious websites. It should also provide their Command and Control (C&C) servers. In these cases, a management interface for easy access and configuration. simple blocking of attacker’s IP address is not enough, as the • User Notifying – When users try to interact with a attackers have techniques that allow them to rapidly change IP blocked domain, it is not sufficient to just block the addresses while their domain name remains the same. These DNS translation. The users should be informed about techniques render IP blocking ineffective [1]. Similar cases why the domain is blocked but contacting them outside when DNS unsuspectingly translates a malicious domain name of the DNS firewall system is often not a trivial task. happen during phishing campaigns that employ typo-squatting The DNS firewall could immediately redirect them to an technique when attackers register domain names similar to informational landing page, so the DNS filtering remains well known and trusted domains in an attempt to create a false transparent and educates users to be careful in the future. sense of security in their victims [2]. A promising adaptation • Event Logging – The DNS firewall must be able to log to this behavior would be an intelligent local DNS resolver, attempts to access blacklisted domains. Analysis of this a DNS firewall, able to distinguish whether a malicious or a log allows detecting anomalies that might indicate an benign domain is being translated and to prevent potentially attack or misconfiguration in the local network. harmful connections. • Domain Blacklist Sharing – Similarly to fast IP switch- Aside from the cybersecurity issues the DNS firewall would ing, the attackers can quickly change domain names of help to solve, its deployment might also be driven by the need their servers. If every DNS firewall acted separately, to fulfill legal requirements. In this role, the DNS firewall the reaction window would be too large for efficient poses as a de facto form of Internet censorship [3]. On the attack prevention. To minimize the size of this window, one hand, there are countries with authoritarian governments organizations using DNS firewall should either share their blacklist or subscribe to updates from a central authority. 978-3-903176-15-7 c 2019 IFIP 551 We designed a DNS firewall system based on the above Numerous commercial organizations, namely FarsightSecu- requirements, using the only open source technology currently rity, SpamHaus, SURBL and others build their own blacklists available – DNS Response Policy Zones (DNS RPZ) [5]. of malicious domains. These blacklists are usually provided to We tested the firewall in both isolated environment and real their subscribers for a fee. It should be mentioned that domain network traffic on our campus network. We discovered that the blacklists are not interchangeable with URL blacklists, as the DNS RPZ technology suffers from serious limitations during former contain only malicious domains while the latter also our testing, most of them arising from the fact that DNS RPZ contain legitimate, but compromised domains [12]. Using an uses techniques similar to DNS session hijacking. We have URL blacklist with the DNS firewall might result in blocking recently deployed a DNS firewall that fulfills the requirements the communication with the whole domain on the basis of one of domain blocking, event logging and partly user informing, malicious URL. A comprehensive list of providers of DNS but fails in blacklist sharing. The data we gathered so far shows firewall compatible domain blacklists is available at the DNS- that the DNS firewall complements other cybersecurity tools RPZ website1. and detects anomalies that would otherwise be overlooked. We To reliably block only malicious domains, they should either present the limitations we identified and propose our solutions be checked manually, or an accurate automatic procedure to promote discussion on the topic. We believe that if these could be employed. Research is being done in the field of issues are resolved, the DNS firewall will prove a valuable timely automatic recognition of malicious domain names. tool in the field of cyberattack prevention. Prakash et al. propose an algorithm for predictive generation The rest of this paper is organized as follows. Section II of malicious URLs used in phishing campaigns [13]. Proactive mentions other works and projects concerning DNS filtering. blacklisting of malicious domain names is also the topic of a Section III describes the specifications of the DNS RPZ study conducted by Felegyhazi et al. [14] technology. Section IV describes our implementation of DNS firewall for the Cybersecurity Incident Response Team of III. DNSRPZTECHNOLOGY Masaryk University (CSIRT-MU). Section V highlights the The DNS RPZ technology may be considered a de facto open issues of current DNS firewall technology we encoun- standard for exerting control over DNS communication for tered and Section VI concludes with lessons learned. the cybersecurity cause. It was designed by Paul Vixie, one of the people behind the DNS protocol itself. The technology is II. RELATED WORK defined in an RFC draft where last changes were committed in June 2018 [5]. It is implemented in the widely used Berkeley The idea to use the DNS filtering to combat online threats Internet Name Domain (BIND) DNS server since version 9.8, comes from a blog post in 2010 by one of the authors of so it can be set up on any BIND-based open source DNS the DNS, Paul Vixie [6]. Vixie claimed that most of the resolver. Beside open source applications, the DNS RPZ is also newly registered domain names at the time were malicious and used in several commercial DNS firewalls as well. For example proposed an open source technology for domain blacklisting in BlueCat DNS [15], and DNS firewall by InfoBlox [16]. called DNS Response Policy Zones. The DNS RPZ blacklist corresponds to a DNS zone file The DNS RPZ is currently the only existing open source commonly used in BIND. The rules contained therein are technology for DNS firewalls usable on the institutional level. written in the form of zone file entries. However, the DNS Only a handful of papers was published in this area over the RPZ defines its specific keywords in two categories – actions last seven years. A case study was conducted in 2012, exam- and triggers. Each rule consists of exactly one action and ining the impact of DNS RPZ on network traffic security [7]. one trigger. For example, a DNS RPZ rule might have the In 2013, a technical report was published by Connery [8], following syntax: containing information on how to correctly implement DNS RPZ as a security measure and join the DNS RPZ community.