From fb097c84797ce88273362e9cf9c62a199515a5ca Mon Sep 17 00:00:00 2001 From: Adi Date: Thu, 8 Feb 2018 12:36:05 +0800 Subject: [PATCH 1/4] mac version --- SocialFish.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SocialFish.py b/SocialFish.py index 0003752..200c98e 100644 --- a/SocialFish.py +++ b/SocialFish.py @@ -33,9 +33,9 @@ def checkNgrok(): if path.isfile('Server/ngrok') == False: print '[*] Downloading Ngrok...' if architecture()[0] == '64bit': - filename = 'ngrok-stable-linux-amd64.zip' + filename = 'ngrok-stable-darwin-amd64.zip' else: - filename = 'ngrok-stable-linux-386.zip' + filename = 'ngrok-stable-darwin-386.zip' url = 'https://bin.equinox.io/c/4VmDzA7iaHb/' + filename download(url) system('unzip ' + filename) @@ -176,8 +176,8 @@ def runPEnv(): def runNgrok(): system('./Server/ngrok http 80 > /dev/null &') sleep(10) - system('curl -s http://127.0.0.1:4040/status | grep -P "https://.*?ngrok.io" -oh > ngrok.url') - url = open('ngrok.url', 'r') + system('curl -s -N http://127.0.0.1:4040/status | grep "https://[0-9a-z]*\.ngrok.io" -oh > ngrok.url') + url = open('./ngrok.url', 'r') print('\n {0}[{1}*{0}]{1} Ngrok URL: {2}' + url.readlines()[0] + '{1}').format(CYAN, END, GREEN) url.close() From b3bf144c11920db92bb05c15cc2078221e593ee1 Mon Sep 17 00:00:00 2001 From: Adi Date: Thu, 8 Feb 2018 13:28:09 +0800 Subject: [PATCH 2/4] generic --- SocialFish.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/SocialFish.py b/SocialFish.py index 200c98e..3052923 100644 --- a/SocialFish.py +++ b/SocialFish.py @@ -8,7 +8,7 @@ from os import system, path import multiprocessing from urllib import urlopen -from platform import architecture +from platform import system as systemos, architecture from wget import download RED, WHITE, CYAN, GREEN, END = '\033[91m', '\33[46m', '\033[36m', '\033[1;32m', '\033[0m' @@ -32,11 +32,15 @@ def connected(host='http://duckduckgo.com'): def checkNgrok(): if path.isfile('Server/ngrok') == False: print '[*] Downloading Ngrok...' + + ostype = systemos().lower() + if architecture()[0] == '64bit': - filename = 'ngrok-stable-darwin-amd64.zip' + filename = 'ngrok-stable-{0}-amd64.zip'.format(ostype) else: - filename = 'ngrok-stable-darwin-386.zip' + filename = 'ngrok-stable-{0}-386.zip'.format(ostype) url = 'https://bin.equinox.io/c/4VmDzA7iaHb/' + filename + print '[*] Downloading ' + filename download(url) system('unzip ' + filename) system('mv ngrok Server/ngrok') From 9cdb6bb23ac5066c184d835631c09ce4e80137e4 Mon Sep 17 00:00:00 2001 From: Adi Date: Thu, 8 Feb 2018 13:37:08 +0800 Subject: [PATCH 3/4] remove filename debug message --- SocialFish.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/SocialFish.py b/SocialFish.py index 3052923..2f2e0ec 100644 --- a/SocialFish.py +++ b/SocialFish.py @@ -32,15 +32,12 @@ def connected(host='http://duckduckgo.com'): def checkNgrok(): if path.isfile('Server/ngrok') == False: print '[*] Downloading Ngrok...' - ostype = systemos().lower() - if architecture()[0] == '64bit': filename = 'ngrok-stable-{0}-amd64.zip'.format(ostype) else: filename = 'ngrok-stable-{0}-386.zip'.format(ostype) url = 'https://bin.equinox.io/c/4VmDzA7iaHb/' + filename - print '[*] Downloading ' + filename download(url) system('unzip ' + filename) system('mv ngrok Server/ngrok') From 837b2bcc9d11bdacdb8a5b9f12c0c1d7b49a94ad Mon Sep 17 00:00:00 2001 From: Adi Date: Thu, 8 Feb 2018 13:44:09 +0800 Subject: [PATCH 4/4] misc --- SocialFish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SocialFish.py b/SocialFish.py index 2f2e0ec..100f2a5 100644 --- a/SocialFish.py +++ b/SocialFish.py @@ -178,7 +178,7 @@ def runNgrok(): system('./Server/ngrok http 80 > /dev/null &') sleep(10) system('curl -s -N http://127.0.0.1:4040/status | grep "https://[0-9a-z]*\.ngrok.io" -oh > ngrok.url') - url = open('./ngrok.url', 'r') + url = open('ngrok.url', 'r') print('\n {0}[{1}*{0}]{1} Ngrok URL: {2}' + url.readlines()[0] + '{1}').format(CYAN, END, GREEN) url.close()