diff --git a/cmd/scan.go b/cmd/scan.go index 5bdbcff..164e20d 100644 --- a/cmd/scan.go +++ b/cmd/scan.go @@ -79,18 +79,8 @@ var ScanCmd = &cobra.Command{ // format and combine flag and positional args targetHosts = append(targetHosts, urlx.FormatHosts(args, ports, scheme, verbose)...) - targetHosts = append(targetHosts, urlx.FormatHosts(hosts, ports, scheme, verbose)...) - // add more hosts specified with `--subnet` flag - if debug { - log.Debug().Msg("adding hosts from subnets") - } for _, subnet := range subnets { - // subnet string is empty so nothing to do here - if subnet == "" { - continue - } - // generate a slice of all hosts to scan from subnets subnetHosts := magellan.GenerateHostsWithSubnet(subnet, &subnetMask, ports, scheme) targetHosts = append(targetHosts, subnetHosts...) @@ -180,8 +170,6 @@ var ScanCmd = &cobra.Command{ } func init() { - // scanCmd.Flags().StringSliceVar(&hosts, "host", []string{}, "set additional hosts to scan") - ScanCmd.Flags().StringSliceVar(&hosts, "host", nil, "Add individual hosts to scan. (example: https://my.bmc.com:5000; same as using positional args)") ScanCmd.Flags().IntSliceVar(&ports, "port", nil, "Adds additional ports to scan for each host with unspecified ports.") ScanCmd.Flags().StringVar(&scheme, "scheme", "https", "Set the default scheme to use if not specified in host URI. (default is 'https')") ScanCmd.Flags().StringVar(&protocol, "protocol", "tcp", "Set the default protocol to use in scan. (default is 'tcp')")