mirror of
https://github.com/alpkeskin/mosint.git
synced 2026-06-12 21:01:56 +08:00
Update PDFcheck.py
This commit is contained in:
parent
4d0afea793
commit
fb98eb8bec
@ -1,9 +1,11 @@
|
||||
from googlesearch import search
|
||||
from datetime import datetime
|
||||
import requests,re,PyPDF2,tabula,os
|
||||
|
||||
def PDFcheck(mail,_verbose=None):
|
||||
domain = mail.split("@")[1]
|
||||
term = "site:"+domain+" filetype:PDF intext:"+'"'+"email"+'"'
|
||||
emails = ""
|
||||
try:
|
||||
data = search(term, num_results=5)
|
||||
for i in data:
|
||||
@ -20,6 +22,10 @@ def PDFcheck(mail,_verbose=None):
|
||||
if(findPDFs[0] is not None):
|
||||
for pdfs in findPDFs:
|
||||
print(pdfs)
|
||||
emails = emails + "\n" + pdfs
|
||||
with open((datetime.today().strftime('%Y-%m-%d-'+domain)+".txt"), "w") as f:
|
||||
f.write(emails)
|
||||
f.close()
|
||||
except:
|
||||
pass
|
||||
pdfFileObj.close()
|
||||
@ -29,4 +35,4 @@ def PDFcheck(mail,_verbose=None):
|
||||
if os.path.exists("out.txt"):
|
||||
os.remove("out.txt")
|
||||
except:
|
||||
print("PDF Search error!")
|
||||
print("PDF Search error!")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user