Skip to content

Instantly share code, notes, and snippets.

@gormih
Created November 22, 2018 20:51
Show Gist options
  • Save gormih/daafe30e6bc6ee0c8aebae506b157cc3 to your computer and use it in GitHub Desktop.
Save gormih/daafe30e6bc6ee0c8aebae506b157cc3 to your computer and use it in GitHub Desktop.
# -*- 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