mirror of
https://github.com/trustedsec/social-engineer-toolkit
synced 2025-02-16 21:38:41 +00:00
Merge pull request #525 from s0i37/master
added anti-blocking inline images in "Mass Mailer Attack"
This commit is contained in:
commit
dad1604875
1 changed files with 22 additions and 1 deletions
|
@ -212,6 +212,17 @@ if option1 != "99":
|
||||||
if not os.path.isfile(file_format):
|
if not os.path.isfile(file_format):
|
||||||
file_format = ""
|
file_format = ""
|
||||||
|
|
||||||
|
inline_files = []
|
||||||
|
while True:
|
||||||
|
yesno = raw_input("Do you want to attach an inline file - [y/n]: ")
|
||||||
|
if yesno.lower() == "y" or yesno.lower() == "yes":
|
||||||
|
inline_file = raw_input(
|
||||||
|
"Enter the path to the inline file you want to attach: ")
|
||||||
|
if os.path.isfile(inline_file):
|
||||||
|
inline_files.append( inline_file )
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
subject = input(setprompt(["1"], "Email subject"))
|
subject = input(setprompt(["1"], "Email subject"))
|
||||||
try:
|
try:
|
||||||
html_flag = input(
|
html_flag = input(
|
||||||
|
@ -315,7 +326,17 @@ def mail(to, subject, prioflag1, prioflag2, text):
|
||||||
fileMsg.set_payload(file(file_format).read())
|
fileMsg.set_payload(file(file_format).read())
|
||||||
email.encoders.encode_base64(fileMsg)
|
email.encoders.encode_base64(fileMsg)
|
||||||
fileMsg.add_header(
|
fileMsg.add_header(
|
||||||
'Content-Disposition', 'attachment;filename=%s' % (file_format))
|
'Content-Disposition', 'attachment; filename="%s"' % os.path.basename(file_format) )
|
||||||
|
msg.attach(fileMsg)
|
||||||
|
|
||||||
|
for inline_file in inline_files:
|
||||||
|
if inline_file != "":
|
||||||
|
fileMsg = email.mime.base.MIMEBase('application', '')
|
||||||
|
fileMsg.set_payload(file(inline_file).read())
|
||||||
|
email.encoders.encode_base64(fileMsg)
|
||||||
|
fileMsg.add_header(
|
||||||
|
'Content-Disposition', 'inline; filename="%s"' % os.path.basename(inline_file) )
|
||||||
|
fileMsg.add_header( "Content-ID", "<%s>" % os.path.basename(inline_file) )
|
||||||
msg.attach(fileMsg)
|
msg.attach(fileMsg)
|
||||||
|
|
||||||
mailServer = smtplib.SMTP(smtp, port)
|
mailServer = smtplib.SMTP(smtp, port)
|
||||||
|
|
Loading…
Add table
Reference in a new issue