Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def print_res_header(target):
"""
Print Breach result header
"""
print(colors.bold, "{:_^90}\n".format(""), colors.reset)
print(
colors.bold
+ colors.fg.green
+ "[>] "
+ colors.reset
+ "Showing results for "
+ target
+ colors.reset
)
def print_result(target, data, source):
"""
Print Breach results
"""
if "PASS" in source:
print(
"{}{}{:15}{}|{}{:>25.25}{} > {}{}{}{}".format(
colors.fg.lightblue,
colors.bold,
source,
colors.fg.lightgrey,
colors.fg.pink,
target,
colors.fg.lightgrey,
colors.bold,
colors.fg.green,
data,
colors.reset,
)
)
elif "LOCALSEARCH" in source:
if len(data) > 140:
print(
"{}{}{:15}{}|{}{:>25.25}{} > {}{}{}{}".format(
colors.fg.lightblue,
colors.bold,
source,
colors.fg.lightgrey,
colors.fg.pink,
target,
colors.fg.lightgrey,
banner = """
._____. ._____. ;____________;
| ._. | | ._. | ; h8mail ;
| !_| |_|_|_! | ;------------;
!___| |_______! Heartfelt Email OSINT
.___|_|_| |___. Use responsibly
| ._____| |_. | ;____________________;
| !_! | | !_! | ; github.com/khast3x ;
!_____! !_____! ;--------------------;
"""
# print(c.bold, c.fg.pink, banner, c.reset)
banner_tab = banner.splitlines()
code = 17
for b in banner_tab:
clr = "\u001b[38;5;" + str(code) + "m "
print(c.bold + clr + b + c.reset)
code += 3
elif "warn" in b_type:
print(
c.fg.green,
"\th8mail is free & open-source. Please report scammers.\n\n",
c.reset,
)
elif "version" in b_type:
print(
"\t",
c.fg.lightgrey,
"Version " + __version__ + ' - "ECHO MIKE - HOTFIX 1" ',
c.reset,
)
def print_result(target, data, source):
"""
Print Breach results
"""
if "PASS" in source:
print(
"{}{}{:15}{}|{}{:>25.25}{} > {}{}{}{}".format(
colors.fg.lightblue,
colors.bold,
source,
colors.fg.lightgrey,
colors.fg.pink,
target,
colors.fg.lightgrey,
colors.bold,
colors.fg.green,
data,
colors.reset,
)
)
elif "LOCALSEARCH" in source:
if len(data) > 140:
print(
"{}{}{:15}{}|{}{:>25.25}{} > {}{}{}{}".format(
colors.fg.lightblue,
def print_summary(start_time, breached_targets):
"""
Prints a padded table where each line is a target, and associated value is simplified to breached/not breached.
If breached, shows len(t.data). Shown elements and total may differ as some elements of t.data are not outputted to stdout.
"""
print("{:_^90}".format(""))
print(
"\n\n\n{:^32}".format(""),
c.bold,
c.underline,
"Session Recap:",
c.reset,
"\n\n",
)
print("{:^40} | ".format("Target"), "{:^40}".format("Status"), c.reset)
print("{:_^90}\n".format(""))
for t in breached_targets:
if t.pwned is not 0:
print(
f"{t.target:^40} | ",
c.fg.green,
"{:^40}".format("Breach Found (" + str(t.pwned) + " elements)"),
c.reset,
)
else:
def get_hibp(self):
try:
sleep(1.3)
c.info_news(c.bold + "HIBP free tier will stop working on the 2019/08/18")
c.info_news(
c.bold
+ "You can already use a purchased API key using h8mail (config file)"
+ c.reset
)
url = "https://haveibeenpwned.com/api/v2/breachedaccount/{}?truncateResponse=true".format(
self.target
)
response = self.make_request(url)
if response.status_code not in [200, 404]:
c.bad_news("Could not contact HIBP for " + self.target)
print(response.status_code)
return
if response.status_code == 200:
data = response.json()