From ef97ce70946fc5f5f327a4379faee51cc3fc67f0 Mon Sep 17 00:00:00 2001 From: ekultek Date: Mon, 13 Nov 2017 14:29:32 -0600 Subject: [PATCH] fix or an issue when an error occurs during the WhoIs lookup it will exit (issue #144) --- lib/attacks/whois_lookup/whois.py | 11 +++++++++-- lib/firewall/wordfence.py | 0 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 lib/firewall/wordfence.py diff --git a/lib/attacks/whois_lookup/whois.py b/lib/attacks/whois_lookup/whois.py index 9a14476..ecef58d 100644 --- a/lib/attacks/whois_lookup/whois.py +++ b/lib/attacks/whois_lookup/whois.py @@ -101,7 +101,13 @@ def whois_lookup_main(domain, **kwargs): )) if timeout is not None: time.sleep(timeout) - raw_information = gather_raw_whois_info(domain) + try: + raw_information = gather_raw_whois_info(domain) + except Exception: + lib.core.settings.logger.error(lib.core.settings.set_color( + "unable to produce information from WhoIs lookup...", level=40 + )) + return None lib.core.settings.logger.info(lib.core.settings.set_color( "discovered raw information...", level=25 )) @@ -113,9 +119,10 @@ def whois_lookup_main(domain, **kwargs): try: human_readable_display(domain, interesting_data) except (ValueError, Exception): - lib.core.settings.logger.fatal(lib.core.settings.set_color( + lib.core.settings.logger.error(lib.core.settings.set_color( "unable to display any information from WhoIs lookup on domain '{}'...".format(domain), level=50 )) + return None lib.core.settings.write_to_log_file( raw_information, lib.core.settings.WHOIS_RESULTS_LOG_PATH, "{}-whois.json".format(domain) diff --git a/lib/firewall/wordfence.py b/lib/firewall/wordfence.py new file mode 100644 index 0000000..e69de29