1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-21 06:59:01 +00:00

Regnerate test scan files, add script scanning, version detection, and

OS detection to complex.xml.
This commit is contained in:
david
2009-07-10 23:28:28 +00:00
parent 3b18401d5d
commit 3d3e3b8515
7 changed files with 70 additions and 60 deletions

View File

@@ -46,8 +46,8 @@ class scan_test(unittest.TestCase):
scan = Scan()
scan.load_from_file("test-scans/complex.xml")
host = scan.hosts[0]
self.assertEqual(len(host.ports), 5)
self.assertEqual(set(host.extraports.items()), set([("filtered", 95), ("open|filtered", 100)]))
self.assertEqual(len(host.ports), 6)
self.assertEqual(set(host.extraports.items()), set([("filtered", 95), ("open|filtered", 99)]))
def test_addresses(self):
"""Test that addresses are recorded."""
@@ -66,7 +66,7 @@ class scan_test(unittest.TestCase):
def test_os(self):
"""Test that OS information is recorded."""
scan = Scan()
scan.load_from_file("test-scans/os.xml")
scan.load_from_file("test-scans/complex.xml")
host = scan.hosts[0]
self.assertTrue(len(host.os) > 0)

View File

@@ -1,29 +1,39 @@
<?xml version="1.0" ?>
<?xml-stylesheet href="/usr/share/nmap/nmap.xsl" type="text/xsl"?>
<?xml-stylesheet href="file:///usr/share/nmap/nmap.xsl" type="text/xsl"?>
<!-- This scan has two scaninfos and two extraports. -->
<!-- Nmap 4.68 scan initiated Thu Sep 4 20:02:52 2008 as: nmap -oX complex.xml -sS -sU -p T:1-100,U:1-100 scanme.nmap.org -->
<nmaprun scanner="nmap" args="nmap -oX complex.xml -sS -sU -p T:1-100,U:1-100 scanme.nmap.org" start="1220580172" startstr="Thu Sep 4 20:02:52 2008" version="4.68" xmloutputversion="1.02">
<!-- Nmap 4.90RC2 scan initiated Fri Jul 10 17:18:31 2009 as: nmap -oX complex.xml -sV -sC -O -&#45;version-light -sS -sU -p T:1-100,U:1-100 scanme.nmap.org -->
<nmaprun scanner="nmap" args="nmap -oX complex.xml -sV -sC -O -&#45;version-light -sS -sU -p T:1-100,U:1-100 scanme.nmap.org" start="1247267911" startstr="Fri Jul 10 17:18:31 2009" version="4.90RC2" xmloutputversion="1.03">
<scaninfo type="syn" protocol="tcp" numservices="100" services="1-100" />
<scaninfo type="udp" protocol="udp" numservices="100" services="1-100" />
<verbose level="0" />
<debugging level="0" />
<host starttime="1220580172" endtime="1220580176"><status state="up" reason="echo-reply"/>
<host starttime="1247267911" endtime="1247268033"><status state="up" reason="echo-reply"/>
<address addr="64.13.134.52" addrtype="ipv4" />
<hostnames><hostname name="scanme.nmap.org" type="PTR" /></hostnames>
<ports><extraports state="open|filtered" count="100">
<extrareasons reason="no-responses" count="100"/>
<ports><extraports state="open|filtered" count="99">
<extrareasons reason="no-responses" count="99"/>
</extraports>
<extraports state="filtered" count="95">
<extrareasons reason="no-responses" count="95"/>
</extraports>
<port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="51"/><service name="ssh" method="table" conf="3" /></port>
<port protocol="tcp" portid="25"><state state="closed" reason="reset" reason_ttl="51"/><service name="smtp" method="table" conf="3" /></port>
<port protocol="tcp" portid="53"><state state="open" reason="syn-ack" reason_ttl="51"/><service name="domain" method="table" conf="3" /></port>
<port protocol="tcp" portid="70"><state state="closed" reason="reset" reason_ttl="51"/><service name="gopher" method="table" conf="3" /></port>
<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="51"/><service name="http" method="table" conf="3" /></port>
<port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="52"/><service name="ssh" product="OpenSSH" version="4.3" extrainfo="protocol 2.0" method="probed" conf="10" /><script id="ssh-hostkey" output="1024 03:5f:d3:9d:95:74:8a:d0:8d:70:17:9a:bf:93:84:13 (DSA)&#xa;2048 fa:af:76:4c:b0:f4:4b:83:a4:6e:70:9f:a1:ec:51:0c (RSA)" /></port>
<port protocol="tcp" portid="25"><state state="closed" reason="reset" reason_ttl="52"/><service name="smtp" method="table" conf="3" /></port>
<port protocol="tcp" portid="53"><state state="open" reason="syn-ack" reason_ttl="52"/><service name="domain" product="ISC BIND" version="9.3.4" method="probed" conf="10" /></port>
<port protocol="tcp" portid="70"><state state="closed" reason="reset" reason_ttl="52"/><service name="gopher" method="table" conf="3" /></port>
<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="52"/><service name="http" product="Apache httpd" version="2.2.2" extrainfo="(Fedora)" method="probed" conf="10" /><script id="html-title" output="Go ahead and ScanMe!" /></port>
<port protocol="udp" portid="53"><state state="open" reason="udp-response" reason_ttl="52"/><service name="domain" product="ISC BIND" version="9.3.4" method="probed" conf="10" /><script id="dns-recursion" output="Recursion appears to be enabled" /></port>
</ports>
<times srtt="85526" rttvar="14010" to="141566" />
<os><portused state="open" proto="tcp" portid="22" />
<portused state="closed" proto="tcp" portid="25" />
<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="100" />
<osmatch name="Linux 2.6.9 - 2.6.24" accuracy="100" line="21905" />
</os>
<uptime seconds="686063" lastboot="Thu Jul 2 18:46:10 2009" />
<tcpsequence index="203" difficulty="Good luck!" values="13851B7D,1427CD45,139707B2,135B0491,138B4CE6,1382F9E5" />
<ipidsequence class="All zeros" values="0,0,0,0,0,0" />
<tcptssequence class="1000HZ" values="28E465CF,28E46633,28E46699,28E466FE,28E46763,28E467C8" />
<times srtt="92786" rttvar="2596" to="103170" />
</host>
<runstats><finished time="1220580176" timestr="Thu Sep 4 20:02:56 2008"/><hosts up="1" down="0" total="1" />
<!-- Nmap done at Thu Sep 4 20:02:56 2008; 1 IP address (1 host up) scanned in 4.00 seconds -->
<runstats><finished time="1247268033" timestr="Fri Jul 10 17:20:33 2009" elapsed="122.74"/><hosts up="1" down="0" total="1" />
<!-- Nmap done at Fri Jul 10 17:20:33 2009; 1 IP address (1 host up) scanned in 122.74 seconds -->
</runstats></nmaprun>

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" ?>
<?xml-stylesheet href="/usr/share/nmap/nmap.xsl" type="text/xsl"?>
<?xml-stylesheet href="file:///usr/share/nmap/nmap.xsl" type="text/xsl"?>
<!-- This scan has a down host. -->
<!-- Nmap 4.75 scan initiated Thu Sep 11 14:13:09 2008 as: nmap -oX down.xml -p 1-100 -PS100 scanme.nmap.org -->
<nmaprun scanner="nmap" args="nmap -oX down.xml -p 1-100 -PS100 scanme.nmap.org" start="1221163989" startstr="Thu Sep 11 14:13:09 2008" version="4.75" xmloutputversion="1.02">
<!-- Nmap 4.90RC2 scan initiated Fri Jul 10 17:21:37 2009 as: nmap -oX down.xml -p 1-100 -PS100 scanme.nmap.org -->
<nmaprun scanner="nmap" args="nmap -oX down.xml -p 1-100 -PS100 scanme.nmap.org" start="1247268097" startstr="Fri Jul 10 17:21:37 2009" version="4.90RC2" xmloutputversion="1.03">
<scaninfo type="syn" protocol="tcp" numservices="100" services="1-100" />
<verbose level="0" />
<debugging level="0" />
<runstats><finished time="1221163991" timestr="Thu Sep 11 14:13:11 2008"/><hosts up="0" down="1" total="1" />
<!-- Nmap done at Thu Sep 11 14:13:11 2008; 1 IP address (0 hosts up) scanned in 2.35 seconds -->
<runstats><finished time="1247268099" timestr="Fri Jul 10 17:21:39 2009" elapsed="2.33"/><hosts up="0" down="1" total="1" />
<!-- Nmap done at Fri Jul 10 17:21:39 2009; 1 IP address (0 hosts up) scanned in 2.33 seconds -->
</runstats></nmaprun>

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" ?>
<?xml-stylesheet href="/usr/share/nmap/nmap.xsl" type="text/xsl"?>
<!-- Nmap 4.68 scan initiated Wed Sep 3 20:03:57 2008 as: nmap -oX empty.xml -p 1-100 -->
<nmaprun scanner="nmap" args="nmap -oX empty.xml -p 1-100" start="1220493837" startstr="Wed Sep 3 20:03:57 2008" version="4.68" xmloutputversion="1.02">
<?xml-stylesheet href="file:///usr/share/nmap/nmap.xsl" type="text/xsl"?>
<!-- Nmap 4.90RC2 scan initiated Fri Jul 10 17:22:08 2009 as: nmap -oX empty.xml -p 1-100 -->
<nmaprun scanner="nmap" args="nmap -oX empty.xml -p 1-100" start="1247268128" startstr="Fri Jul 10 17:22:08 2009" version="4.90RC2" xmloutputversion="1.03">
<scaninfo type="syn" protocol="tcp" numservices="100" services="1-100" />
<verbose level="0" />
<debugging level="0" />
<runstats><finished time="1220493837" timestr="Wed Sep 3 20:03:57 2008"/><hosts up="0" down="0" total="0" />
<!-- Nmap done at Wed Sep 3 20:03:57 2008; 0 IP addresses (0 hosts up) scanned in 0.03 seconds -->
<runstats><finished time="1247268128" timestr="Fri Jul 10 17:22:08 2009" elapsed="0.28"/><hosts up="0" down="0" total="0" />
<!-- Nmap done at Fri Jul 10 17:22:08 2009; 0 IP addresses (0 hosts up) scanned in 0.28 seconds -->
</runstats></nmaprun>

View File

@@ -1,27 +1,27 @@
<?xml version="1.0" ?>
<?xml-stylesheet href="file:///usr/share/nmap/nmap.xsl" type="text/xsl"?>
<!-- Nmap 4.85BETA3 scan initiated Tue Mar 17 18:08:24 2009 as: nmap -oX os.xml -p 22,113 -O scanme.nmap.org -->
<nmaprun scanner="nmap" args="nmap -oX os.xml -p 22,113 -O scanme.nmap.org" start="1237334904" startstr="Tue Mar 17 18:08:24 2009" version="4.85BETA3" xmloutputversion="1.03">
<!-- Nmap 4.90RC2 scan initiated Fri Jul 10 17:23:03 2009 as: nmap -oX os.xml -p 22,113 -O scanme.nmap.org -->
<nmaprun scanner="nmap" args="nmap -oX os.xml -p 22,113 -O scanme.nmap.org" start="1247268183" startstr="Fri Jul 10 17:23:03 2009" version="4.90RC2" xmloutputversion="1.03">
<scaninfo type="syn" protocol="tcp" numservices="2" services="22,113" />
<verbose level="0" />
<debugging level="0" />
<host starttime="1237334904" endtime="1237334908"><status state="up" reason="echo-reply"/>
<host starttime="1247268183" endtime="1247268185"><status state="up" reason="echo-reply"/>
<address addr="64.13.134.52" addrtype="ipv4" />
<hostnames><hostname name="scanme.nmap.org" type="PTR" /></hostnames>
<ports><port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="50"/><service name="ssh" method="table" conf="3" /></port>
<port protocol="tcp" portid="113"><state state="closed" reason="reset" reason_ttl="50"/><service name="auth" method="table" conf="3" /></port>
<ports><port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="52"/><service name="ssh" method="table" conf="3" /></port>
<port protocol="tcp" portid="113"><state state="closed" reason="reset" reason_ttl="52"/><service name="auth" method="table" conf="3" /></port>
</ports>
<os><portused state="open" proto="tcp" portid="22" />
<portused state="closed" proto="tcp" portid="113" />
<osclass type="general purpose" vendor="Linux" osfamily="Linux" osgen="2.6.X" accuracy="100" />
<osmatch name="Linux 2.6.9 - 2.6.24" accuracy="100" line="19245" />
<osmatch name="Linux 2.6.9 - 2.6.24" accuracy="100" line="21905" />
</os>
<uptime seconds="3429372" lastboot="Fri Feb 6 00:32:17 2009" />
<tcpsequence index="198" difficulty="Good luck!" values="12A06169,12502AB7,1247E0B5,11F5A18E,123FC32F,12C350DC" />
<uptime seconds="686216" lastboot="Thu Jul 2 18:46:10 2009" />
<tcpsequence index="198" difficulty="Good luck!" values="1D7B0FEF,1CF2BCF2,1D04B03E,1D5AAAE7,1D1E45AD,1D4F7B7F" />
<ipidsequence class="All zeros" values="0,0,0,0,0,0" />
<tcptssequence class="1000HZ" values="CC67FE25,CC67FE8D,CC67FEF5,CC67FF5E,CC67FFC5,CC68002D" />
<times srtt="62494" rttvar="20620" to="144974" />
<tcptssequence class="1000HZ" values="28E6CD6D,28E6CDD2,28E6CE37,28E6CE9C,28E6CF01,28E6CF66" />
<times srtt="91197" rttvar="3569" to="105473" />
</host>
<runstats><finished time="1237334909" timestr="Tue Mar 17 18:08:29 2009" elapsed="6.45"/><hosts up="1" down="0" total="1" />
<!-- Nmap done at Tue Mar 17 18:08:29 2009; 1 IP address (1 host up) scanned in 6.45 seconds -->
<runstats><finished time="1247268186" timestr="Fri Jul 10 17:23:06 2009" elapsed="3.56"/><hosts up="1" down="0" total="1" />
<!-- Nmap done at Fri Jul 10 17:23:06 2009; 1 IP address (1 host up) scanned in 3.56 seconds -->
</runstats></nmaprun>

View File

@@ -1,19 +1,19 @@
<?xml version="1.0" ?>
<?xml-stylesheet href="/usr/share/nmap/nmap.xsl" type="text/xsl"?>
<?xml-stylesheet href="file:///usr/share/nmap/nmap.xsl" type="text/xsl"?>
<!-- This simple scan has one scaninfo and no extraports. -->
<!-- Nmap 4.68 scan initiated Wed Sep 3 19:49:34 2008 as: nmap -oX simple.xml -p 22,113 scanme.nmap.org -->
<nmaprun scanner="nmap" args="nmap -oX simple.xml -p 22,113 scanme.nmap.org" start="1220492974" startstr="Wed Sep 3 19:49:34 2008" version="4.68" xmloutputversion="1.02">
<!-- Nmap 4.90RC2 scan initiated Fri Jul 10 17:23:30 2009 as: nmap -oX simple.xml -p 22,113 scanme.nmap.org -->
<nmaprun scanner="nmap" args="nmap -oX simple.xml -p 22,113 scanme.nmap.org" start="1247268210" startstr="Fri Jul 10 17:23:30 2009" version="4.90RC2" xmloutputversion="1.03">
<scaninfo type="syn" protocol="tcp" numservices="2" services="22,113" />
<verbose level="0" />
<debugging level="0" />
<host starttime="1220492974" endtime="1220492975"><status state="up" reason="echo-reply"/>
<host starttime="1247268210" endtime="1247268210"><status state="up" reason="echo-reply"/>
<address addr="64.13.134.52" addrtype="ipv4" />
<hostnames><hostname name="scanme.nmap.org" type="PTR" /></hostnames>
<ports><port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="51"/><service name="ssh" method="table" conf="3" /></port>
<port protocol="tcp" portid="113"><state state="closed" reason="reset" reason_ttl="51"/><service name="auth" method="table" conf="3" /></port>
<ports><port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="52"/><service name="ssh" method="table" conf="3" /></port>
<port protocol="tcp" portid="113"><state state="closed" reason="reset" reason_ttl="52"/><service name="auth" method="table" conf="3" /></port>
</ports>
<times srtt="85540" rttvar="49241" to="282504" />
<times srtt="91167" rttvar="51529" to="297283" />
</host>
<runstats><finished time="1220492975" timestr="Wed Sep 3 19:49:35 2008"/><hosts up="1" down="0" total="1" />
<!-- Nmap done at Wed Sep 3 19:49:35 2008; 1 IP address (1 host up) scanned in 0.48 seconds -->
<runstats><finished time="1247268210" timestr="Fri Jul 10 17:23:30 2009" elapsed="0.56"/><hosts up="1" down="0" total="1" />
<!-- Nmap done at Fri Jul 10 17:23:30 2009; 1 IP address (1 host up) scanned in 0.56 seconds -->
</runstats></nmaprun>

View File

@@ -1,25 +1,25 @@
<?xml version="1.0" ?>
<?xml-stylesheet href="/usr/share/nmap/nmap.xsl" type="text/xsl"?>
<?xml-stylesheet href="file:///usr/share/nmap/nmap.xsl" type="text/xsl"?>
<!-- This scan has one scaninfo and one extraports. -->
<!-- Nmap 4.68 scan initiated Wed Sep 3 20:04:31 2008 as: nmap -oX single.xml -p 1-100 scanme.nmap.org -->
<nmaprun scanner="nmap" args="nmap -oX single.xml -p 1-100 scanme.nmap.org" start="1220493871" startstr="Wed Sep 3 20:04:31 2008" version="4.68" xmloutputversion="1.02">
<!-- Nmap 4.90RC2 scan initiated Fri Jul 10 17:24:04 2009 as: nmap -oX single.xml -p 1-100 scanme.nmap.org -->
<nmaprun scanner="nmap" args="nmap -oX single.xml -p 1-100 scanme.nmap.org" start="1247268244" startstr="Fri Jul 10 17:24:04 2009" version="4.90RC2" xmloutputversion="1.03">
<scaninfo type="syn" protocol="tcp" numservices="100" services="1-100" />
<verbose level="0" />
<debugging level="0" />
<host starttime="1220493871" endtime="1220493872"><status state="up" reason="echo-reply"/>
<host starttime="1247268244" endtime="1247268247"><status state="up" reason="echo-reply"/>
<address addr="64.13.134.52" addrtype="ipv4" />
<hostnames><hostname name="scanme.nmap.org" type="PTR" /></hostnames>
<ports><extraports state="filtered" count="95">
<extrareasons reason="no-responses" count="95"/>
</extraports>
<port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="51"/><service name="ssh" method="table" conf="3" /></port>
<port protocol="tcp" portid="25"><state state="closed" reason="reset" reason_ttl="51"/><service name="smtp" method="table" conf="3" /></port>
<port protocol="tcp" portid="53"><state state="open" reason="syn-ack" reason_ttl="51"/><service name="domain" method="table" conf="3" /></port>
<port protocol="tcp" portid="70"><state state="closed" reason="reset" reason_ttl="51"/><service name="gopher" method="table" conf="3" /></port>
<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="51"/><service name="http" method="table" conf="3" /></port>
<port protocol="tcp" portid="22"><state state="open" reason="syn-ack" reason_ttl="52"/><service name="ssh" method="table" conf="3" /></port>
<port protocol="tcp" portid="25"><state state="closed" reason="reset" reason_ttl="52"/><service name="smtp" method="table" conf="3" /></port>
<port protocol="tcp" portid="53"><state state="open" reason="syn-ack" reason_ttl="52"/><service name="domain" method="table" conf="3" /></port>
<port protocol="tcp" portid="70"><state state="closed" reason="reset" reason_ttl="52"/><service name="gopher" method="table" conf="3" /></port>
<port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="52"/><service name="http" method="table" conf="3" /></port>
</ports>
<times srtt="88828" rttvar="25643" to="191400" />
<times srtt="92757" rttvar="19456" to="170581" />
</host>
<runstats><finished time="1220493873" timestr="Wed Sep 3 20:04:33 2008"/><hosts up="1" down="0" total="1" />
<!-- Nmap done at Wed Sep 3 20:04:33 2008; 1 IP address (1 host up) scanned in 2.02 seconds -->
<runstats><finished time="1247268247" timestr="Fri Jul 10 17:24:07 2009" elapsed="2.96"/><hosts up="1" down="0" total="1" />
<!-- Nmap done at Fri Jul 10 17:24:07 2009; 1 IP address (1 host up) scanned in 2.96 seconds -->
</runstats></nmaprun>