Building Adversary Infrastructure Tracking System

Build an automated system to track adversary infrastructure using passive DNS, certificate transparency, WHOIS

What Is This

The "Building Adversary Infrastructure Tracking System" skill teaches you how to develop an automated system for tracking adversary infrastructure using data sources such as passive DNS, certificate transparency logs, WHOIS registration data, and IP enrichment. This approach is a cornerstone of modern threat intelligence, enabling defenders to systematically map, monitor, and discover new components of threat actor command-and-control (C2) networks. By leveraging infrastructure overlap and data-driven pivoting, analysts can uncover related domains, IPs, and digital certificates that are part of a malicious campaign.

Unlike basic indicator blacklisting, infrastructure tracking takes a proactive stance. It investigates the underlying resources that threat actors use to stage attacks, offering defenders the opportunity to anticipate, block, and monitor adversary operations across campaigns and timeframes. The skill aligns with several NIST Cybersecurity Framework controls, particularly related to risk assessment and detection.

Why Use It

Threat actors rarely operate in isolation. They often reuse infrastructure components, such as hosting providers, IP space, domain naming conventions, SSL certificate issuers, and even WHOIS registration details, across multiple campaigns. By tracking these infrastructure elements, defenders can:

  • Identify and map C2 networks more comprehensively than with static indicator lists.
  • Detect newly registered domains and infrastructure likely to be used in future attacks.
  • Pivot from one known indicator to uncover related malicious assets.
  • Improve the accuracy of threat intelligence feeds and automated blocking.
  • Maintain situational awareness of evolving adversary tactics and infrastructure.

Automating this process not only saves time, but also reduces the risk of missing key connections that manual analysis might overlook. This system supports both proactive threat hunting and incident response workflows.

How to Use It

To build an adversary infrastructure tracking system, you will typically integrate multiple data sources and automate analysis workflows. The following steps outline a practical approach:

1. Collect Data from Multiple

Sources

  • Passive DNS: Obtain records of historical DNS resolutions to track domain-IP relationships over time.
  • Certificate Transparency (CT): Query CT logs to find digital certificates associated with domains of interest, which can reveal clusters of related infrastructure.
  • WHOIS Data: Parse registration records to identify reused registrant emails, phone numbers, or patterns in domain registrations.
  • IP Enrichment: Use third-party APIs or internal databases to associate IP addresses with hosting providers, geolocations, and known abuse records.

Example: Querying Passive DNS with Python

import requests

def query_passive_dns(domain):
    api_url = f"https://api.passivedns.example.com/query/{domain}"
    headers = {"Authorization": "Bearer <API_KEY>"}
    response = requests.get(api_url, headers=headers)
    if response.status_code == 200:
        return response.json()["results"]
    return None

2. Normalize and Correlate

Data

Aggregate and normalize the data to allow for cross-source correlation. For example, map all observed IPs to their corresponding domains, SSL certificates, and WHOIS records.

Example: Correlating SSL Certificates

def find_related_domains_by_cert(cert_hash):
    api_url = f"https://api.certtransparency.example.com/certificate/{cert_hash}"
    response = requests.get(api_url)
    if response.status_code == 200:
        return response.json()["domains"]
    return []

3. Pivot Across

Indicators

Leverage overlaps in the data to pivot from one known malicious indicator to others. For instance, if multiple domains share the same SSL certificate or WHOIS email, they may be related to the same threat actor.

4. Automate Detection and

Alerting

Schedule regular queries for newly registered domains, updated SSL certificates, or changes in IP assignments. Use pattern matching or machine learning to flag suspicious infrastructure matching adversary TTPs (tactics, techniques, and procedures).

5. Visualize and

Monitor

Store relationships in a graph database (such as Neo4j) for visualization and advanced querying, enabling analysts to map C2 infrastructure and monitor changes over time.

When to Use It

  • When deploying or configuring adversary infrastructure tracking as part of your security operations center (SOC).
  • When establishing or enhancing threat intelligence capabilities.
  • During incident response, to expand the scope of investigations beyond initial indicators.
  • When performing proactive threat hunting or red team exercises.
  • To support compliance with NIST CSF and other risk management frameworks that require infrastructure monitoring and detection capabilities.

Important Notes

  • Data Privacy and Legal Considerations: Always comply with data privacy laws and terms of service for third-party data sources. Some WHOIS data may be redacted due to privacy regulations.
  • API Rate Limits and Costs: Many data sources, especially passive DNS and CT logs, have usage limits and may require paid subscriptions. Plan accordingly for sustained automation.
  • False Positives: Infrastructure artifacts like shared hosting or CDN IPs can lead to noisy results. Implement filtering and context-aware enrichment to reduce false positives.
  • Continuous Updating: Threat actor infrastructure is dynamic. Regularly update your data sources and detection logic.
  • Security: Protect API keys and sensitive data used in your tracking system, as compromise could expose your monitoring capabilities or sensitive intelligence.

By mastering this skill, you will be equipped to build robust, automated systems that provide early warning and deep visibility into adversary operations, greatly enhancing your organization’s threat intelligence posture. For implementation details and code samples, see the source repository.