Threat Hunting Guide

Introduction

Blue Hexagon’s NDR platform performs deep packet inspection on network protocols and payloads and can generate security enriched data for providing a holistic view of the enterprise threat posture. Network metadata is filtered through a neural network exposed to malicious traffic from the past 15 years  and constantly tuned and updated by Blue Hexagon.  Insights so generated can be flexibly applied across a variety of deployments in the network, public cloud or SaaS. Network metadata is available in a searchable console as SaaS as part of your subscription. 30 days of data retention is included for free.

Threat hunting is done using queries. It allows for manual, proactive investigations into possible security threats based on available data as well as collecting additional supporting evidence that will lead into an investigation.  It consists of several capabilities: 

  • Interesting Insights: These are built in queries that serve as a useful starting point for an advanced investigation. Oftentimes they point to weaknesses in the security environment (such as use of weak ciphers, potentially unauthorized recursive DNS servers, unusual SMB/RPC activity etc.  These insights can be run on ingested data as well as to do retroactive pursuits of attacks and RCA. 

  • Queries: Queries are based on the Kibana Query Language (KQL). These can be extremely simple to complex for exposing very specific threat scenarios.  For example, consider a query like: 

_exists_:dns_server_country AND dns_server_country:"United States" AND orig_h:10.70.120.10 AND -orig_h:10.150.120.10 AND -dns_server_ip:10.255.8.8 AND -dns_server_ip:10.150.120.10 AND  -dns_server_ip:10.150.117.100 AND  -dns_server_ip:10.30.223.10

This query can expose all DNS servers that hosts in an enterprise are connecting to that are not in the United States and are not in the set of authorized DNS servers. Additional threat use cases are shown in the table below. 

 

 

 

Threat Hunting with NG-NDR

The hunting capabilities of the console can be entered via the Discover tab on the left menu of the UI or by clicking the search icon on the sidebar menu

 

There are various attacker techniques that can be revealed by the hunting platform as well as configuration questions that can be answered with the platform. On clicking the search icon a second sidebar appears with a list of protocols to hunt on. 

Clicking on each protocol reveals a list of Detection Insights for that protocol. Clicking on any protocol or an insight populates the corresponding table with data on the right.

When building a query, if you are not familiar with the data fields available, hovering on the columns reveals the data field name to use to build the query. For example, knowing the field name is upload_bytes one can construct queries to limit to data with upload_bytes:>1000

Blue Hexagon NDR Threat Hunting GuideNorth-South Traffic

You can filter out private CIDR blocks using a query such as:
-orig_h:"192.168.0.0/16" OR -orig_h:"10.0.0.0/8" OR -orig_h:"172.16.0.0/12"
Replace orig_h with the appropriate key.

Question

Which DNS servers are in use and have been used in the past? 



Discover → DNS Compliance → Interesting Insights “Top DNS Servers”

Where are the DNS servers in use located and are any of them associated with malicious activity?



Discover → DNS Compliance → Interesting Insights “Top DNS Servers” → Click on VirusTotal link associated



What are the rarely used DNS servers and who is using them?



Discover → DNS Compliance → Interesting Insights “Rare DNS Servers”



 

Are there long DNS queries being generated which could be possible DGA or exfiltration?


Discover → DNS Compliance → Filter by query_length:>30 Tweak the threshold as appropriate or filter by other criteria (such as query_domain).

Discover → DNS Compliance → Sort all queries by the query length column.

Who are the top querying nodes over DNS? (could be a sign of exfiltration)



Discover → DNS Compliance → Interesting Insights “Top Querying Clients”



What are the rarest domains being queried? (could be a sign of C2)



Discover → DNS Compliance → Interesting Insights “Least Queried Domains”



Which endpoints have the most DNS errors? (could be a sign of DGA activity)

 

Discover → DNS Compliance → Interesting Insights “Top Clients with DNS Errors”

 



Are outdated and vulnerable TLS versions in use in the network such as TLS 1.0? Are there SSL transactions in the network?

 

Discover → TLS Compliance → Interesting Insights “Outdated Versions”

Are there unusual protocols traversing the N-S interface such as RPC, SMB or RDP?

Is there RPC activity from external hosts to server IPs?

 

Discover → RPC→ Query -orig_h:"192.168.0.0/16" OR -orig_h:"10.0.0.0/8" OR -orig_h:"172.16.0.0/12"

Discover → SMB Mapping → Query -orig_h:"192.168.0.0/16" OR -orig_h:"10.0.0.0/8" OR -orig_h:"172.16.0.0/12"

Discover → RDP → Query -orig_h:"192.168.0.0/16" OR -orig_h:"10.0.0.0/8" OR -orig_h:"172.16.0.0/12"



Are standard protocols being used over non-standard ports?

 

Suspicious Objects → Interesting Insights “Standard protocols over non-standard ports”

 

Is there traffic, to/from the server farm that does not belong? - e.g. SSH,TLS using a certificate issued by an rare CA. 



What kinds of files are being downloaded by servers? How many of such files are from external hosts?

Suspicious Objects → Query _exists_:resp_h AND (-resp_h:"192.168.0.0/16" OR -resp_h:"10.0.0.0/8" OR -resp_h:"172.16.0.0/12")

Are there outgoing compressed files? How much data is being transferred outside in that manner?



Suspicious Objects → Interesting Insight “Outgoing Compressed Files”

Are there files being transferred over SMB where the file type does not match the file name?



Suspicious Objects → Query filetype:exe AND !filename: *exe*

East-West Traffic

Questions

Are any endpoints performing recon activities?

Security Findings → Port Scan

Security Findings -> Address_Scan

Are administrative tasks occurring from the non-admin subnets?


If admin subnet is 192.168.0.0/16 then

Discover → RPC Tab and SMB Mapping Tab → Query orig_h:"192.168.0.0/16"

Are users connecting to suspicious shares?

Discover → SMB Mapping → Suspicious SMB Shares

Which hosts (whether inside or outside) communicate with servers most often? What communication is happening at unusual times?

Discover → Connection Analytics → Top Uploaders/Downloaders

Are there files being transferred over SMB where the file type does not match the file name?

Discover → SMB Files → Query filetype:exe AND !filename: *exe*

Which hosts are attempting to discover SMB shares?

Discover→ SMB Mapping

Which hosts are attempting to make multiple attempts at lateral movement?

Security Findings → Lateral Movement Detected

Was any host targeted with lateral movement and execution?

Security Findings → Lateral Movement and Execution

Hunting Beacons and Exfil

Questions

Are hosts connecting to Cobalt Strike Team Server controller ports?

Discover → Connection Outliers → Query conn_dst_port_list:"50050/tcp"

Are hosts using uncommon HTTP comms?

Discover → HTTP → Query !resp_p:80 AND !resp_p:443 AND method:POST

Are hosts using uncommon DNS comms with exfil or tunnel characteristics?

Discover → HTTP → Query query_length:>100 AND answers:"TXT*"

 

Blue Hexagon Proprietary