Add generic multiStringFlag option flag, update usage string
@@ -12,7 +12,7 @@ import (
// the template requesting process.
type Options struct {
Debug bool // Debug mode allows debugging request/responses for the engine
- Templates string // Signature specifies the template/templates to use
+ Templates multiStringFlag // Signature specifies the template/templates to use
Target string // Target is a single URL/Domain to scan usng a template
Targets string // Targets specifies the targets to scan using templates.
Threads int // Thread controls the number of concurrent requests to make.
@@ -33,12 +33,23 @@ type Options struct {
Stdin bool // Stdin specifies whether stdin input was given to the process
}
+type multiStringFlag []string
+
+func (m *multiStringFlag) String() string {
+ return ""
+}
+
+func (m *multiStringFlag) Set(value string) error {
+ *m = append(*m, value)
+ return nil
+}
+
// ParseOptions parses the command line flags provided by a user
func ParseOptions() *Options {
options := &Options{}
flag.StringVar(&options.Target, "target", "", "Target is a single target to scan using template")
- flag.StringVar(&options.Templates, "t", "", "Template input file/files to run on host")
+ flag.Var(&options.Templates, "t","Template input file/files to run on host. Can be used multiple times.")
flag.StringVar(&options.Targets, "l", "", "List of URLs to run templates on")
flag.StringVar(&options.Output, "o", "", "File to write output to (optional)")
flag.StringVar(&options.ProxyURL, "proxy-url", "", "URL of the proxy server")
