Skip to content

Instantly share code, notes, and snippets.

@p5yph3r
Created August 4, 2018 06:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save p5yph3r/a8bfe8ddf76221cedc182ca1e570bc5b to your computer and use it in GitHub Desktop.
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.
'''
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
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment