mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-26 21:21:53 +08:00
Harden scan robustness and tests
This commit is contained in:
@@ -200,11 +200,14 @@ func parsePortRange(rangeStr string) []int {
|
||||
// expandPortGroups 展开端口组
|
||||
func expandPortGroups(ports string) string {
|
||||
portGroups := config.GetPortGroups()
|
||||
result := ports
|
||||
for group, portList := range portGroups {
|
||||
result = strings.ReplaceAll(result, group, portList)
|
||||
parts := strings.Split(ports, ",")
|
||||
for i, part := range parts {
|
||||
token := strings.TrimSpace(part)
|
||||
if portList, ok := portGroups[token]; ok {
|
||||
parts[i] = portList
|
||||
}
|
||||
}
|
||||
return result
|
||||
return strings.Join(parts, ",")
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user