diff --git a/runner/options.go b/runner/options.go index 46dda350..1ef24d3a 100644 --- a/runner/options.go +++ b/runner/options.go @@ -85,6 +85,7 @@ type ScanOptions struct { Hashes string Screenshot bool UseInstalledChrome bool + DisableStdini bool } func (s *ScanOptions) Clone() *ScanOptions { @@ -268,6 +269,7 @@ type Options struct { NoDecode bool Screenshot bool UseInstalledChrome bool + DisableStdin bool } // ParseOptions parses the command line options for application @@ -400,6 +402,7 @@ func ParseOptions() *Options { flagSet.BoolVarP(&options.LeaveDefaultPorts, "leave-default-ports", "ldp", false, "leave default http/https ports in host header (eg. http://host:80 - https://host:443"), flagSet.BoolVar(&options.ZTLS, "ztls", false, "use ztls library with autofallback to standard one for tls13"), flagSet.BoolVar(&options.NoDecode, "no-decode", false, "avoid decoding body"), + flagSet.BoolVar(&options.DisableStdin, "no-stdin", false, "Disable Stdin processing"), ) flagSet.CreateGroup("debug", "Debug", diff --git a/runner/runner.go b/runner/runner.go index 6fa65a88..584a4004 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -360,7 +360,7 @@ func (r *Runner) prepareInput() { numHosts += numTargetsFile } } - if fileutil.HasStdin() { + if !r.options.DisableStdin && fileutil.HasStdin() { numTargetsStdin, err := r.loadAndCloseFile(os.Stdin) if err != nil { gologger.Fatal().Msgf("Could not read input from stdin: %s\n", err)