ffuf / ffuf

Fast web fuzzer written in Go
MIT License
12.02k stars 1.25k forks source link

Feature Request: add -prefix flag #778

Open br-sn opened 3 months ago

br-sn commented 3 months ago

In the same way there's currently an -e (extensions) flag, that can be used to not just add extensions such as .php, I believe adding a prefix flag could be useful in several scenarios.

For example, if you know the naming convention of a company, you could add "-prefix " without having to create a second wordlist and a second injection point.

bsysop commented 3 months ago

Hi @br-sn,

Quick approach: For fuzzing with a specific prefix, you can manually prepend it in your command, like so: ffuf -u "http://localhost/prefix_FUZZ"

Detailed explanation: Ffuf handles extension fuzzing by using the wordlist to generate requests both with and without the specified extension, effectively doubling the number of requests.

Similarly, introducing a prefix argument would likely increase the request count by also trying each keyword both with and without the prefix.

Which approach do you think fits better for your needs?

br-sn commented 2 months ago

Hi @bsysop,

The approach I had in mind that best fits my workflow is the exact same mechanism as the -extension/-e flag but with -prefix, so the second approach. This could be helpful in also adding in pre-fixes such as a space character, which I often find myself testing for (ffuf -u example.com/FUZZ -prefix '%20' for example.

bsysop commented 2 months ago

Got it @br-sn Let's wait for joohoi :)

joohoi commented 2 months ago

This is a valid request and should be a rather simple addition. Great for a potential first-time contributor, as they can mostly copy the behavior of extension flag.

As a workaround, you can use the dirsearch style wordlist format ( %EXT% gets replaced by whatever is defined in -e value when -D is defined on ffuf cli ), and it can exist in the beginning of the word as well.