Skip to content

Commit

Permalink
Http verb fuzzing (#57)
Browse files Browse the repository at this point in the history
* typo fix

* Allow fuzzing of http method. Resolves #54
  • Loading branch information
delic authored and joohoi committed Sep 2, 2019
1 parent 08c4cb4 commit 55662e6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -17,7 +17,7 @@ Heavily inspired by the great projects [gobuster](https://github.com/OJ/gobuster
## Features

- Fast!
- Allows fuzzing of HTTP header values, POST data, and different parts of URL, including GET parameter names and values
- Allows fuzzing of HTTP header values, HTTP method, POST data, and different parts of URL, including GET parameter names and values
- Silent mode (`-s`) for clean output that's easy to use in pipes to other processes.
- Modularized architecture that allows integration with existing toolchains with reasonable effort
- Easy-to-add filters and matchers (they are interoperable)
Expand Down
9 changes: 6 additions & 3 deletions main.go
Expand Up @@ -284,7 +284,7 @@ func prepareConfig(parseOpts *cliOptions, conf *ffuf.Config) error {
}
}

// Handle copy as curl situation where POST method is implied by --data flag. If method is set to anything bug GET, NOOP
// Handle copy as curl situation where POST method is implied by --data flag. If method is set to anything but GET, NOOP
if conf.Method == "GET" {
if len(conf.Data) > 0 {
conf.Method = "POST"
Expand All @@ -293,7 +293,10 @@ func prepareConfig(parseOpts *cliOptions, conf *ffuf.Config) error {

conf.CommandLine = strings.Join(os.Args, " ")

//Search for keyword from URL and POST data too
//Search for keyword from HTTP method, URL and POST data too
if conf.Method == "FUZZ" {
foundkeyword = true
}
if strings.Index(conf.Url, "FUZZ") != -1 {
foundkeyword = true
}
Expand All @@ -302,7 +305,7 @@ func prepareConfig(parseOpts *cliOptions, conf *ffuf.Config) error {
}

if !foundkeyword {
errs.Add(fmt.Errorf("No FUZZ keyword(s) found in headers, URL or POST data, nothing to do"))
errs.Add(fmt.Errorf("No FUZZ keyword(s) found in headers, method, URL or POST data, nothing to do"))
}

return errs.ErrorOrNil()
Expand Down
5 changes: 5 additions & 0 deletions pkg/runner/simple.go
Expand Up @@ -46,6 +46,11 @@ func NewSimpleRunner(conf *ffuf.Config) ffuf.RunnerProvider {

func (r *SimpleRunner) Prepare(input []byte) (ffuf.Request, error) {
req := ffuf.NewRequest(r.config)
// should we fuzz the http method
if r.config.Method == "FUZZ" {
req.Method = string(input)
}

for h, v := range r.config.StaticHeaders {
req.Headers[h] = v
}
Expand Down

0 comments on commit 55662e6

Please sign in to comment.