fscan/Plugins/services/postgresql/exploiter.go
ZacharyZcR fbc75bb709 feat: 添加Rsync和SMTP插件实现文件
包含新架构下的连接器、利用器和插件主体实现:
- rsync服务插件:支持RSYNCD协议和模块扫描
- smtp服务插件:支持SMTP协议和PLAIN认证
- PostgreSQL插件文件(之前遗漏)
- Docker测试环境配置文件
2025-08-09 15:05:42 +08:00

42 lines
1.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
}