Created
November 22, 2018 20:51
-
-
Save gormih/daafe30e6bc6ee0c8aebae506b157cc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import dns.resolver | |
from ipwhois import IPWhois | |
import warnings | |
def chek_yandex_security(host): | |
yandex_dns = ['77.88.8.7', '77.88.8.3'] | |
resolver = dns.resolver.Resolver() | |
resolver.nameservers = yandex_dns | |
ip = str(resolver.query(host, 'a').rrset.items[0]) | |
obj_whois = IPWhois(ip) | |
description = obj_whois.lookup_whois(False)['asn_description'] | |
answer = 'Good site' | |
if 'yandex' in description.lower(): | |
answer = 'Bad site' | |
return answer | |
with warnings.catch_warnings(): | |
warnings.filterwarnings("ignore", category=UserWarning) | |
domains = ['porno365.xxx', | |
'google.com', | |
'facebook.com', | |
'vk.com', | |
'xnxx.com', | |
'vkusporno.tv', | |
'porno1.tv', | |
'1ya.su',] | |
for t in domains: | |
print('%s : %s' % (t, chek_yandex_security(t))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment