generated from roerohan/Template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flags.go
57 lines (46 loc) · 1.12 KB
/
flags.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
package main
import (
"flag"
"strings"
"github.com/roerohan/bird/logger"
)
// BirdHome stores the home directory where bird is installed
var (
urls Urls
wordlist string
success Success
)
// Urls is a type to store multiple
// target URLs to be bruteforced
type Urls []string
// Success stores the status codes
// which represent success
type Success []string
// Set is a function on Urls
// to implement flag.Value
func (u *Urls) Set(value string) error {
*u = append(*u, value)
return nil
}
// String is a function on Urls to
// implement flag.Value
func (u *Urls) String() string {
return strings.Join(*u, " ")
}
// Set is a function on Success
// to implement flag.Value
func (s *Success) Set(value string) error {
*s = append(*s, value)
return nil
}
// String is a function on Success to
// implement flag.Value
func (s *Success) String() string {
return strings.Join(*s, " ")
}
func init() {
defer logger.Welcome()
flag.Var(&urls, "u", "Target URL to be bruteforced [required]")
flag.Var(&success, "s", "Status code for success, default 200")
flag.StringVar(&wordlist, "w", "", "Path to wordlist [required]")
}