mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-09-14 05:56:46 +08:00
fix: 完全移除SSH插件的自动利用调用
- 删除SSH插件中的autoExploit方法调用 - 移除autoExploit方法定义 - SSH插件现在只进行弱密码扫描,不再尝试任何利用功能 - -sshkey参数仅用于私钥文件认证,不涉及利用功能 修复后SSH插件不再显示"利用失败"消息
This commit is contained in:
parent
60e59f5a78
commit
90576b122c
@ -155,11 +155,6 @@ func (p *SSHPlugin) Scan(ctx context.Context, info *common.HostInfo) (*base.Scan
|
||||
target := fmt.Sprintf("%s:%s", info.Host, info.Ports)
|
||||
common.LogSuccess(i18n.GetText("ssh_key_auth_success", target, result.Credentials[0].Username))
|
||||
|
||||
// 自动利用功能 - 同步执行以确保及时显示结果
|
||||
if !common.DisableExploit {
|
||||
p.autoExploit(context.Background(), info, result.Credentials[0])
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
}
|
||||
@ -179,11 +174,6 @@ func (p *SSHPlugin) Scan(ctx context.Context, info *common.HostInfo) (*base.Scan
|
||||
cred := result.Credentials[0]
|
||||
common.LogSuccess(i18n.GetText("ssh_pwd_auth_success", target, cred.Username, cred.Password))
|
||||
|
||||
// 自动利用功能(可通过-ne参数禁用)- 同步执行以确保及时显示结果
|
||||
if result.Success && len(result.Credentials) > 0 && !common.DisableExploit {
|
||||
p.autoExploit(context.Background(), info, result.Credentials[0])
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
@ -229,24 +219,6 @@ func (p *SSHPlugin) generateCredentials() []*base.Credential {
|
||||
return base.GenerateCredentials(usernames, common.Passwords)
|
||||
}
|
||||
|
||||
// autoExploit 自动利用功能
|
||||
func (p *SSHPlugin) autoExploit(ctx context.Context, info *common.HostInfo, creds *base.Credential) {
|
||||
target := fmt.Sprintf("%s:%s", info.Host, info.Ports)
|
||||
common.LogDebug(i18n.GetText("plugin_exploit_start", "SSH", target))
|
||||
|
||||
// 执行利用操作
|
||||
result, err := p.exploiter.Exploit(ctx, info, creds)
|
||||
if err != nil {
|
||||
common.LogError(i18n.GetText("plugin_exploit_failed", "SSH", err))
|
||||
return
|
||||
}
|
||||
|
||||
// 处理利用结果
|
||||
if result != nil && result.Success {
|
||||
// SaveExploitResult会自动使用LogSuccess显示红色利用成功消息
|
||||
base.SaveExploitResult(info, result, "SSH")
|
||||
}
|
||||
}
|
||||
|
||||
// Exploit 使用exploiter执行利用
|
||||
func (p *SSHPlugin) Exploit(ctx context.Context, info *common.HostInfo, creds *base.Credential) (*base.ExploitResult, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user