-
Notifications
You must be signed in to change notification settings - Fork 0
/
finger_brute_solution.py
52 lines (36 loc) · 1008 Bytes
/
finger_brute_solution.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
from finger import finger
##record = finger('tjtaubit', 'mtu.edu')
##print(record)
female_names_file = open('name_lists/female.txt')
male_names_file = open('name_lists/male.txt')
female_records = female_names_file.readlines()
male_records = male_names_file.readlines()
##print(female_records)
##for record in female_records:
## name = record.split()[0]
## print(name)
names = []
for record in female_records:
name = record.split()[0]
names.append(name)
for record in male_records:
name = record.split()[0]
names.append(name)
##print(names)
finger_db = []
for name in names:
result = finger(name, 'mtu.edu')
finger_db.extend(result)
##print(finger_db)
##print(len(finger_db))
emails = []
for record in finger_db:
if 'email' in record.keys():
emails.append(record['email'])
##print(emails)
email_file = open('emails.txt', 'w')
for email in emails:
email_file.write(email + '\n')
email_file.close()
female_names_file.close()
male_names_file.close()