def setup_mac_prefix(mac_file):
"""Function downloads nmap-mac-prefixes from internet if not found at given location
Args:
mac_file : location of nmap-mac_prefixes file
"""
if not os.path.isfile(mac_file):
try:
logger.info('Retrieving Nmap MAC prefix database')
urllib.urlretrieve(
"https://svn.nmap.org/nmap/nmap-mac-prefixes",
os.path.join(
package_directory,
"templates/nmap-mac-prefixes"))
except urllib.ContentTooShortError:
logger.exception('Connection interupted: nmap-mac-prefixes retrieval failed')
sys.exit(1)
评论列表
文章目录