Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ Please feel free to issue pull requests with new sources! :)
* https://certdb.com/api-documentation

## TODO
* Flags to control which sources are used
* Likely to be all on by default and a flag to disable
* ~~Flags to control which sources are used~~
* ~~Likely to be all on by default and a flag to disable~~
* Read domains from stdin
69 changes: 58 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,43 @@ import (

func main() {
var subsOnly bool

var (
useCertSpotter bool
useHackerTarget bool
useThreatCrowd bool
useCrtSh bool
useFacebook bool
useVirusTotal bool
useFindSubDomains bool
useUrlscan bool
useBufferOverrun bool
)

flag.BoolVar(&subsOnly, "subs-only", false, "Only include subdomains of search domain")
flag.BoolVar(&useCertSpotter, "use-certspotter", true, "Enable CertSpotter source")
flag.BoolVar(&useHackerTarget, "use-hackertarget", true, "Enable HackerTarget source")
flag.BoolVar(&useThreatCrowd, "use-threatcrowd", true, "Enable ThreatCrowd source")
flag.BoolVar(&useCrtSh, "use-crtsh", true, "Enable CrtSh source")
flag.BoolVar(&useFacebook, "use-facebook", true, "Enable Facebook source")
flag.BoolVar(&useVirusTotal, "use-virustotal", true, "Enable VirusTotal source")
flag.BoolVar(&useFindSubDomains, "use-findsubdomains", true, "Enable FindSubDomains source")
flag.BoolVar(&useUrlscan, "use-urlscan", true, "Enable Urlscan source")
flag.BoolVar(&useBufferOverrun, "use-bufferoverrun", true, "Enable BufferOverrun source")
flag.Parse()

useSources := map[string]bool{
"certspotter": useCertSpotter,
"hackertarget": useHackerTarget,
"threatcrowd": useThreatCrowd,
"crtsh": useCrtSh,
"facebook": useFacebook,
"virustotal": useVirusTotal,
"findsubdomains": useFindSubDomains,
"urlscan": useUrlscan,
"bufferoverrun": useBufferOverrun,
}

var domains io.Reader
domains = os.Stdin

Expand All @@ -27,17 +61,30 @@ func main() {
domains = strings.NewReader(domain)
}

sources := []fetchFn{
fetchCertSpotter,
fetchHackerTarget,
fetchThreatCrowd,
fetchCrtSh,
fetchFacebook,
//fetchWayback, // A little too slow :(
fetchVirusTotal,
fetchFindSubDomains,
fetchUrlscan,
fetchBufferOverrun,
var sources []fetchFn
for source, enabled := range useSources {
if enabled {
switch source {
case "certspotter":
sources = append(sources, fetchCertSpotter)
case "hackertarget":
sources = append(sources, fetchHackerTarget)
case "threatcrowd":
sources = append(sources, fetchThreatCrowd)
case "crtsh":
sources = append(sources, fetchCrtSh)
case "facebook":
sources = append(sources, fetchFacebook)
case "virustotal":
sources = append(sources, fetchVirusTotal)
case "findsubdomains":
sources = append(sources, fetchFindSubDomains)
case "urlscan":
sources = append(sources, fetchUrlscan)
case "bufferoverrun":
sources = append(sources, fetchBufferOverrun)
}
}
}

out := make(chan string)
Expand Down