Projects STRLCPY metabigor Commits 1bd0279e
🤬
  • ■ ■ ■ ■ ■ ■
    cmd/net.go
    skipped 11 lines
    12 12   "github.com/thoas/go-funk"
    13 13  )
    14 14   
    15  -var netCmd *cobra.Command
    16  - 
    17 15  func init() {
    18  - // byeCmd represents the bye command
    19 16   var netCmd = &cobra.Command{
    20 17   Use: "net",
    21 18   Short: "Discover Network Inforamtion about targets",
    skipped 3 lines
    25 22   
    26 23   netCmd.Flags().Bool("asn", false, "Take input as ASN")
    27 24   netCmd.Flags().Bool("org", false, "Take input as Organization")
     25 + netCmd.Flags().BoolP("accurate", "x", false, "Only get from highly trusted source")
     26 + 
    28 27   RootCmd.AddCommand(netCmd)
    29 28  }
    30 29   
    31  -func runNet(cmd *cobra.Command, args []string) error {
     30 +func runNet(cmd *cobra.Command, _ []string) error {
    32 31   asn, _ := cmd.Flags().GetBool("asn")
    33 32   org, _ := cmd.Flags().GetBool("org")
     33 + options.Net.Optimize, _ = cmd.Flags().GetBool("accurate")
     34 + 
    34 35   var inputs []string
    35 36   
    36 37   if options.Input == "-" || options.Input == "" {
    skipped 71 lines
    108 109   data = append(data, modules.OrgBgpDotNet(options)...)
    109 110   wg.Done()
    110 111   }()
    111  - wg.Add(1)
    112  - go func() {
    113  - data = append(data, modules.ASNLookup(options)...)
    114  - wg.Done()
    115  - }()
     112 + 
     113 + // disable when enable trusted source
     114 + if !options.Net.Optimize {
     115 + wg.Add(1)
     116 + go func() {
     117 + data = append(data, modules.ASNLookup(options)...)
     118 + wg.Done()
     119 + }()
     120 + }
    116 121   wg.Wait()
    117 122   
    118 123   var cidrs []string
    skipped 29 lines
  • ■ ■ ■ ■ ■ ■
    cmd/root.go
    skipped 16 lines
    17 17   port string
    18 18  }
    19 19   
    20  -// RootCmd represents the base command when called without any subcommands
    21 20  var RootCmd = &cobra.Command{
    22 21   Use: "metabigor",
    23  - Short: "Metabigor",
     22 + Short: "metabigor",
    24 23   Long: fmt.Sprintf(`Metabigor - Intelligence Tool but without API key - %v by %v`, core.VERSION, core.AUTHOR),
    25 24  }
    26 25   
    skipped 49 lines
    76 75   options.Input = core.GetFileContent(options.Input)
    77 76   }
    78 77   }
     78 + 
     79 + 
     80 + core.InforF("Metabigor %v by %v", core.VERSION, core.AUTHOR)
     81 + core.InforF(fmt.Sprintf("Store log file to: %v", options.LogFile))
    79 82  }
    80 83   
  • ■ ■ ■ ■ ■
    cmd/scan.go
    skipped 11 lines
    12 12   "github.com/spf13/cobra"
    13 13  )
    14 14   
    15  -var scanCmd *cobra.Command
    16 15   
    17 16  func init() {
    18  - // byeCmd represents the bye command
    19 17   var scanCmd = &cobra.Command{
    20 18   Use: "scan",
    21 19   Short: "Wrapper to run scan from input",
    skipped 16 lines
    38 36   
    39 37  }
    40 38   
    41  -func runScan(cmd *cobra.Command, args []string) error {
     39 +func runScan(cmd *cobra.Command, _ []string) error {
    42 40   options.Scan.NmapScripts, _ = cmd.Flags().GetString("script")
    43 41   options.Scan.GrepString, _ = cmd.Flags().GetString("grep")
    44 42   options.Scan.Ports, _ = cmd.Flags().GetString("ports")
    skipped 151 lines
  • ■ ■ ■ ■ ■ ■
    cmd/search.go
    skipped 10 lines
    11 11   "github.com/spf13/cobra"
    12 12  )
    13 13   
    14  -var searchCmd *cobra.Command
    15 14   
    16 15  func init() {
    17  - // byeCmd represents the bye command
    18 16   var searchCmd = &cobra.Command{
    19 17   Use: "search",
    20 18   Short: "Do Search on popular search engine",
    skipped 2 lines
    23 21   }
    24 22   
    25 23   searchCmd.Flags().StringP("source", "s", "fofa", "Search Engine")
    26  - searchCmd.Flags().StringSliceP("query", "q", []string{}, "Query to search")
     24 + searchCmd.Flags().StringSliceP("query", "q", []string{}, "Query to search (Multiple -q flags are accepted)")
    27 25   searchCmd.Flags().BoolP("brute", "b", false, "Enable Brute Force")
    28 26   searchCmd.Flags().BoolP("optimize", "x", false, "Enable Optimize Query")
    29 27   RootCmd.AddCommand(searchCmd)
    30 28  }
    31 29   
    32  -func runSearch(cmd *cobra.Command, args []string) error {
     30 +func runSearch(cmd *cobra.Command, _ []string) error {
    33 31   options.Search.Source, _ = cmd.Flags().GetString("source")
    34 32   options.Search.Source = strings.ToLower(options.Search.Source)
    35 33   options.Search.More, _ = cmd.Flags().GetBool("brute")
    36 34   options.Search.Optimize, _ = cmd.Flags().GetBool("optimize")
    37  - 
    38 35   queries, _ := cmd.Flags().GetStringSlice("query")
    39 36   
    40 37   var inputs []string
    skipped 86 lines
  • ■ ■ ■ ■ ■ ■
    core/common.go
    skipped 23 lines
    24 24   if !FolderExists(logDir) {
    25 25   os.MkdirAll(logDir, 0755)
    26 26   }
    27  - logFile := path.Join(logDir, "metabigor.log")
    28  - f, err := os.OpenFile(logFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
     27 + options.LogFile = path.Join(logDir, "metabigor.log")
     28 + f, err := os.OpenFile(options.LogFile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
    29 29   if err != nil {
    30 30   logger.Error("error opening file: %v", err)
    31 31   }
    32 32   
    33  - // defer f.Close()
    34 33   mwr := io.MultiWriter(os.Stdout, f)
    35 34   
    36 35   logger.SetLevel(logrus.InfoLevel)
    skipped 16 lines
    53 52   } else {
    54 53   logger.SetOutput(ioutil.Discard)
    55 54   }
    56  - 
    57  - InforF("Metabigor %v by %v", VERSION, AUTHOR)
    58  - logger.Info(fmt.Sprintf("Store log file to: %v", logFile))
    59 55  }
    60 56   
    61 57  // GoodF print good message
    skipped 33 lines
  • ■ ■ ■ ■ ■ ■
    core/options.go
    skipped 5 lines
    6 6   Output string
    7 7   TmpOutput string
    8 8   ConfigFile string
     9 + LogFile string
    9 10   Proxy string
    10 11   
    11 12   Concurrency int
    skipped 2 lines
    14 15   Timeout int
    15 16   Verbose bool
    16 17   Debug bool
    17  - Scan ScanOptions
    18  - Net NetOptions
    19  - Search SearchOptions
     18 + Scan ScanOptions
     19 + Net NetOptions
     20 + Search SearchOptions
    20 21  }
    21 22   
    22 23  // ScanOptions options for net command
    skipped 10 lines
    33 34   
    34 35  // NetOptions options for net command
    35 36  type NetOptions struct {
    36  - Asn string
    37  - Org string
     37 + Asn string
     38 + Org string
     39 + Optimize bool
    38 40  }
    39 41   
    40 42  // SearchOptions options for net command
    skipped 26 lines
  • ■ ■ ■ ■
    core/version.go
    skipped 1 lines
    2 2   
    3 3  const (
    4 4   // VERSION current Metabigor version
    5  - VERSION = "beta v1.2"
     5 + VERSION = "beta v1.3"
    6 6   // AUTHOR author of this
    7 7   AUTHOR = "@j3ssiejjj"
    8 8  )
    skipped 1 lines
Please wait...
Page is in error, reload to recover