How can a network detect a hacker?

The short answer

NDR (Network Detection and Response) watches a network's traffic, learns what's normal, and raises an alert when a device calls a server on a schedule that's too regular.

Animated diagram: How can a network detect a hacker?

NDR

NDR (Network Detection and Response) watches a network’s traffic to find a hacker in it. It builds a model of normal behavior, then looks for whatever departs from it. It watches the traffic that goes out to the internet, called north-south, and the traffic that moves between internal machines, called east-west.

What it looks for is a habit. Malware has to receive orders. So it regularly calls its command server, known as C2 (Command and Control). This check-in is called beaconing. Elastic Security Labs analyzed the Koadic example: it called its server every ten minutes, with packets of nearly identical sizes.

What NDR actually watches

First, sensors collect the traffic, as packets, flows, and logs. Next, a tool like Zeek writes one line per connection in its conn.log file. It records the time (ts), the caller (id.orig_h), the destination (id.resp_h), the port (id.resp_p), the service, and the bytes sent by each side (orig_bytes, resp_bytes).

Encryption hides the content. It doesn’t hide the timing, the destination, or the size of the exchanges. Swisscom points out that most traffic is encrypted and that detection also relies on DNS (Domain Name System) and web proxies. A machine that calls the same server every ten minutes, with the same bytes, shows up in the log.

How NDR spots a hacker

  1. Sensors, even on the inside. They collect traffic going to the internet, but also traffic between internal machines. Infected PCs (personal computers) talking to each other stay visible.
  2. One line per connection. Zeek or a similar tool records who calls whom, when, on which port, and with how many bytes.
  3. Normal is the baseline. NDR learns how the network usually behaves. A person browses irregularly. Malware is often too regular. Only often, though: Elastic notes that sophisticated malware, like Emotet, adds a random delay.
  4. The alert, then the response. NDR raises an alert. It can also block IP (Internet Protocol) addresses or isolate the compromised device.

The result: a hacker can hide what they say, but not the fact that they’re calling. At RUAG, in Switzerland, the oldest proxy logs already showed command activity in September 2014. The attack, tied to the Turla malware, was discovered in January 2016. The infected PCs talked to each other internally, and only a few relays went out, over web port 80.

Encryption is not invisibility

Many people think encrypted traffic reveals nothing. That’s wrong. Encryption protects what is said, not the fact of talking. The time of each call, the destination, and the size of the packets stay visible. To spot beaconing, the rhythm alone can be enough to draw attention.

What you can do

  • On your Android phone (version 9 or later), open Settings, search for “Private DNS,” and enter dns.quad9.net as the provider hostname, then save. Labels vary by manufacturer.
  • Check the setting at on.quad9.net. This Swiss DNS service blocks domains known to be malicious.
  • Keep in mind that this setting doesn’t work with an active VPN (virtual private network) or with the Quad9 Connect app turned on.
  • At work, ask whether traffic between internal machines is monitored, not just the traffic going out to the internet.

#NDR#Beaconing#NetworkDetection#Quad9#CyberSecurity#InfoSec#Networking