models_sqlite.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:nweb 作者: pierce403 项目源码 文件源码
def nmap_to_ip_ctime(nmap):
    """take nmap output and return a ctime and ip parsed from it"""
    firstlines = nmap.splitlines()[:2]
    mo = re.search('scan initiated (.+) as:', firstlines[0])
    c_date = datetime.strptime(mo.group(1), '%a %b %d %H:%M:%S %Y')
    ctime = int(datetime.strftime(c_date, '%s'))
    mo = re.search('Nmap scan report for .* \((.*)\)', firstlines[1])
    ip = mo.group(1)
    return (ip, ctime)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号