import math from collections import Counter def calculate_entropy(s): """Calculates the Shannon entropy of a string to detect randomized subdomains.""" p, l = Counter(s), float(len(s)) return -sum(count/l * math.log(count/l, 2) for count in p.values()) # Sample domain collected from network logs sample_subdomain = "://malicious-domain.com" entropy_score = calculate_entropy(sample_subdomain) print(f"Domain: sample_subdomain") print(f"Shannon Entropy Score: entropy_score:.4f") # A score above 4.5 generally warrants closer security inspection. Use code with caution. Measuring Threat Hunting Success
CTI concepts, the Intelligence Cycle, Indicators of Compromise (IoC), and the Cyber Kill Chain.
Let's look at a concrete example of a threat hunt targeting (MITRE ATT&CK T1036). Adversaries often rename malicious files to match legitimate system processes (like svchost.exe ) to hide in plain sight. Step 1: Formulate the Hypothesis Let's look at a concrete example of a
Isolating unique pairs of commands or behaviors that happen together.
Every hunt begins with a specific testable statement based on threat intelligence or security theories. Every hunt begins with a specific testable statement
What do you currently use? (e.g., Splunk, Microsoft Sentinel, CrowdStrike)
is a proactive search process for hidden threats within an organization's information system. It is a crucial component of active defense against advanced threats. Unlike traditional security measures that wait for an alert, threat hunting assumes that an adversary may already be inside the network and actively searches for signs of malicious activity. maintaining high-quality data
Filter out known legitimate parent-child process relationships (e.g., services.exe launching svchost.exe ).
The transition from a reactive to a proactive security posture is a journey, not a destination. While a single PDF can provide a blueprint, true expertise comes from applying these "practical" and "data-driven" concepts to your unique environment every single day. By focusing on TTPs, maintaining high-quality data, and fostering a culture of continuous hunting, you transform your organization from a target into a formidable opponent.
[1. Formulate Hypothesis] ---> [2. Gather Telemetry & Data] ---> [3. Execute Analysis & Queries] | v [6. Automate Detection] <--- [5. Document & Remediate] <--- [4. Validate/Identify Threat] Phase 1: Hypothesis Generation