├── README.md ├── dirbrute.py └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # DirBrute 2 | A lightweight and easy to use directory buster written in Python3. 3 | 4 | ## License 5 | DirBrute is licensed under the MIT license. Refer to [LICENSE](LICENSE) for more info. 6 | 7 | ## Usage 8 | Please refer to the output of `-h` for more usage and help. 9 | 10 | ## Example 11 | ```bash 12 | python3 dirbrute.py -u http://localhost/ -w wordlist.txt 13 | ``` 14 | 15 | ## Contributing 16 | Contributions are accepted and encouraged. 17 | 18 | ## Disclaimer 19 | This project is only for ethical hacking. Me and contributors are not responsible for any misuse. 20 | -------------------------------------------------------------------------------- /dirbrute.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import argparse 3 | 4 | valid_status_codes = [200, 301] 5 | 6 | parser = argparse.ArgumentParser( 7 | prog="python3 dirbrute.py", 8 | description="A lightweight and easy to use directory buster written in Python3." 9 | ) 10 | parser.add_argument("-u", "--url", type=str, required=True, help="URL should be tested started with http(s)://") 11 | parser.add_argument("-w", "--wordlist", type=str, required=True, help="Location of wordlist") 12 | args = parser.parse_args() 13 | 14 | if not args.url.endswith("/"): 15 | args.url = args.url + "/" 16 | 17 | with open(args.wordlist, "r") as wordlist: 18 | for word in wordlist: 19 | url = args.url + word 20 | resp = requests.get(url) 21 | if resp.status_code in valid_status_codes: 22 | print(f"Found: {url}, Status code: {resp.status_code}") 23 | else: 24 | continue 25 | 26 | 27 | print("Attack finished!") 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 0xPwn3r 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------