fix import issue when using powershell

This commit is contained in:
TrustedSec 2016-02-15 09:36:30 -05:00
parent fe7a258c39
commit 0718f45500
2 changed files with 5 additions and 4 deletions

View file

@ -1172,9 +1172,9 @@ and send the QRCode via a mailer.
# Main Menu choice 10: PowerShell Attacks # Main Menu choice 10: PowerShell Attacks
if main_menu_choice == '9': if main_menu_choice == '9':
try: try:
import src.powershell.powershell
except:
module_reload(src.powershell.powershell) module_reload(src.powershell.powershell)
except:
import src.powershell.powershell
# Main Menu choice 11: Third Party Modules # Main Menu choice 11: Third Party Modules
if main_menu_choice == '10': if main_menu_choice == '10':
@ -1183,7 +1183,7 @@ and send the QRCode via a mailer.
try: try:
module_reload(module_handler) module_reload(module_handler)
except: except:
from . import module_handler import module_handler
# Main Menu choice 99: Exit the Social-Engineer Toolkit # Main Menu choice 99: Exit the Social-Engineer Toolkit
if main_menu_choice == '99': if main_menu_choice == '99':

View file

@ -35,9 +35,10 @@ if powershell_menu_choice != "99":
filewrite.close() filewrite.close()
try: try:
reload(src.payloads.powershell.prep) module_reload(src.payloads.powershell.prep)
except: except:
import src.payloads.powershell.prep import src.payloads.powershell.prep
# create the directory if it does not exist # create the directory if it does not exist
if not os.path.isdir(setdir + "/reports/powershell"): if not os.path.isdir(setdir + "/reports/powershell"):
os.makedirs(setdir + "/reports/powershell") os.makedirs(setdir + "/reports/powershell")