This script discovers useful and vulnerable directories and pages by sending HTTP requests to a list of such pages from a text file,and reading the response code.
import httplib
import time
import threading
#open textfile containing pages
f=open("pages2.txt","r")
#screenlock for threads
screenlock=threading.Semaphore(value=1)
def fuzz(name,page):
try:
con=httplib.HTTPConnection(str(name))
screenlock.acquire()
print "Checking "+page+"\n"
#send request
con.request("GET",str(page))
#check response
res=con.getresponse()
if res.status==200:
print page+" "+"found\n"
found+=1
else:
print res.status,res.reason+"\n"
except Exception,prob:
print prob
finally:
con.close
screenlock.release()
site=raw_input("Website:")
#read list of files and directories
pages=f.read()
pages=pages.split(",")
for page in pages:
#create thread for each page
t=threading.Thread(target=fuzz,args=(site,page))
t.start()
f.close()
This is my list of directories and files.(Need a better one)