Projects STRLCPY csprecon Commits 63935fe9
🤬
  • ■ ■ ■ ■ ■ ■
    go.sum
    skipped 7 lines
    8 8  github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
    9 9  github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
    10 10  github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
    11  -github.com/edoardottt/golazy v0.1.2-dev h1:P2MEUKVKJi42DPihjmjddinw2oALmGa6c20K1aouTNA=
    12  -github.com/edoardottt/golazy v0.1.2-dev/go.mod h1:uZRa3TRYvQSxmbAc7O9+3RelkMu+ACbKiUoy+uPsGVM=
    13 11  github.com/edoardottt/golazy v0.1.3-dev h1:RRnMtrc1Z5xkFXOfsXQNTN7qwmjcLZw49li7Bn5xWVA=
    14 12  github.com/edoardottt/golazy v0.1.3-dev/go.mod h1:uZRa3TRYvQSxmbAc7O9+3RelkMu+ACbKiUoy+uPsGVM=
    15 13  github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
    skipped 61 lines
  • ■ ■ ■ ■ ■
    pkg/input/flags.go
    skipped 1 lines
    2 2   
    3 3  import (
    4 4   "io"
     5 + "os"
     6 + "strings"
    5 7   
    6 8   "github.com/edoardottt/csprecon/pkg/output"
    7 9   "github.com/projectdiscovery/goflags"
    skipped 36 lines
    44 46   
    45 47   // Input
    46 48   flagSet.CreateGroup("input", "Input",
    47  - flagSet.StringVar(&options.Input, "u", "", `Input domain`),
    48  - flagSet.StringVar(&options.FileInput, "l", "", `File containing input domains`),
     49 + flagSet.StringVarP(&options.Input, "url", "u", "", `Input domain`),
     50 + flagSet.StringVarP(&options.FileInput, "list", "l", "", `File containing input domains`),
    49 51   )
    50 52   
    51 53   flagSet.CreateGroup("configs", "Configurations",
    52  - flagSet.StringSliceVar(&options.Domain, "d", nil, `Filter results belonging to these domains (comma separated)`, goflags.CommaSeparatedStringSliceOptions),
    53  - flagSet.IntVar(&options.Concurrency, "c", DefaultConcurrency, `Concurrency level`),
    54  - flagSet.IntVar(&options.Timeout, "t", DefaultTimeout, `Connection timeout in seconds`),
     54 + flagSet.StringSliceVarP(&options.Domain, "domain", "d", nil, `Filter results belonging to these domains (comma separated)`, goflags.CommaSeparatedStringSliceOptions),
     55 + flagSet.IntVarP(&options.Concurrency, "concurrency", "c", DefaultConcurrency, `Concurrency level`),
     56 + flagSet.IntVarP(&options.Timeout, "timeout", "t", DefaultTimeout, `Connection timeout in seconds`),
    55 57   )
    56 58   
    57 59   // Output
    58 60   flagSet.CreateGroup("output", "Output",
    59  - flagSet.StringVar(&options.FileOutput, "o", "", `File to write output results`),
    60  - flagSet.BoolVar(&options.Verbose, "v", false, `Verbose output`),
    61  - flagSet.BoolVar(&options.Silent, "s", false, `Print only results`),
     61 + flagSet.StringVarP(&options.FileOutput, "output", "o", "", `File to write output results`),
     62 + flagSet.BoolVarP(&options.Verbose, "verbose", "v", false, `Verbose output`),
     63 + flagSet.BoolVarP(&options.Silent, "silent", "s", false, `Silent output. Print only results`),
    62 64   )
    63 65   
    64  - if !options.Silent {
     66 + if help() || noArgs() {
    65 67   output.ShowBanner()
    66 68   }
    67 69   
    skipped 9 lines
    77 79   gologger.Fatal().Msgf("%s\n", err)
    78 80   }
    79 81   
     82 + output.ShowBanner()
     83 + 
    80 84   return options
    81 85  }
    82 86   
     87 +func help() bool {
     88 + // help usage asked by user.
     89 + for _, arg := range os.Args {
     90 + argStripped := strings.Trim(arg, "-")
     91 + if argStripped == "h" || argStripped == "help" {
     92 + return true
     93 + }
     94 + }
     95 + 
     96 + return false
     97 +}
     98 + 
     99 +func noArgs() bool {
     100 + // User passed no flag.
     101 + return len(os.Args) < 2
     102 +}
     103 + 
Please wait...
Page is in error, reload to recover