From 8ca905aa68e771a9808b0a9724c1601ba6c1f2b1 Mon Sep 17 00:00:00 2001 From: TrustedSec Date: Tue, 27 Dec 2016 15:39:51 -0500 Subject: [PATCH] move requests to beginning --- src/sms/sms.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/sms/sms.py b/src/sms/sms.py index 20aba04c2..d73791b91 100644 --- a/src/sms/sms.py +++ b/src/sms/sms.py @@ -9,6 +9,17 @@ import getpass try: input = raw_input except NameError: pass + +trigger = 0 +try: + import requests + +except ImportError: + core.print_error("Looks like you dont have python-requests installed. " + "Please install (apt-get install python-requests) and try again.") + input("Press {return} to continue.") + trigger = 1 + def _do_sms(): print("""\n ----- The Social-Engineer Toolkit (SET) SMS Spoofing Attack Vector -----\n""") print("This attack vector relies upon a third party service called www.spoofmytextmessage.com. " @@ -70,14 +81,8 @@ def _do_sms(): else: core.print_status("Okay! Exiting out of the Social-Engineer Toolkit SMS Spoofing Attack Vector...") +# launch sms try: - import requests - -except ImportError: - core.print_error("Looks like you dont have python-requests installed. " - "Please install (apt-get install python-requests) and try again.") - input("Press {return} to continue.") - -try: - _do_sms() + if trigger == 0: + _do_sms() except Exception as err: print_error("Something went wrong, printing error: " + str(err))