技能 编程开发 基于DNS的持久化狩猎

基于DNS的持久化狩猎

v20260317
hunting-for-dns-based-persistence
通过导出区域记录、查询SecurityTrails历史、分析DNS审计日志来识别劫持、悬空记录与未授权委派等DNS持久化异常。
获取技能
209 次下载
概览

Hunting for DNS-based Persistence

Overview

Attackers establish DNS-based persistence by hijacking DNS records, creating unauthorized subdomains, abusing wildcard DNS entries, or modifying NS delegations to redirect traffic through attacker-controlled infrastructure. These techniques survive credential rotations, endpoint reimaging, and traditional remediation because DNS changes persist independently of compromised hosts. Detection requires passive DNS historical analysis, zone file auditing, and monitoring for unauthorized record modifications. This skill covers hunting methodologies using SecurityTrails passive DNS API, DNS audit logs from Route53/Azure DNS/Cloudflare, and zone transfer analysis.

Prerequisites

  • SecurityTrails API key (free tier provides 50 queries/month)
  • Access to DNS provider audit logs (Route53, Azure DNS, Cloudflare, or on-premises DNS)
  • Python 3.9+ with requests library
  • DNS zone file access or AXFR capability for internal zones
  • Historical DNS baseline for comparison

Steps

Step 1: Baseline DNS Records

Export current DNS zone records and establish baseline for all authorized A, AAAA, CNAME, MX, NS, and TXT records.

Step 2: Query Passive DNS History

Use SecurityTrails API to retrieve historical DNS records and identify unauthorized changes, new subdomains, and CNAME records pointing to decommissioned services (dangling CNAMEs).

Step 3: Detect Anomalies

Compare current records against baseline to identify unauthorized modifications, wildcard records that resolve all subdomains, NS delegation changes, and MX record hijacking.

Step 4: Investigate Findings

Correlate DNS anomalies with threat intelligence feeds, check resolution targets against known malicious infrastructure, and validate record ownership.

Expected Output

JSON report listing DNS anomalies with record type, historical changes, risk severity, and remediation recommendations for each finding.

信息
Category 编程开发
Name hunting-for-dns-based-persistence
版本 v20260317
大小 8.99KB
更新时间 2026-03-18
语言