fix: 移除误导性的"无可用插件"日志 #588

扫描开始前的插件预检基于端口列表静态匹配,不代表实际扫描中插件
不会执行。移除"无可用插件"提示,避免用户误以为插件未工作。
This commit is contained in:
ZacharyZcR
2026-06-14 22:23:46 +08:00
parent 800cc30794
commit 5c251b123d
2 changed files with 17 additions and 23 deletions
+13 -5
View File
@@ -4,7 +4,9 @@ import (
"bufio"
"encoding/json"
"fmt"
"net"
"os"
"strconv"
"strings"
"sync"
)
@@ -132,13 +134,19 @@ func toInt(v interface{}) (int, bool) {
}
func splitHostPort(target string) (string, int, bool) {
idx := strings.LastIndex(target, ":")
if idx < 0 {
host, portText, err := net.SplitHostPort(target)
if err != nil {
if strings.Count(target, ":") != 1 {
return "", 0, false
}
parts := strings.SplitN(target, ":", 2)
host, portText = parts[0], parts[1]
}
port, err := strconv.Atoi(portText)
if err != nil {
return "", 0, false
}
host := target[:idx]
var port int
if _, err := fmt.Sscanf(target[idx+1:], "%d", &port); err != nil {
if host == "" || port < 1 || port > 65535 {
return "", 0, false
}
return host, port, true