mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-09-14 14:06:44 +08:00

包含新架构下的连接器、利用器和插件主体实现: - rsync服务插件:支持RSYNCD协议和模块扫描 - smtp服务插件:支持SMTP协议和PLAIN认证 - PostgreSQL插件文件(之前遗漏) - Docker测试环境配置文件
42 lines
1.2 KiB
Go
42 lines
1.2 KiB
Go
package postgresql
|
||
|
||
import (
|
||
"context"
|
||
"fmt"
|
||
|
||
"github.com/shadow1ng/fscan/common"
|
||
"github.com/shadow1ng/fscan/plugins/base"
|
||
)
|
||
|
||
// PostgreSQLExploiter PostgreSQL利用器实现
|
||
type PostgreSQLExploiter struct{}
|
||
|
||
// NewPostgreSQLExploiter 创建PostgreSQL利用器
|
||
func NewPostgreSQLExploiter() *PostgreSQLExploiter {
|
||
return &PostgreSQLExploiter{}
|
||
}
|
||
|
||
// Exploit 执行PostgreSQL利用
|
||
func (e *PostgreSQLExploiter) Exploit(ctx context.Context, info *common.HostInfo, creds *base.Credential) (*base.ExploitResult, error) {
|
||
// PostgreSQL插件主要用于服务识别和认证测试,不进行进一步利用
|
||
return &base.ExploitResult{
|
||
Success: false,
|
||
Error: fmt.Errorf("PostgreSQL插件不支持进一步利用"),
|
||
}, nil
|
||
}
|
||
|
||
// GetExploitMethods 获取支持的利用方法
|
||
func (e *PostgreSQLExploiter) GetExploitMethods() []base.ExploitMethod {
|
||
return []base.ExploitMethod{
|
||
{
|
||
Name: "信息收集",
|
||
Type: base.ExploitDataExtraction,
|
||
Description: "收集PostgreSQL数据库信息",
|
||
},
|
||
}
|
||
}
|
||
|
||
// IsExploitSupported 检查是否支持指定的利用类型
|
||
func (e *PostgreSQLExploiter) IsExploitSupported(method base.ExploitType) bool {
|
||
return method == base.ExploitDataExtraction
|
||
} |