diff --git a/Defs/Checks.py b/Defs/Checks.py index f031243..432405e 100644 --- a/Defs/Checks.py +++ b/Defs/Checks.py @@ -1,11 +1,14 @@ #Checks functions from urllib.request import urlopen -from os import path, system +from os import * from subprocess import check_output from platform import system as systemos, architecture from wget import download from Defs.Languages import * +import os +import ctypes + RED, GREEN, DEFAULT = '\033[91m', '\033[1;32m', '\033[0m' installGetText() @@ -47,3 +50,17 @@ def checkNgrok(): #Ngrok check system('mv ngrok Server/ngrok') system('rm -Rf ' + filename) system('clear') + +def checkPermissions(): + if systemos() == 'Linux': + if os.getuid() == 0: + print("{0}Permissions granted!".format(GREEN)) + else: + raise PermissionError("{0}Permissions denied! Please run as '{1}sudo{0}'".format(RED, GREEN)) + elif systemos() == 'Windows': + if ctypes.windll.shell32.IsUserAnAdmin() != 0: + print("{0}Permissions granted!".format(GREEN)) + else: + raise PermissionError("{0}Permissions denied! Please run as Administrator".format(RED)) + else: + raise PermissionError("{0}Permissions denied! Unexpected platform".format(RED)) diff --git a/HiddenEye.py b/HiddenEye.py index f03624c..16194ca 100644 --- a/HiddenEye.py +++ b/HiddenEye.py @@ -11,7 +11,7 @@ from Defs.Actions import * from Defs.Languages import * RED, WHITE, CYAN, GREEN, DEFAULT = '\033[91m', '\033[46m', '\033[36m', '\033[1;32m', '\033[0m' - +checkPermissions() installGetText() languageSelector() checkConnection() diff --git a/instructions.md b/instructions.md index 08f356d..5d235d0 100644 --- a/instructions.md +++ b/instructions.md @@ -1,12 +1,18 @@ ## HOW TO INSTALL - +### BlackArch official repository +``` +sudo pacman -S hidden-eye +``` +to run just use +``` +sudo hidden-eye +``` ### CLONE ``` git clone https://github.com/DarkSecDevelopers/HiddenEye.git ``` ### RUNNING (In Linux) - ``` cd HiddenEye ``` @@ -28,13 +34,12 @@ python3 HiddenEye.py ``` OR - + ``` ./HiddenEye.py ``` -### RUNNING (If distro based on Arch Linux) - +### RUNNING (Arch Linux or Manjaro) ``` cd HiddenEye ``` @@ -55,13 +60,13 @@ chmod 777 HiddenEye.py ``` ``` -python3 HiddenEye.py +sudo python3 HiddenEye.py ``` OR - + ``` -./HiddenEye.py +sudo ./HiddenEye.py ``` @@ -98,11 +103,11 @@ chmod 777 HiddenEye.py ``` ``` -python HiddenEye.py +sudo python HiddenEye.py or -./HiddenEye.py +sudo ./HiddenEye.py ``` ### Running (One Code installation in Termux)