示例#1
0
文件: hfn.py 项目: ziqi521/CUS
def check(site):
    site = www.get_domain(site)
    html = http_request('http://hosts-file.net/?s=%s' % site)
    regex = '''<td\sclass="main_normal"\salign="left"\scolspan="1"\sstyle="[^>]*?">.*?\s*?([^\n]*?)\s\(<a\sclass="main\_normal\_noborder"'''
    result = re.search(regex, html, re.S)
    level = {
        'Not Specified': 'unknown',
        'TBV': 'unknown',
        'ATS': 'safe',
        'GRM': 'warning',
        'HFS': 'warning',
        'MMT': 'danger',
        'WRZ': 'danger',
        'PSH': 'danger',
        'HJK': 'danger',
        'FSA': 'danger',
        'EMD': 'danger',
        'EXP': 'danger'
    }
    if result:
        msg = result.group(1).strip()
    else:
        msg = 'Not Specified'
    check_result = level.get(msg, 'unknown')
    return check_result
示例#2
0
def check(site):
	site = www.get_domain(site)
	html = http_request('http://www.spamhaus.org/query/domain/%s'%site)	
	regex = '''<B><FONT\scolor="green">(.*?\sis\snot\slisted\sin\sthe\sDBL)</FONT></B><br>'''
	result = re.search(regex,html)
	if result:
		check_result = 'safe'
	else:
		check_result = 'danger'
	return check_result
示例#3
0
文件: ntn.py 项目: sdgdsffdsfff/CUS-1
def check(site):
    html = http_request("https://safeweb.norton.com/report/show?url=%s" % site)
    regex = """<div\sclass="ratingIcon\sico(.*?)">"""
    level = {"Caution": "danger", "Safe": "safe", "NSecured": "safe", "Untested": "unknown", "Warning": "warning"}
    result = re.search(regex, html)
    if result:
        msg = result.group(1)
    else:
        msg = "Untested"
    check_result = level.get(msg, "unknown")
    return check_result
示例#4
0
def check(site):
	html = http_request('https://safeweb.norton.com/report/show?url=%s'%site)	
	regex = '''<div\sclass="ratingIcon\sico(.*?)">'''
	level = {'Caution':'danger','Safe':'safe','NSecured':'safe','Untested':'unknown','Warning':'warning'}
	result = re.search(regex,html)
	if result:
		msg = result.group(1)
	else:
		msg = 'Untested'
	check_result = level.get(msg,'unknown')
	return check_result
示例#5
0
文件: gsb.py 项目: iwarsong/CUS
def check(site):
	html = http_request('https://www.google.com/safebrowsing/diagnostic?site=%s'%site)	
	regex = '''<blockquote><p>(.*?)</p>'''
	level = {'Site is listed as suspicious - visiting this web site may harm your computer.':'danger','This site is not currently listed as suspicious.':'safe','unknown':'unknown'}
	result = re.search(regex,html)
	if result:
		msg = result.group(1)
	else:
		msg = 'unknown'
	check_result = level.get(msg,'unknown')
	return check_result
示例#6
0
文件: fse.py 项目: ziqi521/CUS
def check(site):
	html = http_request('http://browsingprotection.f-secure.com/swp/result?idc_hf_0=&url=%s&sa=&boxstate=1'%site)	
	regex = '''<td\sid="url_rating_status"\sstyle="font-size:20px;line-height:1.5em">This\ssite\sis:\s<font.*?color=#417317><b>(.*?)</b></font></td>'''
	level = {'Harmful':'danger','Safe':'safe','Unknown':'unknown'}
	result = re.search(regex,html,re.S)
	if result:
		msg = result.group(1)
	else:
		msg = 'Unknown'
	check_result = level.get(msg,'unknown')
	return check_result
示例#7
0
文件: spt.py 项目: ziqi521/CUS
def check(site):
	site = www.get_domain(site)
	html = http_request('https://spyeyetracker.abuse.ch/monitor.php?host=%s'%site)	
	regex = '''<tr\sbgcolor="#.*?"><td>Level:</td><td>(\d)\s\(.*?\)</td></tr>'''
	level = {'1':'danger','2':'danger','5':'warning','3':'warning','4':'unknown'}
	result = re.search(regex,html)
	if result:
		msg = result.group(1)
	else:
		msg = '4'
	check_result = level.get(msg,'unknown')
	return check_result
示例#8
0
文件: mcf.py 项目: apoyl/CUS
def check(site):
	site = www.get_domain(site)
	html = http_request('http://www.siteadvisor.com/sites/%s'%site)	
	regex = '''<img\ssrc="/images/.*?\.gif"\salt="([a-zA-Z]*?)\sVerdict\sImage"\sborder="0"\s/>'''
	level = {'Red':'danger','Green':'safe','Grey':'unknown','Yellow':'warning'}
	result = re.search(regex,html)
	if result:
		color = result.group(1)
	else:
		color = 'Grey'
	check_result = level.get(color,'unknown')
	return check_result
示例#9
0
文件: rix.py 项目: apoyl/CUS
def check(site):
	site = www.get_domain(site)
	html = http_request('http://site.ikaka.com/Index/domaininfo/%s'%site)	
	regex = '''<h1\sid="domaintd"\sclass="state-title">(.*?)</h1>'''
	level = {'不安全,该网站存在恶意行为,不建议进行访问。':'danger','安全,未在该网站发现重大的安全问题。':'safe','未知,还未对此网站进行检测,欢迎发表你的看法。':'unknown'}
	result = re.search(regex,html)
	if result:
		msg = result.group(1)
	else:
		msg = '未知,还未对此网站进行检测,欢迎发表你的看法。'
	check_result = level.get(msg,'unknown')
	return check_result
示例#10
0
文件: wsg.py 项目: sdgdsffdsfff/CUS
def check(site):
    site = www.get_domain(site)
    html = http_request("http://www.websecurityguard.com/detail.aspx?domain=%s" % site)
    regex = """<div\sid="website-head"\sclass="class-([a-z]*?)">"""
    level = {"red": "danger", "green": "safe", "grey": "unknown", "orange": "warning"}
    result = re.search(regex, html)
    if result:
        color = result.group(1)
    else:
        color = "grey"

    check_result = level.get(color, "unknown")
    return check_result
示例#11
0
文件: hfn.py 项目: apoyl/CUS
def check(site):
	site = www.get_domain(site)
	html = http_request('http://hosts-file.net/?s=%s'%site)	
	regex = '''<td\sclass="main_normal"\salign="left"\scolspan="1"\sstyle="[^>]*?">.*?\s*?([^\n]*?)\s\(<a\sclass="main\_normal\_noborder"'''
	result = re.search(regex,html,re.S)
	level = {'Not Specified':'unknown','TBV':'unknown','ATS':'safe','GRM':'warning','HFS':'warning',
		'MMT':'danger','WRZ':'danger','PSH':'danger','HJK':'danger','FSA':'danger',
		'EMD':'danger','EXP':'danger'}
	if result:
		msg = result.group(1).strip()
	else:
		msg = 'Not Specified'
	check_result = level.get(msg,'unknown')
	return check_result
示例#12
0
文件: rix.py 项目: ziqi521/CUS
def check(site):
    site = www.get_domain(site)
    html = http_request('http://site.ikaka.com/Index/domaininfo/%s' % site)
    regex = '''<h1\sid="domaintd"\sclass="state-title">(.*?)</h1>'''
    level = {
        '不安全,该网站存在恶意行为,不建议进行访问。': 'danger',
        '安全,未在该网站发现重大的安全问题。': 'safe',
        '未知,还未对此网站进行检测,欢迎发表你的看法。': 'unknown'
    }
    result = re.search(regex, html)
    if result:
        msg = result.group(1)
    else:
        msg = '未知,还未对此网站进行检测,欢迎发表你的看法。'
    check_result = level.get(msg, 'unknown')
    return check_result
示例#13
0
文件: jsu.py 项目: apoyl/CUS
def check(site):
	secret='a176201e188a0969cd7b7fa2ef3c8d14'
	appkey='k-33356'
	now = time.time()
	safeurl = base64.b64encode(site)
	safeurl = safeurl.replace('+','-')
	safeurl = safeurl.replace('/','_')
	signature_base_string="/phish/?appkey=k-33356&q="+safeurl+"&timestamp="+str(now)
	sign = signature_base_string+secret
	sign = hashlib.md5(sign).hexdigest().upper()
	url="http://open.pc120.com/phish/?q="+safeurl+"&appkey=k-33356&timestamp="+str(now)+"&sign="+sign
	html = http_request(url)	
	dtype = json.loads(html).get('phish',1)
	level = {-1:'unknown',0:'safe',1:'danger',2:'warning'}
	check_result = level.get(dtype,'unknown')
	return check_result
示例#14
0
def check(site):
	secret='a176201e188a0969cd7b7fa2ef3c8d14'
	appkey='k-33356'
	now = time.time()
	safeurl = base64.b64encode(site)
	safeurl = safeurl.replace('+','-')
	safeurl = safeurl.replace('/','_')
	signature_base_string="/download/?appkey=k-33356&q="+safeurl+"&timestamp="+str(now)
	sign = signature_base_string+secret
	sign = hashlib.md5(sign).hexdigest().upper()
	url="http://open.pc120.com/download/?q="+safeurl+"&appkey=k-33356&timestamp="+str(now)+"&sign="+sign
	html = http_request(url)	
	dtype = json.loads(html).get('down_type',1)
	level = {1:'unknown',2:'safe',3:'danger',6:'unknown'}
	check_result = level.get(dtype,'unknown')
	return check_result
示例#15
0
文件: mcf.py 项目: ziqi521/CUS
def check(site):
    site = www.get_domain(site)
    html = http_request('http://www.siteadvisor.com/sites/%s' % site)
    regex = '''<img\ssrc="/images/.*?\.gif"\salt="([a-zA-Z]*?)\sVerdict\sImage"\sborder="0"\s/>'''
    level = {
        'Red': 'danger',
        'Green': 'safe',
        'Grey': 'unknown',
        'Yellow': 'warning'
    }
    result = re.search(regex, html)
    if result:
        color = result.group(1)
    else:
        color = 'Grey'
    check_result = level.get(color, 'unknown')
    return check_result
示例#16
0
def check(site):
    html = http_request(
        'https://www.google.com/safebrowsing/diagnostic?site=%s' % site)
    regex = '''<blockquote><p>(.*?)</p>'''
    level = {
        'Site is listed as suspicious - visiting this web site may harm your computer.':
        'danger',
        'This site is not currently listed as suspicious.':
        'safe',
        'unknown':
        'unknown'
    }
    result = re.search(regex, html)
    if result:
        msg = result.group(1)
    else:
        msg = 'unknown'
    check_result = level.get(msg, 'unknown')
    return check_result
示例#17
0
文件: wsg.py 项目: ziqi521/CUS
def check(site):
    site = www.get_domain(site)
    html = http_request(
        'http://www.websecurityguard.com/detail.aspx?domain=%s' % site)
    regex = '''<div\sid="website-head"\sclass="class-([a-z]*?)">'''
    level = {
        'red': 'danger',
        'green': 'safe',
        'grey': 'unknown',
        'orange': 'warning'
    }
    result = re.search(regex, html)
    if result:
        color = result.group(1)
    else:
        color = 'grey'

    check_result = level.get(color, 'unknown')
    return check_result