-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.go
53 lines (43 loc) · 1.02 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package main
import (
"bufio"
"flag"
"log"
"os"
"strings"
)
func loadDomains(domain, filename string) []string {
domains := []string{}
if domain != "" {
domains = append(domains, domain)
} else if filename != "" {
file, err := os.Open(filename)
if err != nil {
log.Fatal(err.Error())
}
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
if d := strings.TrimSpace(scanner.Text()); d != "" {
domains = append(domains, d)
}
}
} else {
flag.Usage()
os.Exit(1)
}
return domains
}
func main() {
log.SetFlags(log.LstdFlags | log.Lshortfile)
log.SetOutput(os.Stdout)
var concurrency int
var domain, filename, output string
flag.StringVar(&domain, "t", "", "Target domain to scan")
flag.StringVar(&filename, "f", "", "File contains bulk domains")
flag.StringVar(&output, "o", "json", "Output format")
flag.IntVar(&concurrency, "c", 50, "Concurrency for scanning")
flag.Parse()
domains := loadDomains(domain, filename)
NewSSLScanner(domains, output, concurrency).Run()
}