Projects STRLCPY metabigor Commits dbbcba3c
🤬
  • ■ ■ ■ ■ ■
    README.md
    skipped 36 lines
    37 37  # Only run masscan full ports
    38 38  echo '1.2.3.4/24' | metabigor scan -o result.txt
    39 39   
    40  -# Only run nmap detail scan
     40 +# Only run nmap detail scan based on pre-scan data
    41 41  echo '1.2.3.4:21' | metabigor scan -s -c 10
    42 42  echo '1.2.3.4:21' | metabigor scan --tmp /tmp/raw-result/ -s -o result.txt
     43 +echo '1.2.3.4 -> [80,443,2222]' | metabigor scan -R
    43 44   
    44 45  # Only run scan with zmap
    45 46  cat ranges.txt | metabigor scan -p '443,80' -z
    skipped 33 lines
  • ■ ■ ■ ■ ■
    cmd/root.go
    skipped 99 lines
    100 100  # Only run masscan full ports
    101 101  echo '1.2.3.4/24' | metabigor scan -o result.txt
    102 102   
    103  -# Only run nmap detail scan
     103 +# Only run nmap detail scan based on pre-scan data
    104 104  echo '1.2.3.4:21' | metabigor scan -s
    105 105  cat list_of_ip_with_port.txt | metabigor scan -c 10 --8 -s -o result.txt
    106 106  cat list_of_ip_with_port.txt | metabigor scan -c 10 --tmp /tmp/raw-result/ -s -o result.txt
     107 +echo '1.2.3.4 -> [80,443,2222]' | metabigor scan -R
    107 108   
    108 109  # Only run scan with zmap
    109 110  cat ranges.txt | metabigor scan -p '443,80' -z
    skipped 11 lines
  • ■ ■ ■ ■ ■
    cmd/scan.go
    skipped 28 lines
    29 29   scanCmd.Flags().BoolVarP(&options.Scan.NmapOverview, "nmap", "n", false, "Use nmap instead of masscan for overview scan")
    30 30   scanCmd.Flags().BoolVarP(&options.Scan.ZmapOverview, "zmap", "z", false, "Only scan range with zmap")
    31 31   scanCmd.Flags().BoolVarP(&options.Scan.SkipOverview, "skip-masscan", "s", false, "run nmap from input format like this: 1.2.3.4:443")
     32 + scanCmd.Flags().BoolVarP(&options.Scan.InputFromRustScan, "rstd", "R", false, "run nmap from rustscan input format like: 1.2.3.4 -> [80,443,8080,8443,8880]")
    32 33   // more nmap options
    33 34   scanCmd.Flags().StringVarP(&options.Scan.NmapScripts, "script", "S", "", "nmap scripts")
    34  - scanCmd.Flags().StringVar(&options.Scan.NmapTemplate, "nmap-command", "nmap -sSV -p {{.ports}} {{.input}} {{.script}} -T4 --open -oA {{.output}}", "Nmap template command to run")
     35 + scanCmd.Flags().StringVar(&options.Scan.NmapTemplate, "nmap-command", "nmap -sSV -sC -p {{.ports}} {{.input}} {{.script}} -T4 --open -oA {{.output}}", "Nmap template command to run")
    35 36   scanCmd.Flags().StringVar(&options.Scan.GrepString, "grep", "", "match string to confirm script success")
    36  - scanCmd.Flags().StringP("result-folder", "R", "", "Result folder")
     37 + scanCmd.Flags().String("result-folder", "", "Result folder")
    37 38   scanCmd.Flags().BoolVar(&options.Scan.IPv4, "4", true, "Filter input to only get ipv4")
    38 39   scanCmd.Flags().BoolVar(&options.Scan.Skip80And443, "8", false, "Skip ports 80 and 443. Useful when you want to look for service behind the list of pre-scanned data")
    39 40   //scanCmd.Flags().Bool("6", false, "Filter input to only get ipv4")
    skipped 10 lines
    50 51   if resultFolder != "" {
    51 52   parseResult(resultFolder, options)
    52 53   os.Exit(0)
     54 + }
     55 + 
     56 + if options.Scan.InputFromRustScan {
     57 + options.Scan.SkipOverview = true
    53 58   }
    54 59   
    55 60   if options.Input == "-" || options.Input == "" {
    skipped 139 lines
    195 200  }
    196 201   
    197 202  func directDetail(input string, options core.Options) []string {
     203 + var out []string
    198 204   if options.Scan.Skip80And443 {
    199 205   if strings.HasSuffix(input, ":80") && strings.HasSuffix(input, ":443") {
    200  - return []string{}
     206 + return out
    201 207   }
    202 208   }
    203 209   
    204 210   if input == "" {
    205  - return []string{}
     211 + return out
    206 212   }
    207  - if len(strings.Split(input, ":")) == 1 {
    208  - return []string{}
     213 + var host, ports string
     214 + 
     215 + if options.Scan.InputFromRustScan {
     216 + // 1.1.1.1 -> [80,443,2095,2096,8080,8443,8880]
     217 + if !strings.Contains(input, "->") {
     218 + return out
     219 + }
     220 + host = strings.Split(input, " -> ")[0]
     221 + ports = strings.Split(input, " -> ")[1]
     222 + ports = strings.TrimLeft(strings.TrimRight(ports, "]"), "[")
     223 + } else {
     224 + if len(strings.Split(input, ":")) == 1 {
     225 + return out
     226 + }
     227 + host = strings.Split(input, ":")[0]
     228 + ports = strings.Split(input, ":")[1]
    209 229   }
    210  - host := strings.Split(input, ":")[0]
    211  - ports := strings.Split(input, ":")[1]
     230 + 
    212 231   core.BannerF("Run detail scan on: ", fmt.Sprintf("%v:%v", host, ports))
    213  - return modules.RunNmap(host, ports, options)
     232 + out = modules.RunNmap(host, ports, options)
     233 + return out
    214 234  }
    215 235   
    216 236  // only parse result
    skipped 72 lines
  • ■ ■ ■ ■ ■ ■
    core/options.go
    skipped 31 lines
    32 32   
    33 33  // ScanOptions options for net command
    34 34  type ScanOptions struct {
    35  - Ports string
    36  - Rate string
    37  - NmapTemplate string
    38  - NmapOverview bool
    39  - ZmapOverview bool
    40  - Detail bool
    41  - Flat bool
    42  - All bool
    43  - IPv4 bool
    44  - IPv6 bool
    45  - Skip80And443 bool
    46  - SkipOverview bool
    47  - TmpOutput string
    48  - NmapScripts string
    49  - GrepString string
    50  - InputFile string
     35 + Ports string
     36 + Rate string
     37 + NmapTemplate string
     38 + NmapOverview bool
     39 + ZmapOverview bool
     40 + Detail bool
     41 + Flat bool
     42 + All bool
     43 + IPv4 bool
     44 + IPv6 bool
     45 + Skip80And443 bool
     46 + SkipOverview bool
     47 + InputFromRustScan bool
     48 + TmpOutput string
     49 + NmapScripts string
     50 + GrepString string
     51 + InputFile string
    51 52  }
    52 53   
    53 54  // NetOptions options for net command
    skipped 54 lines
  • ■ ■ ■ ■
    core/version.go
    skipped 1 lines
    2 2   
    3 3  const (
    4 4   // VERSION current Metabigor version
    5  - VERSION = "beta v1.9"
     5 + VERSION = "beta v1.10"
    6 6   // AUTHOR author of this
    7 7   AUTHOR = "@j3ssiejjj"
    8 8  )
    skipped 1 lines
Please wait...
Page is in error, reload to recover