Skip to content

Commit c9316e1

Browse files
committed
优化密码破解 的控制流程 2022-09-27
1 parent 1f9429a commit c9316e1

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

pkg/hydra/doNmapResult.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@ func DoParseXml(s string, bf *bytes.Buffer) {
6565
//bf.Write([]byte(fmt.Sprintf("%s:%s\n", ip, szPort)))
6666
szUlr := fmt.Sprintf("http://%s:%s\n", ip, szPort)
6767
bf.Write([]byte(szUlr))
68-
if bCheckWeakPassword {
69-
CheckWeakPassword(ip, service, port)
70-
} else {
71-
log.Println("bCheckWeakPassword = ", bCheckWeakPassword)
72-
}
68+
7369
// 存储结果到其他地方
7470
//x9 := AuthInfo{IPAddr: ip, Port: port, Protocol: service}
7571
// 构造发送es等数据
@@ -81,9 +77,7 @@ func DoParseXml(s string, bf *bytes.Buffer) {
8177
m1[ip] = append(xx09, []string{szPort, service})
8278
}
8379
if os.Getenv("NoPOC") != "true" {
84-
if "socks5" == service || "vnc" == service {
85-
CheckWeakPassword(ip, service, port)
86-
} else if "445" == szPort && service == "microsoft-ds" || "135" == szPort && service == "msrpc" {
80+
if "445" == szPort && service == "microsoft-ds" || "135" == szPort && service == "msrpc" {
8781
util.PocCheck_pipe <- &util.PocCheck{
8882
Wappalyzertechnologies: &[]string{service},
8983
URL: szUlr,
@@ -97,8 +91,6 @@ func DoParseXml(s string, bf *bytes.Buffer) {
9791
FinalURL: szUlr,
9892
Checklog4j: false,
9993
}
100-
} else if bCheckWeakPassword && ("110" == szPort || "995" == szPort) && service == "pop3" {
101-
CheckWeakPassword(ip, service, port)
10294
} else if "2181" == szPort {
10395
util.PocCheck_pipe <- &util.PocCheck{
10496
Wappalyzertechnologies: &[]string{"ZookeeperUnauthority"},
@@ -108,11 +100,14 @@ func DoParseXml(s string, bf *bytes.Buffer) {
108100
}
109101
}
110102
}
103+
// 若密码、破解
111104
if bCheckWeakPassword {
112105
if "8728" == szPort && service == "unknown" {
113106
CheckWeakPassword(ip, "router", port)
114107
} else if ("5985" == szPort || "5986" == szPort) && -1 < strings.Index(service, "microsoft ") {
115108
CheckWeakPassword(ip, "winrm", port)
109+
} else { // if ("110" == szPort || "995" == szPort) && service == "pop3" || "socks5" == service || "vnc" == service {
110+
CheckWeakPassword(ip, service, port)
116111
}
117112
}
118113

pkg/hydra/hydra.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var (
2222
CustomAuthMap *AuthList
2323
// rtsp://admin:[email protected]:554/0x8b6c42
2424
// rtsp: 554, 5554,8554
25-
ProtocolList = strings.Split("rdp,ssh,rsh-spx,mysql,mssql,oracle,postgresql,redis,ftp,mongodb,mongod,smb,telnet,snmp,wap-wsp,router,winrm,pop3,socks5,vnc", ",")
25+
ProtocolList = strings.Split("rdp,ssh,rsh-spx,mysql,mssql,oracle,postgresql,redis,ftp,mongodb,mongod,smb,telnet,snmp,wap-wsp,router,winrm,pop3,socks5,vnc,pop3s", ",")
2626
)
2727

2828
func NewCracker(info *AuthInfo, isAuthUpdate bool, threads int) *Cracker {
@@ -67,6 +67,8 @@ func (c *Cracker) Run() {
6767
c.Pool.Function = rdpCracker(ip, port)
6868
case "mysql":
6969
c.Pool.Function = mysqlCracker
70+
case "pop3s":
71+
c.Pool.Function = pop3Cracker
7072
case "pop3":
7173
c.Pool.Function = pop3Cracker
7274
case "mssql":

0 commit comments

Comments
 (0)