From 2797bc0b5318ed67ad943ae35a6b024b91eabe85 Mon Sep 17 00:00:00 2001 From: TrustedSec Date: Wed, 24 Apr 2013 12:21:55 -0400 Subject: [PATCH] Added ability for older python versions to not use multiprocessing --- readme/CHANGES | 6 ++++++ src/core/setcore.py | 6 ++---- src/html/spawn.py | 13 +++++++++---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/readme/CHANGES b/readme/CHANGES index c76a588dd..c48920af8 100644 --- a/readme/CHANGES +++ b/readme/CHANGES @@ -1,3 +1,9 @@ +~~~~~~~~~~~~~~~~ +version 5.0.6 +~~~~~~~~~~~~~~~~ + +* added ability for multiprocessing to not be used on the webattack vector for older use of python 2.6 and below + ~~~~~~~~~~~~~~~~ version 5.0.5 ~~~~~~~~~~~~~~~~ diff --git a/src/core/setcore.py b/src/core/setcore.py index 5cacac27a..e74bc5c35 100644 --- a/src/core/setcore.py +++ b/src/core/setcore.py @@ -15,9 +15,7 @@ import string import inspect import base64 from src.core import dictionaries -import multiprocessing import thread -from multiprocessing import Process # check to see if we have python-pycrypto try: @@ -229,7 +227,7 @@ def print_error(message): print bcolors.RED + bcolors.BOLD + "[!] " + bcolors.ENDC + bcolors.RED + str(message) + bcolors.ENDC def get_version(): - define_version = '5.0.5' + define_version = '5.0.6' return define_version class create_menu: @@ -1410,7 +1408,7 @@ def dns(): sys.exit() udps.close() -# start dns with multiprocessing +# start dns def start_dns(): thread.start_new_thread(dns,()) diff --git a/src/html/spawn.py b/src/html/spawn.py index 646de02fc..82908d5e1 100644 --- a/src/html/spawn.py +++ b/src/html/spawn.py @@ -236,8 +236,13 @@ def web_server_start(): import src.core.webserver as webserver # specify the path for the SET web directories for the applet attack path = (setdir + "/web_clone/") - p = multiprocessing.Process(target=webserver.start_server, args=(web_port,path)) - p.start() + try: + import multiprocessing + p = multiprocessing.Process(target=webserver.start_server, args=(web_port,path)) + p.start() + except Exception: + import thread + thread.start_new_thread(webserver.start_server, (web_port,path)) # Handle KeyboardInterrupt except KeyboardInterrupt: @@ -522,8 +527,8 @@ try: # prep ratte if its posix if operating_system == "posix": - subprocess.Popen("chmod +x ../../payloads/ratte/ratteserver", stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) - os.system("../../payloads/ratte/ratteserver %s" % (port)) + subprocess.Popen("chmod +x src/payloads/ratte/ratteserver", stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) + os.system("src/payloads/ratte/ratteserver %s" % (port)) # if not then run it in windows if operating_system == "windows":