| skipped 2 lines |
3 | 3 | | from insides.bcolors import bcolors |
4 | 4 | | from insides.Header import Header |
5 | 5 | | |
6 | | - | with open('config.json', "r") as configFile: |
7 | | - | conf = json.loads(configFile.read()) |
| 6 | + | def parse_args(): |
| 7 | + | import argparse |
| 8 | + | parser = argparse.ArgumentParser() |
| 9 | + | parser.add_argument('-e', '--email', type=str, required=True, help="Email") |
| 10 | + | return parser.parse_args() |
8 | 11 | | |
9 | | - | for i in conf: |
10 | | - | verifyApi = (i['verify-email.org API Key']) |
11 | | - | socialscan = (i['Social Scan']) |
12 | | - | leakeddb = (i['Leaked DB']) |
13 | | - | breachedsites = (i['Breached Sites[leak-lookup.com API Key]']) |
14 | | - | hunterApi = (i['hunter.io API Key']) |
15 | | - | dbdata = (i['Related Phone Numbers']) |
16 | | - | tcrwd = (i['Related Domains']) |
17 | | - | pastebindumps = (i['Pastebin Dumps']) |
18 | | - | googlesearch = (i['Google Search']) |
19 | | - | dns = (i['DNS Lookup']) |
20 | 12 | | |
21 | | - | from insides.Banner import Banner |
22 | | - | Banner() |
| 13 | + | # TODO: Clean boolean in string. |
23 | 14 | | |
24 | | - | from modules.ConfigTree import ConfigTree |
25 | | - | ConfigTree(verifyApi,socialscan,leakeddb,breachedsites,hunterApi,dbdata,tcrwd,pastebindumps,googlesearch,dns,_verbose=True) |
| 15 | + | def main(): |
| 16 | + | args = parse_args() |
| 17 | + | mail = args.email |
26 | 18 | | |
27 | | - | print("") |
| 19 | + | EMAIL_REGEX = r'(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)' |
28 | 20 | | |
29 | | - | # TODO: Clean boolean in string. |
| 21 | + | if not re.match(EMAIL_REGEX, mail): |
| 22 | + | print(f"{bcolors.FAIL}Email format is wrong!{bcolors.ENDC}") |
| 23 | + | exit() |
30 | 24 | | |
31 | | - | EMAIL_REGEX = r'(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)' |
| 25 | + | with open('config.json', "r") as configFile: |
| 26 | + | conf = json.loads(configFile.read()) |
32 | 27 | | |
33 | | - | while True: |
34 | | - | mail=input(f"{bcolors.OKBLUE}MAIL > {bcolors.ENDC}") |
| 28 | + | for i in conf: |
| 29 | + | verifyApi = (i['verify-email.org API Key']) |
| 30 | + | socialscan = (i['Social Scan']) |
| 31 | + | leakeddb = (i['Leaked DB']) |
| 32 | + | breachedsites = (i['Breached Sites[leak-lookup.com API Key]']) |
| 33 | + | hunterApi = (i['hunter.io API Key']) |
| 34 | + | checkPDF = (i['PDF Check for Related Emails']) |
| 35 | + | dbdata = (i['Related Phone Numbers']) |
| 36 | + | tcrwd = (i['Related Domains']) |
| 37 | + | pastebindumps = (i['Pastebin Dumps']) |
| 38 | + | googlesearch = (i['Google Search']) |
| 39 | + | dns = (i['DNS Lookup']) |
| 40 | + | |
| 41 | + | from insides.Banner import Banner |
| 42 | + | Banner() |
| 43 | + | |
| 44 | + | from modules.ConfigTree import ConfigTree |
| 45 | + | ConfigTree(verifyApi,socialscan,leakeddb,breachedsites,hunterApi,checkPDF,dbdata,tcrwd,pastebindumps,googlesearch,dns,_verbose=True) |
35 | 46 | | |
36 | | - | if (mail == "q" or mail == "Q" or mail == "exit"): |
37 | | - | print("Thank you for using "+f"{bcolors.BOLD}MOSINT{bcolors.ENDC}.") |
38 | | - | break |
39 | | - | elif not re.match(EMAIL_REGEX, mail): |
40 | | - | print(f"{bcolors.FAIL}Email format is wrong!{bcolors.ENDC}") |
41 | | - | continue |
| 47 | + | print("") |
42 | 48 | | |
43 | 49 | | if (verifyApi != ""): |
44 | 50 | | from modules.VerifyMail import VerifyMail |
| skipped 25 lines |
70 | 76 | | Header(title) |
71 | 77 | | Hunter(mail,hunterApi,_verbose=True) |
72 | 78 | | |
| 79 | + | if (checkPDF == "True" or checkPDF == "T" or checkPDF == "true"): |
| 80 | + | from modules.PDFcheck import PDFcheck |
| 81 | + | title = "RELATED EMAILS IN PDFs" |
| 82 | + | Header(title) |
| 83 | + | PDFcheck(mail,_verbose=True) |
| 84 | + | |
73 | 85 | | if (dbdata == "True" or dbdata == "T" or dbdata == "true"): |
74 | 86 | | from modules.RelatedNumbers import RelatedNumbers |
75 | 87 | | title = "RELATED PHONE NUMBERS" |
| skipped 23 lines |
99 | 111 | | title = "DNS LOOKUP" |
100 | 112 | | Header(title) |
101 | 113 | | DNS(mail,_verbose=True) |
| 114 | + | |
| 115 | + | main() |
102 | 116 | | |
103 | 117 | | |