This commit is contained in:
影舞者
2022-05-12 17:56:32 +08:00
parent 4915539fb3
commit 11fb239c61
4 changed files with 6 additions and 5 deletions
+4 -2
View File
@@ -11,7 +11,10 @@ func ParsePort(ports string) (scanPorts []int) {
}
slices := strings.Split(ports, ",")
for _, port := range slices {
port = strings.Trim(port, " ")
port = strings.TrimSpace(port)
if port == "" {
continue
}
upper := port
if strings.Contains(port, "-") {
ranges := strings.Split(port, "-")
@@ -28,7 +31,6 @@ func ParsePort(ports string) (scanPorts []int) {
port = ranges[1]
upper = ranges[0]
}
}
start, _ := strconv.Atoi(port)
end, _ := strconv.Atoi(upper)