mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
Disable default global scan timeout
This commit is contained in:
+1
-1
@@ -110,7 +110,7 @@ func Flag(Info *HostInfo) error {
|
||||
flag.IntVar(&fv.ThreadNum, "t", 600, i18n.GetText("flag_thread_num"))
|
||||
flag.Int64Var(&fv.TimeoutSec, "time", 3, i18n.GetText("flag_timeout"))
|
||||
flag.IntVar(&fv.ModuleThreadNum, "mt", 20, i18n.GetText("flag_module_thread_num"))
|
||||
flag.Int64Var(&fv.GlobalTimeout, "gt", 180, i18n.GetText("flag_global_timeout"))
|
||||
flag.Int64Var(&fv.GlobalTimeout, "gt", 0, 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"))
|
||||
|
||||
+4
-1
@@ -34,7 +34,7 @@ func TestBuildConfigFromFlags_ScanControl(t *testing.T) {
|
||||
ThreadNum: 600,
|
||||
ModuleThreadNum: 20,
|
||||
TimeoutSec: 3,
|
||||
GlobalTimeout: 180,
|
||||
GlobalTimeout: 0,
|
||||
},
|
||||
validate: func(t *testing.T, cfg *Config) {
|
||||
if cfg.Mode != "all" {
|
||||
@@ -49,6 +49,9 @@ func TestBuildConfigFromFlags_ScanControl(t *testing.T) {
|
||||
if cfg.Timeout != 3*time.Second {
|
||||
t.Errorf("Timeout = %v, want %v", cfg.Timeout, 3*time.Second)
|
||||
}
|
||||
if cfg.GlobalTimeout != 0 {
|
||||
t.Errorf("GlobalTimeout = %v, want disabled", cfg.GlobalTimeout)
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -25,9 +25,7 @@ flag_timeout:
|
||||
flag_module_thread_num:
|
||||
other: "Module thread count"
|
||||
flag_global_timeout:
|
||||
other: "Global timeout"
|
||||
global_timeout_adjusted:
|
||||
other: "Large scan detected, global timeout adjusted from {{.V0}}s to {{.V1}}s (use -gt to override)"
|
||||
other: "Global timeout in seconds (0 means unlimited)"
|
||||
global_timeout_exceeded:
|
||||
other: "Global timeout reached (-gt {{.V0}}s), scan aborted. Use -gt to increase or set to 0 to disable"
|
||||
flag_disable_ping:
|
||||
|
||||
@@ -25,9 +25,7 @@ flag_timeout:
|
||||
flag_module_thread_num:
|
||||
other: "模块线程数"
|
||||
flag_global_timeout:
|
||||
other: "全局超时时间"
|
||||
global_timeout_adjusted:
|
||||
other: "扫描规模较大,全局超时从 {{.V0}}s 自动调整为 {{.V1}}s(可用 -gt 手动指定)"
|
||||
other: "全局超时时间(秒,0 表示不限制)"
|
||||
global_timeout_exceeded:
|
||||
other: "全局超时已到(-gt {{.V0}}s),扫描被终止。大规模扫描请用 -gt 调大超时或设为 0 禁用"
|
||||
flag_disable_ping:
|
||||
|
||||
Reference in New Issue
Block a user