1 | | - | from bs4 import BeautifulSoup |
2 | | - | import json, requests |
| 1 | + | import requests |
3 | 2 | | from insides.bcolors import bcolors |
4 | 3 | | from prettytable import PrettyTable |
5 | 4 | | |
6 | 5 | | def LeakedDB(mail,_verbose=None): |
7 | 6 | | if _verbose != None: |
8 | 7 | | try: |
9 | | - | headers = { |
10 | | - | "Accept": "application/json" |
11 | | - | } |
12 | | - | leakedpassurl = "https://scylla.sh/search?q=email:" |
13 | | - | u = (leakedpassurl+mail) |
14 | | - | response = requests.get(u,timeout=5,headers=headers) |
15 | | - | html = response.content |
16 | | - | lp = json.loads(html) |
| 8 | + | res = requests.get(f"https://scylla.sh/search?q=email:{mail}&size=50&start=0", headers={'Accept': 'application/json'}).json() |
17 | 9 | | table = PrettyTable(["Domain","Email",f"{bcolors.FAIL}Password{bcolors.ENDC}"]) |
18 | | - | for s in range(len(lp)): |
19 | | - | table.add_row([lp[s]["fields"]["domain"],lp[s]["fields"]["email"],lp[s]["fields"]["password"]]) |
20 | | - | print(table) |
21 | | - | except: |
| 10 | + | if len(res): |
| 11 | + | for s in res: |
| 12 | + | table.add_row([s["fields"]["domain"],s["fields"]["email"],s["fields"].get("password") or s["fields"].get("passhash") or "No Pass Data"]) |
| 13 | + | print(table) |
| 14 | + | else: |
| 15 | + | print(f"{bcolors.FAIL}No leaked accounts found!{bcolors.ENDC}") |
| 16 | + | except Exception as e: |
| 17 | + | print(e) |
22 | 18 | | print(f"{bcolors.FAIL}Leaked DB Connection Error!{bcolors.ENDC}") |
23 | 19 | | |