from core.modules.info import info from core.libs.termcolor import cprint as colorize from core.libs.executer import commander from core.libs.listen_handler import listen from core.libs.menu import getargs, banner from core.libs.update import update # Check for arguments dependencies if getargs.url: if getargs.method == 'post' and not getargs.parameter: errmsg = '\n[!] Using post method requires --parameter flag, check help' exit(colorize(errmsg, 'red')) elif getargs.method == 'get' and getargs.parameter: errmsg = '\n[!] Using get method doesn\'t require --parameter flag, check help' exit(colorize(errmsg, 'red')) else: print banner # Print the banner info.get_information() # Call get_information and print info commander.BackConnect() # Call BackConnect method to handle input elif getargs.listen: if 'windows' in OS().lower(): errmsg = '[!] WebHandler doesn\'t support Windows OS yet, ' errmsg += 'still working on it.' exit(colorize(errmsg, 'red')) else: listen.wait_connection() # Call wait_connection to wait for a connection elif getargs.update: update() # Update the script
else: # Check for arguments dependencies if getargs.url: if getargs.method == 'post' and not getargs.parameter: errmsg = '\n[!] Using post method requires --parameter flag, check help' exit(cprint(errmsg, 'red')) elif getargs.method == 'get' and getargs.parameter: errmsg = '\n[!] Using get method doesn\'t require --parameter flag, check help' exit(cprint(errmsg, 'red')) else: if not getargs.banner: print banner # Print the banner commander.BackConnect() # Call BackConnect method to handle input elif getargs.listen or getargs.connect: if 'windows' in OS().lower(): errmsg = '[!] WebHandler doesn\'t support Windows yet, still working on it.' exit(cprint(errmsg, 'red')) if getargs.listen: listen.wait_connection( ) # Call wait_connection to wait for a connection commander.BackConnect() # Call BackConnect method to handle input else: connect.create_connection( ) # Call create_connection to try and connect to the target commander.BackConnect() # Call BackConnect method to handle input elif getargs.update: update() # Update the script
def update(self, command): update()