gobuster icon indicating copy to clipboard operation
gobuster copied to clipboard

Added ability to search for files only

Open rtheory opened this issue 7 years ago • 4 comments
trafficstars

This minor change adds the -xo switch to enable file-only searching. This prevents gobuster from searching directory names first. This is useful when you've already performed a directory search earlier and now want to search for files by extension without re-querying for directories again. This improves speed and removes unnecessary queries.

  • Added -xo switch processing
  • Added -xo help statement in -h
  • Added error handling; -xo can only be set if -x is provided
  • Added line to gobuster output: [+] Files Only : true

This could be done other ways, but ultimately I chose just making "-xo" since it fits right next to the companion "-x" that everyone is already familiar with.

rtheory avatar Jul 14 '18 02:07 rtheory

Apologies for the delay on this, can I please request that you rebase your changes on 2.0.0 now that I've finally landed #79? Thank you so much.

OJ avatar Aug 27 '18 02:08 OJ

Ping @rtheory would you mind rebasing on the new master now that 3.0 has been released? Many thanks!

OJ avatar Jun 20 '19 01:06 OJ

Wow, a lot has changed since I originally requested this! Sorry for the delay. I rebased to the new master and re-implemented the option based on the new ways gobuster works. Testing worked well:

gobuster dir -x txt,docx -w test.txt -u https://example.com This is standard usage. It makes requests for directories and file names as expected.

gobuster dir -x txt,docx -X -w test.txt -u https://example.com Same as above, but there are no requests for directories, only file names

rtheory avatar Jun 20 '19 05:06 rtheory

Great, thank you for your efforts and support @rtheory, I'll look to get this merged pronto! We'll do a smaller release for 3.0.1 when this and a couple of other small things are ready.

OJ avatar Jun 20 '19 05:06 OJ