From 423208624e9d5d047a056d2e0ab917234e6fdc47 Mon Sep 17 00:00:00 2001 From: TrustedSec Date: Sat, 30 Jul 2016 14:19:59 -0400 Subject: [PATCH] fix set.options exception handling --- src/core/setcore.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/core/setcore.py b/src/core/setcore.py index 27d98c2ca..cea3d62a3 100644 --- a/src/core/setcore.py +++ b/src/core/setcore.py @@ -838,11 +838,13 @@ def show_banner(define_version, graphic): def pull_version(): if not os.path.isfile(setdir + "/version.lock"): try: + url = ('https://raw.githubusercontent.com/trustedsec/social-engineer-toolkit/master/src/core/set.version') version = urlopen(url).read().rstrip().decode('utf-8') filewrite = open(setdir + "/version.lock", "w") filewrite.write(version) filewrite.close() + except KeyboardInterrupt: version = "keyboard interrupt" else: version = open(setdir + "/version.lock", "r").read() @@ -1324,15 +1326,17 @@ def copyfolder(sourcePath, destPath): def check_options(option): # open the directory trigger = 0 - fileopen = open(setdir + "/set.options", "r").readlines() - for line in fileopen: - match = re.search(option, line) - if match: - line = line.rstrip() - line = line.replace('"', "") - line = line.split("=") - return line[1] - trigger = 1 + if os.path.isfile(setdir + "/set.options"): + fileopen = open(setdir + "/set.options", "r").readlines() + for line in fileopen: + match = re.search(option, line) + if match: + line = line.rstrip() + line = line.replace('"', "") + line = line.split("=") + return line[1] + trigger = 1 + if trigger == 0: return trigger