Skip to content

Commit 6b65513

Browse files
committed
Adds --subs-only to assetfinder
1 parent 8e0ccb1 commit 6b65513

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

assetfinder/main.go

+6
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ import (
1212
)
1313

1414
func main() {
15+
var subsOnly bool
16+
flag.BoolVar(&subsOnly, "subs-only", false, "Only incluse subdomains of search domain")
1517
flag.Parse()
1618

1719
domain := flag.Arg(0)
1820
if domain == "" {
1921
fmt.Println("no domain specified")
2022
return
2123
}
24+
domain = strings.ToLower(domain)
2225

2326
sources := []fetchFn{
2427
fetchCertSpotter,
@@ -68,6 +71,9 @@ func main() {
6871
if _, ok := printed[n]; ok {
6972
continue
7073
}
74+
if subsOnly && !strings.HasSuffix(n, domain) {
75+
continue
76+
}
7177
fmt.Println(n)
7278
printed[n] = true
7379
}

0 commit comments

Comments
 (0)