-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathmark-ports.xslt
More file actions
35 lines (29 loc) · 1.29 KB
/
mark-ports.xslt
File metadata and controls
35 lines (29 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:npo="http://xmlns.sven.to/npo"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="str npo">
<npo:comment>[ports] [color]
Marks a list of ports or hosts with port (in address:port format) with the given color in scan result. Expects a comma-separated list as input. The comment will be displayed in the HTML report.
Example:
nmap-parse-output scan.xml mark-ports '80,10.0.0.1:8080' red | nmap-parse-output - html > report.html
</npo:comment>
<npo:category>manipulate</npo:category>
<!-- see http://exslt.org/str/index.html -->
<xsl:variable name="mark-ports" select="str:tokenize($param1, ',')" />
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/nmaprun/host/ports/port">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<xsl:if test="$mark-ports = ./@portid or $mark-ports = concat(../../address/@addr, ':', ./@portid)">
<npo-color-annotation><xsl:value-of select="$param2"/></npo-color-annotation>
</xsl:if>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>