1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11:29 +00:00

Multiple changes to support new features and clean up presentation of existing data:

Added support for the pre-scan script data.  The output is formatted using HTML 'pre' tags
in order to maintain formatting.
    - the top menu entry is conditional and only appears if pre-scan data is present
    - the pre-scan script block is currently at the beginning of the page right after
      the scan summary

Changed host script and port script output to use 'pre' tags so that lengthy output, such 
as that from ssl-cert.nse  and snmp-win32-services will be readable.

Added title section for hostscript output
Added table headers for hostscript output
Added MAC vendor text to address section 

Fixed a bug in the port script output that caused it to only span 5 columns instead of 6.

Changed color of script output cells in port table as well as hostscript and prescan result
tables slightly to make visual parsing easier.

Changed nmap_xsl_version variable from 9b to 9c

Changed wording related to OS fingerprint being present even though the OS was positively identified.
This occurs when Nmap is run with higher levels of verbosity.

Change the OS guess accuracy percentage to use bold font.
This commit is contained in:
tomsellers
2010-11-14 14:45:39 +00:00
parent cec33e3aad
commit d464a8228f

View File

@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- =========================================================================
nmap.xsl stylesheet version 0.9b
last change: 2006-03-04
nmap.xsl stylesheet version 0.9c
last change: 2010-11-14
Benjamin Erb, http://www.benjamin-erb.de
==============================================================================
Copyright (c) 2004-2006 Benjamin Erb
@@ -34,7 +34,7 @@
<!-- global variables -->
<!-- ............................................................ -->
<xsl:variable name="nmap_xsl_version">0.9b</xsl:variable>
<xsl:variable name="nmap_xsl_version">0.9c</xsl:variable>
<!-- ............................................................ -->
<xsl:variable name="start"><xsl:value-of select="/nmaprun/@startstr" /></xsl:variable>
<xsl:variable name="end"><xsl:value-of select="/nmaprun/runstats/finished/@timestr" /> </xsl:variable>
@@ -294,6 +294,12 @@
background-color: #CCFFCC;
color: #000000;
}
tr.script
{
background-color: #DDFFEE;
color: #000000;
}
tr.filtered
{
@@ -337,6 +343,11 @@
<ul id="menu">
<li><a href="#scansummary">scan summary</a><xsl:text> | </xsl:text></li>
<xsl:if test="prescript/script/@id">
<li><a href="#prescript">pre-scan script output</a><xsl:text> | </xsl:text></li>
</xsl:if>
<li><a href="#scaninfo">scan info</a><xsl:text> | </xsl:text></li>
<xsl:for-each select="host">
@@ -377,12 +388,14 @@
<xsl:otherwise>Debugging was enabled, </xsl:otherwise>
</xsl:choose>
the verbosity level was <xsl:value-of select="verbose/@level" />.
</p>
<xsl:apply-templates select="prescript"/>
<xsl:apply-templates select="host">
<xsl:sort select="substring ( address/@addr, 1, string-length ( substring-before ( address/@addr, '.' ) ) )* (256*256*256) + substring ( substring-after ( address/@addr, '.' ), 1, string-length ( substring-before ( substring-after ( address/@addr, '.' ), '.' ) ) )* (256*256) + substring ( substring-after ( substring-after ( address/@addr, '.' ), '.' ), 1, string-length ( substring-before ( substring-after ( substring-after ( address/@addr, '.' ), '.' ), '.' ) ) ) * 256 + substring ( substring-after ( substring-after ( substring-after ( address/@addr, '.' ), '.' ), '.' ), 1 )" order="ascending" data-type="number"/>
</xsl:apply-templates>
<xsl:apply-templates select="runstats"/>
<xsl:apply-templates select="scaninfo"/>
</div>
</body>
@@ -471,7 +484,13 @@
<h3>address</h3>
<ul>
<xsl:for-each select="address">
<li><xsl:value-of select="@addr"/> (<xsl:value-of select="@addrtype"/>)</li>
<li><xsl:value-of select="@addr"/>
<xsl:if test="@vendor">
<xsl:text> - </xsl:text>
<xsl:value-of select="@vendor"/>
<xsl:text> </xsl:text>
</xsl:if>
(<xsl:value-of select="@addrtype"/>)</li>
</xsl:for-each>
</ul>
@@ -554,13 +573,15 @@
<td><xsl:value-of select="service/@extrainfo" /><xsl:text>&#xA0;</xsl:text></td>
</tr>
<xsl:for-each select="script">
<tr class="open">
<tr class="script">
<td></td>
<td>
<xsl:value-of select="@id"/> <xsl:text>&#xA0;</xsl:text>
</td>
<td colspan="5">
<td colspan="6">
<pre>
<xsl:value-of select="@output"/> <xsl:text>&#xA0;</xsl:text>
</pre>
</td>
</tr>
@@ -646,7 +667,7 @@
<!-- ............................................................ -->
<xsl:template match="osmatch">
<li>os match: <b><xsl:value-of select="@name" /> </b></li>
<li>accuracy: <xsl:value-of select="@accuracy" />%</li>
<li>accuracy: <b><xsl:value-of select="@accuracy" />%</b></li>
<li>reference fingerprint line number: <xsl:value-of select="@line" /></li>
</xsl:template>
<!-- ............................................................ -->
@@ -662,7 +683,7 @@
</xsl:when>
<xsl:otherwise>
<br /><br />
<li>OS Fingerprint requested at scan time and provided below.</li>
<li>OS identified but the fingerprint was requested at scan time and provided below.</li>
</xsl:otherwise>
</xsl:choose>
@@ -679,17 +700,54 @@
</xsl:template>
<!-- ............................................................ -->
<!-- Host Script Scan -->
<!-- Pre-Scan script -->
<!-- ............................................................ -->
<xsl:template match="hostscript">
<xsl:template match="prescript">
<xsl:element name="a">
<xsl:attribute name="name">prescript</xsl:attribute>
</xsl:element>
<h2>pre-scan script output</h2>
<table>
<tr class="head">
<td>script Name</td>
<td>output</td>
</tr>
<xsl:for-each select="script">
<tr class="open">
<tr class="script">
<td>
<xsl:value-of select="@id"/> <xsl:text>&#xA0;</xsl:text>
</td>
<td>
<pre>
<xsl:value-of select="@output"/> <xsl:text></xsl:text>
</pre>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<!-- ............................................................ -->
<!-- Host Script Scan -->
<!-- ............................................................ -->
<xsl:template match="hostscript">
<h3>host script output</h3>
<table>
<tr class="head">
<td>script Name</td>
<td>output</td>
</tr>
<xsl:for-each select="script">
<tr class="script">
<td>
<xsl:value-of select="@id"/> <xsl:text>&#xA0;</xsl:text>
</td>
<td>
<pre>
<xsl:value-of select="@output"/> <xsl:text>&#xA0;</xsl:text>
</pre>
</td>
</tr>
@@ -823,5 +881,4 @@
</xsl:if>
</xsl:template>
<!-- ............................................................ -->
</xsl:stylesheet>