Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option no-stdin #1213

Merged
merged 1 commit into from
Jun 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ type ScanOptions struct {
Hashes string
Screenshot bool
UseInstalledChrome bool
DisableStdini bool
}

func (s *ScanOptions) Clone() *ScanOptions {
Expand Down Expand Up @@ -268,6 +269,7 @@ type Options struct {
NoDecode bool
Screenshot bool
UseInstalledChrome bool
DisableStdin bool
}

// ParseOptions parses the command line options for application
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down