File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,24 @@ def whois_gather(short_domain):
26
26
print (Fore .RED + "Error while gathering WHOIS information. Reason: {}" .format (e ))
27
27
pass
28
28
29
- def mail_gather (url ):
29
+ def contact_mail_gather (url ):
30
+ try :
31
+ r = requests .get (url )
32
+ data = r .text
33
+ soup = BeautifulSoup (data , "html.parser" )
34
+ mails = []
35
+ for i in soup .find_all (href = re .compile ("mailto" )):
36
+ i .encode ().decode ()
37
+ mails .append (i .string )
38
+ if (not mails ) or (mails is None ):
39
+ return 'No contact e-mails were found'
40
+ else :
41
+ return mails
42
+ except requests .RequestException as e :
43
+ print (Fore .RED + "Error while gathering e-mails. Reason: {}" .format (e ))
44
+ pass
45
+
46
+ def subdomains_mail_gather (url ):
30
47
try :
31
48
r = requests .get (url )
32
49
data = r .text
@@ -131,7 +148,7 @@ def domains_reverse_research(subdomains, report_file_type):
131
148
132
149
try :
133
150
for subdomain_url in subdomain_urls :
134
- subdomain_mail = mail_gather (subdomain_url )
151
+ subdomain_mail = subdomains_mail_gather (subdomain_url )
135
152
subdomain_mails .append (subdomain_mail )
136
153
subdomain_social = sm_gather (subdomain_url )
137
154
subdomain_socials .append (subdomain_social )
You can’t perform that action at this time.
0 commit comments