mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-23 03:31:53 +08:00
fix(credential): 修复凭据测试结果不一致的问题
问题原因: 1. 未知错误类型不重试,导致服务端限流时跳过正确密码 2. SSH 错误分类不够准确,某些临时错误未被识别 修复内容: 1. 未知错误改为可重试(可能是临时问题) 2. 增加 SSH 特有的网络错误识别(handshake failed, disconnect 等)
This commit is contained in:
+11
-1
@@ -160,12 +160,22 @@ func classifySSHErrorType(err error) ErrorType {
|
||||
return ErrorTypeUnknown
|
||||
}
|
||||
|
||||
// SSH 特有的认证错误(密码错误)
|
||||
sshAuthErrors := append(CommonAuthErrors,
|
||||
"unable to authenticate",
|
||||
"no supported methods remain",
|
||||
)
|
||||
|
||||
return ClassifyError(err, sshAuthErrors, CommonNetworkErrors)
|
||||
// SSH 特有的网络/临时错误(需要重试)
|
||||
sshNetworkErrors := append(CommonNetworkErrors,
|
||||
"handshake failed", // 握手失败,可能是服务端限流
|
||||
"ssh: disconnect", // SSH 主动断开
|
||||
"connection closed", // 连接被关闭
|
||||
"max startups", // SSH MaxStartups 限制
|
||||
"too many authentication", // 认证次数过多
|
||||
)
|
||||
|
||||
return ClassifyError(err, sshAuthErrors, sshNetworkErrors)
|
||||
}
|
||||
|
||||
// scanWithKey 使用SSH私钥扫描
|
||||
|
||||
Reference in New Issue
Block a user