mirror of
https://github.com/trustedsec/social-engineer-toolkit
synced 2025-03-03 06:47:31 +00:00
add file attachment abilities within mass mailer
This commit is contained in:
parent
3b103d2e24
commit
3606780252
3 changed files with 20 additions and 11 deletions
|
@ -7,6 +7,7 @@ version 7.2
|
|||
* added wording when using gmail and application specific passwords
|
||||
* rewrote ms08-067 instead of being the python exploit to use the metasploit default which is much more reliable
|
||||
* re-introduced the SMS spoofing method (now option 10) - it has been optimized and reduced to only use SMSGang as a main provider.
|
||||
* added ability to add your own attachments via file format attacks instead of having to use the ones built in
|
||||
|
||||
~~~~~~~~~~~~~~~~
|
||||
version 7.1.2
|
||||
|
|
|
@ -128,14 +128,6 @@ if counter == 0:
|
|||
if os.path.isfile(setdir + "/template.mov"):
|
||||
file_format = (setdir + "/template.mov")
|
||||
|
||||
if counter == 0:
|
||||
print_status("No prior payloads were detected, do you want to import your own payload?")
|
||||
yesno = raw_input("Hit yes to input file to import, or hit no to just send emails [y/n]:")
|
||||
if yesno.lower() == "y" or yesno.lower() == "yes":
|
||||
file_format = raw_input("Enter the file to attach to the emails: ")
|
||||
if not os.path.isfile(file_format):
|
||||
print_error("File was not found! Proceeding without an attachment")
|
||||
|
||||
# Determine if prior payload created
|
||||
if not os.path.isfile(setdir + "/template.pdf"):
|
||||
if not os.path.isfile(setdir + "/template.rar"):
|
||||
|
|
|
@ -12,6 +12,7 @@ import base64
|
|||
# fix for python2 to 3 compatibility
|
||||
try: from cStringIO import StringIO
|
||||
except NameError: from io import StringIO
|
||||
import email,email.encoders,email.mime.text,email.mime.base
|
||||
from email.MIMEMultipart import MIMEMultipart
|
||||
from email.MIMEBase import MIMEBase
|
||||
from email.MIMEText import MIMEText
|
||||
|
@ -196,6 +197,13 @@ if option1 != "99":
|
|||
prioflag1 = ' 1 (Highest)'
|
||||
prioflag2 = ' High'
|
||||
|
||||
# if we want to attach a file
|
||||
file_format = ""
|
||||
yesno = raw_input("Do you want to attach a file - [y/n]: ")
|
||||
if yesno.lower() == "y" or yesno.lower() == "yes":
|
||||
file_format = raw_input("Enter the path to the file you want to attach: ")
|
||||
if not os.path.isfile(file_format): file_format = ""
|
||||
|
||||
subject = input(setprompt(["1"], "Email subject"))
|
||||
try:
|
||||
html_flag = input(
|
||||
|
@ -282,6 +290,14 @@ def mail(to, subject, prioflag1, prioflag2, text):
|
|||
body_type = MIMEText(text, "%s" % (message_flag), 'UTF-8')
|
||||
msg.attach(body_type)
|
||||
|
||||
# now attach the file
|
||||
if file_format != "":
|
||||
fileMsg = email.mime.base.MIMEBase('application', '')
|
||||
fileMsg.set_payload(file(file_format).read())
|
||||
email.encoders.encode_base64(fileMsg)
|
||||
fileMsg.add_header('Content-Disposition','attachment;filename=%s' % (file_format))
|
||||
msg.attach(fileMsg)
|
||||
|
||||
mailServer = smtplib.SMTP(smtp, port)
|
||||
|
||||
io = StringIO()
|
||||
|
@ -340,9 +356,9 @@ if option1 == '1':
|
|||
except KeyboardInterrupt:
|
||||
print_error("Control-C detected, exiting out of SET.")
|
||||
sys.exit()
|
||||
except Exception as err:
|
||||
print_error("Something went wrong.. Printing error: " + str(err))
|
||||
sys.exit()
|
||||
# except Exception as err:
|
||||
# print_error("Something went wrong.. Printing error: " + str(err))
|
||||
# sys.exit()
|
||||
|
||||
# if we specified the mass mailer for multiple users
|
||||
if option1 == '2':
|
||||
|
|
Loading…
Add table
Reference in a new issue