Skip to content

Instantly share code, notes, and snippets.

@MayankPandey01
Created February 1, 2022 19:07
Show Gist options
  • Save MayankPandey01/3ed00e54ac2c1cec4b396b011a6bc5c8 to your computer and use it in GitHub Desktop.
Save MayankPandey01/3ed00e54ac2c1cec4b396b011a6bc5c8 to your computer and use it in GitHub Desktop.
def brute(myList,url):
start=time.perf_counter()
for lists in myList:
threads.append(Thread(target=worker,args=(lists,url),daemon=True))
for thread in threads:
try:
thread.start()
except KeyboardInterrupt:
print("\nReceived Keyboard Interrupt , Terminating threads\n")
sys.exit()
for thread in threads:
try:
thread.join()
except KeyboardInterrupt:
print("\nReceived Keyboard Interrupt , Terminating threads\n")
sys.exit()
finish=time.perf_counter()
print(f"\n\n\t\t Checked {total_len} Directories in {round(finish-start,2)} Seconds\n")
def worker(lists,url):
try:
for word in lists:
if word.startswith("/"):
word=word[1:]
url2=url+"/"+word.strip()
r=requests.get(url2)
if str(r.status_code) in match:
print(f"/{word.strip():<40} [ Status: {r.status_code} Length:{len(r.content)} ]")
except KeyboardInterrupt:
print("\nReceived Keyboard Interrupt , Terminating threads\n")
sys.exit()
except Exception as e:
print(f"\nAn error Occurred : {e}\n")
sys.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment