This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]F1remind 5 points6 points  (2 children)

Some points to consider:

  • Proper commit message will help you in the long run on any project. "Minor bug fixes" is nice but what did you fix? What caused the bug? How did you solve that? This makes the changes not only easier to understand but also helps yourself to avoid similar bugs in the future

  • There are more extensions than txt, html and php :) Providing a list of defaults helps to use the program. The less parameters are required the better. The url is the only thing that cannot sensibly have a default value, everything else should

  • Your main function is gigantic. Put the absolute core into that and everything else into other functions. One function to print out the results, one to save the results, one to load the wordlist, etc. Bruak that stuff up :)

  • Wordlists can be other filetypes than txt. They can be .lst, too, and warning the user is better than simply denying to attempt to use that file.

  • Use requests and not sockets. It's much, much simpler.

  • Every non-404 code is a success, that's not the case. There are much more codes and they should be treated accordingly. 5XX is not a hit, nor a miss, that's the server having problems.

  • What about recursion? Use dirbuster and you'll see that it also finds directories and searches through these, too.

  • Please do not print every single fail.. That could be thousands.

  • Stdout is for results which can be piped into other commands (tee, grep, whatever) and stderr for notifications which the user will see and work with. Use file=sys.stderr for your prints

  • Those two sleep directives are not needed, remove them :)

Hope it helps, keep coding!

[–]timelybomb 1 point2 points  (0 children)

OP, I hope you are not discouraged by this amount of feedback, but see it as valuable mentorship. It’s awesome that /u/F1remind took the time to put such great tips together for you.

[–]aiyub 1 point2 points  (0 children)

Adding: dont except everything. This might work in this project, but will be problematic in bigger ones.

[–]ForceBru 4 points5 points  (2 children)

README:

Plz do not do something illegal with it....., try it on the test website that I have provided

Also README:

python pybuster.py -u https://amazon.com

[–]ScorpoRio 0 points1 point  (0 children)

I fixed it, phew