
import time
from cymon import Cymon
#Personal Key Removed.  Replace 'xxx' with your own key.
api = Cymon('xxx')

#Parsing Text file retrieved from:
#http://stackoverflow.com/questions/6277107/parsing-text-file-in-python

#Open malware domain file.
f = open('text.txt','r')
#Open output file to write to
cymondata = open('cymondata.txt','w')
while True:
   try:
      #Read the next domain in file.
      text = f.readline()
      print(text)
	  #Lookup the domain through Cymon and print results back to output file.
      cymondata.write(repr(api.domain_lookup(text)))
      cymondata.write("\n")
      cymondata.write("\n")
   #If 404 error encountered, skip domain and move to the next one.
   except Exception:
      pass
   time.sleep(1)

#Once finished, close the connection.
cymondata.close()



import time
from cymon import Cymon
#Personal Key Removed.  Replace 'xxx' with your own key.
api = Cymon('xxx')

#Parsing Text file retrieved from:
#http://stackoverflow.com/questions/6277107/parsing-text-file-in-python

#Open malware domain file.
f = open('TestedMalwareDomains.txt','r')
#Open output file to write to
cymondata = open('cymondata.txt','w')
while True:
   try:
      #Read the next domain in file.
      text = f.readline()
      print(text)
	  #Lookup the domain through Cymon and print results back to output file.
      cymondata.write(repr(api.domain_lookup(text)))
      cymondata.write("\n")
      cymondata.write("\n")
   #If 404 error encountered, skip domain and move to the next one.
   except Exception:
      pass
   time.sleep(1)

#Once finished, close the connection.
cymondata.close()


Update to Script, Fixed malware domain file name
Update to Script, Fixed malware domain file name

Fixed malware domains file name to accurately represent the file opened. (Better than text.txt)
  
  import time
  from cymon import Cymon
  #Personal Key Removed.  Replace 'xxx' with your own key.
  api = Cymon('xxx')
  
  #Parsing Text file retrieved from:
  #http://stackoverflow.com/questions/6277107/parsing-text-file-in-python
  
  #Open malware domain file.
- f = open('text.txt','r')
+ f = open('TestedMalwareDomains.txt','r')
  #Open output file to write to
  cymondata = open('cymondata.txt','w')
  while True:
     try:
        #Read the next domain in file.
        text = f.readline()
        print(text)
  	  #Lookup the domain through Cymon and print results back to output file.
        cymondata.write(repr(api.domain_lookup(text)))
        cymondata.write("\n")
        cymondata.write("\n")
     #If 404 error encountered, skip domain and move to the next one.
     except Exception:
        pass
     time.sleep(1)
  
  #Once finished, close the connection.
  cymondata.close()
  
  
Update to Script, Fixed malware domain file name
## Code Before:

import time
from cymon import Cymon
#Personal Key Removed.  Replace 'xxx' with your own key.
api = Cymon('xxx')

#Parsing Text file retrieved from:
#http://stackoverflow.com/questions/6277107/parsing-text-file-in-python

#Open malware domain file.
f = open('text.txt','r')
#Open output file to write to
cymondata = open('cymondata.txt','w')
while True:
   try:
      #Read the next domain in file.
      text = f.readline()
      print(text)
	  #Lookup the domain through Cymon and print results back to output file.
      cymondata.write(repr(api.domain_lookup(text)))
      cymondata.write("\n")
      cymondata.write("\n")
   #If 404 error encountered, skip domain and move to the next one.
   except Exception:
      pass
   time.sleep(1)

#Once finished, close the connection.
cymondata.close()


## Instruction:
Update to Script, Fixed malware domain file name
## Code After:

import time
from cymon import Cymon
#Personal Key Removed.  Replace 'xxx' with your own key.
api = Cymon('xxx')

#Parsing Text file retrieved from:
#http://stackoverflow.com/questions/6277107/parsing-text-file-in-python

#Open malware domain file.
f = open('TestedMalwareDomains.txt','r')
#Open output file to write to
cymondata = open('cymondata.txt','w')
while True:
   try:
      #Read the next domain in file.
      text = f.readline()
      print(text)
	  #Lookup the domain through Cymon and print results back to output file.
      cymondata.write(repr(api.domain_lookup(text)))
      cymondata.write("\n")
      cymondata.write("\n")
   #If 404 error encountered, skip domain and move to the next one.
   except Exception:
      pass
   time.sleep(1)

#Once finished, close the connection.
cymondata.close()

