Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CloudSniffer.py #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions CloudSniffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,21 @@ def check_url(ip, url):
print(Fore.YELLOW + f'IP {ip} caused a redirect, might be real.')
if trace:
trace_file.write(f'IP {ip} caused a redirect, might be real.\n')
except requests.exceptions.ConnectTimeout:
if trace:
trace_file.write(f'Request for IP {ip} failed with timeout error.\n')
except requests.exceptions.HTTPError as errh:
if trace:
trace_file.write(f'Http Error: {str(errh)} for IP {ip}\n')
except requests.exceptions.ConnectionError as errc:
if trace:
trace_file.write(f'Error Connecting: {str(errc)} for IP {ip}\n')
except requests.exceptions.Timeout as errt:
if trace:
trace_file.write(f'Timeout Error: {str(errt)} for IP {ip}\n')
except requests.exceptions.RequestException as err:
if isinstance(err, requests.exceptions.ConnectTimeout):
if trace:
trace_file.write(f'Request for IP {ip} failed with timeout error: {err}\n')
else:
if trace:
trace_file.write(f'Request for IP {ip} failed with error: {err}\n')
if trace:
trace_file.write(f'Request Error: {str(err)} for IP {ip}\n')

for ip in tqdm(ip_addresses, ncols=75, bar_format='{l_bar}{bar}| {n_fmt}/{total_fmt}'):
ip = ip.strip()
Expand Down