Skip to content

Commit 34a4f07

Browse files
committed
add pop3 2022-08-02
1 parent 1aca113 commit 34a4f07

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

pkg/hydra/cracker.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/hktalent/scan4all/pkg/hydra/mssql"
99
"github.com/hktalent/scan4all/pkg/hydra/mysql"
1010
"github.com/hktalent/scan4all/pkg/hydra/oracle"
11+
"github.com/hktalent/scan4all/pkg/hydra/pop3"
1112
"github.com/hktalent/scan4all/pkg/hydra/postgresql"
1213
"github.com/hktalent/scan4all/pkg/hydra/rdp"
1314
"github.com/hktalent/scan4all/pkg/hydra/redis"
@@ -111,6 +112,15 @@ func mysqlCracker(i interface{}) interface{} {
111112
return nil
112113
}
113114

115+
func pop3Cracker(i interface{}) interface{} {
116+
info := i.(AuthInfo)
117+
info.Auth.MakePassword()
118+
if ok := pop3.DoPop3(info.IPAddr, info.Auth.Username, info.Auth.Password); ok {
119+
info.Status = true
120+
return info
121+
}
122+
return nil
123+
}
114124
func mssqlCracker(i interface{}) interface{} {
115125
info := i.(AuthInfo)
116126
info.Auth.MakePassword()

pkg/hydra/doNmapResult.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ func DoParseXml(s string, bf *bytes.Buffer) {
102102
}
103103
}
104104
}
105-
106-
if bCheckWeakPassword && "8728" == szPort && service == "unknown" {
105+
if bCheckWeakPassword && "110" == szPort && service == "pop3" {
106+
CheckWeakPassword(ip, service, port)
107+
} else if bCheckWeakPassword && "8728" == szPort && service == "unknown" {
107108
CheckWeakPassword(ip, "router", port)
108109
} else if bCheckWeakPassword && ("5985" == szPort || "5986" == szPort) && -1 < strings.Index(service, "microsoft ") {
109110
CheckWeakPassword(ip, "winrm", port)

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", ",")
25+
ProtocolList = strings.Split("rdp,ssh,rsh-spx,mysql,mssql,oracle,postgresql,redis,ftp,mongodb,mongod,smb,telnet,snmp,wap-wsp,router,winrm,pop3", ",")
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 "pop3":
71+
c.Pool.Function = pop3Cracker
7072
case "mssql":
7173
c.Pool.Function = mssqlCracker
7274
case "oracle":

pkg/hydra/loadDicts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ func init() {
143143
Paswd: util.GetVal4File("ssh_pswd", pswd),
144144
DefaultUp: util.GetVal4Filedefault("ssh_default", ssh_default),
145145
}
146+
md["pop3"] = md["ssh"]
146147
md["rsh-spx"] = md["ssh"]
147148
md["snmp"] = &PPDict{
148149
Username: util.GetVal4File("snmp_user", snmp_user),

0 commit comments

Comments
 (0)