From 617d9c6ac73384db5e9048e80a5b7fcdbab66264 Mon Sep 17 00:00:00 2001 From: Guest257351 <57662212+Guest257351@users.noreply.github.com> Date: Wed, 24 Aug 2022 14:38:58 +0930 Subject: [PATCH 1/3] added threading --- Looking_Glass.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Looking_Glass.py b/Looking_Glass.py index 23e1ebb..4a907e2 100644 --- a/Looking_Glass.py +++ b/Looking_Glass.py @@ -4,6 +4,7 @@ '''imports''' import requests import time +import threading ''' INPUT USERNMAE TO DOX ''' username = input('\033[92m{+} Enter username to DOX: ') @@ -300,9 +301,13 @@ def search(): time.sleep(1) count = 0 - match = True - for url in WEBSITES: - r = requests.get(url) + threads = [] + results = [False for i in range(len(WEBSITES))] + for i in range(len(WEBSITES)): + url = WEBSITES[i] + def thread(results, index, url): + try: + r = requests.get(url, timeout=10) if r.status_code == 200: if match == True: @@ -313,7 +318,23 @@ def search(): GREEN(f'POSITIVE MATCH: Username:{username} - text has been detected in url.') else: GREEN(f'POSITIVE MATCH: Username:{username} - \033[91mtext has NOT been detected in url, could be a FALSE POSITIVE.')# - count += 1 + results[index] = True + except requests.exceptions.ConnectTimeout: + RED(f'{url} - Connection Timeout') + except Exception as e: + RED(f'ERROR checking {url} - {e}') + + t = threading.Thread(target=thread, args=(results, i, url)) + t.start() + threads.append(t) + + for thread in threads: + thread.join() + + for i in range(len(results)): + if results[i]: + count += 1 + total = len(WEBSITES) GREEN(f'FINISHED: A total of {count} MATCHES found out of {total} websites.') From 80680b6e1e5bd9439aaa131802a1144367e3703b Mon Sep 17 00:00:00 2001 From: Guest257351 <57662212+Guest257351@users.noreply.github.com> Date: Wed, 24 Aug 2022 14:39:29 +0930 Subject: [PATCH 2/3] Added error handling --- Looking_Glass.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Looking_Glass.py b/Looking_Glass.py index 4a907e2..e13430d 100644 --- a/Looking_Glass.py +++ b/Looking_Glass.py @@ -309,15 +309,12 @@ def thread(results, index, url): try: r = requests.get(url, timeout=10) - if r.status_code == 200: - if match == True: - GREEN('[+] FOUND MATCHES') - match = False - YELLOW(f'\n{url} - {r.status_code} - OK') - if username in r.text: - GREEN(f'POSITIVE MATCH: Username:{username} - text has been detected in url.') - else: - GREEN(f'POSITIVE MATCH: Username:{username} - \033[91mtext has NOT been detected in url, could be a FALSE POSITIVE.')# + if r.status_code == 200: + YELLOW(f'\n{url} - {r.status_code} - OK') + if username in r.text: + GREEN(f'POSITIVE MATCH: Username:{username} - text has been detected in url.') + else: + GREEN(f'POSITIVE MATCH: Username:{username} - \033[91mtext has NOT been detected in url, could be a FALSE POSITIVE.')# results[index] = True except requests.exceptions.ConnectTimeout: RED(f'{url} - Connection Timeout') From a8b9d37e6652920b5c4cb85a9d30eae2e97d74cd Mon Sep 17 00:00:00 2001 From: Guest257351 <57662212+Guest257351@users.noreply.github.com> Date: Wed, 24 Aug 2022 16:04:35 +0930 Subject: [PATCH 3/3] made username checking case insensitive --- Looking_Glass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Looking_Glass.py b/Looking_Glass.py index e13430d..17c97b7 100644 --- a/Looking_Glass.py +++ b/Looking_Glass.py @@ -311,7 +311,7 @@ def thread(results, index, url): if r.status_code == 200: YELLOW(f'\n{url} - {r.status_code} - OK') - if username in r.text: + if username.lower() in r.text.lower(): GREEN(f'POSITIVE MATCH: Username:{username} - text has been detected in url.') else: GREEN(f'POSITIVE MATCH: Username:{username} - \033[91mtext has NOT been detected in url, could be a FALSE POSITIVE.')#