-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathweakpass.go
39 lines (34 loc) · 1017 Bytes
/
weakpass.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
package main
import (
"flag"
"goWeakPass/work"
"log"
"os"
)
var proto = flag.String("proto", "", "Weak password detection protos (ssh/telnet)")
var hostaddr = flag.String("host", "", "Weak password detection hostaddr")
var port = flag.String("port", "", "Weak password detection port")
var tasknum = flag.Int("t", 1, "Weak password detection Number of threads")
var confpath = flag.String("conf", "conf.ini", "Weak password detection confpath")
var database = flag.String("database", "admin", "Weak password database name")
func main() {
flag.Parse()
check()
work.Taskinit(*confpath)
work.Taskrun(*proto, *tasknum, *hostaddr, *port,*database)
log.Print("未检测到该服务弱口令,请再次检查确认或补充字典!")
}
func check() {
if *proto == "" {
log.Print("请使用 -proto 指定协议名")
os.Exit(1)
}
if *hostaddr == "" {
log.Print("请使用 -host 指定目标地址")
os.Exit(1)
}
if *port == "" {
log.Print("请使用 -port 指定目标端口")
os.Exit(1)
}
}