mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-02-09 02:09:17 +08:00
fix: -hf的一个问题 修复#412的问题
This commit is contained in:
@@ -148,6 +148,29 @@ func ParsePass(Info *HostInfo) error {
|
||||
LogInfo(fmt.Sprintf("从文件加载URL: %d 个", len(urls)))
|
||||
}
|
||||
|
||||
// 从文件加载主机列表
|
||||
if HostsFile != "" {
|
||||
hosts, err := Readfile(HostsFile)
|
||||
if err != nil {
|
||||
return fmt.Errorf("读取主机文件失败: %v", err)
|
||||
}
|
||||
|
||||
tmpHosts := make(map[string]struct{})
|
||||
for _, host := range hosts {
|
||||
if host != "" {
|
||||
if _, ok := tmpHosts[host]; !ok {
|
||||
tmpHosts[host] = struct{}{}
|
||||
if Info.Host == "" {
|
||||
Info.Host = host
|
||||
} else {
|
||||
Info.Host += "," + host
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
LogInfo(fmt.Sprintf("从文件加载主机: %d 个", len(hosts)))
|
||||
}
|
||||
|
||||
// 从文件加载端口列表
|
||||
if PortsFile != "" {
|
||||
ports, err := Readfile(PortsFile)
|
||||
|
||||
@@ -107,7 +107,7 @@ func parseIP(ip string) []string {
|
||||
|
||||
switch {
|
||||
case ip == "192":
|
||||
return parseIP("192.168.0.0/8")
|
||||
return parseIP("192.168.0.0/16")
|
||||
case ip == "172":
|
||||
return parseIP("172.16.0.0/12")
|
||||
case ip == "10":
|
||||
|
||||
@@ -16,7 +16,7 @@ const (
|
||||
)
|
||||
|
||||
// 插件分类映射表 - 所有插件名使用小写
|
||||
var pluginGroups = map[string][]string{
|
||||
var PluginGroups = map[string][]string{
|
||||
ModeAll: {
|
||||
"webtitle", "webpoc", // web类
|
||||
"mysql", "mssql", "redis", "mongodb", "postgres", // 数据库类
|
||||
@@ -78,12 +78,12 @@ func ParseScanMode(mode string) {
|
||||
// 默认使用All模式
|
||||
ScanMode = ModeAll
|
||||
LogInfo(fmt.Sprintf("未识别的模式,使用默认模式: %s", ModeAll))
|
||||
LogInfo(fmt.Sprintf("包含插件: %v", pluginGroups[ModeAll]))
|
||||
LogInfo(fmt.Sprintf("包含插件: %v", PluginGroups[ModeAll]))
|
||||
}
|
||||
|
||||
// GetPluginsForMode 获取指定模式下的插件列表
|
||||
func GetPluginsForMode(mode string) []string {
|
||||
plugins, exists := pluginGroups[mode]
|
||||
plugins, exists := PluginGroups[mode]
|
||||
if exists {
|
||||
return plugins
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user