fix set.options exception handling

This commit is contained in:
TrustedSec 2016-07-30 14:19:59 -04:00
parent 133a6f7bfa
commit 423208624e

View file

@ -838,11 +838,13 @@ def show_banner(define_version, graphic):
def pull_version(): def pull_version():
if not os.path.isfile(setdir + "/version.lock"): if not os.path.isfile(setdir + "/version.lock"):
try: try:
url = ('https://raw.githubusercontent.com/trustedsec/social-engineer-toolkit/master/src/core/set.version') url = ('https://raw.githubusercontent.com/trustedsec/social-engineer-toolkit/master/src/core/set.version')
version = urlopen(url).read().rstrip().decode('utf-8') version = urlopen(url).read().rstrip().decode('utf-8')
filewrite = open(setdir + "/version.lock", "w") filewrite = open(setdir + "/version.lock", "w")
filewrite.write(version) filewrite.write(version)
filewrite.close() filewrite.close()
except KeyboardInterrupt: version = "keyboard interrupt" except KeyboardInterrupt: version = "keyboard interrupt"
else: version = open(setdir + "/version.lock", "r").read() else: version = open(setdir + "/version.lock", "r").read()
@ -1324,15 +1326,17 @@ def copyfolder(sourcePath, destPath):
def check_options(option): def check_options(option):
# open the directory # open the directory
trigger = 0 trigger = 0
fileopen = open(setdir + "/set.options", "r").readlines() if os.path.isfile(setdir + "/set.options"):
for line in fileopen: fileopen = open(setdir + "/set.options", "r").readlines()
match = re.search(option, line) for line in fileopen:
if match: match = re.search(option, line)
line = line.rstrip() if match:
line = line.replace('"', "") line = line.rstrip()
line = line.split("=") line = line.replace('"', "")
return line[1] line = line.split("=")
trigger = 1 return line[1]
trigger = 1
if trigger == 0: if trigger == 0:
return trigger return trigger