1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-04 13:49:03 +00:00

latest changes ...

This commit is contained in:
fyodor
2006-03-25 23:56:48 +00:00
parent 161b2bb30f
commit 7fafddee53
26 changed files with 466 additions and 194 deletions

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- =========================================================================
nmap.xsl stylesheet version 0.9a
last change: 2005-02-04
nmap.xsl stylesheet version 0.9b
last change: 2006-03-04
Benjamin Erb, http://www.benjamin-erb.de
==============================================================================
Copyright (c) 2004 Benjamin Erb
Copyright (c) 2004-2006 Benjamin Erb
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -34,10 +34,10 @@
<!-- global variables -->
<!-- ............................................................ -->
<xsl:variable name="nmap_xsl_version">0.9a</xsl:variable>
<xsl:variable name="nmap_xsl_version">0.9b</xsl:variable>
<!-- ............................................................ -->
<xsl:variable name="start"><xsl:value-of select="/nmaprun/@start" /></xsl:variable>
<xsl:variable name="end"><xsl:value-of select="/nmaprun/runstats/finished/@time" /> </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>
<xsl:variable name="totaltime"><xsl:value-of select="/nmaprun/runstats/finished/@time -/nmaprun/@start" /></xsl:variable>
<!-- ............................................................ -->
@@ -55,17 +55,6 @@
<xsl:comment>generated with nmap.xsl - version <xsl:value-of select="$nmap_xsl_version" /> by Benjamin Erb - http://www.benjamin-erb.de/nmap_xsl.php </xsl:comment>
<!-- embedded JavaScript for time conversion -->
<script language="JavaScript" type="text/javascript" >
function timestamp2date(stamp)
{
var myDate = new Date(stamp * 1000);
dateStr = myDate.toGMTString();
return dateStr;
}
</script>
<style type="text/css">
/* stylesheet print */
@media print
@@ -154,7 +143,7 @@ function timestamp2date(stamp)
#container
{
text-align:left;
margin: 0px auto;
margin: 10px auto;
width: 90%;
}
@@ -162,7 +151,7 @@ function timestamp2date(stamp)
{
font-family: Verdana, Helvetica, sans-serif;
font-weight:bold;
font-size: 16pt;
font-size: 14pt;
color: #000000;
background-color:#87CEFA;
margin:10px 0px 0px 0px;
@@ -172,22 +161,13 @@ function timestamp2date(stamp)
text-align: left;
}
h1 a
{
font-family: Verdana, Helvetica, sans-serif;
font-weight:bold;
font-size: 16pt;
color: #000000;
background-color:#87CEFA;
}
h2
{
font-family: Verdana, Helvetica, sans-serif;
font-weight:bold;
font-size: 12pt;
font-size: 11pt;
color: #000000;
margin:10px 0px 0px 0px;
margin:30px 0px 0px 0px;
padding:4px;
width: 100%;
border:1px solid black;
@@ -208,7 +188,7 @@ function timestamp2date(stamp)
background-color:#FFCCCC;
border-color:#8B0000;
}
h3
{
font-family: Verdana, Helvetica, sans-serif;
@@ -223,7 +203,7 @@ function timestamp2date(stamp)
p
{
font-family: Verdana, Helvetica, sans-serif;
font-size: 10pt;
font-size: 8pt;
color:#000000;
background-color: #FFFFFF;
width: 75%;
@@ -241,7 +221,7 @@ function timestamp2date(stamp)
ul
{
font-family: Verdana, Helvetica, sans-serif;
font-size: 10pt;
font-size: 8pt;
color:#000000;
background-color: #FFFFFF;
width: 75%;
@@ -249,6 +229,17 @@ function timestamp2date(stamp)
}
a
{
font-family: Verdana, Helvetica, sans-serif;
text-decoration: none;
font-size: 8pt;
color:#000000;
font-weight:bold;
background-color: #FFFFFF;
color: #000000;
}
li a
{
font-family: Verdana, Helvetica, sans-serif;
text-decoration: none;
@@ -264,6 +255,15 @@ function timestamp2date(stamp)
text-decoration: underline;
}
a.red
{
color:#8B0000;
}
a.green
{
color:#006400;
}
table
{
width: 80%;
@@ -277,7 +277,7 @@ function timestamp2date(stamp)
{
vertical-align:top;
font-family: Verdana, Helvetica, sans-serif;
font-size: 10pt;
font-size: 8pt;
color:#000000;
background-color: #D1D1D1;
}
@@ -303,18 +303,28 @@ function timestamp2date(stamp)
tr.closed
{
background-color: #FFCCCC;
background-color: #FFAFAF;
color: #000000;
}
td
{
padding:2px;
}
.status
{
display:none;
}
#menu li
{
display : inline;
margin : 0;
margin-right : 10px;
/*margin-right : 10px;*/
padding : 0;
list-style-type : none;
}
}
}
</style>
<title>nmap report</title>
@@ -322,50 +332,59 @@ function timestamp2date(stamp)
<body>
<div id="container">
<h1>nmap scan report - scan @
<xsl:call-template name="timestamp">
<xsl:with-param name="stamp"><xsl:value-of select="$start" /></xsl:with-param>
</xsl:call-template>
<h1>nmap scan report - scan @ <xsl:value-of select="$start" />
</h1>
<ul id="menu">
<li><a href="#scansummary">scan summary</a></li>
<li><a href="#scaninfo">scan info</a></li>
<li><a href="#scansummary">scan summary</a><xsl:text> | </xsl:text></li>
<li><a href="#scaninfo">scan info</a><xsl:text> | </xsl:text></li>
<xsl:for-each select="host">
<li>
<xsl:element name="a">
<xsl:attribute name="href">#<xsl:value-of select="translate(address/@addr, '.', '_') " /></xsl:attribute>
<xsl:attribute name="target">_self</xsl:attribute>
<xsl:value-of select="address/@addr"/>
</xsl:element>
</li>
</xsl:for-each>
<li><a href="#runstats">runstats</a></li>
<xsl:for-each 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"/>
<li>
<xsl:element name="a">
<xsl:attribute name="href">#<xsl:value-of select="translate(address/@addr, '.', '_') " /></xsl:attribute>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="status/@state = 'up'">green</xsl:when>
<xsl:otherwise>red</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="address/@addr"/>
<xsl:if test="count(hostnames/hostname) > 0">
<xsl:for-each select="hostnames/hostname">
<xsl:sort select="@name" order="ascending" data-type="text"/>
<xsl:text> / </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
</xsl:if>
</xsl:element>
<xsl:text> | </xsl:text></li>
</xsl:for-each>
<li><a href="#runstats">runstats</a></li>
</ul>
<xsl:element name="a">
<xsl:attribute name="name">scansummary</xsl:attribute>
</xsl:element>
<h2>scan summary</h2>
<p>
<xsl:value-of select="@scanner"/> was initiated at
<xsl:call-template name="timestamp">
<xsl:with-param name="stamp"><xsl:value-of select="$start" /></xsl:with-param>
</xsl:call-template> with these arguments:<br/>
<xsl:value-of select="@scanner"/> was initiated at <xsl:value-of select="$start" /> with these arguments:<br/>
<i><xsl:value-of select="@args" /></i><br/>
The process stopped at
<xsl:call-template name="timestamp">
<xsl:with-param name="stamp"><xsl:value-of select="$end" /></xsl:with-param>
</xsl:call-template>.
The process stopped at <xsl:value-of select="$end" />.
<xsl:choose>
<xsl:when test="debugging/@level = '0'">Debugging was disabled, </xsl:when>
<xsl:otherwise>Debugging was enabled, </xsl:otherwise>
<xsl:when test="debugging/@level = '0'">Debbuging was disabled, </xsl:when>
<xsl:otherwise>Debugging was enabeld, </xsl:otherwise>
</xsl:choose>
the verbosity level was <xsl:value-of select="verbose/@level" />.
the verbosing level was <xsl:value-of select="verbose/@level" />.
</p>
<xsl:apply-templates/>
</div>
<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"/>
</div>
</body>
</html>
</xsl:template>
@@ -401,6 +420,11 @@ function timestamp2date(stamp)
<li><xsl:value-of select="hosts/@up" /> host(s) online</li>
<li><xsl:value-of select="hosts/@down" /> host(s) offline</li>
</ul>
<ul>
<li>nmap version: <xsl:value-of select="/nmaprun/@version" /></li>
<li>xml output version: <xsl:value-of select="/nmaprun/@xmloutputversion" /></li>
<li>nmap.xsl version: <xsl:value-of select="$nmap_xsl_version" /></li>
</ul>
<xsl:apply-templates/>
</xsl:template>
<!-- ............................................................ -->
@@ -413,15 +437,45 @@ function timestamp2date(stamp)
</xsl:element>
<xsl:choose>
<xsl:when test="status/@state = 'up'"><h2 class="green"><xsl:value-of select="address/@addr"/> (online)</h2></xsl:when>
<xsl:otherwise><h2 class="red"><xsl:value-of select="address/@addr"/> (offline)</h2></xsl:otherwise>
<xsl:when test="status/@state = 'up'">
<h2 class="green"><xsl:value-of select="address/@addr"/>
<xsl:if test="count(hostnames/hostname) > 0">
<xsl:for-each select="hostnames/hostname">
<xsl:sort select="@name" order="ascending" data-type="text"/>
<xsl:text> / </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
</xsl:if>
<span class="status">(online)</span>
</h2>
</xsl:when>
<xsl:otherwise>
<h2 class="red"><xsl:value-of select="address/@addr"/>
<xsl:if test="count(hostnames/hostname) > 0">
<xsl:for-each select="hostnames/hostname">
<xsl:sort select="@name" order="ascending" data-type="text"/>
<xsl:text> / </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
</xsl:if>
<span class="status">(offline)</span></h2>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates/>
<xsl:if test="count(address) > 0">
<h3>address</h3>
<ul>
<xsl:for-each select="address">
<li><xsl:value-of select="@addr"/> (<xsl:value-of select="@addrtype"/>)</li>
</xsl:for-each>
</ul>
</xsl:if>
<xsl:apply-templates/>
</xsl:template>
<!-- ............................................................ -->
<!-- hostnames -->
<!-- ............................................................ -->
<xsl:template match="hostnames">
@@ -432,7 +486,7 @@ function timestamp2date(stamp)
<!-- hostname -->
<!-- ............................................................ -->
<xsl:template match="hostname">
<li><xsl:value-of select="@name"/> ( <xsl:value-of select="@type"/> )</li>
<li><xsl:value-of select="@name"/> (<xsl:value-of select="@type"/>)</li>
</xsl:template>
<!-- ............................................................ -->
@@ -445,6 +499,8 @@ function timestamp2date(stamp)
<p>The <xsl:value-of select="@count" /> ports scanned but not shown below are in state: <b><xsl:value-of select="@state" /></b></p>
</xsl:if>
</xsl:for-each>
<xsl:if test="count(port) > 0">
<table cellspacing="1">
<tr class="head">
<td colspan="2">Port</td>
@@ -456,6 +512,7 @@ function timestamp2date(stamp)
</tr>
<xsl:apply-templates/>
</table>
</xsl:if>
</xsl:template>
<!-- ............................................................ -->
@@ -533,13 +590,7 @@ function timestamp2date(stamp)
<xsl:template match="osmatch">
<li>os match: <b><xsl:value-of select="@name" /> </b></li>
<li>accuracy: <xsl:value-of select="@accuracy" />%</li>
</xsl:template>
<!-- ............................................................ -->
<!-- os fingerprint -->
<!-- ............................................................ -->
<xsl:template match="osfingerprint">
<li>os fingerprint: <em><xsl:value-of select="@fingerprint" /></em></li>
<li>reference fingerprint line number: <xsl:value-of select="@line" /></li>
</xsl:template>
<!-- ............................................................ -->
@@ -605,25 +656,4 @@ function timestamp2date(stamp)
</xsl:template>
<!-- ............................................................ -->
<!-- Timestamp Conversion -->
<!-- ............................................................ -->
<xsl:template name="timestamp">
<xsl:param name="stamp" />
<xsl:choose>
<!-- Prevent Firefox / Transformiix from running docuement.write() -->
<xsl:when test="system-property('xsl:vendor')!='Transformiix'">
<script language="JavaScript" type="text/javascript" >
<xsl:comment>
document.write(timestamp2date(<xsl:value-of select="$stamp"/>));
</xsl:comment>
</script>
</xsl:when>
<xsl:otherwise><xsl:value-of select="$stamp"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ............................................................ -->
</xsl:stylesheet>
</xsl:stylesheet>