chore: cleanup unused code

This commit is contained in:
David Allen 2025-04-23 18:30:36 -06:00
parent 1b173a8339
commit 1d9dbe7b7f
Signed by: towk
GPG key ID: 0430CDBE22619155

View file

@ -79,18 +79,8 @@ var ScanCmd = &cobra.Command{
// format and combine flag and positional args // format and combine flag and positional args
targetHosts = append(targetHosts, urlx.FormatHosts(args, ports, scheme, verbose)...) 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 { 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 // generate a slice of all hosts to scan from subnets
subnetHosts := magellan.GenerateHostsWithSubnet(subnet, &subnetMask, ports, scheme) subnetHosts := magellan.GenerateHostsWithSubnet(subnet, &subnetMask, ports, scheme)
targetHosts = append(targetHosts, subnetHosts...) targetHosts = append(targetHosts, subnetHosts...)
@ -180,8 +170,6 @@ var ScanCmd = &cobra.Command{
} }
func init() { 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().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(&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')") ScanCmd.Flags().StringVar(&protocol, "protocol", "tcp", "Set the default protocol to use in scan. (default is 'tcp')")