mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-25 12:41:53 +08:00
fix: 修复扫描逻辑
This commit is contained in:
+2
-2
@@ -73,7 +73,7 @@ func Flag(Info *HostInfo) {
|
||||
// ═════════════════════════════════════════════════
|
||||
// 扫描控制参数
|
||||
// ═════════════════════════════════════════════════
|
||||
flag.StringVar(&ScanMode, "m", "All", GetText("flag_scan_mode"))
|
||||
flag.StringVar(&ScanMode, "m", "all", GetText("flag_scan_mode"))
|
||||
flag.IntVar(&ThreadNum, "t", 10, GetText("flag_thread_num"))
|
||||
flag.Int64Var(&Timeout, "time", 3, GetText("flag_timeout"))
|
||||
flag.IntVar(&ModuleThreadNum, "mt", 10, GetText("flag_module_thread_num"))
|
||||
@@ -183,7 +183,7 @@ func FlagFromRemote(info *HostInfo, argString string) error {
|
||||
fs.StringVar(&HostsFile, "hf", "", GetText("flag_hosts_file"))
|
||||
fs.StringVar(&PortsFile, "pf", "", GetText("flag_ports_file"))
|
||||
|
||||
fs.StringVar(&ScanMode, "m", "All", GetText("flag_scan_mode"))
|
||||
fs.StringVar(&ScanMode, "m", "all", GetText("flag_scan_mode"))
|
||||
fs.IntVar(&ThreadNum, "t", 10, GetText("flag_thread_num"))
|
||||
fs.Int64Var(&Timeout, "time", 3, GetText("flag_timeout"))
|
||||
fs.IntVar(&ModuleThreadNum, "mt", 10, GetText("flag_module_thread_num"))
|
||||
|
||||
+20
-1
@@ -8,13 +8,32 @@ type HostInfo struct {
|
||||
Infostr []string
|
||||
}
|
||||
|
||||
// 在 Common/const.go 中添加
|
||||
// 插件类型常量
|
||||
const (
|
||||
PluginTypeService = "service" // 服务类型插件
|
||||
PluginTypeWeb = "web" // Web类型插件
|
||||
PluginTypeLocal = "local" // 本地类型插件
|
||||
)
|
||||
|
||||
// ScanPlugin 定义扫描插件的结构
|
||||
type ScanPlugin struct {
|
||||
Name string // 插件名称
|
||||
Ports []int // 关联的端口列表,空切片表示特殊扫描类型
|
||||
Ports []int // 适用端口
|
||||
Types []string // 插件类型标签,一个插件可以有多个类型
|
||||
ScanFunc func(*HostInfo) error // 扫描函数
|
||||
}
|
||||
|
||||
// 添加一个用于检查插件类型的辅助方法
|
||||
func (p ScanPlugin) HasType(typeName string) bool {
|
||||
for _, t := range p.Types {
|
||||
if t == typeName {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// HasPort 检查插件是否支持指定端口
|
||||
func (p *ScanPlugin) HasPort(port int) bool {
|
||||
// 如果没有指定端口列表,表示支持所有端口
|
||||
|
||||
Reference in New Issue
Block a user