Projects STRLCPY metabigor Commits 39748235
🤬
  • ■ ■ ■ ■ ■
    cmd/scan.go
    skipped 21 lines
    22 22   }
    23 23   // scan options
    24 24   scanCmd.Flags().StringVarP(&options.Scan.Ports, "ports", "p", "0-65535", "Port range for previous command")
    25  - scanCmd.Flags().StringVarP(&options.Scan.Rate, "rate", "r", "3000", "rate limit for masscan command")
     25 + scanCmd.Flags().StringVarP(&options.Scan.Rate, "rate", "r", "3000", "rate limit for rustscan command")
     26 + scanCmd.Flags().StringVar(&options.Scan.Retry, "retry", "", "retry limit for rustscan command")
     27 + scanCmd.Flags().StringVar(&options.Scan.Timeout, "timeout", "", "timeout for rustscan command")
    26 28   scanCmd.Flags().BoolVarP(&options.Scan.All, "join", "A", false, "Join all inputs to a file first then do a scan")
    27 29   // scan strategy option
    28 30   scanCmd.Flags().BoolVarP(&options.Scan.Flat, "flat", "f", true, "format output like this: 1.2.3.4:443")
    skipped 269 lines
  • ■ ■ ■ ■ ■ ■
    core/options.go
    skipped 44 lines
    45 45  type ScanOptions struct {
    46 46   Ports string
    47 47   Rate string
     48 + Retry string
     49 + Timeout string
    48 50   NmapTemplate string
    49 51   NmapOverview bool
    50 52   ZmapOverview bool
    skipped 77 lines
  • ■ ■ ■ ■ ■ ■
    modules/scan.go
    skipped 40 lines
    41 41   if strings.Contains(options.Scan.Ports, ",") || !strings.Contains(options.Scan.Ports, "-") {
    42 42   ports = fmt.Sprintf("--ports %v", options.Scan.Ports)
    43 43   }
    44  - rustscanCmd := fmt.Sprintf("rustscan --timeout 3000 -b %v --scripts None %v -a %v -g >> %v", options.Scan.Rate, ports, input, tmpOutput)
     44 + 
     45 + prefix := fmt.Sprintf("rustscan -b %v", options.Scan.Rate)
     46 + if options.Scan.Timeout != "" {
     47 + prefix += fmt.Sprintf(" --timeout %v", options.Scan.Timeout)
     48 + } else {
     49 + prefix += " --timeout 3000 "
     50 + }
     51 + if options.Scan.Retry != "" {
     52 + prefix += fmt.Sprintf(" --tries %v", options.Scan.Retry)
     53 + }
     54 + 
     55 + rustscanCmd := fmt.Sprintf("%v %v --scripts None -a %v -g >> %v", prefix, ports, input, tmpOutput)
    45 56   runOSCommand(rustscanCmd)
    46 57   
    47 58   core.InforF("Parsing result from: %v", tmpOutput)
    skipped 261 lines
Please wait...
Page is in error, reload to recover