Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rtpt-erikgeiser authored and rtpt-alexanderneumann committed Jul 14, 2023
1 parent 64285f4 commit eb52e06
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions cmd/fuzz/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ Only show responses which contain the pattern "The secret is: " in the response:
--show-pattern 'The secret is: ' \
https://example.com/FUZZ
Load a request from the file 'template.txt', setting the 'User-Agent' header
and replacing the string FUZZ from the file:
Load a request from the file 'template.txt' (note that the HTTP version
specified in the template file is currently ignored), setting the 'User-Agent'
header and replacing the string FUZZ from the file:
monsoon fuzz --range 1-500 \
--template-file template.txt \
Expand Down
6 changes: 4 additions & 2 deletions cmd/fuzz/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ func AddCommand(c *cobra.Command) {
fs.StringSliceVarP(&opts.Range, "range", "r", nil, "set range `from-to`")
fs.StringVar(&opts.RangeFormat, "range-format", "%d", "set `format` for range (when used with --range)")
fs.StringVarP(&opts.Filename, "file", "f", "", "read values from `filename`")
fs.StringArrayVar(&opts.Replace, "replace", []string{}, "add replace var `name:type:options` (valid types: 'file','range', and 'value', e.g. 'FUZZ:range:1-100'), mutually exclusive with --range and --file")
fs.StringArrayVar(&opts.Replace, "replace", []string{}, "add replace var `name:type:options` (valid types: 'file','range', "+
"and 'value', e.g. 'FUZZ:range:1-100'), mutually exclusive with --range and --file")

fs.StringVar(&opts.Logfile, "logfile", "", "write copy of printed messages to `filename`.log")
fs.StringVar(&opts.Logdir, "logdir", os.Getenv("MONSOON_LOG_DIR"), "automatically log all output to files in `dir`")
Expand All @@ -265,7 +266,8 @@ func AddCommand(c *cobra.Command) {
fs.StringArrayVar(&opts.ShowPattern, "show-pattern", nil, "show only responses containing `regex` in response header or body (can be specified multiple times)")

fs.StringArrayVar(&opts.Extract, "extract", nil, "extract `regex` from response header or body (can be specified multiple times)")
fs.StringArrayVar(&opts.ExtractPipe, "extract-pipe", nil, "pipe response body to `cmd` to extract data (can be specified multiple times)")
fs.StringArrayVar(&opts.ExtractPipe, "extract-pipe", nil, "pipe response body to `cmd` to extract data (can be specified multiple times, "+
"the current fuzz values are passed as environment variables $MONSOON_VALUE or $MONSOON_VALUE1-$MONSOON_VALUEN)")
fs.IntVar(&opts.MaxBodySize, "max-body-size", 5, "read at most `n` MiB from a returned response body (used for extracting data from the body)")
fs.BoolVar(&opts.DisableDecompression, "disable-decompression", false, "disable automatic decompression of the response body")

Expand Down
4 changes: 3 additions & 1 deletion cmd/show/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ Construct a request from scratch with a custom header, using the string
--value hunter2 \
https://www.example.com
Load a request from the file 'request.txt', replacing the 'Accept' header:
Load a request from the file 'request.txt' (note that the HTTP version
specified in the template file is currently ignored), replacing the
'Accept' header:
monsoon show --template-file 'request.txt' \
--header 'Accept: */*' \
Expand Down
2 changes: 1 addition & 1 deletion request/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func AddFlags(r *Request, fs *pflag.FlagSet) {
fs.StringVarP(&r.Body, "data", "d", "", "transmit `data` in the HTTP request body")
fs.StringVarP(&r.UserPass, "user", "u", "", "use `user:password` for HTTP basic auth")

fs.StringVar(&r.TemplateFile, "template-file", "", "read HTTP request from `file`")
fs.StringVar(&r.TemplateFile, "template-file", "", "read HTTP request from `file` (the HTTP version specified in the file is ignored)")

// configure request
fs.BoolVar(&r.ForceChunkedEncoding, "force-chunked-encoding", false, `do not set the Content-Length HTTP header and use chunked encoding`)
Expand Down

0 comments on commit eb52e06

Please sign in to comment.