Created
February 1, 2022 19:07
-
-
Save MayankPandey01/3ed00e54ac2c1cec4b396b011a6bc5c8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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") |
This file contains hidden or 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
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