Se Toolkit
Se Toolkit
/usr/bin/env python3
# coding=utf-8
import os
import re
import shutil
import subprocess
import sys
# Py2/3 compatibility
# Python3 renamed raw_input to input
try:
input = raw_input
except NameError:
pass
if operating_system == "posix":
#
# 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")
core.exit_set()
if not os.path.isfile("/etc/setoolkit/set.config"):
shutil.copyfile("src/core/config.baseline", "/etc/setoolkit/set.config")
if os.path.isfile(os.path.join(core.userconfigpath, "version.lock")):
os.remove(os.path.join(core.userconfigpath, "version.lock"))
# use ~/.set
if operating_system == "posix":
if not os.path.isdir(core.userconfigpath):
# create the set variables
os.makedirs(core.userconfigpath)
# if for some reason it failed to pull the path
userdir = os.path.join(os.path.expanduser('~'), '.set')
if not os.path.isdir(userdir):
os.makedirs(userdir)
#
# The Social-Engineer Toolkit (SET) #
# Written by: David Kennedy (ReL1K) #
#
#
# this is the main menu structure for SET
# main menu
dns = core.check_config("DNS_SERVER=")
if dns.lower() == "on":
import src.core.minifakedns
from src.core.setcore import detect_public_ip
src.core.minifakedns.start_dns_server(detect_public_ip())
define_version = core.get_version()
try:
# Remove old Signed_Updates
if os.path.isfile(os.path.join(core.userconfigpath, "Signed_Update.jar")):
os.remove(os.path.join(core.userconfigpath, "Signed_Update.jar"))
while True:
core.show_banner(define_version, '1')
show_main_menu = core.create_menu(text.main_text, text.main_menu)
# funny
if main_menu_choice == "hugs":
core.print_warning("Have you given someone a hug today? Remember a hug
can change the world.")
pause = input("\nPlease give someone a hug then press {return} to
continue.")
# funny2
if main_menu_choice == "freehugs":
core.print_warning("HUGS ARE ALWAYS FREE! NEVER CHARGE! ALWAYS HUG.")
pause = input("\nDo not press return until giving someone a hug.")
# funny3
if main_menu_choice == "derbycon":
core.print_warning(core.bcolors.BOLD + "YAYYYYYYYYYYYYYYYYYYYYYY
DerbyCon.\n\nDerbyCon 7.0 'Legacy' -- September 22th - 24th 2017" +
core.bcolors.ENDC)
pause = input(core.bcolors.BOLD + "\nDon't miss it! Sep 23 - Sep 25th!
Press {return} to continue." + core.bcolors.ENDC)
# rance
if main_menu_choice == "rance":
core.print_warning(core.bcolors.BOLD + "We miss you buddy. David Jones
(Rance) changed a lot of us and you'll always be apart of our lives (and SET). Fuck
Cancer." + core.bcolors.ENDC)
pause = input("Press {return} to continue.")
# cavs
if main_menu_choice == "cavs":
core.print_warning(core.bcolors.BOLD + "2015-2016 CHAMPS BABY!!! C l e
e e e e e v eeee l a a n n d d d d d d d d d d d " + core.bcolors.ENDC)
pause = input("Press {return} to continue.")
# quit out
if main_menu_choice == 'exit' or main_menu_choice == "99" or
main_menu_choice == "quit":
core.exit_set()
# cleans up stale processes from SET
try:
# kill anything python running on 80
core.kill_proc("80", "python")
# kill anything on 443 ruby which is generally a rogue listener
core.kill_proc("443", "ruby")
except:
pass
# load set
if main_menu_choice == '1':
try:
core.module_reload(src.core.set)
except:
import src.core.set
# load fasttrack
if main_menu_choice == '2':
try:
core.module_reload(src.core.fasttrack)
except:
import src.core.fasttrack
# update set
if main_menu_choice == '4':
core.update_set()
# credits
if main_menu_choice == '5':
update_config()
# update config
if main_menu_choice == '6':
core.help_menu()
# cleanup routine
core.cleanup_routine()