From 466a011db96e0400602d2ef20741d5b2f1fa09b8 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Thu, 8 Nov 2018 11:49:06 +0200 Subject: [PATCH] Added POST data fuzzing --- main.go | 6 ++++++ pkg/runner/simple.go | 1 + 2 files changed, 7 insertions(+) diff --git a/main.go b/main.go index 006e855..38dbe77 100644 --- a/main.go +++ b/main.go @@ -50,6 +50,7 @@ func main() { flag.BoolVar(&conf.TLSSkipVerify, "k", false, "Skip TLS identity verification (insecure)") flag.StringVar(&opts.filterStatus, "fc", "", "Filter HTTP status codes from response") flag.StringVar(&opts.filterSize, "fs", "", "Filter HTTP response size") + flag.StringVar(&conf.Data, "d", "", "POST data.") //flag.StringVar(&opts.filterRegex, "fr", "", "Filter regex") //flag.StringVar(&opts.filterReflect, "fref", "", "Filter reflected payload") flag.StringVar(&opts.matcherStatus, "mc", "200,204,301,302,307", "Match HTTP status codes from respose") @@ -132,9 +133,14 @@ func prepareConfig(parseOpts *cliOptions, conf *ffuf.Config) error { errlist = multierror.Append(errlist, fmt.Errorf("Header defined by -H needs to have a value. \":\" should be used as a separator.")) } } + //Search for keyword from URL and POST data too if strings.Index(conf.Url, "FUZZ") != -1 { foundkeyword = true } + if strings.Index(conf.Data, "FUZZ") != -1 { + foundkeyword = true + } + if !foundkeyword { errlist = multierror.Append(errlist, fmt.Errorf("No FUZZ keywords found in headers or URL, nothing to do.")) } diff --git a/pkg/runner/simple.go b/pkg/runner/simple.go index 5254632..f4702c3 100644 --- a/pkg/runner/simple.go +++ b/pkg/runner/simple.go @@ -47,6 +47,7 @@ func (r *SimpleRunner) Prepare(input []byte) (ffuf.Request, error) { } req.Input = input req.Url = strings.Replace(r.config.Url, "FUZZ", string(input), -1) + req.Data = []byte(strings.Replace(r.config.Data, "FUZZ", string(input), -1)) return req, nil }