Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ArpScanCmd = &cobra.Command{ Use: "arpscan", Short: "netdog: a better dig", Aliases: []string{"as", "arp"}, Long: `arp scan on an interface `, Run: func(cmd *cobra.Command, args []string) { log.SetFormatter(&log.JSONFormatter{DisableTimestamp: true}) log.SetOutput(os.Stdout) vprint.Println(args) all, _ := cmd.PersistentFlags().GetBool("all") timeout, _ := cmd.Flags().GetFloat64("timeout") delay, _ := cmd.Flags().GetFloat64("delay") vprint.Println("Timeout: ", timeout) vprint.Println("Delay: ", delay) if all { arpResults, err := netdog.ScanAllInterfaces(timeout, delay) if err != nil { log.Fatal(err) } log.Println(arpResults) return } if len(args) == 0 { log.Fatal("Must provide an interface name") } interfaceName := args[0] arpResults, err := netdog.ScanInterface(interfaceName, timeout, delay) if err != nil { log.Fatal(err) } vprint.Print(arpResults) return }, }
View Source
var DigCmd = &cobra.Command{ Use: "dig", Short: "netdog: like dig, but fluffier", Long: `Does what it says on the tin. Bare-bone, no-nonsense DNS lookups `, Run: func(cmd *cobra.Command, args []string) { log.SetFormatter(&log.JSONFormatter{}) log.SetOutput(os.Stdout) vprint.Printf("root called") vprint.Println(args) host := args[0] timeout, _ := cmd.Flags().GetFloat64("timeout") vprint.Println(timeout) start := time.Now() addrs, err := netdog.TimeoutLookupHost(host, timeout) if err != nil { log.Fatal(err) } log.WithFields(log.Fields{ "addrs": addrs, "host": host, "elapsed": time.Since(start).Seconds()}, ).Info() }, }
View Source
var RootCmd = &cobra.Command{ Use: "dug", Short: "Dug: a better dig", Long: `Does what it says on the tin. Bare-bone, no-nonsense DNS lookups `, Run: func(cmd *cobra.Command, args []string) { log.SetFormatter(&log.JSONFormatter{}) log.SetOutput(os.Stdout) vprint.Printf("root called") vprint.Print(args) host := args[0] ns, _ := cmd.PersistentFlags().GetString("namespace") timeout, _ := cmd.PersistentFlags().GetFloat64("timeout") vprint.Printf(ns) addrs, err := netdog.TimeoutLookupHost(host, timeout) if err != nil { log.Fatal(err) } log.WithFields(log.Fields{ "addrs": addrs, "host": host}).Info() }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.