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

- 统一所有服务插件的实现模式,移除i18n国际化依赖 - 删除硬编码的备份凭据列表,统一使用GenerateCredentials() - 移除过度工程化的Context取消检查 - 清理exploitation功能,专注于弱密码检测和服务识别 - 简化代码结构,移除冗余注释和说明文档 - 优化19个服务插件:activemq, cassandra, elasticsearch, ftp, kafka, ldap, memcached, mongodb, mssql, mysql, neo4j, oracle, postgresql, rabbitmq, rsync, smtp, snmp, telnet, vnc - 代码总量减少约40%,提升维护效率 此次重构确保插件架构的一致性和简洁性
62 lines
960 B
Go
62 lines
960 B
Go
package services
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/shadow1ng/fscan/common"
|
|
)
|
|
|
|
type OraclePlugin struct {
|
|
name string
|
|
ports []int
|
|
}
|
|
|
|
func NewOraclePlugin() *OraclePlugin {
|
|
return &OraclePlugin{
|
|
name: "oracle",
|
|
ports: []int{1521, 1522, 1525},
|
|
}
|
|
}
|
|
|
|
func (p *OraclePlugin) GetName() string {
|
|
return p.name
|
|
}
|
|
|
|
func (p *OraclePlugin) GetPorts() []int {
|
|
return p.ports
|
|
}
|
|
|
|
func (p *OraclePlugin) Scan(ctx context.Context, info *common.HostInfo) *ScanResult {
|
|
if common.DisableBrute {
|
|
return p.identifyService(ctx, info)
|
|
}
|
|
|
|
return &ScanResult{
|
|
Success: false,
|
|
Service: "oracle",
|
|
Error: fmt.Errorf("Oracle驱动未安装"),
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (p *OraclePlugin) identifyService(ctx context.Context, info *common.HostInfo) *ScanResult {
|
|
return &ScanResult{
|
|
Success: false,
|
|
Service: "oracle",
|
|
Error: fmt.Errorf("Oracle驱动未安装"),
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
RegisterPlugin("oracle", func() Plugin {
|
|
return NewOraclePlugin()
|
|
})
|
|
} |