mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-24 20:21:52 +08:00
refactor: 精简化输出,移除冗余启动信息
- 移除showParseSummary开局配置输出 - 移除LogPluginInfo/LogPluginInfoWithPort插件信息输出 - 移除alive_scanner冗余统计输出 - 移除port_scan_start扫描开始提示 - 移除handleUDPPorts SNMP死代码 - 移除相关i18n条目
This commit is contained in:
+2
-95
@@ -396,102 +396,9 @@ func joinInts(slice []int, sep string) string {
|
||||
return strings.Join(strs, sep)
|
||||
}
|
||||
|
||||
// showParseSummary 显示解析结果摘要(精简版)
|
||||
// showParseSummary 显示解析结果摘要(已精简,不再输出冗余信息)
|
||||
func showParseSummary(config *parsers.ParsedConfig) {
|
||||
if config == nil {
|
||||
return
|
||||
}
|
||||
|
||||
fv := GetFlagVars()
|
||||
|
||||
// 1. 目标信息(合并为一行)
|
||||
if config.Targets != nil {
|
||||
var targetParts []string
|
||||
|
||||
// 主机信息
|
||||
if len(config.Targets.Hosts) > 0 {
|
||||
if len(config.Targets.Hosts) == 1 {
|
||||
targetParts = append(targetParts, config.Targets.Hosts[0])
|
||||
} else {
|
||||
targetParts = append(targetParts, fmt.Sprintf("%d主机", len(config.Targets.Hosts)))
|
||||
}
|
||||
}
|
||||
|
||||
// URL信息
|
||||
if len(config.Targets.URLs) > 0 {
|
||||
if len(config.Targets.URLs) == 1 {
|
||||
targetParts = append(targetParts, config.Targets.URLs[0])
|
||||
} else {
|
||||
targetParts = append(targetParts, fmt.Sprintf("%dURL", len(config.Targets.URLs)))
|
||||
}
|
||||
}
|
||||
|
||||
// 端口信息
|
||||
if len(config.Targets.Ports) > 0 {
|
||||
targetParts = append(targetParts, fmt.Sprintf("%d端口", len(config.Targets.Ports)))
|
||||
}
|
||||
|
||||
// 本地模式
|
||||
if config.Targets.LocalMode {
|
||||
targetParts = append(targetParts, "本地模式")
|
||||
}
|
||||
|
||||
if len(targetParts) > 0 {
|
||||
LogBase(fmt.Sprintf("目标: %s", strings.Join(targetParts, " x ")))
|
||||
}
|
||||
|
||||
// 排除端口单独显示(如果有)
|
||||
if len(config.Targets.ExcludePorts) > 0 {
|
||||
LogBase(fmt.Sprintf("排除: %d端口", len(config.Targets.ExcludePorts)))
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 非默认配置(只显示用户修改过的)
|
||||
var customConfigs []string
|
||||
|
||||
if fv.ThreadNum != 600 {
|
||||
customConfigs = append(customConfigs, fmt.Sprintf("线程%d", fv.ThreadNum))
|
||||
}
|
||||
if fv.TimeoutSec != 3 {
|
||||
customConfigs = append(customConfigs, fmt.Sprintf("超时%ds", fv.TimeoutSec))
|
||||
}
|
||||
if fv.ModuleThreadNum != 20 {
|
||||
customConfigs = append(customConfigs, fmt.Sprintf("模块线程%d", fv.ModuleThreadNum))
|
||||
}
|
||||
if fv.GlobalTimeout != 180 {
|
||||
customConfigs = append(customConfigs, fmt.Sprintf("全局超时%ds", fv.GlobalTimeout))
|
||||
}
|
||||
|
||||
// 代理配置
|
||||
if config.Network != nil {
|
||||
if config.Network.HTTPProxy != "" {
|
||||
customConfigs = append(customConfigs, fmt.Sprintf("HTTP代理:%s", config.Network.HTTPProxy))
|
||||
}
|
||||
if config.Network.Socks5Proxy != "" {
|
||||
customConfigs = append(customConfigs, fmt.Sprintf("SOCKS5:%s", config.Network.Socks5Proxy))
|
||||
}
|
||||
}
|
||||
|
||||
if len(customConfigs) > 0 {
|
||||
LogBase(fmt.Sprintf("配置: %s", strings.Join(customConfigs, " ")))
|
||||
}
|
||||
|
||||
// 3. 凭据信息(合并为一行)
|
||||
if config.Credentials != nil {
|
||||
var credParts []string
|
||||
if len(config.Credentials.Usernames) > 0 {
|
||||
credParts = append(credParts, fmt.Sprintf("%d用户", len(config.Credentials.Usernames)))
|
||||
}
|
||||
if len(config.Credentials.Passwords) > 0 {
|
||||
credParts = append(credParts, fmt.Sprintf("%d密码", len(config.Credentials.Passwords)))
|
||||
}
|
||||
if len(config.Credentials.HashValues) > 0 {
|
||||
credParts = append(credParts, fmt.Sprintf("%d哈希", len(config.Credentials.HashValues)))
|
||||
}
|
||||
if len(credParts) > 0 {
|
||||
LogBase(fmt.Sprintf("凭据: %s", strings.Join(credParts, " ")))
|
||||
}
|
||||
}
|
||||
// 不再输出开局配置信息,减少干扰
|
||||
}
|
||||
|
||||
// logLevelMap 日志级别字符串到级别的映射(支持新旧格式)
|
||||
|
||||
Reference in New Issue
Block a user