DanielHannon

NETSAFETY

Jan 7th, 2017
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.55 KB | None | 0 0
  1. """
  2. NetMums Super Secure Virus and Harmful Content Blocking Script
  3. 2017 Daniel Hannon
  4. Free To Distribute """
  5. hostsfile = open("hosts.txt","r+")
  6. hostsfile.write("#NETMUMS WEB SAFETY HOSTS FILE \n")
  7. hostsfile.write("#FOR UNIX SYSTEMS PLACE IN /etc/hosts \n")
  8. hostsfile.write("#FOR WINDOWS SYSTEMS PLACE IN %SystemRoot%\System32\drivers\etc\hosts \n")
  9. def virusblock():
  10.     word_bank = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"]
  11.     nasty_subdomain = [".com",".net",".co.uk",".it",".be",".ie",".gov",".io",".jp"]
  12.     domain_of_nasty_website=[0]
  13.     domain_to_block = ""
  14.     while len(domain_to_block) < 13:
  15.         domain_to_block = ""
  16.         for i in domain_of_nasty_website:
  17.             domain_to_block = domain_to_block + str(word_bank[i])
  18.         for f in nasty_subdomain:
  19.             hostsfile.write("127.0.0.1 http://www.%s%s \n" % (domain_to_block, f))
  20.         for e in range(len(domain_of_nasty_website)):
  21.             if e == 0:
  22.                 domain_of_nasty_website[e] = domain_of_nasty_website[e]+1
  23.             if domain_of_nasty_website[e] > (len(word_bank)-1):
  24.                 domain_of_nasty_website[e] = 0
  25.                 if (len(domain_of_nasty_website)-1) - e == 0:
  26.                     domain_of_nasty_website.append(0)
  27.                 else:
  28.                     domain_of_nasty_website[e+1] = domain_of_nasty_website[e+1] + 1
  29. virusblock()
Advertisement
Add Comment
Please, Sign In to add comment