From 20dbeb2f38684c65ff0a4b99012c161295708e88 Mon Sep 17 00:00:00 2001 From: AL-LCL Date: Fri, 19 May 2023 11:01:49 +0200 Subject: NeoRAT --- binary/data_handling/send_data.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 binary/data_handling/send_data.py (limited to 'binary/data_handling/send_data.py') diff --git a/binary/data_handling/send_data.py b/binary/data_handling/send_data.py new file mode 100644 index 0000000..4622fbb --- /dev/null +++ b/binary/data_handling/send_data.py @@ -0,0 +1,13 @@ +import pickle +import zlib + + +def send_data(conn, data, settings, extra_data={}): + encryption, encoding, headersize = settings + data.update(extra_data) + + pickled_msg = pickle.dumps(data) + compressed_msg = zlib.compress(pickled_msg, 5) + encrypted_msg = encryption.do_encrypt(compressed_msg) + final_msg = bytes(f'{len(encrypted_msg):<{headersize}}', encoding) + encrypted_msg + conn.send(final_msg) \ No newline at end of file -- cgit v1.2.3