Fix issue when -request is used in conjunction with -u (#172)

This commit is contained in:
Joona Hoikkala 2020-02-18 19:20:30 +02:00 committed by GitHub
parent a5d9bb5c18
commit 1e57e6d0a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -7,6 +7,7 @@
- Write POST request data properly to file when ran with `-od`
- Properly handle relative redirect urls with `-recursion`
- Calculate req/sec correctly for when using recursion
- When `-request` is used, allow the user to override URL using `-u`
- v1.0.1
- Changed

View file

@ -36,6 +36,7 @@ type cliOptions struct {
replayProxyURL string
request string
requestProto string
URL string
outputFormat string
wordlists multiStringFlag
inputcommands multiStringFlag
@ -67,7 +68,7 @@ func main() {
flag.StringVar(&opts.extensions, "e", "", "Comma separated list of extensions. Extends FUZZ keyword.")
flag.BoolVar(&conf.DirSearchCompat, "D", false, "DirSearch wordlist compatibility mode. Used in conjunction with -e flag.")
flag.Var(&opts.headers, "H", "Header `\"Name: Value\"`, separated by colon. Multiple -H flags are accepted.")
flag.StringVar(&conf.Url, "u", "", "Target URL")
flag.StringVar(&opts.URL, "u", "", "Target URL")
flag.Var(&opts.wordlists, "w", "Wordlist file path and (optional) keyword separated by colon. eg. '/path/to/wordlist:KEYWORD'")
flag.BoolVar(&ignored, "k", false, "Dummy flag for backwards compatibility")
flag.StringVar(&opts.delay, "p", "", "Seconds of `delay` between requests, or a range of random delay. For example \"0.1\" or \"0.1-2.0\"")
@ -335,6 +336,11 @@ func prepareConfig(parseOpts *cliOptions, conf *ffuf.Config) error {
}
}
//Prepare URL
if parseOpts.URL != "" {
conf.Url = parseOpts.URL
}
//Prepare headers
for _, v := range parseOpts.headers {
hs := strings.SplitN(v, ":", 2)