-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
73 lines (69 loc) · 1.55 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package main
import (
"github.com/urfave/cli/v2"
"log"
"os"
)
const (
Red = "\033[31m"
Green = "\033[32m"
Yellow = "\033[33m"
Reset = "\033[0m"
)
func main() {
app := &cli.App{
Name: "lame-delegation-check",
Usage: "Identify if a domain name contains any lame delegations",
Commands: []*cli.Command{
{
Name: "query",
Aliases: []string{"q"},
Usage: "Query the domain name for lame delegations.",
Action: QueryDomain,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "domain",
Aliases: []string{"d"},
Usage: "Domain name to check for lame delegations",
Required: true,
},
&cli.StringFlag{
Name: "queryType",
Aliases: []string{"t"},
Usage: "Type of DNS Query to perform. (Default: A)",
Value: "A",
},
},
},
{
Name: "scan",
Aliases: []string{"s"},
Usage: "Scan the input list of hostnames for lame delegations.",
Action: ScanHostnames,
Flags: []cli.Flag {
&cli.StringFlag{
Name: "input",
Aliases: []string{"i"},
Usage: "Filename / path to file containing hostnames to scan",
Required: true,
},
&cli.StringFlag{
Name: "queryType",
Aliases: []string{"t"},
Usage: "Type of DNS Query to perform. (Default: A)",
Value: "A",
},
&cli.StringFlag{
Name: "outdir",
Aliases: []string{"o"},
Usage: "Name of the output directory to store the scanned results in",
Value: "results",
},
},
},
},
}
if err := app.Run(os.Args); err != nil {
log.Fatal(err)
}
}