feat: 添加 -nsp 参数禁用网段预筛

大规模扫描时 probeSubnets 会自动跳过空 /24 网段,
部分场景下用户需要关闭此优化以扫描全部目标。
新增 -nsp (no subnet probe) 参数控制。
This commit is contained in:
ZacharyZcR
2026-06-27 16:23:51 +08:00
parent ed2f947722
commit 4976cb1f6b
9 changed files with 20 additions and 7 deletions
+3 -1
View File
@@ -32,6 +32,7 @@ type Config struct {
DisableBrute bool // 禁用暴力破解
DisablePing bool // 禁用Ping检测
DisableTcpProbe bool // 禁用TCP补充探测
DisableSubnetProbe bool // 禁用网段预筛
// 扫描模式
Mode string // 扫描模式
@@ -200,7 +201,8 @@ func NewConfig() *Config {
ModuleThreadNum: 10,
DisableBrute: false,
DisablePing: false,
DisableTcpProbe: false,
DisableTcpProbe: false,
DisableSubnetProbe: false,
// 扫描模式
Mode: DefaultScanMode,
+1
View File
@@ -113,6 +113,7 @@ func Flag(Info *HostInfo) error {
flag.Int64Var(&fv.GlobalTimeout, "gt", 180, i18n.GetText("flag_global_timeout"))
flag.BoolVar(&fv.DisablePing, "np", false, i18n.GetText("flag_disable_ping"))
flag.BoolVar(&fv.DisableTcpProbe, "ntp", false, i18n.GetText("flag_disable_tcp_probe"))
flag.BoolVar(&fv.DisableSubnetProbe, "nsp", false, i18n.GetText("flag_disable_subnet_probe"))
flag.StringVar(&fv.LocalPlugin, "local", "", i18n.GetText("flag_local_plugin"))
flag.BoolVar(&fv.AliveOnly, "ao", false, i18n.GetText("flag_alive_only"))
+2
View File
@@ -41,6 +41,7 @@ type FlagVars struct {
GlobalTimeout int64
DisablePing bool
DisableTcpProbe bool
DisableSubnetProbe bool
LocalPlugin string
AliveOnly bool
DisableBrute bool
@@ -150,6 +151,7 @@ func BuildConfigFromFlags(fv *FlagVars) *Config {
DisableBrute: fv.DisableBrute,
DisablePing: fv.DisablePing,
DisableTcpProbe: fv.DisableTcpProbe,
DisableSubnetProbe: fv.DisableSubnetProbe,
// 扫描模式
Mode: fv.ScanMode,
+2
View File
@@ -30,6 +30,8 @@ flag_disable_ping:
other: "Disable ping detection"
flag_disable_tcp_probe:
other: "Disable TCP supplementary probe"
flag_disable_subnet_probe:
other: "Disable subnet pre-filter (optimization that skips empty /24 subnets in large scans)"
flag_local_plugin:
other: "Specify local plugin name (e.g.: cleaner, systeminfo, keylogger)"
flag_debug:
+2
View File
@@ -30,6 +30,8 @@ flag_disable_ping:
other: "禁用ping探测"
flag_disable_tcp_probe:
other: "禁用TCP补充探测"
flag_disable_subnet_probe:
other: "禁用网段预筛(大规模扫描时跳过空 /24 网段的优化)"
flag_local_plugin:
other: "指定本地插件名称 (如: cleaner, systeminfo, keylogger 等)"
flag_debug: