Updated Jul 14, 2026

Recon

Crawl pages for second-order subdomain takeover refs

Crawler that collects second-order subdomain references for takeover review.

Agent

overview

What second-order does

second-order crawls a -target URL and records the resources each page loads. It hunts second-order subdomain takeover: a trusted page still pulls a script, image, or link from a subdomain that no longer resolves.

A -config file selects which attributes and resources to collect. -depth bounds how far the crawl walks, -header carries session context, and -threads sets concurrency. Output is a folder of structured results, not a single verdict.

DNS and certificate host lists miss references that live only in page HTML. Crawl discovered hosts with second-order, then confirm dangling candidates with subjack or nuclei takeover templates.

source github.com/mhmdiaa/second-order

use cases

Where second-order fits

Find dangling subdomain references

Crawl a target and collect the subdomain resources its pages load, surfacing references that point at services no longer claimed and open to takeover.

Drive collection with a config file

Use the -config file to specify which HTML attributes and resources to record, whether to log non-200 references, and which URLs to skip, so the crawl captures exactly what you want to review.

Bound the crawl depth

Set -depth to control how far second-order walks from the seed, keeping a scan focused on the immediate surface or reaching deeper into linked pages.

Crawl authenticated areas

Pass -header to carry a session cookie or token so pages behind a login are crawled and the resources they load are inspected for dangling references.

reference

second-order inputs and flags

6 inputs
NameTypeFlagDescription
targetSTRING-targetTarget URL to crawl.
configFILE-configConfiguration file controlling which attributes and resources to collect.
depthSTRING-depthHow far to crawl from the seed URL. Default: 1.
headerSTRING-headerHeader as 'Name: Value', usable more than once for session context.
threadsSTRING-threadsNumber of concurrent crawl threads. Default: 10.
insecureBOOLEAN-insecureAccept untrusted SSL/TLS certificates while crawling.

Showing key inputs. second-order exposes 6 inputs in total.

example

Run second-order

second-order · command
# crawl a target two levels deep, collecting the configured resourcessecond-order -target https://example.com -config config.json -depth 2 -threads 20
sample output
# output/ folder: one JSON file per configured attributeoutput/script-src.json   (loaded <script src> values)output/a-href.json       (page <a href> links)# script-src.json excerpt: pages mapped to the scripts they load{  "https://example.com/": [    "https://cdn.example.com/app.js",    "https://assets.staging.example.com/widget.js"  ]}

guidance

Choosing second-order

Use second-order when you need takeover risk through resources a trusted page loads, not only host enumeration. For direct checks against a subdomain list, subjack or nuclei takeover templates are a faster fit.

subjack

Checks a subdomain list against known takeover fingerprints directly.

nuclei

Runs takeover-detection templates across a host list as part of broader scanning.

katana

General-purpose crawler when you want endpoints rather than takeover candidates.

faq

second-order questions

A trusted page can still load a script or asset from a subdomain that no longer resolves. second-order records those loaded hosts with -target, -depth, and -config so you can confirm dangling candidates with subjack or nuclei.

Run second-order yourself

A target URL feeds second-order, which crawls the site and records loaded subdomain references, writing takeover candidates as a queryable output.

Facts on this page come from the live Trickest tool library.