# Recon Attack Surface Management

> Use when an authorized engagement or defensive program needs a living inventory of everything an organization exposes to the internet and a way to keep it current. Covers asset discovery across domains, IPs, cloud services, and third party SaaS, ownership and lifecycle tracking, change detection between recon runs, exposure scoring, and turning raw recon findings into a prioritized attack surface register that active testing and remediation can work from. Authorized targets only, only inventory assets you are permitted to test.

- Skill: `mizazhaider-ceh/recon-attack-surface-management` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/recon-attack-surface-management`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/recon-attack-surface-management/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Product & Planning
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/recon-attack-surface-management

---


Attack surface management (ASM) turns one-off recon into a register that stays
true over time. A single subdomain list goes stale the day a team ships a new
service, retires an old one, or points a record at a new provider. This skill
covers building the first inventory, assigning an owner and a lifecycle state
to every asset, re-running discovery on a schedule, diffing the results, and
scoring what changed so testers and defenders spend effort on the riskiest
new exposure first. Only inventory assets you are authorized to test, and keep
the register inside the engagement boundary.

## Quick Workflow

1. Confirm scope in writing and record seed domains, IP ranges, and exclusions.
2. Collect the first inventory from passive sources, subdomain enumeration, ASN and netblock data, and certificate logs.
3. Resolve every name, probe every live host once, and record port, service, and technology signals.
4. Normalize everything into one register with one row per asset, with owner, lifecycle state, first seen, and last seen dates.
5. Score each asset by exposure, sensitivity, and freshness, and sort the testing queue by that score.
6. Re-run discovery on a schedule, diff against the previous register, and triage only the changes.
7. Retire assets that stop resolving or stop serving, and flag dangling records for the takeover workflow instead of silently dropping them.
8. Hand the current register, the change log, and the top-scored queue to active testing.

## 1. Seed the inventory and record scope

Start with a scope file, not a tool run. Seeds are the root domains, the ASN
ranges from recon-asn-netblock, and any cloud or SaaS names already known from
recon-passive. Anything outside the seeds is out of scope until scope changes
in writing.

```bash
mkdir -p asm/example.com
cd asm/example.com
cat > SCOPE.txt <<'EOF'
Client: Example Ltd
Authorized: example.com, *.example.com, 203.0.113.0/24
Off limits: partner.example.com (third party)
Authorization ref: SOW-2026-041
Run date: 2026-10-27
EOF
cat > seeds.txt <<'EOF'
example.com
example.org
EOF
cat seeds.txt
```

## 2. Build the first inventory from several sources

No single source is complete. Subdomain tools miss assets that never had a
certificate, certificate logs miss assets that never had TLS, and ASN data
misses SaaS names hosted outside the organization's ranges. Merge at least
three source families before calling the inventory complete.

```bash
# Passive subdomain collection per seed domain
while read -r d; do
  subfinder -d "$d" -silent -o "subfinder-$d.txt"
done < seeds.txt
cat subfinder-*.txt | sort -u > subs-raw.txt

# Certificate log names for the same seeds
for d in $(cat seeds.txt); do
  curl -s "https://crt.sh/?q=%25.$d&output=json" \
    | jq -r '.[].name_value' \
    | sed 's/^\*\.//' \
    | sort -u >> subs-raw.txt
done
sort -u subs-raw.txt > subs-all.txt
wc -l subs-all.txt subs-raw.txt
```

## 3. Resolve and probe once, then record what is live

Resolution turns names into testable assets. Probe with httpx through a
public resolver path where possible, and keep the raw probe output so a later
diff can tell a real change from a flaky probe.

```bash
# Resolve every name, keep only names with an answer
dnsx -l subs-all.txt -silent -a -resp -o resolved.txt -t 50
wc -l resolved.txt

# Probe live web hosts and record status, title, and technology hints
httpx -l subs-all.txt -silent -status-code -title -tech-detect \
  -o probed.txt -threads 50
head -20 probed.txt
```

A name that resolves but serves nothing is still an asset, with a different
risk profile from a live login page. Record both, and do not delete the
silent ones on the first run. They may be staging hosts, APIs without a web
root, or services on non-web ports.

## 4. Normalize into one register

The register is the product. One row per asset, in a stable format, with
fields every later run can reproduce. Use a simple CSV or JSON lines file so
diffing is a text operation, not a guess.

```bash
# Build a minimal register from resolved names and probe results
python3 - <<'PY'
import csv, json, re

probed = {}
try:
    for line in open("probed.txt"):
        parts = line.split()
        if parts:
            probed[parts[0].strip()] = line.strip()
except FileNotFoundError:
    pass

rows = []
for line in open("resolved.txt"):
    m = re.match(r"(\S+)\s+\[([^\]]+)\]", line.strip())
    if not m:
        continue
    host, ips = m.group(1), m.group(2)
    rows.append({
        "asset": host,
        "ips": ips,
        "probe": probed.get(host, ""),
        "lifecycle": "active",
        "first_seen": "2026-10-27",
        "last_seen": "2026-10-27",
        "owner": "unassigned",
    })

with open("register.jsonl", "w") as fh:
    for row in rows:
        fh.write(json.dumps(row) + "\n")
print(f"register rows: {len(rows)}")
PY
head -5 register.jsonl
```

Owner assignment is manual and matters more than automation. An unowned asset
is an asset nobody will patch. Route each new asset to a team, a service
owner, or an explicit "unknown, needs owner" queue, and track how long assets
sit unowned.

## 5. Score exposure so the queue is ordered, not alphabetical

Score on signals you actually observed, not on guesses about the business.
A useful starting rubric, tuned per engagement:

```bash
# Score helper - reads probed.txt and assigns a simple tier
python3 - <<'PY'
for line in open("probed.txt"):
    low = line.lower()
    tier = "low"
    if any(k in low for k in ("login", "admin", "sso", "auth")):
        tier = "high"
    elif any(k in low for k in ("api", "staging", "dev", "test", "internal")):
        tier = "medium"
    elif "[200]" in line or "[301]" in line or "[302]" in line:
        tier = "medium"
    print(f"{tier} {line.strip()}")
PY
```

Rules that keep scoring honest: a fresh asset scores higher than a long-lived
one until it has been tested once, a login or admin surface scores higher
than a marketing page, a staging or dev name scores higher than production
because it usually has weaker controls, and any asset with a dangling record
or an expired certificate jumps the queue regardless of its other signals.
Record the reason for the score next to the score, so a reviewer can
challenge it.

## 6. Diff runs and triage only the changes

The value of ASM is the diff. Re-run the same commands into a dated folder,
normalize the same way, and compare asset sets. New assets, vanished assets,
IP changes, and status changes are the four change types worth triaging.

```bash
# Compare two register snapshots by asset name
mkdir -p runs/2026-10-27
cp register.jsonl runs/2026-10-27/register.jsonl
jq -r '.asset' runs/2026-10-27/register.jsonl | sort -u > prev-assets.txt
jq -r '.asset' register.jsonl | sort -u > curr-assets.txt
echo "--- new assets ---"
comm -13 prev-assets.txt curr-assets.txt
echo "--- vanished assets ---"
comm -23 prev-assets.txt curr-assets.txt
echo "--- counts ---"
wc -l prev-assets.txt curr-assets.txt
```

Triaging a new asset means confirming it is in scope, assigning an owner,
probing it, and scoring it. Triaging a vanished asset means checking whether
it was decommissioned cleanly (DNS removed, service deleted) or left dangling.
A vanished asset with a live DNS record pointing at a third party service is
not a retirement, it is a takeover candidate, and it goes to
recon-subdomain-takeover.

## 7. Lifecycle states and retirement hygiene

Use a small, fixed lifecycle vocabulary and never invent a new state per
asset: active, staging, parked, retired, dangling, unknown. Staging assets get
tested like production, because attackers will. Parked assets get a quarterly
check, not a free pass. Retired assets keep their last seen date and the
evidence that DNS and the service were both removed. Dangling assets stay in
the register until the DNS record is fixed, with a link to the takeover
evidence.

## Edge cases

- Wildcard DNS makes every guessed name resolve. Detect it with a random
  name probe before trusting any resolved list, and filter wildcard answers
  out of the register or mark them explicitly as wildcard-derived.
- Shared hosting and CDN certificates flood the inventory with names that
  belong to the provider, not the target. Filter by checking which names
  resolve to the target's ranges or serve the target's content.
- A name that resolves today and not tomorrow may be a flaky resolver, a
  short-lived staging host, or a decommission. Re-probe vanished names once
  through a second resolver before marking them retired.
- Mergers, acquisitions, and rebrands leave legacy domains in the register
  that nobody owns. Keep them, mark the owner unknown, and escalate the
  ownership gap instead of deleting the evidence.
- SaaS assets (status pages, docs sites, support portals) live outside the
  organization's IP ranges. They still belong in the register, with the
  provider named, because their compromise is the organization's incident.
- Rate limits and API quotas on passive sources mean two runs can differ
  for tool reasons, not target reasons. Record which sources ran and which
  failed in each run's notes, so a diff is never misread as a target change.

## Key references

- MITRE ATT&CK T1590 Gather Victim Network Information
- MITRE ATT&CK T1590.001 Domain Properties
- MITRE ATT&CK T1592 Gather Victim Host Information
- OWASP Attack Surface Analysis guidance: https://owasp.org/www-project-web-security-testing-guide/
- crt.sh documentation: https://crt.sh
- ProjectDiscovery subfinder documentation: https://github.com/projectdiscovery/subfinder
- ProjectDiscovery httpx documentation: https://github.com/projectdiscovery/httpx

