Artica Wiki

DNS tunnels and DGA malware

Detect DNS tunnels and DGA malware per computer, alert the SIEM, and optionally block the domain of a tunnel.

Back to the DNS Firewall service

Malware hides in DNS because DNS is allowed everywhere.
A DNS tunnel smuggles data out in thousands of random names under one domain.
A DGA malware tries hundreds of random domains until it finds its command server.
The DNS Firewall spots both, computer by computer, and tells you which one is infected.

Benefits

Use cases

How the detection works

The DNS Firewall analyses each computer over windows of five minutes.

One alert is raised per type, computer and domain, at most once an hour.
The detection needs the DNS Firewall: it reads the queries the service receives.

See the alerts

DNS threats tab with a tunnel and a DGA alert

Column Meaning
Date When the alert was raised.
Type TUNNEL or DGA.
Client The IP address of the computer, with the number of names and their average randomness in bits per character.
Domain The domain of the tunnel, and three examples of the names queried.
Status Alert only, or the result of the block when the option is on.

The same alerts are written in three places:

A syslog line looks like this:

dns-threat: Possible DNS tunnel from 192.168.4.1 to exfil-tunnel-demo.net: 100 queries, 100 distinct subdomains in 5 minutes, average length 52.0, entropy 4.5 bits per character, 0 TXT/NULL queries.

Settings

The Parameters subtab shows the current state.
Click Edit the detection to change it.

Parameters of the detection

Edit the detection

Setting Meaning
Detect DNS tunnels and DGA malware On by default.
Block the domain of a detected tunnel Off by default.
When on, the DNS Firewall answers REFUSED for that domain to every computer.
Block duration (minutes) From 5 to 1440 minutes, 60 by default.
A restart of the DNS service also lifts the block.
Domains never analysed One domain per line, its subdomains included.
Add the internal services that use random names, such as telemetry or backup.

A DGA alert never blocks anything.
Blocking random domains would only cut the DNS of the infected computer, while the malware keeps trying new names.

Before turning on the block

The thresholds were set on test traffic.
Leave the detection in alert mode for a few days first.
When an alert names a legitimate service, add its domain to Domains never analysed.
Turn the block on once the alerts only show real threats.

To check a block from a shell of the appliance:

dnsdist -C /etc/dnsdist.conf -c -e 'showDynBlocks()'

A blocked domain appears with the reason Artica: DNS tunnel and the seconds left.

Artica Meta

The DNS Firewall policy carries Detect DNS tunnels and DGA malware, Block the domain of a detected tunnel and Block duration.
The list of domains never analysed stays local to each node.
It can be changed on a node even when Meta holds the other settings.

Reference