mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-26 21:21:53 +08:00
fix(scan): 修复 -hf 参数无法单独使用的问题
This commit is contained in:
@@ -54,8 +54,9 @@ func (s *AliveScanStrategy) Description() string {
|
|||||||
|
|
||||||
// Execute 执行存活探测扫描策略
|
// Execute 执行存活探测扫描策略
|
||||||
func (s *AliveScanStrategy) Execute(config *common.Config, state *common.State, info common.HostInfo, ch chan struct{}, wg *sync.WaitGroup) {
|
func (s *AliveScanStrategy) Execute(config *common.Config, state *common.State, info common.HostInfo, ch chan struct{}, wg *sync.WaitGroup) {
|
||||||
// 验证扫描目标
|
// 验证扫描目标(需要同时检查 -h 和 -hf 参数)
|
||||||
if info.Host == "" {
|
fv := common.GetFlagVars()
|
||||||
|
if info.Host == "" && fv.HostsFile == "" {
|
||||||
common.LogError(i18n.GetText("parse_error_target_empty"))
|
common.LogError(i18n.GetText("parse_error_target_empty"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,8 +113,9 @@ func (s *ServiceScanStrategy) Description() string {
|
|||||||
|
|
||||||
// Execute 执行服务扫描策略
|
// Execute 执行服务扫描策略
|
||||||
func (s *ServiceScanStrategy) Execute(config *common.Config, state *common.State, info common.HostInfo, ch chan struct{}, wg *sync.WaitGroup) {
|
func (s *ServiceScanStrategy) Execute(config *common.Config, state *common.State, info common.HostInfo, ch chan struct{}, wg *sync.WaitGroup) {
|
||||||
// 验证扫描目标
|
// 验证扫描目标(需要同时检查 -h 和 -hf 参数)
|
||||||
if info.Host == "" {
|
fv := common.GetFlagVars()
|
||||||
|
if info.Host == "" && fv.HostsFile == "" {
|
||||||
common.LogError(i18n.GetText("parse_error_target_empty"))
|
common.LogError(i18n.GetText("parse_error_target_empty"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user