setup.py support Arch Linux ; Python3 (most) and identation errors on setoolkit and setcore.py

This commit is contained in:
fnk0c 2015-05-24 19:02:03 -03:00
parent 0af45fb058
commit 4fdeb8974f
3 changed files with 186 additions and 160 deletions

View file

@ -2,14 +2,17 @@
import os
import sys
try:raw_input
except: raw_input = input
# if we are running in the path no need to change
if os.path.isfile("setoolkit"):
pass
# check where we are and load default directory
elif os.path.isdir("/usr/share/setoolkit"):
if not os.path.isfile("setoolkit"):
os.chdir("/usr/share/setoolkit")
if not os.path.isfile("setoolkit"):
os.chdir("/usr/share/setoolkit")
sys.path.append("/usr/share/setoolkit")
# check where we are and load default directory
@ -68,7 +71,7 @@ try:
from Crypto.Cipher import AES
except ImportError:
print "[!] The python-pycrypto python module not installed. You will lose the ability to use multi-pyinjector."
print("[!] The python-pycrypto python module not installed. You will lose the ability to use multi-pyinjector.")
pass
#########################################
@ -118,8 +121,8 @@ if operating_system == "posix":
################################################
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"
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")
exit_set()
# if there isn't a set_config.py file yet, create one
@ -143,19 +146,19 @@ try:
if not os.path.isfile("src/agreement4"):
fileopen = file("readme/LICENSE", "r")
for line in fileopen:
print line.rstrip()
print(line.rstrip())
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
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]: ")
choice += " " #b/c method below
if choice[0].lower() == "y":
filewrite = file("src/agreement4", "w")
filewrite.write("user accepted")
filewrite.close()
print bcolors.ENDC
print(bcolors.ENDC)
else:
print bcolors.ENDC + "[!] Exiting the Social-Engineer Toolkit, have a nice day." + bcolors.ENDC
print(bcolors.ENDC + "[!] Exiting the Social-Engineer Toolkit, have a nice day." + bcolors.ENDC)
sys.exit()
while True:
@ -163,7 +166,7 @@ The Social-Engineer Toolkit is designed purely for good and not evil. If you are
show_main_menu = create_menu(text.main_text, text.main_menu)
# special case of list item 99
print '\n 99) Exit the Social-Engineer Toolkit\n'
print('\n 99) Exit the Social-Engineer Toolkit\n')
# main core menu
main_menu_choice = (raw_input(setprompt("0", "")))
@ -174,10 +177,10 @@ The Social-Engineer Toolkit is designed purely for good and not evil. If you are
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.")
# funny2
if main_menu_choice == "freehugs":
print_warning("HUGS ARE ALWAYS FREE! NEVER CHARGE! ALWAYS HUG.")
pause = raw_input("\nDo not press return until giving someone a hug.")
# funny2
if main_menu_choice == "freehugs":
print_warning("HUGS ARE ALWAYS FREE! NEVER CHARGE! ALWAYS HUG.")
pause = raw_input("\nDo not press return until giving someone a hug.")
# funny3
if main_menu_choice == "derbycon":
@ -226,12 +229,12 @@ The Social-Engineer Toolkit is designed purely for good and not evil. If you are
# handle keyboard interrupts
except KeyboardInterrupt:
print "\n\nThank you for " + bcolors.RED+"shopping" + bcolors.ENDC+" with the Social-Engineer Toolkit.\n\nHack the Gibson...and remember...hugs are worth more than handshakes.\n"
print("\n\nThank you for " + bcolors.RED+"shopping" + bcolors.ENDC+" with the Social-Engineer Toolkit.\n\nHack the Gibson...and remember...hugs are worth more than handshakes.\n")
# handle exceptions
except Exception, error:
except Exception as error:
log(error)
print "\n\n[!] Something went wrong, printing the error: "+ str(error)
print("\n\n[!] Something went wrong, printing the error: "+ str(error))
# cleanup routine
cleanup_routine()

View file

@ -7,10 +7,20 @@ import sys
import os
import platform
# Changes:
# * Check user id
# * Pacman support
# * Python 3 on setup.py
# if nix then run installer
if platform.system() == "Linux":
# give installer a null value
installer = False
#Check user ID
if os.getuid() != 0:
print("Are you root? Please execute as root")
exit()
try:
# if our command option is true then install stuff
@ -19,10 +29,10 @@ if platform.system() == "Linux":
# if index is out of range then flag options
except IndexError:
print "** SET Dependancy Installer **"
print "** Written by: Dave Kennedy (ReL1K) **"
print "** Visit: https://www.trustedsec.com **"
print "\nTo install: setup.py install"
print("** SET Dependancy Installer **")
print("** Written by: Dave Kennedy (ReL1K) **")
print("** Visit: https://www.trustedsec.com **")
print("\nTo install: setup.py install")
# if user specified install then lets to the installation
if installer is True:
@ -33,36 +43,46 @@ if platform.system() == "Linux":
# force install of debian packages
subprocess.Popen("apt-get --force-yes -y install git build-essential python-pexpect python-pefile python-crypto python-openssl", shell=True).wait()
# if sources.list is not available then we're running something offset
# If pacman.conf exists, we have a Arch based system
elif os.path.isfile("/etc/pacman.conf"):
subprocess.Popen("pacman -S --noconfirm --needed git python2 python2-beautifulsoup3 python2-pexpect python2-crypto", shell=True).wait()
subprocess.Popen("wget https://pefile.googlecode.com/files/pefile-1.2.10-139.tar.gz", shell=True).wait()
subprocess.Popen("tar xvfz pefile-1.2.10-139.tar.gz", shell=True).wait()
subprocess.Popen("chmod a+x pefile-1.2.10-139/setup.py", shell=True).wait()
subprocess.Popen("rm -rf pefile-1.2.10-139*", shell=True).wait()
# if sources.list or pacman.conf is not available then we're running something offset
else:
print "[!] You're not running a Debian variant. Installer not finished for this type of Linux distro."
print "[!] Install git, python-pexpect, python-crypto, python-openssl, python-pefile manually for all of SET dependancies."
print("[!] You're not running a Debian or Arch variant. Installer not finished for this type of Linux distro.")
print("[!] Install git, python-pexpect, python-crypto, python-openssl, python-pefile manually for all of SET dependancies.")
sys.exit()
if os.path.isdir("/usr/share/setoolkit"):
print "[!] SET is already installed in /usr/share/setoolkit. Remove and start again."
print("[!] SET is already installed in /usr/share/setoolkit. Remove and start again.")
sys.exit()
if not os.path.isfile("/usr/bin/git"):
print "[-] Install failed. GIT is not installed. SET will not continue."
print "[!] Install GIT and run the installer again."
print("[-] Install failed. GIT is not installed. SET will not continue.")
print("[!] Install GIT and run the installer again.")
sys.exit()
print "[*] Installing SET into the /usr/share/setoolkit folder through git..."
subprocess.Popen("git clone https://github.com/trustedsec/social-engineer-toolkit /usr/share/setoolkit", shell=True).wait()
print "[*] Installing setoolkit installer to /usr/bin/setoolkit..."
subprocess.Popen("cp /usr/share/setoolkit/setoolkit /usr/bin", shell=True).wait()
print("[*] Moving SET into the /usr/share/ directory...")
subprocess.Popen("cd .. && mv social-engineer-toolkit setoolkit && mv setoolkit /usr/share/", shell=True).wait()
print("[*] Installing setoolkit installer to /usr/bin/setoolkit...")
subprocess.Popen("echo #!/bin/bash > /usr/bin/setoolkit", shell=True).wait()
subprocess.Popen("echo cd /usr/share/setoolkit >> /usr/bin/setoolkit", shell=True).wait()
subprocess.Popen("echo exec python2 setoolkit $@ >> /usr/bin/setoolkit", shell=True).wait()
subprocess.Popen("cp /usr/share/setoolkit/seupdate /usr/bin/", shell=True).wait()
subprocess.Popen("chmod +x /usr/bin/setoolkit", shell=True).wait()
print "[*] Note you will manually need to install Core Security 'Impacket'"
print "[*] Download link: http://corelabs.coresecurity.com/index.php?module=Wiki&action=view&type=tool&name=Impacket"
print("[*] Note you will manually need to install Core Security 'Impacket'")
print("[*] Download link: http://corelabs.coresecurity.com/index.php?module=Wiki&action=view&type=tool&name=Impacket")
# https://impacket.googlecode.com/files/impacket-0.9.10.tar.gz
print "[*] Once downloaded, tar -zxvf impacket*, go to the directory and run python setup.py install."
print "[*] We are now finished! To run SET, type setoolkit..."
print("[*] Once downloaded, tar -zxvf impacket*, go to the directory and run python setup.py install.")
print("[*] We are now finished! To run SET, type setoolkit...")
if platform.system() =='Darwin':
subprocess.Popen("easy_install pexpect pycrypto pyopenssl pefile", shell=True).wait()
if platform.system() != "Linux":
if platform.system() != "Darwin":
print "[!] Sorry this installer is not designed for any other system other than Linux and Mac. Please install the Python dependencies manually."
print("[!] Sorry this installer is not designed for any other system other than Linux and Mac. Please install the Python dependencies manually.")

View file

@ -19,13 +19,16 @@ import thread
import cStringIO
import trace
try: raw_input
except: raw_input = input
# check to see if we have python-pycrypto
try:
from Crypto.Cipher import AES
except ImportError:
print "[!] The python-pycrypto python module not installed. You will lose the ability for encrypted communications."
print ("[!] The python-pycrypto python module not installed. You will lose the ability for encrypted communications.")
pass
# get the main SET path
@ -202,7 +205,7 @@ def debug_msg(currentModule, message, msgType):
else:
if msgType <= DEBUG_LEVEL:
# a bit more streamlined
print bcolors.RED + "\nDEBUG_MSG: from module '" + currentModule + "': " + message + bcolors.ENDC
print(bcolors.RED + "\nDEBUG_MSG: from module '" + currentModule + "': " + message + bcolors.ENDC)
if DEBUG_LEVEL == 2 or DEBUG_LEVEL == 4 or DEBUG_LEVEL == 6:
raw_input("waiting for <ENTER>\n")
@ -215,19 +218,19 @@ def mod_name():
##########################################
############ RUNTIME MESSAGES ############
def print_status(message):
print bcolors.GREEN + bcolors.BOLD + "[*] " + bcolors.ENDC + str(message)
print(bcolors.GREEN + bcolors.BOLD + "[*] " + bcolors.ENDC + str(message))
def print_info(message):
print bcolors.BLUE + bcolors.BOLD + "[-] " + bcolors.ENDC + str(message)
print(bcolors.BLUE + bcolors.BOLD + "[-] " + bcolors.ENDC + str(message))
def print_info_spaces(message):
print bcolors.BLUE + bcolors.BOLD + " [-] " + bcolors.ENDC + str(message)
print(bcolors.BLUE + bcolors.BOLD + " [-] " + bcolors.ENDC + str(message))
def print_warning(message):
print bcolors.YELLOW + bcolors.BOLD + "[!] " + bcolors.ENDC + str(message)
print(bcolors.YELLOW + bcolors.BOLD + "[!] " + bcolors.ENDC + str(message))
def print_error(message):
print bcolors.RED + bcolors.BOLD + "[!] " + bcolors.ENDC + bcolors.RED + str(message) + bcolors.ENDC
print(bcolors.RED + bcolors.BOLD + "[!] " + bcolors.ENDC + bcolors.RED + str(message) + bcolors.ENDC)
def get_version():
define_version = '6.3.2'
@ -237,7 +240,7 @@ class create_menu:
def __init__(self, text, menu):
self.text = text
self.menu = menu
print text
print(text)
for i, option in enumerate(menu):
menunum = i + 1
@ -250,7 +253,7 @@ class create_menu:
else:
print(' %s) %s' % (menunum,option))
else:
print '\n 99) Return to Main Menu\n'
print('\n 99) Return to Main Menu\n')
return
def validate_ip(address):
@ -280,44 +283,44 @@ def meta_path():
trigger = 0
if not os.path.isdir(msf_path):
# specific for kali linux
if os.path.isfile("/opt/metasploit/apps/pro/msf3/msfconsole"):
msf_path = "/opt/metasploit/apps/pro/msf3/"
trigger = 1
# specific for kali linux
if os.path.isfile("/opt/metasploit/apps/pro/msf3/msfconsole"):
msf_path = "/opt/metasploit/apps/pro/msf3/"
trigger = 1
# specific for backtrack5 and other backtrack versions
if os.path.isfile("/opt/framework3/msf3/msfconsole"):
msf_path = "/opt/framework3/msf3/"
trigger = 1
if os.path.isfile("/opt/framework/msf3/msfconsole"):
msf_path = "/opt/framework/msf3/"
trigger = 1
if os.path.isfile("/opt/metasploit/msf3/msfconsole"):
msf_path = "/opt/metasploit/msf3/"
trigger = 1
# specific for backtrack5 and other backtrack versions
if os.path.isfile("/opt/framework3/msf3/msfconsole"):
msf_path = "/opt/framework3/msf3/"
trigger = 1
if os.path.isfile("/opt/framework/msf3/msfconsole"):
msf_path = "/opt/framework/msf3/"
trigger = 1
if os.path.isfile("/opt/metasploit/msf3/msfconsole"):
msf_path = "/opt/metasploit/msf3/"
trigger = 1
# specific for pwnpad and pwnplug (pwnie express)
if os.path.isfile("/opt/metasploit-framework/msfconsole"):
msf_path = "/opt/metasploit-framework/"
trigger = 1
if os.path.isfile("/opt/metasploit-framework/msfconsole"):
msf_path = "/opt/metasploit-framework/"
trigger = 1
if os.path.isfile("/usr/bin/msfconsole"):
msf_path = ""
trigger = 1
if os.path.isfile("/usr/bin/msfconsole"):
msf_path = ""
trigger = 1
if trigger == 0:
if check_os() != "windows":
check_metasploit = check_config("METASPLOIT_MODE=").lower()
if check_metasploit != "off":
print_error("Metasploit path not found. These payloads will be disabled.")
print_error("Please configure in the config/set_config.")
return_continue()
return False
if trigger == 0:
if check_os() != "windows":
check_metasploit = check_config("METASPLOIT_MODE=").lower()
if check_metasploit != "off":
print_error("Metasploit path not found. These payloads will be disabled.")
print_error("Please configure in the config/set_config.")
return_continue()
return False
# if we are using windows
if check_os() == "windows":
print_warning("Metasploit payloads are not currently supported. This is coming soon.")
msf_path = ""
# if we are using windows
if check_os() == "windows":
print_warning("Metasploit payloads are not currently supported. This is coming soon.")
msf_path = ""
# this is an option if we don't want to use Metasploit period
check_metasploit = check_config("METASPLOIT_MODE=").lower()
@ -377,9 +380,9 @@ def grab_ipaddress():
if ip_check == True: break
return rhost
except Exception, e:
except Exception as e:
print_error("ERROR:Something went wrong:")
print bcolors.RED + "ERROR:" + str(e) + bcolors.ENDC
print(bcolors.RED + "ERROR:" + str(e) + bcolors.ENDC)
#
@ -436,12 +439,12 @@ def help_menu():
fileopen = file("README.md", "r").readlines()
for line in fileopen:
line = line.rstrip()
print line
print(line)
fileopen = file("readme/CREDITS", "r").readlines()
print "\n"
print("\n")
for line in fileopen:
line = line.rstrip()
print line
print(line)
return_continue()
@ -613,17 +616,17 @@ def java_applet_attack(website, port, directory):
applet_name = check_options("APPLET_NAME=")
if applet_name == "":
applet_name = generate_random_string(6, 15) + ".jar"
applet_name = generate_random_string(6, 15) + ".jar"
# lastly we need to copy over the signed applet
subprocess.Popen("cp %s/Signed_Update.jar %s/%s" % (setdir,directory,applet_name), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).wait()
# lastly we need to copy over the signed applet
subprocess.Popen("cp %s/Signed_Update.jar %s/%s" % (setdir,directory,applet_name), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).wait()
# start the web server by running it in the background
start_web_server(directory)
# start the web server by running it in the background
start_web_server(directory)
# run multi handler for metasploit
print_info("Starting the multi/handler through Metasploit...")
metasploit_listener_start("windows/meterpreter/reverse_tcp",port)
# run multi handler for metasploit
print_info("Starting the multi/handler through Metasploit...")
metasploit_listener_start("windows/meterpreter/reverse_tcp",port)
#
# this will create a raw PDE file for you to use in your teensy device
@ -761,7 +764,7 @@ def show_banner(define_version,graphic):
else:
os.system("clear")
print bcolors.BLUE + """
print (bcolors.BLUE + """
[---] The Social-Engineer Toolkit ("""+bcolors.YELLOW+"""SET"""+bcolors.BLUE+""") [---]
[---] Created by:""" + bcolors.RED+""" David Kennedy """+bcolors.BLUE+"""("""+bcolors.YELLOW+"""ReL1K"""+bcolors.BLUE+""") [---]
[---] Version: """+bcolors.RED+"""%s""" % (define_version) +bcolors.BLUE+""" [---]
@ -772,73 +775,73 @@ def show_banner(define_version,graphic):
""" + bcolors.GREEN+""" Welcome to the Social-Engineer Toolkit (SET).
The one stop shop for all of your SE needs.
"""
print bcolors.BLUE + """ Join us on irc.freenode.net in channel #setoolkit\n""" + bcolors.ENDC
print bcolors.BOLD + """ The Social-Engineer Toolkit is a product of TrustedSec.\n\n Visit: """ + bcolors.GREEN + """https://www.trustedsec.com\n""" + bcolors.ENDC
""")
print(bcolors.BLUE + """ Join us on irc.freenode.net in channel #setoolkit\n""" + bcolors.ENDC)
print(bcolors.BOLD + """ The Social-Engineer Toolkit is a product of TrustedSec.\n\n Visit: """ + bcolors.GREEN + """https://www.trustedsec.com\n""" + bcolors.ENDC)
def show_graphic():
menu = random.randrange(2,13)
if menu == 2:
print bcolors.YELLOW + r"""
print(bcolors.YELLOW + r"""
.--. .--. .-----.
: .--': .--'`-. .-'
`. `. : `; : :
_`, :: :__ : :
`.__.'`.__.' :_; """ + bcolors.ENDC
`.__.'`.__.' :_; """ + bcolors.ENDC)
return
if menu == 3:
print bcolors.GREEN + r"""
print(bcolors.GREEN + r"""
_______________________________
/ _____/\_ _____/\__ ___/
\_____ \ | __)_ | |
/ \ | \ | |
/_______ //_______ / |____|
\/ \/ """ + bcolors.ENDC
\/ \/ """ + bcolors.ENDC)
return
if menu == 4:
print bcolors.BLUE + r"""
print(bcolors.BLUE + r"""
:::=== :::===== :::====
::: ::: :::====
===== ====== ===
=== === ===
====== ======== ===
""" + bcolors.ENDC
""" + bcolors.ENDC)
if menu == 5:
print bcolors.RED + r"""
print(bcolors.RED + r"""
..######..########.########
.##....##.##..........##...
.##.......##..........##...
..######..######......##...
.......##.##..........##...
.##....##.##..........##...
..######..########....##... """ + bcolors.ENDC
..######..########....##... """ + bcolors.ENDC)
return
if menu == 6:
print bcolors.PURPLE + r'''
print (bcolors.PURPLE + r'''
.M"""bgd `7MM"""YMM MMP""MM""YMM
,MI "Y MM `7 P' MM `7
`MMb. MM d MM
`YMMNq. MMmmMM MM
. `MM MM Y , MM
Mb dM MM ,M MM
P"Ybmmd" .JMMmmmmMMM .JMML.''' + bcolors.ENDC
P"Ybmmd" .JMMmmmmMMM .JMML.''' + bcolors.ENDC)
return
if menu == 7:
print bcolors.YELLOW + r"""
print (bcolors.YELLOW + r"""
________________________
__ ___/__ ____/__ __/
_____ \__ __/ __ /
____/ /_ /___ _ /
/____/ /_____/ /_/ """ + bcolors.ENDC
/____/ /_____/ /_/ """ + bcolors.ENDC)
return
if menu == 8:
print bcolors.RED + r'''
print (bcolors.RED + r'''
!\_________________________/!\
!! !! \
!! Social-Engineer Toolkit !! \
@ -856,11 +859,11 @@ def show_graphic():
/oooo oooo oooo oooo /!
/ooooooooooooooooooooooo/ /
/ooooooooooooooooooooooo/ /
/C=_____________________/_/''' + bcolors.ENDC
/C=_____________________/_/''' + bcolors.ENDC)
if menu == 9:
print bcolors.YELLOW + """
print (bcolors.YELLOW + """
01011001011011110111010100100000011100
10011001010110000101101100011011000111
10010010000001101000011000010111011001
@ -881,11 +884,11 @@ def show_graphic():
01011001010111001000100000010101000110
11110110111101101100011010110110100101
11010000100000001010100110100001110101
011001110111001100101010""" + bcolors.ENDC
011001110111001100101010""" + bcolors.ENDC)
if menu == 10:
print bcolors.GREEN + """
print (bcolors.GREEN + """
. ..
MMMMMNMNMMMM=
.DMM. .MM$
@ -908,10 +911,10 @@ def show_graphic():
,MM? .MMM
,MMMMMMMMMMM
https://www.trustedsec.com""" + bcolors.ENDC
https://www.trustedsec.com""" + bcolors.ENDC)
if menu == 11:
print bcolors.backBlue + r"""
print (bcolors.backBlue + r"""
_ J
/-\ J
_____|#|_____ J
@ -932,11 +935,11 @@ def show_graphic():
| ||___| | |___|| | !
|-----------------| !
| Timey Wimey | !
------------------- !""" + bcolors.ENDC
------------------- !""" + bcolors.ENDC)
if menu == 12:
print bcolors.RED + r"""
print (bcolors.RED + r"""
..:::::::::..
..:::aad8888888baa:::..
.::::d:?88888888888?::8b::::.
@ -957,7 +960,7 @@ def show_graphic():
`::::::::88::88::P::::88::::::::'
`::::::88::88:::::::88::::::'
``:::::::::::::::::::''
``:::::::::''""" + bcolors.ENDC
``:::::::::''""" + bcolors.ENDC)
#
# identify if set interactive shells are disabled
@ -999,11 +1002,11 @@ def custom_template():
filewrite.write("# Author: "+author+"\n#\n#\n#\n")
filewrite.write('SUBJECT='+'"'+subject+'"\n\n')
filewrite.write('BODY='+'"'+body+'"\n')
print "\n"
print ("\n")
filewrite.close()
except Exception, e:
except Exception as e:
print_error("ERROR:An error occured:")
print bcolors.RED + "ERROR:" + str(e) + bcolors.ENDC
print(bcolors.RED + "ERROR:" + str(e) + bcolors.ENDC)
# routine for checking length of a payload: variable equals max choice
@ -1200,11 +1203,11 @@ def socket_listener(port):
# set is so that when we cancel out we can reuse port
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((host, port))
print "Listening on 0.0.0.0:%s" % str(port)
print ("Listening on 0.0.0.0:%s" % str(port))
# listen for only 1000 connection
s.listen(1000)
conn, addr = s.accept()
print 'Connected by', addr
print('Connected by', addr)
data = conn.recv(1024)
# start loop
@ -1214,7 +1217,7 @@ def socket_listener(port):
# if we specify quit then break out of loop and close socket
if command == "quit": break
data = conn.recv(1024)
print data
print(data)
conn.close()
# generates powershell payload
@ -1328,7 +1331,7 @@ def shellcode_replace(ipaddr, port, shellcode):
# exit routine
def exit_set():
cleanup_routine()
print "\n\n Thank you for " + bcolors.RED+"shopping" + bcolors.ENDC+" with the Social-Engineer Toolkit.\n\n Hack the Gibson...and remember...hugs are worth more than handshakes.\n"
print("\n\n Thank you for " + bcolors.RED+"shopping" + bcolors.ENDC+" with the Social-Engineer Toolkit.\n\n Hack the Gibson...and remember...hugs are worth more than handshakes.\n")
sys.exit()
@ -1438,7 +1441,7 @@ def dns():
udps.sendto(p.respuesta(ip), addr)
except KeyboardInterrupt:
print "Exiting the DNS Server.."
print ("Exiting the DNS Server..")
sys.exit()
udps.close()
@ -1536,7 +1539,7 @@ def validateCIDRBlock(b):
return False
# subnet is an appropriate value (1-32)
if (int(subnet) < 1) or (int(subnet) > 32):
print "Error: subnet "+str(subnet)+" wrong size."
print("Error: subnet "+str(subnet)+" wrong size.")
return False
# passed all checks -> return True
return True
@ -1592,49 +1595,49 @@ def check_kali():
# if we aren't running kali
else: return "Non-Kali"
else:
print "[!] Not running a Debian variant.."
print("[!] Not running a Debian variant..")
return "Non-Kali"
# checking if we have bleeding-edge enabled for updates
def bleeding_edge():
bleeding = check_config("BLEEDING_EDGE=").lower()
if bleeding == "on":
# first check if we are actually using Kali
kali = check_kali()
if kali == "Kali":
print_status("Checking to see if bleeding-edge repos are active.")
# check if we have the repos enabled first
fileopen = file("/etc/apt/sources.list", "r")
kalidata = fileopen.read()
if "deb http://repo.kali.org/kali kali-bleeding-edge main" in kalidata:
print_status("Bleeding edge already active..Moving on..")
return True
else:
print_warning("Bleeding edge repos were not detected. Use at your own risk!")
enable = raw_input("Do you want to enable bleeding-edge repos for fast updates [yes/no]: ")
if enable == "y" or enable == "yes":
print_status("Backing up sources.list to /etc/apt/sources.list.bak")
if os.path.isfile("/etc/apt/sources.list.bak"): os.remove("/etc/apt/sources.list.bak")
shutil.copyfile("/etc/apt/sources.list", "/etc/apt/sources.list.bak")
print_status("Adding Kali bleeding edge to sources.list for updates.")
# we need to add repo to kali file
# we will rewrite the entire apt in case not all repos are there
filewrite = file("/etc/apt/sources.list", "w")
filewrite.write("# kali repos installed by SET\ndeb http://http.kali.org/kali kali main non-free contrib\ndeb-src http://http.kali.org/kali kali main non-free contrib\n## Security updates\ndeb http://security.kali.org/kali-security kali/updates main contrib non-free\ndeb http://repo.kali.org/kali kali-bleeding-edge main")
filewrite.close()
print "[*] It is recommended to now run apt-get update && apt-get upgrade && apt-get dist-upgrade && apt-get autoremove and restart SET."
return True
else:
print "[:(] Your loss! Bleeding edge provides updates regularly to Metasploit, SET, and others!"
bleeding = check_config("BLEEDING_EDGE=").lower()
if bleeding == "on":
# first check if we are actually using Kali
kali = check_kali()
if kali == "Kali":
print_status("Checking to see if bleeding-edge repos are active.")
# check if we have the repos enabled first
fileopen = file("/etc/apt/sources.list", "r")
kalidata = fileopen.read()
if "deb http://repo.kali.org/kali kali-bleeding-edge main" in kalidata:
print_status("Bleeding edge already active..Moving on..")
return True
else:
print_warning("Bleeding edge repos were not detected. Use at your own risk!")
enable = raw_input("Do you want to enable bleeding-edge repos for fast updates [yes/no]: ")
if enable == "y" or enable == "yes":
print_status("Backing up sources.list to /etc/apt/sources.list.bak")
if os.path.isfile("/etc/apt/sources.list.bak"): os.remove("/etc/apt/sources.list.bak")
shutil.copyfile("/etc/apt/sources.list", "/etc/apt/sources.list.bak")
print_status("Adding Kali bleeding edge to sources.list for updates.")
# we need to add repo to kali file
# we will rewrite the entire apt in case not all repos are there
filewrite = file("/etc/apt/sources.list", "w")
filewrite.write("# kali repos installed by SET\ndeb http://http.kali.org/kali kali main non-free contrib\ndeb-src http://http.kali.org/kali kali main non-free contrib\n## Security updates\ndeb http://security.kali.org/kali-security kali/updates main contrib non-free\ndeb http://repo.kali.org/kali kali-bleeding-edge main")
filewrite.close()
print("[*] It is recommended to now run apt-get update && apt-get upgrade && apt-get dist-upgrade && apt-get autoremove and restart SET.")
return True
else:
print("[:(] Your loss! Bleeding edge provides updates regularly to Metasploit, SET, and others!")
else:
print "[*] Kali Linux was not detected, moving on..."
else:
print("[*] Kali Linux was not detected, moving on...")
# here we give multiple options to specify for SET java applet
def applet_choice():
# prompt here
print """
print ("""
[-------------------------------------------]
Java Applet Configuration Options Below
[-------------------------------------------]
@ -1645,7 +1648,7 @@ Select which option you want:
1. Make my own self-signed certificate applet.
2. Use the applet built into SET.
3. I have my own code signing certificate or applet.\n"""
3. I have my own code signing certificate or applet.\n""")
choice1 = raw_input("Enter the number you want to use [1-3]: ")