mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Made scanned results optional with verbose flag
This commit is contained in:
parent
8c19608966
commit
2289209604
1 changed files with 6 additions and 3 deletions
|
|
@ -58,8 +58,11 @@ var scanCmd = &cobra.Command{
|
||||||
threads = mathutil.Clamp(len(hostsToScan), 1, 255)
|
threads = mathutil.Clamp(len(hostsToScan), 1, 255)
|
||||||
}
|
}
|
||||||
probeStates := magellan.ScanForAssets(hostsToScan, portsToScan, threads, timeout, disableProbing)
|
probeStates := magellan.ScanForAssets(hostsToScan, portsToScan, threads, timeout, disableProbing)
|
||||||
for _, r := range probeStates {
|
if verbose {
|
||||||
fmt.Printf("%s:%d (%s)\n", r.Host, r.Port, r.Protocol)
|
|
||||||
|
for _, r := range probeStates {
|
||||||
|
fmt.Printf("%s:%d (%s)\n", r.Host, r.Port, r.Protocol)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the dbpath dir if needed
|
// make the dbpath dir if needed
|
||||||
|
|
@ -86,6 +89,6 @@ func init() {
|
||||||
viper.BindPFlag("scan.subnets", scanCmd.Flags().Lookup("subnet"))
|
viper.BindPFlag("scan.subnets", scanCmd.Flags().Lookup("subnet"))
|
||||||
viper.BindPFlag("scan.subnet-masks", scanCmd.Flags().Lookup("subnet-mask"))
|
viper.BindPFlag("scan.subnet-masks", scanCmd.Flags().Lookup("subnet-mask"))
|
||||||
viper.BindPFlag("scan.disable-probing", scanCmd.Flags().Lookup("disable-probing"))
|
viper.BindPFlag("scan.disable-probing", scanCmd.Flags().Lookup("disable-probing"))
|
||||||
|
|
||||||
rootCmd.AddCommand(scanCmd)
|
rootCmd.AddCommand(scanCmd)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue