getroots
A simple Go tool to normalize and extract root (apex) domains from bug bounty scope lists. It removes wildcards and outputs the clean root domain, making it easy to process domains from platforms like HackerOne and Bugcrowd.
Features
- Removes wildcards (e.g.,
*.example.com → example.com)
- Extracts the root (apex) domain using the Public Suffix List
- Supports input from STDIN or a file
- Simple command-line interface
Installation
go install github.com/offftherecord/getroots@latest
Usage
$ getroots -h
getroots - Extract the root domains from wildcarded domain strings. Useful for parsing bug bounty scope lists
Usage:
getroots [options]
Options:
-f FILE Read domains from FILE (one per line)
-h Show this help message and exit
Examples
From STDIN
echo "*.google.com" | getroots
From a file
getroots -f domains.txt
Example input
*.google.com
sub.*.example.co.uk
http://*.test.com.
Example output
google.com
example.co.uk
test.com
License
MIT