资源简介
nmap 绿色版 6.25
强大的网络扫描工具
代码片段和文件信息
#!/usr/bin/env python
# Ndiff
#
# This programs reads two Nmap xml files and displays a list of their
# differences.
#
# Copyright 2008 Insecure.Com LLC
# Ndiff is distributed under the same license as Nmap. See the file COPYING or
# http://nmap.org/data/COPYING. See http://nmap.org/book/man-legal.html for more
# details.
#
# David Fifield
# based on a design by Michael Pattrick
import datetime
import difflib
import getopt
import sys
import time
import xml.sax
import xml.sax.saxutils
import xml.dom.minidom
verbose = False
NDIFF_xml_VERSION = u“1“
class Scan(object):
“““A single Nmap scan corresponding to a single invocation of Nmap. It is a
container for a list of hosts. It also has utility methods to load itself
from an Nmap xml file.“““
def __init__(self):
self.scanner = None
self.version = None
self.args = None
self.start_date = None
self.end_date = None
self.hosts = []
self.pre_script_results = []
self.post_script_results = []
def sort_hosts(self):
self.hosts.sort(key = lambda h: h.get_id())
def load(self f):
“““Load a scan from the Nmap xml in the file-like object f.“““
parser = xml.sax.make_parser()
handler = NmapContentHandler(self)
parser.setContentHandler(handler)
parser.parse(f)
def load_from_file(self filename):
“““Load a scan from the Nmap xml file with the given filename.“““
f = open(filename “r“)
try:
self.load(f)
finally:
f.close()
def write_nmaprun_open(self writer):
attrs = {}
if self.scanner is not None:
attrs[u“scanner“] = self.scanner
if self.args is not None:
attrs[u“args“] = self.args
if self.start_date is not None:
attrs[u“start“] = “%d“ % time.mktime(self.start_date.timetuple())
attrs[u“startstr“] = self.start_date.strftime(“%a %b %d %H:%M:%S %Y“)
if self.version is not None:
attrs[u“version“] = self.version
writer.startElement(u“nmaprun“ attrs)
def write_nmaprun_close(self writer):
writer.endElement(u“nmaprun“)
def nmaprun_to_dom_fragment(self document):
frag = document.createDocumentFragment()
elem = document.createElement(u“nmaprun“)
if self.scanner is not None:
elem.setAttribute(u“scanner“ self.scanner)
if self.args is not None:
elem.setAttribute(u“args“ self.args)
if self.start_date is not None:
elem.setAttribute(u“start“ “%d“ % time.mktime(self.start_date.timetuple()))
elem.setAttribute(u“startstr“ self.start_date.strftime(“%a %b %d %H:%M:%S %Y“))
if self.version is not None:
elem.setAttribute(u“version“ self.version)
frag.appendChild(elem)
return frag
class Host(object):
“““A single host with a state addresses host names a dict mapping port
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-11-29 19:39 nmap-6.25\
文件 71217 2012-11-29 19:39 nmap-6.25\3rd-party-licenses.txt
文件 511499 2012-11-29 19:39 nmap-6.25\ca-bundle.crt
文件 608763 2012-11-29 19:39 nmap-6.25\CHANGELOG
文件 25149 2012-11-29 19:39 nmap-6.25\COPYING
文件 1176064 2012-11-16 19:28 nmap-6.25\libeay32.dll
目录 0 2012-11-29 19:39 nmap-6.25\licenses\
文件 1465 2012-11-29 19:39 nmap-6.25\licenses\BSD-simplified
文件 25292 2012-11-29 19:39 nmap-6.25\licenses\LGPL-2
文件 26440 2012-11-29 19:39 nmap-6.25\licenses\LGPL-2.1
文件 25755 2012-11-29 19:39 nmap-6.25\licenses\MPL-1.1
文件 6279 2012-11-29 19:39 nmap-6.25\licenses\OpenSSL.txt
文件 188928 2012-11-29 19:39 nmap-6.25\ncat.exe
文件 945 2012-11-29 19:39 nmap-6.25\ndiff.bat
文件 52432 2012-11-29 19:39 nmap-6.25\ndiff.py
文件 400733 2012-11-29 19:39 nmap-6.25\nmap-mac-prefixes
文件 3538192 2012-11-29 19:39 nmap-6.25\nmap-os-db
文件 9981 2012-11-29 19:39 nmap-6.25\nmap-payloads
文件 6304 2012-11-29 19:39 nmap-6.25\nmap-protocols
文件 49245 2012-11-29 19:39 nmap-6.25\nmap-rpc
文件 1656038 2012-11-29 19:39 nmap-6.25\nmap-service-probes
文件 622042 2012-11-29 19:39 nmap-6.25\nmap-services
文件 1385984 2012-11-29 19:39 nmap-6.25\nmap-update.exe
文件 2145792 2012-11-29 19:39 nmap-6.25\nmap.exe
文件 31935 2012-11-29 19:39 nmap-6.25\nmap.xsl
文件 192 2012-11-29 19:39 nmap-6.25\nmap_performance.reg
文件 304640 2012-11-29 19:39 nmap-6.25\nping.exe
目录 0 2012-11-29 19:39 nmap-6.25\nselib\
文件 71731 2012-11-29 19:39 nmap-6.25\nselib\afp.lua
文件 15658 2012-11-29 19:39 nmap-6.25\nselib\ajp.lua
文件 12399 2012-11-29 19:39 nmap-6.25\nselib\amqp.lua
............此处省略582个文件信息
评论
共有 条评论