SET
#!/usr/bin/python
from src.core import setcore
from src.core.menu import text
import os,subprocess,sys
#########################################
# The Social-Engineer Toolkit (SET) #
# Written by: David Kennedy (ReL1K) #
# Email: davek@secmaniac.com #
#########################################
# this is the main menu structure for SET
# main menu
################################################
# ROOT CHECK
################################################
if os.geteuid() != 0:
print "\n The Social-Engineer Toolkit (SET) - by David Kennedy (ReL1K)"
print "\n Not running as root. \n\nExiting the Social-Engineer Toolkit (SET).\n"
setcore.ExitSet()
setcore.check_pexpect()
setcore.check_beautifulsoup()
define_version = setcore.GetVersion()
setcore.cleanup_routine()
try:
# Remove old Signed_Updates
if os.path.isfile("src/program_junk/Signed_Update.jar"):
subprocess.Popen("rm src/program_junk/Signed_Update.jar", stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
# intitial user menu
if not os.path.isfile("src/agreement"):
print """Copyright 2011, The Social-Engineer Toolkit (SET)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
* Neither the name of Social-Engineer Toolkit nor the names of its contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The above licensing was taken from the BSD licensing and is applied to Social-Engineer Toolkit as well.
Note that the Social-Engineer Toolkit is provided as is, and is a royalty free open-source application.
Feel free to modify, use, change, market, do whatever you want with it as long as you give the appropriate credit where credit
is due (which means giving the authors the credit they deserve for writing it).\n"""
print setcore.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."""
choice = raw_input("\nDo you agree to the terms of service [y/n]: ")
if choice == "yes" or choice == "y":
filewrite = file("src/agreement", "w")
filewrite.write("user accepted")
filewrite.close()
print setcore.bcolors.ENDC
else:
print "[!] Exiting the Social-Engineer Toolkit, have a nice day." + setcore.bcolors.ENDC
sys.exit()
while 1:
setcore.show_banner(define_version,'1')
show_main_menu = setcore.CreateMenu(text.main_text, text.main_menu)
# special case of list item 99
print '\n 99) Exit the Social-Engineer Toolkit\n'
# mainc ore menu
main_menu_choice = (raw_input(setcore.setprompt("0", "")))
# quit out
if main_menu_choice == 'exit' or main_menu_choice == "99" or main_menu_choice == "quit":
setcore.ExitSet()
# cleans up stale processes from SET
try:
# kill anything python running on 80
kill_proc("80","python")
# kill anything on 443 ruby which is generally a rogue listener
kill_proc("443", "ruby")
except: pass
subprocess.Popen("killall python 1> /dev/null 2> /dev/null", shell = True).wait()
# load set
if main_menu_choice == '1':
try:
reload(src.core.set)
except:
import src.core.set
# load fasttrack
if main_menu_choice == '2':
try: reload(src.core.fasttrack)
except: import src.core.fasttrack
# third party modules
if main_menu_choice == '3':
try: reload(src.core.module_handler)
except: import src.core.module_handler
# update metasploit
if main_menu_choice == '4':
setcore.update_metasploit()
# update set
if main_menu_choice == '5':
setcore.update_set()
# credits
if main_menu_choice == '6':
setcore.help_menu()
# handle keyboard interrupts
except KeyboardInterrupt:
print "\n\n Thank you for " + setcore.bcolors.RED+"shopping" + setcore.bcolors.ENDC+" at the Social-Engineer Toolkit.\n\n Hack the Gibson...and remember...hugs are worth more than handshakes.\n"
# handle exceptions
#except Exception, error:
# setcore.log(error)
# print "\n\n Something went wrong, printing the error: "+ str(error)