mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-09-14 14:06:44 +08:00
37 lines
984 B
Go
37 lines
984 B
Go
package ssh
|
||
|
||
import (
|
||
"context"
|
||
|
||
"github.com/shadow1ng/fscan/common"
|
||
"github.com/shadow1ng/fscan/plugins/base"
|
||
)
|
||
|
||
// SSHExploiter SSH利用器实现 - 最小化版本,不提供利用功能
|
||
type SSHExploiter struct {
|
||
*base.BaseExploiter
|
||
}
|
||
|
||
// NewSSHExploiter 创建SSH利用器
|
||
func NewSSHExploiter() *SSHExploiter {
|
||
exploiter := &SSHExploiter{
|
||
BaseExploiter: base.NewBaseExploiter("ssh"),
|
||
}
|
||
|
||
// SSH插件不提供利用功能
|
||
exploiter.setupExploitMethods()
|
||
|
||
return exploiter
|
||
}
|
||
|
||
// setupExploitMethods 设置利用方法
|
||
func (e *SSHExploiter) setupExploitMethods() {
|
||
// SSH插件不提供利用功能,-sshkey参数用于私钥文件认证而非命令执行
|
||
// SSH的价值在于弱密码发现,获取SSH访问权限本身就是目标
|
||
}
|
||
|
||
// Exploit 利用接口实现 - 空实现
|
||
func (e *SSHExploiter) Exploit(ctx context.Context, info *common.HostInfo, creds *base.Credential) (*base.ExploitResult, error) {
|
||
// SSH插件不提供利用功能
|
||
return nil, nil
|
||
} |