Skip to content

Commit d463562

Browse files
Updated networking_processor.py to 0.9rc1
1 parent d96ebce commit d463562

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

modules/networking_processor.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
import dns.resolver
2-
import ssl
3-
import socket
4-
from colorama import Fore, Style
5-
import requests
6-
import xml.etree.ElementTree as ET
7-
import builtwith
1+
import sys
2+
3+
try:
4+
import dns.resolver
5+
import ssl
6+
import socket
7+
from colorama import Fore, Style
8+
import requests
9+
import xml.etree.ElementTree as ET
10+
import builtwith
11+
except ImportError as e:
12+
print(Fore.RED + "Import error appeared. Reason: {}".format(e) + Style.RESET_ALL)
13+
sys.exit()
814

915
def get_dns_info(short_domain):
1016
resolver = dns.resolver.Resolver()
@@ -29,7 +35,6 @@ def query_internetdb(ip):
2935
response = requests.get(url)
3036

3137
if response.status_code == 200:
32-
print(Fore.GREEN + "Found some information on InternetDB" + Style.RESET_ALL)
3338
data = response.json()
3439
ports = data.get("ports", [])
3540
hostnames = data.get("hostnames", [])
@@ -79,7 +84,8 @@ def extract_links_from_sitemap(report_folder):
7984
for link in links:
8085
f.write(f"=> {link}\n")
8186
return 'Links from "sitemap.txt" were successfully parsed'
82-
except ET.ParseError:
87+
except ET.ParseError as e:
88+
print(Fore.RED + "Links from sitemap.txt were not parsed. Reason: {}".format(e))
8389
return 'Links from "sitemap.txt" were not parsed'
8490

8591
def get_technologies(url):

0 commit comments

Comments
 (0)