Kali Linux

Second-Order : Subdomain Takeover Scanner

Second-Order is a Scans web applications for second-order subdomain takeover by crawling the app, and collecting URLs (and other data) that match certain rules, or respond in a certain way.

Installation

From binary

Download a prebuilt binary from the releases page and unzip it.

From source

Go version 1.17 is recommended

go install -v github.com/mhmdiaa/second-order@latest

Docker

docker pull mhmdiaa/second-order

Command line options

-target string
Target URL
-config string
Configuration file (default “config.json”)
-depth int
Depth to crawl (default 1)
-header value
Header name and value separated by a colon ‘Name: Value’ (can be used more than once)
-insecure
Accept untrusted SSL/TLS certificates
-output string
Directory to save results in (default “output”)
-threads int
Number of threads (default 10)

Configuration File

Example configuration files are in config

  • LogQueries: A map of tag-attribute queries that will be searched for in crawled pages. For example, "a": "href" means log every href attribute of every a tag.
  • LogNon200Queries: A map of tag-attribute queries that will be searched for in crawled pages, and logged only if they contain a valid URL that doesn’t return a 200 status code.
  • LogInline: A list of tags whose inline content (between the opening and closing tags) will be logged, like title and script

Output

All results are saved in JSON files that specify what and where data was found

  • The results of LogQueries are saved in attributes.json

{
“https://example.com/”: {
“input[name]”: [
“user”,
“id”,
“debug”
]
}
}

The results of LogNon200Queries are saved in non-200-url-attributes.json

{
“https://example.com/”: {
“script[src]”: [
“https://cdn.old_abandoned_domain.com/app.js”,
]
}
}


The results of LogInline are saved in inline.json

{
“https://example.com/”: {
“title”: [
“Example – Home”
]
},
“https://example.com/login”: {
“title”: [
“Example – login”
]
}
}

Usage Ideas

This is a list of tips and ideas (not necessarily related to second-order subdomain takeover) on what to use Second Order for.

  • Check for second-order subdomain takeover: takeover.json. (Duh!)
  • Collect inline and imported JS code: javascript.json.
  • Find where a target hosts static files cdn.json. (S3 buckets, anyone?)
  • Collect <input> names to build a tailored parameter bruteforcing wordlist: parameters.json.
  • Feel free to contribute more ideas!
R K

Recent Posts

Kali Linux 2024.4 Released, What’s New?

Kali Linux 2024.4, the final release of 2024, brings a wide range of updates and…

5 hours ago

Lifetime-Amsi-EtwPatch : Disabling PowerShell’s AMSI And ETW Protections

This Go program applies a lifetime patch to PowerShell to disable ETW (Event Tracing for…

5 hours ago

GPOHunter – Active Directory Group Policy Security Analyzer

GPOHunter is a comprehensive tool designed to analyze and identify security misconfigurations in Active Directory…

2 days ago

2024 MITRE ATT&CK Evaluation Results – Cynet Became a Leader With 100% Detection & Protection

Across small-to-medium enterprises (SMEs) and managed service providers (MSPs), the top priority for cybersecurity leaders…

5 days ago

SecHub : Streamlining Security Across Software Development Lifecycles

The free and open-source security platform SecHub, provides a central API to test software with…

1 week ago

Hawker : The Comprehensive OSINT Toolkit For Cybersecurity Professionals

Don't worry if there are any bugs in the tool, we will try to fix…

1 week ago