· 9 years ago · Sep 09, 2016, 11:22 PM
1import os
2
3os.system('cls' if os.name == 'nt' else 'clear')
4
5oldfile = raw_input('{*} Enter the file (with extension) you would like to strip domains from: ')
6newfile = raw_input('{*} Enter the name of the file (with extension) you would like me to save: ')
7
8emailDomains = ['windstream.net', 'mail.com', 'google.com', 'web.de', 'email', 'yandex.ru', 'ymail', 'mail.eu', 'mail.bg', 'comcast.net', 'yahoo', 'Yahoo', 'gmail', 'Gmail', 'GMAIL', 'hotmail', 'comcast', 'bellsouth.net', 'verizon.net', 'att.net', 'roadrunner.com', 'charter.net', 'mail.ru', '@live', 'icloud', '@aol', 'facebook', 'outlook', 'myspace', 'rocketmail']
9
10print "\n[*] This script will remove records that contain the following strings: \n\n", emailDomains
11
12raw_input("\n[!] Press any key to start...\n")
13
14linecounter = 0
15
16with open(oldfile) as oFile, open(newfile, 'w') as nFile:
17 for line in oFile:
18 if not any(domain in line for domain in emailDomains):
19 nFile.write(line)
20 linecounter = linecounter + 1
21 print '[*] - {%s} Writing verified record to %s ---{ %s' % (linecounter, newfile, line)
22
23print '[*] === COMPLETE === [*]'
24print '[*] %s was saved' % newfile
25print '[*] There are %s records in your saved file.' % linecounter