mirror of
https://github.com/trustedsec/social-engineer-toolkit
synced 2024-12-11 21:42:35 +00:00
Merge branch 'master' of https://github.com/trustedsec/social-engineer-toolkit
This commit is contained in:
commit
8bb2c60caa
5 changed files with 41 additions and 17 deletions
13
setoolkit
13
setoolkit
|
@ -18,7 +18,7 @@ elif os.path.isdir("/usr/share/set"):
|
|||
os.chdir("/usr/share/set")
|
||||
sys.path.append("/usr/share/set")
|
||||
|
||||
# if we can't see our config then something didn't go good..
|
||||
# if we can't see our config then something didn't go right...
|
||||
if not os.path.isfile("config/set_config"):
|
||||
print_error("Cannot locate SET executable. Try running from the local directory.")
|
||||
print_error("If this does not work, please run the setup.py install file.")
|
||||
|
@ -42,7 +42,7 @@ if not os.path.isfile("src/logs/set_logfile.log"):
|
|||
filewrite.write("")
|
||||
filewrite.close()
|
||||
|
||||
# grab the operating system
|
||||
# check which operating system
|
||||
operating_system = check_os()
|
||||
|
||||
# use ~/.set
|
||||
|
@ -89,7 +89,8 @@ if operating_system == "posix":
|
|||
subprocess.Popen("chmod +x seautomate;chmod +x set-update;chmod +x setup.py;chmod +x set-proxy;chmod +x src/payloads/ratte/ratteserver;chmod +x src/payloads/set_payloads/listener.py", stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
|
||||
dns = check_config("DNS_SERVER=")
|
||||
if dns == "ON" or dns == "on": start_dns()
|
||||
if dns.lower() == "on":
|
||||
start_dns()
|
||||
|
||||
# remove old files
|
||||
for root, dirs, files in os.walk(setdir):
|
||||
|
@ -147,7 +148,8 @@ try:
|
|||
print bcolors.RED + """
|
||||
The Social-Engineer Toolkit is designed purely for good and not evil. If you are planning on using this tool for malicious purposes that are not authorized by the company you are performing assessments for, you are violating the terms of service and license of this toolset. By hitting yes (only one time), you agree to the terms of service and that you will only use this tool for lawful purposes only.""" + bcolors.GREEN
|
||||
choice = raw_input("\nDo you agree to the terms of service [y/n]: ")
|
||||
if choice == "yes" or choice == "y":
|
||||
choice += " " #b/c method below
|
||||
if choice[0].lower() == "y":
|
||||
filewrite = file("src/agreement4", "w")
|
||||
filewrite.write("user accepted")
|
||||
filewrite.close()
|
||||
|
@ -156,7 +158,7 @@ The Social-Engineer Toolkit is designed purely for good and not evil. If you are
|
|||
print bcolors.ENDC + "[!] Exiting the Social-Engineer Toolkit, have a nice day." + bcolors.ENDC
|
||||
sys.exit()
|
||||
|
||||
while 1:
|
||||
while True:
|
||||
show_banner(define_version,'1')
|
||||
show_main_menu = create_menu(text.main_text, text.main_menu)
|
||||
|
||||
|
@ -167,6 +169,7 @@ The Social-Engineer Toolkit is designed purely for good and not evil. If you are
|
|||
main_menu_choice = (raw_input(setprompt("0", "")))
|
||||
|
||||
# funny
|
||||
# edit: you're hilarious.
|
||||
if main_menu_choice == "hugs":
|
||||
print_warning("Have you given someone a hug today? Remember a hug can change the world.")
|
||||
pause = raw_input("\nPlease give someone a hug then press {return} to continue.")
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -12,9 +12,13 @@ import pexpect
|
|||
import base64
|
||||
import thread
|
||||
|
||||
from cStringIO import StringIO
|
||||
from email.MIMEMultipart import MIMEMultipart
|
||||
from email.MIMEBase import MIMEBase
|
||||
from email.MIMEText import MIMEText
|
||||
from email.header import Header
|
||||
from email.generator import Generator
|
||||
from email import Charset
|
||||
from email import Encoders
|
||||
# DEFINE SENDMAIL CONFIG
|
||||
sendmail=0
|
||||
|
@ -22,6 +26,8 @@ sendmail_file=file("config/set_config","r").readlines()
|
|||
|
||||
from src.core.setcore import *
|
||||
|
||||
Charset.add_charset('utf-8', Charset.BASE64, Charset.BASE64, 'utf-8')
|
||||
|
||||
# Specify if its plain or html
|
||||
message_flag="plain"
|
||||
|
||||
|
@ -309,14 +315,14 @@ else:
|
|||
# Define mail send here
|
||||
def mail(to, subject, text, attach, prioflag1, prioflag2):
|
||||
msg = MIMEMultipart()
|
||||
msg['From'] = from_displayname
|
||||
msg['From'] = str(Header(from_displayname, 'UTF-8').encode() + ' <' + from_address + '> ')
|
||||
msg['To'] = to
|
||||
msg['X-Priority'] = prioflag1
|
||||
msg['X-MSMail-Priority'] = prioflag2
|
||||
msg['Subject'] = subject
|
||||
msg['Subject'] = Header(subject, 'UTF-8').encode()
|
||||
# specify if its html or plain
|
||||
# body message here
|
||||
body_type=MIMEText(text, "%s" % (message_flag))
|
||||
body_type=MIMEText(text, "%s" % (message_flag), 'UTF-8')
|
||||
msg.attach(body_type)
|
||||
# define connection mimebase
|
||||
part = MIMEBase('application', 'octet-stream')
|
||||
|
@ -326,6 +332,11 @@ def mail(to, subject, text, attach, prioflag1, prioflag2):
|
|||
# add headers
|
||||
part.add_header('Content-Disposition','attachment; filename="%s"' % os.path.basename(attach))
|
||||
msg.attach(part)
|
||||
|
||||
io = StringIO()
|
||||
msggen = Generator(io, False)
|
||||
msggen.flatten(msg)
|
||||
|
||||
# define connection to smtp server
|
||||
mailServer = smtplib.SMTP(smtp, int(port))
|
||||
mailServer.ehlo()
|
||||
|
@ -348,7 +359,7 @@ def mail(to, subject, text, attach, prioflag1, prioflag2):
|
|||
mailServer.ehlo()
|
||||
if len(provideruser) > 0:
|
||||
mailServer.login(provideruser, pwd)
|
||||
mailServer.sendmail(from_address, to, msg.as_string())
|
||||
mailServer.sendmail(from_address, to, io.getvalue())
|
||||
except Exception, e:
|
||||
print_error("Unable to deliver email. Printing exceptions message below, this is most likely due to an illegal attachment. If using GMAIL they inspect PDFs and is most likely getting caught.")
|
||||
raw_input("Press {return} to view error message.")
|
||||
|
@ -360,16 +371,16 @@ def mail(to, subject, text, attach, prioflag1, prioflag2):
|
|||
print str(e)
|
||||
try:
|
||||
mailServer.login(provideremail, pwd)
|
||||
thread.start_new_thread(mailServer.sendmail(from_address, to, msg.as_string()))
|
||||
thread.start_new_thread(mailServer.sendmail(from_address, to, io.getvalue()))
|
||||
except Exception, e:
|
||||
return_continue()
|
||||
|
||||
if email_provider == "hotmail":
|
||||
mailServer.login(provideruser, pwd)
|
||||
thread.start_new_thread(mailServer.sendmail,(from_address, to, msg.as_string()))
|
||||
thread.start_new_thread(mailServer.sendmail,(from_address, to, io.getvalue()))
|
||||
|
||||
if sendmail == 1:
|
||||
thread.start_new_thread(mailServer.sendmail,(from_address, to, msg.as_string()))
|
||||
thread.start_new_thread(mailServer.sendmail,(from_address, to, io.getvalue()))
|
||||
|
||||
if option1 == '1':
|
||||
try:
|
||||
|
|
|
@ -10,11 +10,17 @@ import glob
|
|||
import random
|
||||
import time
|
||||
import base64
|
||||
from cStringIO import StringIO
|
||||
from email.MIMEMultipart import MIMEMultipart
|
||||
from email.MIMEBase import MIMEBase
|
||||
from email.MIMEText import MIMEText
|
||||
from email.header import Header
|
||||
from email.generator import Generator
|
||||
from email import Charset
|
||||
from email import Encoders
|
||||
|
||||
Charset.add_charset('utf-8', Charset.BASE64, Charset.BASE64, 'utf-8')
|
||||
|
||||
# default the email messages to plain text
|
||||
# unless otherwise specified
|
||||
message_flag="plain"
|
||||
|
@ -241,17 +247,21 @@ if option1 != "99":
|
|||
def mail(to, subject, prioflag1, prioflag2, text):
|
||||
|
||||
msg = MIMEMultipart()
|
||||
msg['From'] = from_displayname
|
||||
msg['From'] = str(Header(from_displayname, 'UTF-8').encode() + ' <' + from_address + '> ')
|
||||
msg['To'] = to
|
||||
msg['X-Priority'] = prioflag1
|
||||
msg['X-MSMail-Priority'] = prioflag2
|
||||
msg['Subject'] = subject
|
||||
msg['Subject'] = Header(subject, 'UTF-8').encode()
|
||||
|
||||
body_type=MIMEText(text, "%s" % (message_flag))
|
||||
body_type=MIMEText(text, "%s" % (message_flag), 'UTF-8')
|
||||
msg.attach(body_type)
|
||||
|
||||
mailServer = smtplib.SMTP(smtp, port)
|
||||
|
||||
io = StringIO()
|
||||
msggen = Generator(io, False)
|
||||
msggen.flatten(msg)
|
||||
|
||||
if sendmail == 0:
|
||||
|
||||
if email_provider == "gmail":
|
||||
|
@ -266,7 +276,7 @@ def mail(to, subject, prioflag1, prioflag2, text):
|
|||
try:
|
||||
if provideruser != "" or pwd != "":
|
||||
mailServer.login(provideruser, pwd)
|
||||
mailServer.sendmail(from_address, to, msg.as_string())
|
||||
mailServer.sendmail(from_address, to, io.getvalue())
|
||||
|
||||
except:
|
||||
# try logging in with base64 encoding here
|
||||
|
@ -281,7 +291,7 @@ def mail(to, subject, prioflag1, prioflag2, text):
|
|||
return_continue()
|
||||
|
||||
if sendmail == 1:
|
||||
mailServer.sendmail(from_address, to, msg.as_string())
|
||||
mailServer.sendmail(from_address, to, io.getvalue())
|
||||
|
||||
# if we specified a single address
|
||||
if option1 == '1':
|
||||
|
|
Loading…
Reference in a new issue