diff --git a/h8mail/utils/classes.py b/h8mail/utils/classes.py index 0c4139b..e2bbbf6 100644 --- a/h8mail/utils/classes.py +++ b/h8mail/utils/classes.py @@ -310,7 +310,7 @@ def get_emailrepio(self, api_key=""): if response.status_code == 429: c.info_news( - "[warning] emailrep.io: Unauthenticated API requests limit reached. Get a free API key here: https://bit.ly/3b1e7Pw" + "[warning] Is your emailrep key working? Get a free API key here: https://bit.ly/3b1e7Pw" ) elif response.status_code == 404: c.info_news( @@ -320,14 +320,15 @@ def get_emailrepio(self, api_key=""): data = response.json() self.data.append( - ( - "EMAILREP_INFO", - "Reputation: {rep} | Deliverable: {deli}".format( - rep=data["reputation"].capitalize(), deli=data["details"]["deliverable"] - ) - ) + ( + "EMAILREP_INFO", + "Reputation: {rep} | Deliverable: {deli}".format( + rep=data["reputation"].capitalize(), + deli=data["details"]["deliverable"], + ), ) - + ) + if data["details"]["credentials_leaked"] is True: self.pwned += int(data["references"]) # or inc num references if data["references"] == 1: @@ -352,11 +353,25 @@ def get_emailrepio(self, api_key=""): if len(data["details"]["profiles"]) != 0: for profile in data["details"]["profiles"]: self.data.append(("EMAILREP_SOCIAL", profile.capitalize())) - c.good_news("Found social profils") + c.good_news( + "Found {num} social profiles linked to {target} using emailrep.io".format( + num=len(data["details"]["profiles"]), target=self.target + ) + ) if "never" in data["details"]["last_seen"]: return self.data.append(("EMAILREP_1ST_SN", data["details"]["first_seen"])) + c.good_news( + "{target} was first seen on the {data}".format( + data=data["details"]["first_seen"], target=self.target + ) + ) self.data.append(("EMAILREP_LASTSN", data["details"]["last_seen"])) + c.good_news( + "{target} was last seen on the {data}".format( + data=data["details"]["last_seen"], target=self.target + ) + ) else: c.bad_news( "emailrep.io: got API response code {code} for {target}".format( @@ -389,8 +404,15 @@ def get_scylla(self, user_query="email"): url = "https://scylla.sh/search?q={}".format( requests.utils.requote_uri(uri_scylla) ) - response = self.make_request(url, verify=False) + + # https://github.com/khast3x/h8mail/issues/64 + response = self.make_request( + url, + verify=False, + auth=requests.auth.HTTPBasicAuth("sammy", "BasicPassword!"), + ) self.headers.popitem() + if response.status_code not in [200, 404]: c.bad_news("Could not contact scylla.sh for " + self.target) print(response.status_code) @@ -403,7 +425,7 @@ def get_scylla(self, user_query="email"): if k is not None: total += 1 c.good_news( - "Found {num} entries for {target} using Scylla.sh ".format( + "Found {num} entries for {target} using scylla.sh ".format( num=total, target=self.target ) ) @@ -742,6 +764,11 @@ def get_weleakinfo_pub(self, api_key): def get_dehashed(self, api_email, api_key, user_query): try: + # New Dehashed API needs fixing, waiting for devs to respond + c.bad_news("Dehashed is temporarily unavailable") + c.bad_news("This should be fixed in the next updated\n") + return + if user_query == "hash": user_query == "hashed_password" if user_query == "ip": @@ -823,4 +850,3 @@ def get_dehashed(self, api_email, api_key, user_query): except Exception as ex: c.bad_news("Dehashed error with {target}".format(target=self.target)) print(ex) - diff --git a/h8mail/utils/helpers.py b/h8mail/utils/helpers.py index af2c011..12fdf96 100644 --- a/h8mail/utils/helpers.py +++ b/h8mail/utils/helpers.py @@ -71,7 +71,7 @@ def print_banner(b_type="intro"): print( "\t", c.fg.lightgrey, - "Version " + __version__ + ' - "ROCKSROCKSMASSON" ', + "Version " + __version__ + ' - "ROCKSMASSON.1" ', c.reset, ) @@ -191,14 +191,16 @@ def check_scylla_online(): Checks if scylla.sh is online """ # Supress SSL Warning on UI + # https://github.com/khast3x/h8mail/issues/64 try: - requests.packages.urllib3.disable_warnings() re = requests.head( - url="https://scylla.sh", verify=False + url="https://scylla.sh", verify=False, auth=requests.auth.HTTPBasicAuth("sammy", "BasicPassword!") ) if re.status_code == 200: c.good_news("scylla.sh is up") return True + else: + c.info_news("scylla.sh is down, skipping") return False except Exception: c.info_news("scylla.sh is down, skipping") \ No newline at end of file diff --git a/h8mail/utils/run.py b/h8mail/utils/run.py index 89bae72..e285999 100644 --- a/h8mail/utils/run.py +++ b/h8mail/utils/run.py @@ -49,12 +49,14 @@ def target_factory(targets, user_args): skip_default_queries = False if user_args.user_query is not None: query = user_args.user_query - skip_default_queries = True # ?? + skip_default_queries = True # custom query skips default query automatically scylla_up = False if user_args.skip_defaults is False: scylla_up = check_scylla_online() + + for counter, t in enumerate(targets): c.info_news("Target factory started for {target}".format(target=t)) if user_args.debug: @@ -64,12 +66,13 @@ def target_factory(targets, user_args): if not skip_default_queries: if not user_args.skip_defaults: current_target.get_hunterio_public() - if api_keys is None or "emailrep" not in api_keys: - current_target.get_emailrepio() - elif ( - api_keys is not None and "emailrep" in api_keys and query == "email" - ): - current_target.get_emailrepio(api_keys["emailrep"]) + ## emailrep seems to insta-block h8mail user agent without a key + # if api_keys is None or "emailrep" not in api_keys: + # current_target.get_emailrepio() + # elif ( + # api_keys is not None and "emailrep" in api_keys and query == "email" + # ): + # current_target.get_emailrepio(api_keys["emailrep"]) if scylla_up: current_target.get_scylla(query) @@ -133,6 +136,10 @@ def h8mail(user_args): start_time = time.time() + import warnings + + warnings.filterwarnings('ignore', message='Unverified HTTPS request') + targets = [] if user_args.user_urls: targets = target_urls(user_args) diff --git a/h8mail/utils/url.py b/h8mail/utils/url.py index 265dff1..209d432 100644 --- a/h8mail/utils/url.py +++ b/h8mail/utils/url.py @@ -27,7 +27,7 @@ def fetch_urls(target): def get_urls_from_file(targets_file): """ - For each line in file, check for URLs using fetch_urls()(todo). + For each line in file, check for URLs using fetch_urls(). Returns list of URLs. """ email_obj_list = [] diff --git a/h8mail/utils/version.py b/h8mail/utils/version.py index 5cdc0cd..7a2056f 100644 --- a/h8mail/utils/version.py +++ b/h8mail/utils/version.py @@ -1 +1 @@ -__version__ = "2.5" +__version__ = "2.5.1"