Skip to content

Commit

Permalink
breachdir integration
Browse files Browse the repository at this point in the history
  • Loading branch information
khast3x committed Jan 26, 2021
1 parent 9f75390 commit 70c763b
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 13 deletions.
50 changes: 41 additions & 9 deletions h8mail/utils/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,22 +366,22 @@ def get_emailrepio(self, api_key=""):

def get_scylla(self, user_query="email"):
try:
c.info_news("[" + self.target + "]>[scylla.sh]")
c.info_news("[" + self.target + "]>[scylla.so]")
sleep(0.5)
self.headers.update({"Accept": "application/json"})
if user_query == "email":
uri_scylla = 'Email: "' + self.target + '"'
uri_scylla = 'email: "' + self.target + '"'
elif user_query == "password":
uri_scylla = 'Password: "' + self.target + '"'
uri_scylla = 'password: "' + self.target + '"'
elif user_query == "username":
uri_scylla = 'User: "' + self.target + '"'
uri_scylla = 'name: "' + self.target + '"'
elif user_query == "ip":
uri_scylla = 'IP: "' + self.target + '"'
uri_scylla = 'ip: "' + self.target + '"'
elif user_query == "hash":
uri_scylla = 'Hash: "' + self.target + '"'
uri_scylla = 'hash: "' + self.target + '"'
elif user_query == "domain":
uri_scylla = 'Email: "*@' + self.target + '"'
url = "https://scylla.sh/search?q={}".format(
uri_scylla = 'email: "*@' + self.target + '"'
url = "https://scylla.so/search?q={}".format(
requests.utils.requote_uri(uri_scylla)
)

Expand Down Expand Up @@ -411,7 +411,7 @@ def get_scylla(self, user_query="email"):
)
for d in data:
for field, k in d["fields"].items():
if "user" in field and k is not None:
if "name" in field and k is not None:
self.data.append(("SCYLLA_USERNAME", k))
self.pwned += 1
elif (
Expand Down Expand Up @@ -821,3 +821,35 @@ def get_dehashed(self, api_email, api_key, user_query):
except Exception as ex:
c.bad_news(f"Dehashed error with {self.target}")
print(ex)

def get_breachdirectory(self, user, passw):
c.info_news("[" + self.target + "]>[breachdirectory]")
url = "https://breachdirectory.tk/api/index?username={user}&password={passw}&func=auto&term={target}".format(user=user, passw=passw, target=self.target)
try:
req = self.make_request(
url, timeout=60
)
if req.status_code == 200:
response = req.json()
if response["success"] is True:
c.good_news(
"Found {num} entries for {target} using breachdirectory.tk".format(
num=str(response["found"]), target=self.target
)
)

for result in response["result"]:
if result["has_password"] is True:
self.data.append(("BREACHDR_PASS", result["password"]))
self.data.append(("BREACHDR_MD5", result["md5"]))
if result["sources"] == "Unverified":
source = result["sources"]
elif len(result["sources"]) > 1:
source = ", ".join(result["sources"])
else:
source = result["sources"][0]
self.data.append(("BREACHDR_SOURCE", source))
self.pwned += 1
except Exception as ex:
c.bad_news(f"Breachdirectory error with {self.target}")
print(ex)
2 changes: 2 additions & 0 deletions h8mail/utils/gen_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def gen_config_file():
;dehashed_key =
;intelx_key =
;intelx_maxfile = 10
;breachdirectory_user =
;breachdirectory_pass =
"""
dest_config.write(config)
c.good_news(
Expand Down
2 changes: 1 addition & 1 deletion h8mail/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def check_scylla_online():
# https://github.com/khast3x/h8mail/issues/64
try:
re = requests.head(
url="https://scylla.sh", verify=False, auth=requests.auth.HTTPBasicAuth("sammy", "BasicPassword!"), timeout=10,
url="https://scylla.so", verify=False, auth=requests.auth.HTTPBasicAuth("sammy", "BasicPassword!"), timeout=10,
)
if re.status_code == 200:
c.good_news("scylla.sh is up")
Expand Down
2 changes: 2 additions & 0 deletions h8mail/utils/print_results.py
Original file line number Diff line number Diff line change