-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathflag.go
43 lines (38 loc) · 1.21 KB
/
flag.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
package gotoscan
import (
"flag"
"log"
)
type ArgsInfo struct {
Host string
Hosts string
CmsJson string
}
func Banner() {
banner := `
________ ___________ __________________ _____ _______
/ _____/ ___\__ ___/___ / _____/\_ ___ \ / _ \ \ \
/ \ ___ / _ \| | / _ \\_____ \ / \ \/ / /_\ \ / | \
\ \_\ ( <_> ) |( <_> ) \\ \____/ | \/ | \
\______ /\____/|____| \____/_______ / \______ /\____|__ /\____|__ /
\/ \/ \/ \/ \/
GoToScan version:1.0
`
print(banner)
}
func (Info *ArgsInfo) Flag() {
Banner()
//可以指定的参数
flag.StringVar(&Info.Host, "host", "", "Test a host,http://xxxxx")
flag.StringVar(&Info.Hosts, "hosts", "", "Filename with hosts,One host per line")
flag.StringVar(&Info.CmsJson, "cmsjson", "cms.json", "Cms fingerprint feature json file, The default is cms.json")
flag.Parse()
if Info.Host == "" && Info.Hosts == "" {
log.Fatalln("err:./no host parameter")
return
}
if Info.Host != "" && Info.Hosts != "" {
log.Fatalln("err:./only one host parameter")
return
}
}