subxtract

command module
v0.0.0-...-b6beb31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

ℹ️ About

Wrapper around go-fasttld for extracting TLD (Top-Level-Domains) & ROOT_DOMAIN using accurate and always-uptodate public-suffix list from domains, urls, ipv4, ipv6, etc.
Tools like tomnomnom/unfurl rely on Hardcoded Regexes and thus fail to properly separate tld-suffix from actual domains.
Instead, go-fasttld uses Public Suffix List which is autoupdated regularly.

🖳 Installation

Use soar & Run:

soar add 'subxtract#github.com.pkgforge-security.subxtract'

🧰 Usage

❯ subxtract --help
Public-Suffix based TLDs (Top-Level-Domains) & Root Domain Extractor

Usage:
  subxtract [flags]

Flags:
  -c, --concurrency int     Limit the number of concurrent goroutines (Higher CPU/RAM Usage) (default 1000)
  -d, --domains             Print the root domain and suffix combined
  -f, --file string         Input file containing URLs|Domains (one per line)
  -h, --help                help for subxtract
  -i, --ignore-subdomains   Ignore (Exclude) subdomains
  -j, --json                Output in JSON Format (Everything)
  -s, --private-suffix      Include Private Suffix (Example: blogspot.com)
  -p, --punycode            Convert Internationalized Domain Names (IDN) to Punycode (ASCII Characters)
  -r, --roots               Print only the root domain (without suffix)
  -t, --tlds                Print only the Top Level Domain (TLD)

Examples:

  • Input

cat domains.txt

  • You can also pass urls, doesn't really matter
  • Don't pass wildcards (.*)
abc.example.com
abc.example.net
apple.com
be.banana.com
example.com
example.com.np
example.net
example.org
xyz.abc.example.com
xyz.abc.example.net

  • To Extract Root Domain Names ( NO .tld)
subxtract -f domains.txt -r | awk '!seen[$0]++'
!# Or Via STDIN
cat domains.txt | subxtract -r | awk '!seen[$0]++'
  • Output

example
apple
banana

  • Similarly, To Extract Root Domain Names + Top Level Domains (TLDs)
subxtract -f domains.txt -d | awk '!seen[$0]++'
!# Or Via STDIN
cat domains.txt | subxtract -d | awk '!seen[$0]++'
  • Output

example.com
apple.com
banana.com
example.net
example.org
example.com.np

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址