File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change 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
915def 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
8591def get_technologies (url ):
You can’t perform that action at this time.
0 commit comments