-
Notifications
You must be signed in to change notification settings - Fork 0
/
chef.py
43 lines (34 loc) · 872 Bytes
/
chef.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
import whois
import sys
import os
import subprocess
def Check(domains,org):
errors = []
for domain in domains:
try:
whois=GetWhois(domain)
if(org.lower() in whois.org.lower()):
print domain
except:
errors.append(domain)
return errors
def GetWhois(domain):
return whois.whois(domain)
def OpenFile(fileName):
with open(fileName) as f:
content = f.readlines()
content = [x.strip() for x in content]
return content
def main():
if len(sys.argv) != 3:
print ('[+] usage: <filename> <org>')
sys.exit(-1)
filename = sys.argv[1]
org = sys.argv[2]
domains = OpenFile(filename)
errors = Check(domains,org)
print('\n\n')
print("[+] ERRORS:" )
print errors
if __name__ == "__main__":
main()