-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmailer.py
1520 lines (1395 loc) · 66.7 KB
/
mailer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/local/bin/python3
from colorama import init
from colorama import Fore
from termcolor import colored
from base64 import b64encode
from base64 import b64decode
import cv2
import face_recognition
from time import sleep,time
import sys
import smtplib
import os
from stdiomask import getpass
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email import encoders
import pickle
from datetime import datetime
from random import choice
import speech_recognition as speech
from re import search
from tqdm import trange
from shutil import make_archive,copyfile
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException
init()
#lambda functions
encrypt = lambda x: b64encode(x.encode('utf-32')).hex()
decrypt = lambda x: b64decode(bytes.fromhex(x)).decode('utf-32')
parse = lambda x: x.replace('\ ',' ').replace('\~','~')
take_pic = lambda x,y : cv2.imwrite(y,x.read()[-1]) if x.read()[0] else False
if os.name == "nt":
cam_check = lambda : [a for a in [cv2.VideoCapture(0,cv2.CAP_DSHOW)] if a.read()[0]]
else:
cam_check = lambda : [a for a in [cv2.VideoCapture(0)] if a.read()[0]]#cv2.CAP_DSHOW does not work for mac
class mailbox:#mailbox object
def __init__(self,user,pwd):#initialise driver and user and pwd vars
options = webdriver.ChromeOptions()
options.add_experimental_option("detach", True)
options.add_argument('--disable-extensions')
options.add_experimental_option('excludeSwitches',['enable-logging'])
self.driver=webdriver.Chrome(options=options,executable_path=ChromeDriverManager().install())
self.user = user
self.pwd = pwd
def gmail(self):#open gmail inbox
EMAILFIELD = (By.ID, 'identifierId')
PASSWORDFIELD = (By.NAME, 'password')
NEXTBUTTON1 = (By.ID, 'identifierNext')
NEXTBUTTON2 = (By.ID, 'passwordNext')
CONTINUE = (By.ID, 'confirm-submit')
self.driver.get('https://stackoverflow.com/users/signup?ssrc=head&returnurl=%2fusers%2fstory%2fcurrent')
self.driver.find_element_by_xpath('/html/body/div[4]/div[2]/div/div[2]/div[2]/button[1]').click()
WebDriverWait(self.driver, 30).until(EC.element_to_be_clickable(EMAILFIELD)).send_keys(self.user)
WebDriverWait(self.driver, 30).until(EC.element_to_be_clickable(NEXTBUTTON1)).click()
WebDriverWait(self.driver, 30).until(EC.element_to_be_clickable(PASSWORDFIELD)).send_keys(self.pwd)
WebDriverWait(self.driver, 30).until(EC.element_to_be_clickable(NEXTBUTTON2)).click()
sleep(6)
self.driver.get('https://mail.google.com/mail/u/0/#inbox')
self.driver.execute_script('alert("LOG OUT NOT REQUIRED AS COOKIES ARE NOT STORED");')
'''if WebDriverWait(self.driver, 30).until(EC.element_to_be_clickable(CONTINUE)):
mypath = 'QuickMail/'
f = open(mypath+'log.log','a+')
f.write('\n[*] ACCOUNT '+self.user+' OPENED TO VIEW ' + '\nAT ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
f.close()
sleep(2)
self.driver.get('https://mail.google.com/mail/u/0/#inbox')
self.driver.execute_script('alert("LOG OUT NOT REQUIRED AS COOKIES ARE NOT STORED");')'''
def yahoo(self):#open yahoo inbox
self.driver.get('https://login.yahoo.com')
WebDriverWait(self.driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "input.phone-no"))).send_keys(self.user)
self.driver.find_element_by_css_selector("input.orko-button-primary.orko-button#login-signin").click()
WebDriverWait(self.driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "input#login-passwd"))).send_keys(self.pwd)
self.driver.execute_script("arguments[0].click();", WebDriverWait(self.driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "button.pure-button.puree-button-primary.puree-spinner-button"))))
mypath = 'QuickMail/'
f = open(mypath+'log.log','a+')
f.write('\n[*] ACCOUNT '+self.user+' OPENED TO VIEW ' + '\nAT ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
f.close()
self.driver.execute_script('alert("LOG OUT NOT REQUIRED AS COOKIES ARE NOT STORED");')
def outlook(self):#open outlook/hotmail inbox
EMAILFIELD = (By.ID, "i0116")
PASSWORDFIELD = (By.ID, "i0118")
NEXTBUTTON = (By.ID, "idSIButton9")
self.driver.get('https://login.live.com')
WebDriverWait(self.driver, 10).until(EC.element_to_be_clickable(EMAILFIELD)).send_keys(self.user)
WebDriverWait(self.driver, 10).until(EC.element_to_be_clickable(NEXTBUTTON)).click()
WebDriverWait(self.driver, 10).until(EC.element_to_be_clickable(PASSWORDFIELD)).send_keys(self.pwd)
WebDriverWait(self.driver, 10).until(EC.element_to_be_clickable(NEXTBUTTON)).click()
sleep(2)
mypath = 'QuickMail/'
f = open(mypath+'log.log','a+')
f.write('\n[*] ACCOUNT '+self.user+' OPENED TO VIEW ' + '\nAT ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
f.close()
self.driver.get('https://outlook.live.com/mail/0/inbox')
self.driver.execute_script('alert("LOG OUT NOT REQUIRED AS COOKIES ARE NOT STORED");')
def apple(self):#open apple mail inbox
self.driver.get('https://www.icloud.com/mail')
delay = 10
WebDriverWait(self.driver, delay).until(EC.frame_to_be_available_and_switch_to_it((By.ID, 'auth-frame')))
username = WebDriverWait(self.driver, delay).until(EC.presence_of_element_located((By.ID, 'account_name_text_field')))
username.send_keys(self.user)
username.send_keys(Keys.ENTER)
password = WebDriverWait(self.driver, delay).until(EC.element_to_be_clickable((By.ID, 'password_text_field')))
password.send_keys(self.pwd)
password.send_keys(Keys.ENTER)
mypath = 'QuickMail/'
f = open(mypath+'log.log','a+')
f.write('\n[*] ACCOUNT '+self.user+' OPENED TO VIEW ' + '\nAT ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
f.close()
self.driver.execute_script('alert("LOG OUT NOT REQUIRED AS COOKIES ARE NOT STORED");')
def rediff(self):#open rediffmail inbox
self.driver.get('https://mail.rediff.com/cgi-bin/login.cgi')
self.driver.find_element_by_id('login1').send_keys(self.user)
self.driver.find_element_by_id('password').send_keys(self.pwd)
self.driver.find_element_by_xpath('/html/body/div/div[1]/div[1]/div[2]/form/div[1]/div[2]/div[2]/div[2]/input[2]').click()
mypath = 'QuickMail/'
f = open(mypath+'log.log','a+')
f.write('\n[*] ACCOUNT '+self.user+' OPENED TO VIEW ' + '\nAT ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
f.close()
self.driver.execute_script('alert("LOG OUT NOT REQUIRED AS COOKIES ARE NOT STORED");')
def setup():#setup to be done for the first time
d={'gmail':('smtp.gmail.com',587),
'outlook':('smtp.office365.com',587),
'yahoo':('smtp.mail.yahoo.com',587),#app specific
'icloud':('smtp.mail.me.com',587),#app specific
'rediffmail':('smtp.rediffmailpro.com',587),
'rediff':('smtp.rediffmail.com',25)}
def load():#fancy loading animation (of sorts)
load_str = "starting the setup ..."
ls_len = len(load_str)
animation = "|_/-\_|"
anicount = 0
counttime = 0
i = 0
while (counttime != 100):
sleep(0.05)
load_str_list = list(load_str)
x = ord(load_str_list[i])
y = 0
if x != 32 and x != 46:
if x>90:
y = x-32
else:
y = x + 32
load_str_list[i]= chr(y)
res =''
for j in range(ls_len):
res = res + load_str_list[j]
sys.stdout.write("\r"+res + animation[anicount])
sys.stdout.flush()
load_str = res
anicount = (anicount + 1)% 4
i =(i + 1)% ls_len
counttime = counttime + 1
if os.name =="nt":
os.system("cls")
else:
os.system("clear")
try:
load()
print(colored('''
____ _ _ _____ _____ _ ____ __ _____ _
/ __ \| | | |_ _/ ____| |/ / \/ | /\ |_ _| |
| | | | | | | | || | | ' /| \ / | / \ | | | |
| | | | | | | | || | | < | |\/| | / /\ \ | | | |
| |__| | |__| |_| || |____| . \| | | |/ ____ \ _| |_| |____
\___\_\\\____/|_____\_____|_|\_\_| |_/_/ \_\_____|______|
A COMPUTER SCIENCE PROJECT BY V. ANIRUDH AND NISHANT OF CLASS 12 E
''', 'green', attrs=['bold']))#fancy ascii art
mypath = 'QuickMail/'
os.umask(0)
z=1
signer=''
present = []
if not os.path.isdir(mypath):
os.makedirs(mypath, 0o777)#create folder if doesnt exist
open(mypath+'temp_mail.txt','w+')#create mail typing file
if not os.path.isdir(mypath+'/faces'):
os.makedirs(mypath+'/faces',0o777)#create folder for face rec
if not os.path.isdir(mypath+'/faces/2'):
os.makedirs(mypath+'/faces/2',0o777)
if not os.path.isdir(mypath+'/faces/1'):
os.makedirs(mypath+'/faces/1',0o777)
while 1:
try:
open(r'QuickMail/cred.log').read()#check if mail id setup is complete
except FileNotFoundError:
add_address('')
inp1 = colored('\n[*] DO YOU WANT TO ADD ANOTHER ACCOUNT (Y/N) ','green',attrs=['bold'])
try:
abcd2 = input(inp1).upper()
except:
pri3 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri3)
continue
if abcd2=='N':
break
elif abcd2 == 'Y':
continue
else:
pri4 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri4)
check = cam_check()
security = ''
if check:#for setting a security option
while 1:
try:
inp2 = colored('\n[*] SELECT METHOD TO SECURE QUICK MAIL\n'+'1)FACE ID\n'+'2)PASSWORD\n','green',attrs=['bold'])
a = input(inp2)
except:
pri5 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri5)
continue
if a not in '12':
pri6 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri6)
else:
a = int(a)
if a == 1:
pri7 = colored('\n[*] STARTING FACE RECOGNITION ENGINE ', 'green',attrs=['bold'])
print(pri7)
if face(check[0]):
pri8 = colored('\n[*] FACE ID SET','green',attrs=['bold'])
print(pri8)
security = 'face|_/-\_|'
while 1:
inp10 = colored("\n[*] ENTER BACKUP PASSWORD FOR SERVICE ",'green',attrs=['bold'])
inp11 = colored("\n[*] RE-ENTER BACKUP PASSWORD ",'green',attrs=['bold'])
secure1 = getpass(prompt=inp10)
secure2 = getpass(prompt=inp11)
if secure1 == secure2:
pri9 = colored('\n[*] PASSWORD SET','green',attrs=['bold'])
print(pri9)
break
else:
pri10 =colored('\n[*] PASSWORDS DO NOT MATCH','red',attrs=['bold'])
print(pri10)
security += secure1
if a == 2:
while 1:
inp3 = colored("\n[*] ENTER PASSWORD FOR SERVICE ",'green',attrs=['bold'])
inp4 = colored("\n[*] RE-ENTER PASSWORD ",'green',attrs=['bold'])
secure1 = getpass(prompt=inp3)
secure2 = getpass(prompt=inp4)
if secure1 == secure2:
pri11 = colored('\n[*] PASSWORD SET', 'green',attrs=['bold'])
print(pri11)
break
else:
pri12 = colored('\n[*] PASSWORDS DO NOT MATCH', 'red',attrs=['bold'])
print(pri12)
security = secure1
break
else:
while 1:
if 1:
a = int(a)
if a == 1:
while 1:
inp3 = colored("\n[*] ENTER PASSWORD FOR SERVICE ",'green',attrs=['bold'])
inp4 = colored("\n[*] RE-ENTER PASSWORD ",'green',attrs=['bold'])
secure1 = getpass(prompt=inp3)
secure2 = getpass(prompt=inp4)
if secure1 == secure2:
pri13 = colored('\n[*] PASSWORD SET', 'green',attrs=['bold'])
print(pri13)
break
else:
pri14 = colored('\n[*] PASSWORDS DO NOT MATCH', 'red',attrs=['bold'])
print(pri14)
security = secure1
break
while 1:
try:
inp5 = colored('\n[*] ENTER A RECOVERY MAIL ID ','green',attrs=['bold'])
mail = input(inp5)
except:
pri15 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri15)
continue
a = mail.split('@')
pri16 = colored('\n[*] SENDING OTP TO '+mail[0]+'*'*(len(a[0])-2)+a[0][-1]+'@'+a[1], 'green',attrs=['bold'])
print(pri16)
req_otp = otp()
msg = MIMEMultipart('alternative')
msg['Subject'] = 'CONFIRM RECOVERY MAIL ADDRESS'
msg['From'] = 'quick.mail.noreply@gmail.com'
ab = 'ENTER THIS OTP IN QUICK MAIL TO CONFIRM RECOVERY MAIL ADDRESS: '+req_otp
ac = MIMEText(ab, 'html')
msg.attach(ac)
server = smtplib.SMTP('smtp.gmail.com',587)
server.ehlo()
server.starttls()
server.login('quick.mail.noreply@gmail.com','anirudhnfs01')
a = time()
server.sendmail('quick.mail.noreply@gmail.com', mail, msg.as_string())
server.quit()
tries = 5
while tries>0:
inp6 = colored('\n[*] ENTER OTP SENT TO YOUR RECOVERY MAIL WITHIN 30 SECONDS ','green',attrs=['bold'])
ad = input(inp6)
if time()-a > 30:
pri17 = colored('\n[*] TIME UP', 'red',attrs=['bold'])
print(pri17)
break
if ad == req_otp:
tries = 0
continue
else:
pri18 = colored('\n[*] INCORRECT OTP. TRIES LEFT: '+str(tries),'red',attrs=['bold'])
print(pri18)
tries -= 1
if tries:
pri19 = colored('\n[*] OUT OF TRIES.','red',attrs=['bold'])
print(pri19)
elif not tries:
break
ab = open(mypath+'/lock.log','w+')
ab.write(encrypt(encrypt(security))+'\n'+encrypt(encrypt(mail)))
ab.close()
except KeyboardInterrupt:
pri20 = colored('\n[*] YOU HAVE QUIT THE SETUP ','red',attrs=['bold'])
print(pri20)
def change1(mail,mypath):#change stored credentials for the smtp
file = open(mypath+'cred.log','r')
f = open(mypath+'log.log','a+')
entered = file.read()
file.close()
e=entered.split('\n\n\n')
fa=[]
for a in e:
fa.append(a.split('\n'))
fa.pop(-1)
new_app = ''
pri21 = colored('\n[*] STORED PASSWORD IS INCORRECT FOR '+mail,'red',attrs=['bold'])
print(pri21)
for a in range(len(fa)):
if decrypt(decrypt(fa[a][1])) == mail:
if mail.split('@')[-1].split('.')[0] in ('yahoo','apple'):
inpoutofblue = colored("\n[*] ENTER NEW APP PASSWORD ",'green',attrs=['bold'])
new_app = getpass(prompt=inpoutofblue)
else:
inpoutofblue2 = colored('\n[*] ENTER YOUR NEW PASSWORD ','green',attrs=['bold'])
pwd = getpass(prompt=inpoutofblue2)
if not new_app:
fa[a][2] = encrypt(encrypt(pwd))
else:
fa[a][0] = encrypt(encrypt(new_app))
f.write('\n[*] PASSWORD CHANGED FOR ACCOUNT '+mail)
break
file = open(mypath+'cred.log','w+')
final = ''
for a in fa:
s = ''
for b in a:
s += b+'\n'
final += s+'\n\n\n'
file.write(final)
def change2(mypath):#change stored credentials for inbox
try:
while 1:
file = open(mypath+'cred.log','r')
f = open(mypath+'log.log','a+')
entered = file.read()
file.close()
e=entered.split('\n\n\n')
fa=[]
for a in e:
fa.append(a.split('\n'))
fa.pop(-1)
acc_select = '\n[*] SELECT YOUR ACCOUNT[PRESS CTRL+C TO GO TO MAIN MENU]\n'
for a in range(len(fa)):
acc_select+=str(a+1)+')'+decrypt(decrypt(fa[a][1]))+'\n'
acc_select = colored(acc_select,'green',attrs=['bold'])
while 1:
try:
acc_choice=int(input(acc_select))
except Exception as e:
pri22 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri22)
continue
if acc_choice > len(fa)+1:
pri23 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri23)
else:
break
mail = decrypt(decrypt(fa[acc_choice-1][1]))
for a in range(len(fa)):
if decrypt(decrypt(fa[a][1])) == mail:
while 1:
try:
inp7 = colored('\n[*] ENTER YOUR NEW PASSWORD ','green',attrs=['bold'])
pwd = getpass(prompt=inp7)
except Exception as e:
pri24 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri24)
continue
break
fa[a][2] = encrypt(encrypt(pwd))
file = open(mypath+'cred.log','w+')
final = ''
for a in fa:
s = ''
for b in a:
s += b+'\n'
final += s+'\n\n\n'
file.write(final)
f.write('\n[*] PASSWORD CHANGED FOR ACCOUNT '+mail)
break
while 1:
try:
inp8 = colored('\n[*] DO YOU WANT TO CHANGE PASSWORD FOR ANOTHER ACCOUNT?(Y/N) ','green',attrs=['bold'])
asd = input(inp8).upper()
except Exception as e:
pri25 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri25)
continue
if asd in 'YN':
break
else:
pri26 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri26)
if asd == 'N':
pri27 = colored('\n[*] PLEASE RELAUNCH QUICK MAIL FOR THE CHANGES TO TAKE EFFECT ', 'red',attrs=['bold'])
print(pri27)
break
except KeyboardInterrupt:
print()
def face_id(cam):#face id for unlock
pri28 = colored('\n[*] STARTING FACE RECOGNITION ENGINE ','green',attrs=['bold'])
print(pri28)
vid = cam
known_faces = []
known_faces.append(pickle.load(open('QuickMail/faces/1/f.pkz','rb')))
c = 0
while 1:
r,image = vid.read()
if r < 25:
pri30 = colored('\n[*] PLEASE MOVE TO A WELL LIT PLACE AND TRY AGAIN','red',attrs=['bold'])
print(pri30)
continue
locations = face_recognition.face_locations(image)
encodings = face_recognition.face_encodings(image, locations)
try:
results = face_recognition.compare_faces(known_faces, encodings[0], 10)
except:
continue
c += 1
if c == 20:
vid.release()
return 0
if True in results:
vid.release()
return 1
def face(cap):#face id for setup
while 1:
_,face = cap.read()
cv2.imshow('PRESS s TO START FACE ID', face)
if cv2.waitKey(1) & 0xFF == ord('s'):
pri31 = colored('\n[*] PLEASE WAIT','green',attrs=['bold'])
print(pri31)
try:
locations = face_recognition.face_locations(face)
encodings = face_recognition.face_encodings(face, locations)
f = open('QuickMail/faces/1/f.pkz','wb')
pickle.dump(encodings[0], f)
f.close()
cap.release()
return 1
except Exception as e:
pri32 = colored('\n[*] PLEASE TRY AGAIN','red',attrs=['bold'])
print(pri32)
def pword(mail,check):#reset quick mail password
try:
security = ''
if check:
while 1:
try:
inp9 = colored('\n[*] SELECT METHOD TO SECURE QUICK MAIL\n'+'1)FACE ID\n'+'2)PASSWORD\n','green',attrs=['bold'])
a = input(inp9)
except:
pri33 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri33)
continue
if a not in '12':
pri34 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri34)
continue
else:
a = int(a)
if a == 1:
pri35 = colored('\n[*] STARTING FACE RECOGNITION ENGINE FOR FACE ID ','green',attrs=['bold'])
print(pri35)
if face(check[0]):
pri36 = colored('\n[*] FACE ID SET','green',attrs=['bold'])
print(pri36)
security = 'face|_/-\_|'
while 1:
inp10 = colored("\n[*] ENTER BACKUP PASSWORD FOR SERVICE ",'green',attrs=['bold'])
inp11 = colored("\n[*] RE-ENTER BACKUP PASSWORD ",'green',attrs=['bold'])
secure1 = getpass(prompt=inp10)
secure2 = getpass(prompt=inp11)
if secure1 == secure2:
pri37 = colored('\n[*] PASSWORD SET','green',attrs=['bold'])
print(pri37)
break
else:
pri38 = colored('\n[*] PASSWORDS DO NOT MATCH','red',attrs=['bold'])
print(pri38)
security += secure1
if a == 2:
while 1:
inp10 = colored("\n[*] ENTER PASSWORD FOR SERVICE ",'green',attrs=['bold'])
inp11 = colored("\n[*] RE-ENTER PASSWORD ",'green',attrs=['bold'])
secure1 = getpass(prompt=inp10)
secure2 = getpass(prompt=inp11)
if secure1 == secure2:
pri39 = colored('\n[*] PASSWORD SET','green',attrs=['bold'])
print(pri39)
break
else:
pri40 = colored('\n[*] PASSWORDS DO NOT MATCH','red',attrs=['bold'])
print(pri40)
security = secure1
break
else:
while 1:
if 1:
while 1:
try:
inp10 = colored("\n[*] ENTER PASSWORD FOR SERVICE ",'green',attrs=['bold'])
inp11 = colored("\n[*] RE-ENTER PASSWORD ",'green',attrs=['bold'])
secure1 = getpass(prompt=inp10)
secure2 = getpass(prompt=inp11)
except:
pri41 = colored('\n[*] INVALID PASSWORD','red',attrs=['bold'])
print(pri41)
continue
if secure1 == secure2:
pri42 = colored('\n[*] PASSWORD SET','green',attrs=['bold'])
print(pri42)
break
else:
pri43 = colored('\n[*] PASSWORDS DO NOT MATCH','red',attrs=['bold'])
print(pri43)
security = secure1
break
recovery = mail
mypath = 'QuickMail'
af = open(mypath+'/lock.log','w+')
af.write(encrypt(encrypt(security))+'\n'+encrypt(encrypt(recovery)))
af.close()
f = open(mypath+'log.log','a+')
f.write('\n[*] QUICK MAIL PASSWORD CHANGED AT ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
f.close()
except KeyboardInterrupt:
pri44 = colored('\n[*] YOU HAVE QUIT QUICK MAIL','red',attrs=['bold'])
print(pri44)
def pic(cap):#take a pic using webcam
f_name = r'QuickMail/faces/2/pic.jpg'
while 1:
if take_pic(cap,f_name):
return f_name
def otp():#returns an otp to reset password
OTP = ''.join([choice('ABCDEFGHIVWXY0123456789klmnopqrstvwxyz') for n in range(6)])
return OTP
def reset(mail,cam):#send and receive otp to confirm password reset
try:
a = mail.split('@')
pri45 = colored('\n[*] SENDING OTP TO '+mail[0]+'*'*(len(a[0])-2)+a[0][-1]+'@'+a[1],'green',attrs=['bold'])
print(pri45)
req_otp = otp()
msg = MIMEMultipart('alternative')
msg['Subject'] = 'CHANGE OF PASSWORD'
msg['From'] = 'quick.mail.noreply@gmail.com'
ab = 'CHANGE OF PASSWORD REQUESTED FROM YOUR QUICK MAIL APPLICATION. OTP: '+req_otp
ac = MIMEText(ab, 'html')
msg.attach(ac)
server = smtplib.SMTP('smtp.gmail.com',587)
server.ehlo()
server.starttls()
server.login('quick.mail.noreply@gmail.com','anirudhnfs01')
a = time()
server.sendmail('quick.mail.noreply@gmail.com', mail, msg.as_string())
server.quit()
tries = 5
while tries>0:
try:
inp12 = colored('\n[*] ENTER OTP SENT TO YOUR RECOVERY MAIL WITHIN 30 SECONDS ','green',attrs=['bold'])
ad = input(inp12)
except:
pri46 = colored('\n[*] INVALID OTP','red',attrs=['bold'])
print(pri46)
if time()-a > 30:
pri47 = colored('\n[*] TIME UP','red',attrs=['bold'])
print(pri47)
break
if ad == req_otp:
pword(mail,cam)
break
else:
pri48 = colored('\n[*] INCORRECT OTP. TRIES LEFT: '+str(tries),'red',attrs=['bold'])
print(pri48)
tries -= 1
if tries == 1:
pri49 = colored('\n[*] OUT OF TRIES','red',attrs=['bold'])
print(pri49)
except KeyboardInterrupt:
pri50 = colored('\n[*] YOU HAVE QUIT QUICK MAIL','red',attrs=['bold'])
print(pri50)
def unlock(cam):#unlock quick mail
try:
while 1:
re = open(r'QuickMail/lock.log').read()
l=[]
for a in re.split('\n'):
l.append(decrypt(decrypt(a)))
l[0] = l[0].split('|_/-\_|')
if l[0][0] == 'face':
if cam[0]:
return face_id(cam[0])
else:
tries = 5
while tries > 0:
try:
inp13 = colored('\n[*] ENTER YOUR PASSWORD ','green',attrs=['bold'])
p = input(inp13)
except:
pri51 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri51)
continue
if p == l[0][1]:
return 1
else:
pri52 = colored('\n[*] INCORRECT PASSWORD. TRIES LEFT: '+str(tries),'red',attrs=['bold'])
print(pri52)
tries -= 1
pri53 = colored('\n[*] OUT OF TRIES','red',attrs=['bold'])
print(pri53)
msg = MIMEMultipart('alternative')
msg['Subject'] = 'SNOOPER ALERT'
msg['From'] = 'quick.mail.noreply@gmail.com'
ab = 'PASSWORD ENTERED INCORRECTLY MORE THAN 6 TIMES IN YOUR QUICK MAIL AAPLICATION'
ac = MIMEText(ab, 'html')
msg.attach(ac)
server = smtplib.SMTP('smtp.gmail.com',587)
server.ehlo()
server.starttls()
server.login('quick.mail.noreply@gmail.com','anirudhnfs01')
server.sendmail('quick.mail.noreply@gmail.com', l[1], msg.as_string())
server.quit()
return 0
else:
tries = 5
while tries > 0:
try:
inp13 = colored('\n[*] ENTER YOUR PASSWORD ','green',attrs=['bold'])
p = getpass(prompt=inp13)
except Exception as e:
pri55 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri55)
continue
if p == l[0][0]:
return 1
else:
pri56 = colored('\n[*] INCORRECT PASSWORD. TRIES LEFT: '+str(tries),'red',attrs=['bold'])
print(pri56)
tries -= 1
pri57 = colored('\n[*] OUT OF TRIES','red',attrs=['bold'])
print(pri57)
msg = MIMEMultipart('alternative')
msg['Subject'] = 'SNOOPER ALERT'
msg['From'] = 'quick.mail.noreply@gmail.com'
ab = 'PASSWORD ENTERED INCORRECTLY MORE THAN 6 TIMES IN YOUR QUICK MAIL AAPLICATION'
ac = MIMEText(ab, 'html')
msg.attach(ac)
server = smtplib.SMTP('smtp.gmail.com',587)
server.ehlo()
server.starttls()
server.login('quick.mail.noreply@gmail.com','anirudhnfs01')
if cam[0]:
file_ = open(pic(cam[0]),'rb')
attacher = MIMEBase('application','octet-stream')
attacher.set_payload((file_).read())
encoders.encode_base64(attacher)
attacher.add_header("Content-Disposition",'attachment; filename ="%s" '%'snooper.jpg')
msg.attach(attacher)
server.sendmail('quick.mail.noreply@gmail.com', l[1], msg.as_string())
server.quit()
return 0
except KeyboardInterrupt:
reset(l[1],cam)
def body():#get the body of the mail
key='''
[*] KEY FOR VOICE RECOGNITION [*]
(ACCURACY DEPENDS ON CLARITY OF DICTATION)
DOULE QUOTES -> "
SINGLE QUOTES -> '
FULLSTOP -> .
SLASH -> /
BACK SLASH -> \
ASTERISK -> *
HYPHEN -> -
OPEN BRACKETS -> (
CLOSE BRACKETS -> )
SEMI-COLON -> ;
COLON -> :
UNDERSCORE -> _
COMMA -> ,
PERCENT -> %
EXCLAMATION MARK -> !
HASHTAG -> #
AT -> @ (APPLICABLE FOR MAIL ID'S ONLY)
AMPERSAND -> &
DOLLAR(S) -> $
PLUS -> +
EQUALS -> =
NEW LINE -> (TO ENTER A NEW LINE)
NEW PARAGRAPH -> (TO START A NEW PARAGRAPH)
NUMBERS
LETTERS
'''
recog = speech.Recognizer()
with speech.Microphone() as src:
while 1:
try:
inp14 = colored('\n[*] DO YOU WANT TO SPEAK THE BODY OF YOUR MAIL?(Y/N) ','green',attrs=['bold'])
a = input(inp14).upper()
except:
pri58 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri58)
continue
if a == 'Y':
recog.adjust_for_ambient_noise(src)
while 1:
try:
try:
inp15 = colored('\n[*] PRESS ENTER TO START SPEAKING ','green',attrs=['bold'])
input(inp15)
except:
pass
pri59 = colored('\n[*] TRANSCRIBING.....','green',attrs=['bold'])
print(pri59)
listen = recog.listen(src)
text = recog.recognize_google(listen)
break
except speech.UnknownValueError:
pri109 = colored("\n[*] SORRY DIDN'T GET YOU THERE ",'red',attrs=['bold'])
print(pri109)
f = open(r'QuickMail/temp_mail.txt','w+')
f.write(text)
f.close()
pri60 = colored('\n[*] EDIT YOUR BODY IN THE WINDOW WHICH WILL OPEN AND PRESS ENTER KEY AFTER MAKING AND SAVING YOUR DESIRED CHANGES ','red',attrs=['bold'])
print(pri60)
if os.name == "nt":
os.system(r'notepad.exe QuickMail/temp_mail.txt')
else:
os.system(r'open QuickMail/temp_mail.txt')
try:
input()
except:
pass
body = open(r'QuickMail/temp_mail.txt').read()
open(r'QuickMail/temp_mail.txt','w+').close()
return body
elif a == 'N':
inp16 = colored('\n[*] ENTER THE BODY OF YOUR MAIL IN THE WINDOW OPENING NOW AND PRESS ENTER ONCE DONE','green',attrs=['bold'])
print(inp16)
if os.name == "nt":
os.system(r'notepad.exe QuickMail/temp_mail.txt')
else:
os.system(r'open QuickMail/temp_mail.txt')
input()
body = open('QuickMail/temp_mail.txt','r').read()
open('QuickMail/temp_mail.txt','w+').close()
return body
else:
pri62 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri62)
return body
def add_address(email):#add an account to quick mail
d={'gmail':('smtp.gmail.com',587),
'outlook':('smtp.office365.com',587),
'yahoo':('smtp.mail.yahoo.com',587),
'icloud':('smtp.mail.me.com',587),
'rediffmail':('smtp.rediffmailpro.com',587),
'rediff':('smtp.rediffmail.com',25)}
z = 1
while z:
try:
mypath = 'QuickMail/'
signer=''
while 1:
app_pwd = ''
print('\n\n\n\n\n')
pri63 = colored('!!!GRANT ACCESS TO THIRD PARTY APPS FROM YOUR SECURITY SETTINGS ON YOUR EMAIL ACCOUNT IF PRESENT!!!','red',attrs=['bold'])
print(pri63)
print('\n\n\n')
provider = '[*] SELECT YOUR MAIL PROVIDER \n'
c = 1
for a in d:
provider += str(c)+')'+a.upper()+'\n'
c += 1
provider = colored(provider,'green',attrs=['bold'])
while 1:
try:
selected = int(input(provider))
except:
pri64 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri64)
continue
if selected > c-1:
pri65 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri65)
else:
break
while 1:
try:
inp17 = colored("\n[*] ENTER YOUR EMAIL ADDRESS ",'green',attrs=['bold'])
from_address = str(input(inp17))
except:
pri66 = colored('\n[*] INVALID MAIL ID','red',attrs=['bold'])
print(pri66)
continue
break
if 1:
inner = 1
for a in d:
if inner == selected:
smtp_server=d[a][0]
smtp_port=d[a][1]
while 1:
if a in ('icloud','yahoo'):
while 1:
try:
inp18 = colored('\n[*] ENTER AN APP SPECIFIC PASSWORD TO SEND EMAILS ','green',attrs=['bold'])
inp19 = colored('\n[*] ENTER YOUR PASSWORD TO VIEW YOUR EMAILS ','green',attrs=['bold'])
app_pwd = getpass(prompt=inp18)
password = getpass(prompt=inp19)
except:
pri67 = colored('\n[*] INVALID PASSWORD(S)','red',attrs=['bold'])
print(pri67)
continue
break
else:
while 1:
try:
inp20 = colored('\n[*] DO YOU WANT TO USE AN APP SPECIFIC PASSWORD?(Y/N) ','green',attrs=['bold'])
abcd = input(inp20).upper()
except:
pri68 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri68)
continue
if abcd == 'N':
while 1:
try:
inp21 = colored('\n[*] ENTER YOUR PASSWORD TO VIEW YOUR EMAILS ','green',attrs=['bold'])
password = getpass(prompt=inp21)
except:
pri69 = colored('\n[*] INVALID PASSWORD','red',attrs=['bold'])
print(pri69)
continue
break
break
elif abcd == 'Y':
while 1:
try:
inp22 = colored('\n[*] ENTER AN APP SPECIFIC PASSWORD TO SEND EMAILS ','green',attrs=['bold'])
inp23 = colored('\n[*] ENTER YOUR PASSWORD TO VIEW YOUR EMAILS ','green',attrs=['bold'])
app_pwd = getpass(prompt=inp22)
password = getpass(prompt=inp23)
except:
pri70 = colored('\n[*] INVALID PASSWORD(S)','red',attrs=['bold'])
print(pri70)
continue
break
break
else:
pri71 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri71)
try:
server = smtplib.SMTP(smtp_server, smtp_port)
server.ehlo()
server.starttls()
if app_pwd == '':
server.login(from_address,password)
else:
server.login(from_address,app_pwd)
server.quit()
break
except Exception as e:
pri72 = colored('\n[*] INVALID APP/ACCOUNT PASSWORD','red',attrs=['bold'])
print(pri72,end='\n')
pri73 = colored('\n!!!GRANT ACCESS TO THIRD PARTY APPS FROM YOUR SECURITY SETTINGS ON YOUR EMAIL ACCOUNT IF PRESENT!!!','red',attrs=['bold'])
print(pri73)
break
inner += 1
while 1:
try:
inp24 = colored('\n[*] WOULD YOU LIKE TO SIGN YOUR EMAILS?(Y/N) ','green',attrs=['bold'])
abcd1 = input(inp24).upper()
except:
pri74 = colored('\n[*] INVALID CHOICE', 'red',attrs=['bold'])
print(pri74)
continue