Files
py-security-audit-tool/test_lookuparg.py
2014-12-15 22:26:13 -08:00

32 lines
775 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!env python
#coding=utf-8
#
# Author: liaoxinxi@
#
# Created Time: Fri 12 Dec 2014 10:02:35 AM GMT-8
#
# FileName: test_lookuparg.py
#
# Description:
#
# ChangeLog:
def check_subdomains(str,single_target):
str = str.replace('',';').replace('',',')
status = True
msg = ""
p = re.compile(",|;|\n|\r\n| ")
scan_array = p.split(str)
subdomins = [x for x in scan_array if not x in [u'', u' '] ]
for subdomin in subdomins:
subdomin = subdomin.strip()
return subdomin
def is_this_subdomain(domain,subdomain):
try:
tmp_list = subdomain.split('.')
subdomain_str = ('%s.%s') % (tmp_list[-2], tmp_list[-1])
subdomain_str1 = ('%s.%s') % (tmp_list, tmp_list)
except:
return False