From 58c8009af15a5bb5a38ad317d046e5ccd71684f7 Mon Sep 17 00:00:00 2001 From: AnonUD4Y Date: Sat, 2 May 2020 17:49:04 +0530 Subject: [PATCH] GitLab Changes Pushed --- Defs/Checks.py | 141 ++++++++++++++++++++----------------------------- 1 file changed, 57 insertions(+), 84 deletions(-) diff --git a/Defs/Checks.py b/Defs/Checks.py index 270856f..753973c 100644 --- a/Defs/Checks.py +++ b/Defs/Checks.py @@ -19,12 +19,10 @@ def checkConnection(host='https://google.com'): # Connection check try: req = requests.get(host, timeout=10) if req.status_code == 200: - print("{0}HURRAY!! Internet is available.. We can Continue{1}".format( - GREEN, DEFAULT)) - print("\n\n{0}Wait! Checking for Neccesary Packages{1}...\n ".format( - GREEN, DEFAULT)) + print("\n{1}[{0}>{1}] {0}INTERNET {0}- {2}[CONNECTED]".format(GREEN, RED,DEFAULT)) return True except: + print("\n{1}[{0}>{1}] {0}INTERNET {0}- {1}[NOT-CONNECTED]".format(GREEN, RED)) return False @@ -38,10 +36,9 @@ if checkConnection() == False: '''.format(RED, DEFAULT)) exit() -def verCheck(): - system('clear') - print("{1}[{0}>{1}] {0}Checking For Updates{2}...".format(GREEN, RED, DEFAULT )) - ver_url = 'https://raw.githubusercontent.com/darksecdevelopers/hiddeneye/master/version.txt' +def verCheck(): #Version Check For Latest Updates. + print("\n{1}[{0}>{1}] {0}Checking For Updates{2}...".format(GREEN, RED, DEFAULT )) + ver_url = 'https://gitlab.com/An0nUD4Y/hiddeneye/-/raw/master/version.txt' ver_rqst = requests.get(ver_url) ver_sc = ver_rqst.status_code if ver_sc == 200: @@ -66,21 +63,20 @@ def verCheck(): sleep(5) system("clear") else: - print('{1}[{0}^{1}] {0}Failed To Get Update [Status:{1}{3}{0}]\n'.format(GREEN, RED, DEFAULT)) + print('{1}[{0}^{1}] {0}Failed To Get Update [Status:{1}ErrorCodeReturn{0}]\n'.format(GREEN, RED, DEFAULT)) - def checkPHP(): # PHP installation Check - if 256 != system('which php > /dev/null'): # Checking if user have PHP - print(" {2}* {0}PHP INSTALLATION FOUND".format(GREEN, DEFAULT, RED)) - else: - print("{0}**{2} PHP NOT FOUND\n {0}** {2} Installing PHP... ".format(RED, GREEN, DEFAULT)) - system('apt-get install php > /dev/null') - - + if 256 != system('which php > /dev/null'): + print("\n{1}[{0}>{1}] {0}PHP {0}- {2}[INSTALLED]".format(GREEN, RED, DEFAULT)) + + else: + print("{1}[{0}>{1}] {0}PHP {0}- {1}[NOT-INSTALLED]\n{1}[{0}>{1}] {0}Installing PHP... ".format(GREEN, RED, DEFAULT)) + system('apt-get install php > /dev/null 2>&1') + checkPHP() def checkNgrok(): # Ngrok check if path.isfile('Server/ngrok') == False: # Is Ngrok downloaded? - print('[*] Ngrok Not Found !!') - print('[*] Downloading Ngrok...') + print("{1}[{0}>{1}] {0}NGROK {0}- {1}[NOT-INSTALLED]".format(GREEN, RED)) + print("{1}[{0}>{1}] {0}Installing NGROK...".format(GREEN, RED)) if 'Android' in str(check_output(('uname', '-a'))) or 'arm' in str(check_output(('uname', '-a'))): filename = 'ngrok-stable-linux-arm.zip' else: @@ -90,18 +86,21 @@ def checkNgrok(): # Ngrok check else: filename = 'ngrok-stable-{0}-386.zip'.format(ostype) url = 'https://bin.equinox.io/c/4VmDzA7iaHb/' + filename - req = requests.get(url , verify= False) + req = requests.get(url , verify=False) with open(filename, "wb") as file_obj: file_obj.write(req.content) - system('unzip ' + filename) - system('mv ngrok Server/ngrok') - system('rm ' + filename) - system('clear') + system('unzip ' + filename + '> /dev/null 2>&1') + system('mv ngrok Server/ngrok > /dev/null 2>&1') + system('rm ' + filename + '> /dev/null 2>&1') + print("{1}[{0}>{1}] {0}NGROK {0}- {2}[INSTALLED]".format(GREEN, RED, DEFAULT)) + elif path.isfile('Server/ngrok') == True: + print("{1}[{0}>{1}] {0}NGROK {0}- {2}[INSTALLED]".format(GREEN, RED, DEFAULT)) + def checkOpenport(): # Openport Check if 256 == system('which openport > /dev/null'): - print('[*] Openport not Installed !!') - print("[*] Installing Openport...") + print("{1}[{0}>{1}] {0}OPENPORT {0}- {1}[NOT-INSTALLED]".format(GREEN, RED)) + print("{1}[{0}>{1}] {0}Installing OPENPORT...".format(GREEN, RED)) if 'Android' in str(check_output(('uname', '-a'))) or 'arm' in str(check_output(('uname', '-a'))): filename = 'arm/latest.deb' else: @@ -111,42 +110,37 @@ def checkOpenport(): # Openport Check else: filename = 'debian32/latest.deb'.format(ostype) url = 'https://openport.io/download/' + filename - req = requests.get(url , verify= False) + req = requests.get(url , verify=False) filename2 = 'openport.deb' with open(filename2, "wb") as file_obj: file_obj.write(req.content) - system('chmod 777 openport* && dpkg -i openport* > /dev/null && rm openport.deb && clear') + system('chmod 777 openport* > /dev/null 2>&1 && dpkg -i openport* > /dev/null 2>&1 && rm openport.deb > /dev/null 2>&1') checkOpenportinstall() + def checkOpenportinstall(): # Check If installed properly - if 256 == system('which openport > /dev/null'): - print('[*] Openport not Installed correctly, Try installing it manually !!') - print('[*] Check Here ... https://openport.io/download') - input('\n Press Enter To Continue') - else: - print('[*] Openport Installation Success !!') - sleep(1) + if 256 == system('which openport > /dev/null'): + print("{1}[{0}>{1}] {0}Openport Not Installed Properly, Try installing Manually.\n{1}[{0}>{1}] {0}Check Here::( https://openport.io/download)".format(GREEN, RED)) + sleep(6) + else: + print("{1}[{0}>{1}] {0}OPENPORT {0}- {2}[INSTALLED]".format(GREEN, RED, DEFAULT)) + sleep(1) def checkPagekite(): # Check Pagekite if path.isfile('Server/pagekite.py') == False: - print('[*] Pagekite Not Found !!') - print('[*] Downloading Pagekite...') + print("{1}[{0}>{1}] {0}PAGEKITE {0}- {1}[NOT-INSTALLED]".format(GREEN, RED)) + print("{1}[{0}>{1}] {0}Installing PAGEKITE...".format(GREEN, RED)) url = 'https://pagekite.net/pk/pagekite.py' - req = requests.get(url , verify= False) + req = requests.get(url , verify=False) filename = 'pagekite.py' with open(filename, "wb") as file_obj: file_obj.write(req.content) - system('chmod 777 pagekite.py && mv pagekite.py Server/pagekite.py') - print('\n[*] Pagekite install Success !!') - print('\n[!] Remember: Pagekite Supports only Python2, Not Supports Python3') - print('[!] So Make Sure You Have installed Python2 as well, if Wants To use Pagekite Tunnel.') - system('cd Server && chmod 777 * -R') - input('\n Press Enter To Continue') - + system('chmod 777 pagekite.py && mv pagekite.py Server/pagekite.py && cd Server && chmod 777 * -R') + print("{1}[{0}>{1}] {0}PAGEKITE {0}- {2}[INSTALLED] ({1}Pagekite only works with python2{0})".format(GREEN, RED, DEFAULT)) def checkLocalxpose(): # Localxpose check if path.isfile('Server/loclx') == False: # Is Localxpose downloaded? - print('[*] Localxpose Not Found !!') - print('[*] Downloading Localxpose...') + print("{1}[{0}>{1}] {0}LOCALXPOSE {0}- {1}[NOT-INSTALLED]".format(GREEN, RED)) + print("{1}[{0}>{1}] {0}Installing LOCALXPOSE...".format(GREEN, RED)) if 'Android' in str(check_output(('uname', '-a'))) or 'arm' in str(check_output(('uname', '-a'))): filename = 'loclx-linux-arm.zip' else: @@ -156,52 +150,34 @@ def checkLocalxpose(): # Localxpose check else: filename = 'loclx-linux-386.zip'.format(ostype) url = 'https://lxpdownloads.sgp1.digitaloceanspaces.com/cli/'+filename - req = requests.get(url , verify= False) + req = requests.get(url , verify=False) with open("loclx-linux-download.zip", "wb") as file_obj: file_obj.write(req.content) - system('unzip loclx-linux-download.zip && rm loclx-linux-download.zip') - system('mv loclx-linux-* loclx && mv loclx Server/') - system('clear') - - -def checkbinaryLT(): # LocalTunnel Binary File check. - if path.isfile('Server/lt') == False: # Is LocalTunnel downloaded? - print('[*] LocalTunnel Binary File Not Found !!') - print('[*] Downloading LocalTunnel...') - url = "https://www.wa4e.com/downloads/lt-linux.zip" - req = requests.get(url , verify= False) - with open("lt-linux.zip", "wb") as file_obj: - file_obj.write(req.content) - system("unzip lt-linux.zip && rm lt-linux.zip") - system("mv lt* lt && mv lt Server/lt ") - system('clear') - + system('unzip loclx-linux-download.zip > /dev/null 2>&1 && rm loclx-linux-download.zip > /dev/null 2>&1') + system('mv loclx-linux-* loclx > /dev/null 2>&1 && mv loclx Server/ > /dev/null 2>&1') + print("{1}[{0}>{1}] {0}LOCALXPOSE {0}- {2}[INSTALLED]".format(GREEN, RED, DEFAULT)) + elif path.isfile('Server/loclx') == True: + print("{1}[{0}>{1}] {0}LOCALXPOSE {0}- {2}[INSTALLED]".format(GREEN, RED, DEFAULT)) def checkLT(): # Ask to install npm,node.js,localtunnel(packages). - system('cd Server && chmod 777 * -R') if 256 == system('which lt > /dev/null'): - system('clear') - print("{0}[{1}?{0}] Do You Want To Install LOCALTUNNEL(Tunneling Service) Packages.\n{0}[{1}*{0}]{1} May take time , Skip if not wants to use LocalTunnel(Package Version).".format(RED, GREEN, DEFAULT)) - choice = input( - " \n({1}Y{2}/{2}(N)>> {2}".format(RED, GREEN, DEFAULT)).upper() + print("{1}[{0}>{1}] {0}LOCALTUNNEL {0}- {1}[NOT-INSTALLED]".format(GREEN, RED)) + choice = input("\n{0}[{1}?{0}] {1}Do You Want To install LocalTunnel({0}Y{1}/{0}N{1}): {2}".format(RED, GREEN, DEFAULT)).upper() if choice == 'Y': - system('clear') + print('') installLT() elif choice == 'N': - print("\n{0}[{1}!{0}]{0} You can not use LocalTunnel(Package Version).\n{0}[{1}!{0}]{0} But still You Can Use LocalTunnel(Binary Version).\n\n\n".format( - RED, GREEN, DEFAULT)) - input('Press Enter To Continue') - system('clear') + print("{1}[{0}>{1}] {0}LOCALTUNNEL {0}- {1}[ABORTED]".format(GREEN, RED)) + sleep(4) else: return checkLT() else: - print("[*] LocalTunnel Packages Found !!") + print("{1}[{0}>{1}] {0}LOCALTUNNEL {0}- {2}[INSTALLED]".format(GREEN, RED, DEFAULT)) sleep(2) - system('clear') def installLT(): # Localtunnel check - print('[*] Installing LocalTunnel...') + print("{1}[{0}>{1}] {0}Installing LOCALTUNNEL ... {1}(Takes About 10 min.)".format(GREEN, RED)) if 'Android' in str(check_output(('uname', '-a'))) or 'arm' in str(check_output(('uname', '-a'))): system("apt-get -y update;apt -y install nodejs npm;npm cache clean -f;npm i -g n;n stable;npm i -g localtunnel-termux;clear") checkagainLT() @@ -212,14 +188,11 @@ def installLT(): # Localtunnel check def checkagainLT(): # Check if Localtunnel installed correctly or not. if 256 == system('which lt > /dev/null'): - system('clear') - print('{1}[ERROR]: LocalTunnel packages haven\'t been installed correctly...{0}'.format( - DEFAULT, RED)) - print('') - input('[^] Press Enter To Go Back To installation..') + print("{1}[{0}>{1}] {0}LOCALTUNNEL {0}- {1}[FAILED]".format(GREEN, RED)) + input("{1}[{0}>{1}] {0}Trying Again To Install Localtunnel (Press Enter)".format(GREEN, RED)) checkLT() else: - print('{1}[SUCCESS] LocalTunnel Installed.{0}'.format(DEFAULT, GREEN)) + print("{1}[{0}>{1}] {0}LOCALTUNNEL {0}- {2}[INSTALLED]".format(GREEN, RED, DEFAULT)) sleep(2)