Exemple #1
0
def start_ngrok(port):
    ngrok_conf.PyngrokConfig(config_path=".config/ngrok.yml")
    pid = check_process("ngrok")
    for p in pid:
        kill(p, signal.SIGKILL)
    # continue
    run_command("clear")
    print(global_localization.hidden_eye_logo)
    print(global_localization.official_website_link)
    print(global_localization.by_darksec)
    print(global_localization.line_of_dots)
    print(localization.lang_start_ngrok["ngrok_server"])
    ngrok.connect(port=int(port))#TODO done
    while True:
        wait(2)
        ngrok_tunnels = ngrok.get_tunnels()
        url = ngrok_tunnels[0].public_url
        if regular_expression.match("https://[0-9a-z]*\.ngrok.io",
                                    url) is not None:
            print(localization.lang_start_ngrok["send_this_url_suggestion"])
            print(localization.lang_start_localhost["localhost_url"] +
                  "127.0.0.1:" + port)
            print(localization.lang_start_ngrok["ngrok_url"] + url +
                  default_palette[4])
            break
Exemple #2
0
def start_ngrok(port):
    ngrok.DEFAULT_CONFIG_PATH = ".config/ngrok.yml"
    # ngrok.set_auth_token("<NGROK_AUTH_TOKEN>") # Will be easier to input
    # later
    pid = check_process("ngrok")
    for p in pid:
        kill(p, signal.SIGKILL)

# continue
    run_command('clear')
    # print('''
    #    {1}_  _ . ___  ___  ___ _  _  {0}___ _  _ ___{1}
    #    |__| | ]  | ]  | |__ |\ |  {0}|__ \__/ |__{1}
    #    |  | | ]__| ]__| |__ | \|  {0}|__  ||  |__{1}
    #    {0}http://github.com/darksecdevelopers
    #    {0}** BY:DARKSEC ** \n\n-------------------------------
    # ''')
    print(global_localization.hidden_eye_logo)
    print(global_localization.official_website_link)
    print(global_localization.by_darksec)
    print(global_localization.line_of_dots)
    print(localization.lang_start_ngrok["ngrok_server"])
    # run_command(['./Server/ngrok http {0}'.format(port)], stdout=DEVNULL, stderr=DEVNULL)
    # chmod('Server', 0o777)
    # run_command(['Server/ngrok', 'http {0}'.format(port)],stdout=DEVNULL,
    # stderr=DEVNULL)
    ngrok.connect(port=int(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()
        ngrok_tunnels = ngrok.get_tunnels()
        url = ngrok_tunnels[0].public_url
        # urlFile.close()
        if regular_expression.match("https://[0-9a-z]*\.ngrok.io",
                                    url) is not None:
            # print(\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]))
            # print("\n")
            print(localization.lang_start_ngrok["send_this_url_suggestion"])
            print(localization.lang_start_localhost["localhost_url"] +
                  '127.0.0.1:' + port)
            print(localization.lang_start_ngrok["ngrok_url"] + url +
                  default_palette[4])
            break
def start_ngrok(port):
    ngrok.DEFAULT_CONFIG_PATH = path.join(".config/ngrok.yml")
    run_command(['killall', '-2', 'ngrok'], stdout=DEVNULL, stderr=DEVNULL)
    run_command('clear')
    # print('''
    #    {1}_  _ . ___  ___  ___ _  _  {0}___ _  _ ___{1}
    #    |__| | ]  | ]  | |__ |\ |  {0}|__ \__/ |__{1}
    #    |  | | ]__| ]__| |__ | \|  {0}|__  ||  |__{1}
    #    {0}http://github.com/darksecdevelopers
    #    {0}** BY:DARKSEC ** \n\n-------------------------------
    # ''')
    simple_informant.global_message()
    print(localization.lang_start_ngrok["ngrok_server"])
    # run_command(['./Server/ngrok http {0}'.format(port)], stdout=DEVNULL, stderr=DEVNULL)
    ##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()
        ngrok_tunnels = ngrok.get_tunnels()
        url = ngrok_tunnels[0].public_url
        # urlFile.close()
        if regular_expression.match("https://[0-9a-z]*\.ngrok.io",
                                    url) is not None:
            # print(\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]))
            # print("\n")
            print(localization.lang_start_ngrok["send_this_url_suggestion"])
            print(localization.lang_start_localhost["localhost_url"] +
                  '127.0.0.1:' + port)
            print(localization.lang_start_ngrok["ngrok_url"] + url +
                  default_palette[4])
            break