Created
August 4, 2018 06:35
-
-
Save p5yph3r/a8bfe8ddf76221cedc182ca1e570bc5b to your computer and use it in GitHub Desktop.
This is a simple script that bruteforces the web directory with a dictionary or wordlist, it is very simple and fast and does it works properly. You are free to modify the code according to your need.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
usage :- | |
python <url> <wordlist> <extension> | |
for example : | |
python http://www.google.com/ common.txt .php | |
it supports all extensions & wordlists. | |
if you just want subdirectories write "/" in place of extension it will find it for you. | |
''' | |
import requests | |
import random | |
import time | |
import sys | |
url = sys.argv[1] | |
wordlist = sys.argv[2] | |
ext = sys.argv[3] | |
def write(word): | |
f1 = open("write1.txt","a") | |
f1.write(word +"\n") | |
fo = open(wordlist,"r+") | |
for i in range(2000): | |
word = fo.readline(10).strip() | |
surl = url+word+ext | |
#print (surl) | |
response = requests.get(surl) | |
#print (response) | |
if (response.status_code == 200): | |
print ("[+] found :- ",surl) | |
write(word) | |
else: | |
print ("[-] Not found :- ",surl) | |
pass | |
mrirfankhan
commented
Mar 25, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment