MCPcopy
hub / github.com/shadow1ng/fscan / classifyFTPErrorType

Function classifyFTPErrorType

plugins/services/ftp.go:122–145  ·  view source on GitHub ↗

classifyFTPErrorType FTP错误分类

(err error)

Source from the content-addressed store, hash-verified

120
121// classifyFTPErrorType FTP错误分类
122func classifyFTPErrorType(err error) ErrorType {
123 if err == nil {
124 return ErrorTypeUnknown
125 }
126
127 ftpAuthErrors := []string{
128 "530 login incorrect",
129 "530 not logged in",
130 "530 user cannot log in",
131 "530 authentication failed",
132 "authentication failed",
133 "permission denied",
134 "access denied",
135 "invalid credentials",
136 "bad password",
137 "login incorrect",
138 }
139
140 ftpNetworkErrors := append(CommonNetworkErrors,
141 "421 there are too many connections",
142 )
143
144 return ClassifyError(err, ftpAuthErrors, ftpNetworkErrors)
145}
146
147func (p *FTPPlugin) identifyService(info *common.HostInfo, config *common.Config, state *common.State) *ScanResult {
148 target := info.Target()

Callers 1

doFTPAuthMethod · 0.85

Calls 1

ClassifyErrorFunction · 0.85

Tested by

no test coverage detected