Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Lucksi
GitHub Repository: Lucksi/Mr.Holmes
Path: blob/master/Core/E_Mail.py
1071 views
1
# ORIGINAL CREATOR: Luca Garofalo (Lucksi)
2
# AUTHOR: Luca Garofalo (Lucksi)
3
# Copyright (C) 2021-2024 Lucksi <[email protected]>
4
# License: GNU General Public License v3.0
5
6
import os
7
import json
8
import urllib
9
import MrHolmes as holmes
10
from Core.Support import Font
11
from Core.Support import Creds
12
from Core.Support import FileTransfer
13
from Core.Support import Clear
14
from Core.Support import Dorks
15
from Core.Support.Mail import Mail_Validator as mail
16
from Core.Support.Mail import Lookup
17
from Core.Support import ApiCheck as Api
18
from Core.Support import Banner_Selector as banner
19
from Core.Support import Language
20
from Core.Support import DateFormat
21
from Core.Support import Notification
22
from Core.Support import Encoding
23
from time import sleep
24
from datetime import datetime
25
26
filename = Language.Translation.Get_Language()
27
filename
28
29
30
class Mail_search:
31
32
@staticmethod
33
def Banner(Mode):
34
Clear.Screen.Clear()
35
Folder = "Banners/E-Mail"
36
banner.Random.Get_Banner(Folder, Mode)
37
38
@staticmethod
39
def Google_dork(username):
40
report = "GUI/Reports/E-Mail/Dorks/{}_dorks.txt".format(username)
41
nomefile = "Site_lists/E-Mail/Google_dorks.txt"
42
if os.path.isfile(report):
43
os.remove(report)
44
print(Font.Color.BLUE + "\n[I]" + Font.Color.WHITE + Language.Translation.Translate_Language(
45
filename, "Dorks", "Remove", "None").format(username))
46
else:
47
pass
48
Type = "GOOGLE"
49
Dorks.Search.dork(username, report, nomefile, Type)
50
51
@staticmethod
52
def Yandex_dork(username):
53
report = "GUI/Reports/E-Mail/Dorks/{}_dorks.txt".format(username)
54
nomefile = "Site_lists/E-Mail/Yandex_dorks.txt"
55
Type = "YANDEX"
56
Dorks.Search.dork(username, report, nomefile, Type)
57
58
@staticmethod
59
def Lookup(username, report):
60
print(Font.Color.GREEN + "\n[+]" + Font.Color.WHITE +
61
Language.Translation.Translate_Language(filename, "Website", "Default", "Whois").format(username))
62
sleep(2)
63
Key = Api.Check.WhoIs()
64
Key
65
RecList = []
66
if Key == "None":
67
print(Font.Color.RED + "[!]" + Font.Color.WHITE + "API-KEY NOT FOUND")
68
else:
69
try:
70
print(Font.Color.GREEN + "[+]" +
71
Font.Color.WHITE + Language.Translation.Translate_Language(filename, "Website", "Parameters", "KeyFound"))
72
Key2 = str(Key)
73
source = "https://emailverification.whoisxmlapi.com/api/v3?apiKey={}&emailAddress={}".format(
74
Key2, username)
75
access = urllib.request.urlopen(source)
76
reader = access.read()
77
final = json.loads(reader)
78
name = final["username"]
79
domain = final["domain"]
80
completemail = final["emailAddress"]
81
dns = final["dnsCheck"]
82
freeDomain = final["freeCheck"]
83
Temporary = final["disposableCheck"]
84
if("smtpCheck" in final):
85
smtp = final["smtpCheck"]
86
SmtpOk = True
87
else:
88
SmtpOk = False
89
if("catchAllCheck" in final):
90
CatchAll = final["catchAllCheck"]
91
CatchOk = True
92
else:
93
CatchOk = False
94
if("mxRecords" in final):
95
Records = final["mxRecords"]
96
i = 0
97
for record in Records:
98
RecList.append(record)
99
i = i+1
100
RecordOk = True
101
else:
102
RecordOk = False
103
print(Font.Color.GREEN +
104
"\n[+]" + Font.Color.WHITE + "INFORMATIONS FOUND:")
105
sleep(3)
106
print(Font.Color.YELLOW + "[v]" +
107
Font.Color.WHITE + "NAME: " + name)
108
print(Font.Color.YELLOW + "[v]" +
109
Font.Color.WHITE + "DOMAIN: " + domain)
110
print(Font.Color.YELLOW +
111
"[v]" + Font.Color.WHITE + "EMAIL: " + completemail)
112
if SmtpOk:
113
print(Font.Color.YELLOW + "[v]" +
114
Font.Color.WHITE + "SMTP: " + smtp)
115
print(Font.Color.YELLOW + "[v]" +
116
Font.Color.WHITE + "DNS: " + dns)
117
print(Font.Color.YELLOW +
118
"[v]" + Font.Color.WHITE + "FREE-DOMAIN: " + freeDomain)
119
print(Font.Color.YELLOW +
120
"[v]" + Font.Color.WHITE + "TEMPORARY: " + Temporary)
121
if CatchOk:
122
print(Font.Color.YELLOW +
123
"[v]" + Font.Color.WHITE + "CATCH-ALL: " + CatchAll)
124
if RecordOk:
125
print(Font.Color.GREEN +
126
"\n[+]" + Font.Color.WHITE + "FOUND MX-RECORDS(DNS):")
127
i = 1
128
for record in RecList:
129
print(
130
Font.Color.YELLOW + "[v]" + Font.Color.WHITE + "RECORD N {}: ".format(i) + record)
131
i = i+1
132
sleep(2)
133
f = open(report, "a")
134
f.write("\n\nEMAIL DATA:" + "\r\n")
135
f.write("NAME: " + name + "\r\n")
136
f.write("DOMAIN: " + domain + "\r\n")
137
f.write("EMAIL: " + completemail + "\r\n")
138
f.write("SMTP: " + smtp + "\r\n")
139
f.write("FREE-DOMAIN: " + freeDomain + "\r\n")
140
f.write("TEMPORARY: " + Temporary + "\r\n")
141
f.write("CATCH-ALL: " + CatchAll + "\r\n")
142
f.write("\n\nFOUND MX-RECORDS(DNS)" + "\r\n")
143
i = 1
144
for record in RecList:
145
f.write("RECORD N {}: ".format(i) + record + "\r\n")
146
i = i+1
147
except Exception as e:
148
pass
149
150
@staticmethod
151
def searcher(username, report, Mode):
152
#nomefile = "Temp/E-Mail/Code.txt"
153
#if os.path.isfile(nomefile):
154
list_file = "Site_lists/E-Mail/Lists.json"
155
reader = open(list_file,)
156
data = json.loads(reader.read())
157
for sites in data:
158
for data1 in sites:
159
name = sites[data1]["name"]
160
url = sites[data1]["url"].replace("{}", username)
161
print(
162
Font.Color.GREEN + "\n[+]" + Font.Color.WHITE + Language.Translation.Translate_Language(filename, "Email", "Link", "None").format(name))
163
sleep(2)
164
print(Font.Color.YELLOW + "[v]" + Font.Color.WHITE + url)
165
f = open(report, "a")
166
f.write("\nGENERATING {} LINK".format(name))
167
f.write("\n{}".format(url))
168
f.close()
169
f.close()
170
#os.remove(nomefile)
171
#else:
172
# holmes.Main.Menu(Mode)
173
174
@staticmethod
175
def Search(username, Mode):
176
Mail_search.Banner(Mode)
177
print(Font.Color.BLUE + "\n[I]" + Font.Color.WHITE + "INFO:" + "[{}]".format(Font.Color.GREEN + Language.Translation.Translate_Language(filename,"Email","Explanation","None") + Font.Color.WHITE) )
178
now = datetime.now()
179
dataformat = DateFormat.Get.Format()
180
dt_string = now.strftime(dataformat)
181
Date = "Date: " + str(dt_string)
182
folder = "GUI/Reports/E-Mail/" + username
183
report = "GUI/Reports/E-Mail/{}/{}.txt".format(username,username)
184
report2 = "GUI/Reports/E-Mail/{}/{}.mh".format(username,username)
185
if os.path.isfile(report):
186
os.remove(report)
187
print(Font.Color.BLUE + "\n[I]" + Font.Color.WHITE +
188
Language.Translation.Translate_Language(filename, "Default", "Delete", "None").format(username))
189
elif os.path.isfile(report2):
190
os.remove(report2)
191
print(Font.Color.BLUE + "\n[I]" + Font.Color.WHITE +
192
Language.Translation.Translate_Language(filename, "Default", "Delete", "None").format(username))
193
else:
194
os.mkdir(folder)
195
f = open(report, "w")
196
f.write("SCANNING EXECUTED ON:\n" + Date + "\n")
197
f.close()
198
isvalid = mail.Validator.Mail(username, report)
199
if isvalid:
200
Mail_search.Lookup(username, report)
201
lookup = int(input(Font.Color.BLUE + "\n[?]" + Font.Color.WHITE + "WOULD YOU LIKE TO CHECK IF THIS EMAIL IS USED ON SOME SOCIAL MEDIA?(1)YES(2)NO\n\n" + Font.Color.GREEN + "[#MR.HOLMES#]" + Font.Color.WHITE + "-->"))
202
if lookup == 1:
203
Lookup.List.Main(report,username)
204
Mail_search.searcher(username, report, Mode)
205
choice = int(input(
206
Font.Color.BLUE + "\n[?]" + Font.Color.WHITE + Language.Translation.Translate_Language(filename, "Default", "Dorks", "None") + Font.Color.GREEN + "[#MR.HOLMES#]" + Font.Color.WHITE + "-->"))
207
if choice == 1:
208
Mail_search.Google_dork(username)
209
Mail_search.Yandex_dork(username)
210
else:
211
pass
212
print(Font.Color.WHITE + Language.Translation.Translate_Language(filename, "Default", "Report", "None") +
213
os.getcwd() + "/" + report)
214
f = open(report, "a")
215
f.write(Language.Translation.Translate_Language(
216
filename, "Report", "Default", "By"))
217
f.close()
218
print(Font.Color.WHITE + Language.Translation.Translate_Language(filename, "Default", "Report", "None") +
219
report)
220
Notification.Notifier.Start(Mode)
221
Creds.Sender.mail(report, username)
222
choice = int(input(
223
Font.Color.BLUE + "\n[?]" + Font.Color.WHITE + Language.Translation.Translate_Language(filename, "Transfer", "Question", "None") + Font.Color.GREEN + "[#MR.HOLMES#]" + Font.Color.WHITE + "-->"))
224
if choice == 1:
225
FileTransfer.Transfer.File(report, username, ".txt")
226
Encoding.Encoder.Encode(report)
227
inp = input(Language.Translation.Translate_Language(
228
filename, "Default", "Continue", "None"))
229
230