mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-26 13:11:53 +08:00
添加功能,跳过某些ip扫描,-hn 192.168.1.1/24
This commit is contained in:
+5
-3
@@ -5,8 +5,10 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func ParsePort(ports string) []int {
|
||||
var scanPorts []int
|
||||
func ParsePort(ports string) (scanPorts []int) {
|
||||
if ports == "" {
|
||||
return
|
||||
}
|
||||
slices := strings.Split(ports, ",")
|
||||
for _, port := range slices {
|
||||
port = strings.Trim(port, " ")
|
||||
@@ -39,7 +41,7 @@ func ParsePort(ports string) []int {
|
||||
}
|
||||
|
||||
func removeDuplicate(old []int) []int {
|
||||
result := make([]int, 0, len(old))
|
||||
result := []int{}
|
||||
temp := map[int]struct{}{}
|
||||
for _, item := range old {
|
||||
if _, ok := temp[item]; !ok {
|
||||
|
||||
Reference in New Issue
Block a user