Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nmap
GitHub Repository: nmap/nmap
Path: blob/master/docs/nmap-fo.xsl
3733 views
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- =========================================================================
3
nmap_fo.xls stylesheet version 1.010
4
https://github.com/tilikammon/nmap-to-fo
5
last change: 2013-01-20
6
Gustave Walzer
7
8
Usage
9
==============
10
11
* Run nmap with -oX flag for xml output:
12
$ nmap -oX ./nmap.scan.xml localhost
13
14
15
* Convert output xml to pdf using the above xsl file with fop:
16
$ fop -xml nmap.scan.xml -xsl nmap_fo.xsl -pdf nmap.scan.pdf
17
18
========================================================================== -->
19
20
<!-- =========================================================================
21
nmap.xsl stylesheet version 0.9c
22
last change: 2010-12-28
23
Benjamin Erb, http://www.benjamin-erb.de
24
==============================================================================
25
Copyright (c) 2004-2006 Benjamin Erb
26
All rights reserved.
27
28
Redistribution and use in source and binary forms, with or without
29
modification, are permitted provided that the following conditions
30
are met:
31
1. Redistributions of source code must retain the above copyright
32
notice, this list of conditions and the following disclaimer.
33
2. Redistributions in binary form must reproduce the above copyright
34
notice, this list of conditions and the following disclaimer in the
35
documentation and/or other materials provided with the distribution.
36
3. The name of the author may not be used to endorse or promote products
37
derived from this software without specific prior written permission.
38
39
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
40
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
41
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
42
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
43
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
45
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
46
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
47
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
48
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49
========================================================================== -->
50
51
52
<xsl:stylesheet version="1.0"
53
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
54
xmlns:fo="http://www.w3.org/1999/XSL/Format">
55
56
<!-- Base Document -->
57
<xsl:template match="/">
58
<fo:root>
59
<fo:layout-master-set>
60
<fo:simple-page-master master-name="simple" page-height="29.7cm" page-width="21cm" margin-top="1cm" margin-bottom="2cm" margin-left="2.5cm" margin-right="2.5cm">
61
<fo:region-body margin-top="3cm"/>
62
<fo:region-before extent="3cm"/>
63
<fo:region-after extent="1.5cm"/>
64
</fo:simple-page-master>
65
</fo:layout-master-set>
66
67
<fo:bookmark-tree>
68
<fo:bookmark internal-destination="summary">
69
<fo:bookmark-title>Summary</fo:bookmark-title>
70
</fo:bookmark>
71
72
<xsl:if test="/nmaprun/prescript">
73
<fo:bookmark internal-destination="prescript">
74
<fo:bookmark-title>Pre-Scan Script Output</fo:bookmark-title>
75
</fo:bookmark>
76
</xsl:if>
77
78
<xsl:for-each select="nmaprun/host">
79
80
<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"/>
81
82
<fo:bookmark internal-destination="host.{generate-id()}">
83
<fo:bookmark-title>
84
<xsl:if test="count(hostnames/hostname) > 0">
85
<xsl:value-of select="hostnames/hostname/@name"/> (<xsl:value-of select="address/@addr"/>)
86
</xsl:if>
87
88
<xsl:if test="count(hostnames/hostname) = 0">
89
<xsl:value-of select="address/@addr"/>
90
</xsl:if>
91
</fo:bookmark-title>
92
93
<xsl:if test="address">
94
<fo:bookmark internal-destination="address.{generate-id()}">
95
<fo:bookmark-title>Address</fo:bookmark-title>
96
</fo:bookmark>
97
</xsl:if>
98
99
<xsl:if test="count(hostnames/hostname) > 0">
100
<fo:bookmark internal-destination="hostname.{generate-id(hostnames)}">
101
<fo:bookmark-title>Hostname</fo:bookmark-title>
102
</fo:bookmark>
103
</xsl:if>
104
105
<xsl:if test="ports">
106
<fo:bookmark internal-destination="port.{generate-id(ports)}">
107
<fo:bookmark-title>Ports</fo:bookmark-title>
108
</fo:bookmark>
109
</xsl:if>
110
111
<xsl:if test="hostscript">
112
<fo:bookmark internal-destination="hostscript.{generate-id(hostscript)}">
113
<fo:bookmark-title>Host Script Output</fo:bookmark-title>
114
</fo:bookmark>
115
</xsl:if>
116
117
<xsl:if test="trace">
118
<fo:bookmark internal-destination="traceroute.{generate-id(trace)}" >
119
<fo:bookmark-title>Traceroute</fo:bookmark-title>
120
</fo:bookmark>
121
</xsl:if>
122
</fo:bookmark>
123
</xsl:for-each>
124
125
<xsl:if test="/nmaprun/postscript">
126
<fo:bookmark internal-destination="postscript">
127
<fo:bookmark-title>Post-Scan Script Output</fo:bookmark-title>
128
</fo:bookmark>
129
</xsl:if>
130
131
</fo:bookmark-tree>
132
133
<fo:page-sequence master-reference="simple">
134
<fo:flow flow-name="xsl-region-body">
135
<xsl:apply-templates select="nmaprun"/>
136
</fo:flow>
137
</fo:page-sequence>
138
</fo:root>
139
</xsl:template>
140
<!-- ............................................................ -->
141
142
<!-- nmaprun -->
143
<xsl:template match="nmaprun">
144
<fo:block font-size="14pt" font-family="sans-serif" background-color="#2A0D45" color="#FFFFFF" padding-top="3pt" id="head">
145
Nmap Scan Report - Scanned at <xsl:value-of select="@startstr"/>
146
</fo:block>
147
148
<fo:block font-size="8pt" font-family="sans-serif" padding-top="10pt" start-indent="20pt" text-align="left" color="#000000" >
149
<fo:basic-link internal-destination="summary"><fo:inline font-weight="bold">Scan Summary</fo:inline></fo:basic-link>
150
151
<xsl:if test="prescript/script/@id">
152
<xsl:text> | </xsl:text>
153
<fo:basic-link internal-destination="prescript"><fo:inline font-weight="bold">Pre-Scan Script Output</fo:inline></fo:basic-link>
154
</xsl:if>
155
156
<xsl:for-each select="host">
157
<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"/>
158
159
<xsl:text> | </xsl:text>
160
161
<xsl:variable name="var_address" select="address/@addr" />
162
163
<fo:inline font-size="8pt" font-family="sans-serif" font-weight="bold" padding-top="3pt" padding-bottom="3pt" text-align="left" background-color="#CCFFCC" color="#006400">
164
<xsl:if test="count(hostnames/hostname) > 0">
165
<xsl:for-each select="hostnames">
166
<fo:basic-link internal-destination="host.{generate-id(..)}"><xsl:value-of select="hostname/@name"/> (<xsl:value-of select="$var_address"/>)</fo:basic-link>
167
</xsl:for-each>
168
</xsl:if>
169
170
<xsl:if test="count(hostnames/hostname) = 0">
171
<fo:basic-link internal-destination="host.{generate-id()}"><xsl:value-of select="address/@addr"/></fo:basic-link>
172
</xsl:if>
173
</fo:inline>
174
175
</xsl:for-each>
176
177
<xsl:if test="postscript/script/@id">
178
<xsl:text> | </xsl:text>
179
<fo:basic-link internal-destination="postscript"><fo:inline font-weight="bold">Post-Scan Script Output</fo:inline></fo:basic-link>
180
</xsl:if>
181
</fo:block>
182
183
<fo:block>&#160;</fo:block>
184
185
<fo:block font-size="11pt" font-family="sans-serif" font-weight="bold" padding-top="3pt" text-align="left" background-color="#F0F8FF" color="#000000" id="summary">
186
Scan Summary
187
</fo:block>
188
189
<fo:block font-size="8pt" font-family="sans-serif" padding-top="6pt" color="#000000">
190
Nmap <xsl:value-of select="@version" /> was initiated at <xsl:value-of select="/nmaprun/@startstr" /> with these arguments:
191
</fo:block>
192
193
<fo:block font-size="8pt" font-family="sans-serif" font-style="italic" background-color="#CCCCCC" color="#000000">
194
<xsl:value-of select="@args" />
195
</fo:block>
196
197
<fo:block>&#160;</fo:block>
198
199
<fo:block font-size="8pt" font-family="sans-serif" color="#000000">
200
Verbosity: <xsl:value-of select="verbose/@level" />; Debug level <xsl:value-of select="debugging/@level"/>
201
</fo:block>
202
203
<fo:block>&#160;</fo:block>
204
205
<fo:block font-size="8pt" font-family="sans-serif" color="#000000">
206
<xsl:value-of select="/nmaprun/runstats/finished/@summary" />
207
</fo:block>
208
209
<fo:block font-size="6pt" font-family="sans-serif" padding-top="10pt">
210
<fo:basic-link internal-destination="head">back to top</fo:basic-link>
211
</fo:block>
212
213
<fo:block>&#160;</fo:block>
214
215
<xsl:apply-templates select="prescript"/>
216
217
<xsl:apply-templates select="host">
218
<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"/>
219
</xsl:apply-templates>
220
221
<xsl:apply-templates select="postscript"/>
222
223
</xsl:template>
224
<!-- ............................................................ -->
225
226
<!-- Hosts -->
227
<xsl:template match="host">
228
229
<xsl:choose>
230
231
<xsl:when test="status/@state = 'up'">
232
<fo:block font-size="11pt" font-family="sans-serif" font-weight="bold" background-color="#CCFFCC" padding-top="3pt" padding-left="3pt" color="#000000" id="host.{generate-id()}">
233
<xsl:value-of select="address/@addr"/>
234
<xsl:if test="count(hostnames/hostname) > 0">
235
<xsl:for-each select="hostnames/hostname">
236
<xsl:sort select="@name" order="ascending" data-type="text"/>
237
<xsl:text> / </xsl:text><xsl:value-of select="@name"/>
238
</xsl:for-each>
239
</xsl:if>
240
</fo:block>
241
</xsl:when>
242
243
<xsl:otherwise>
244
<fo:block font-size="11pt" font-family="sans-serif" font-weight="bold" background-color="#E1E1E1" padding-top="3pt" padding-left="3pt" id="host.{generate-id()}">
245
<xsl:value-of select="address/@addr"/>
246
<xsl:if test="count(hostnames/hostname) > 0">
247
<xsl:for-each select="hostnames/hostname">
248
<xsl:sort select="@name" order="ascending" data-type="text"/>
249
<xsl:text> / </xsl:text><xsl:value-of select="@name"/>
250
</xsl:for-each>
251
</xsl:if>
252
(<xsl:value-of select="status/@state"/>)
253
</fo:block>
254
</xsl:otherwise>
255
</xsl:choose>
256
257
<fo:block font-size="10pt" font-family="sans-serif" font-weight="bold" padding-top="10pt" padding-bottom="5pt" color="#000000" id="address.{generate-id()}">
258
Address
259
</fo:block>
260
261
<fo:block font-size="8pt" font-family="sans-serif" start-indent="15pt" color="#000000">
262
<xsl:if test="count(address) > 0">
263
<xsl:for-each select="address">
264
&#8226; <xsl:value-of select="@addr"/>
265
<xsl:if test="@vendor">
266
<xsl:text> - </xsl:text>
267
<xsl:value-of select="@vendor"/>
268
<xsl:text> </xsl:text>
269
</xsl:if>
270
(<xsl:value-of select="@addrtype"/>)
271
</xsl:for-each>
272
</xsl:if>
273
</fo:block>
274
275
<fo:block font-size="2pt"></fo:block>
276
277
<xsl:apply-templates/>
278
279
<fo:block font-family="sans-serif" font-size="10pt" font-weight="bold" padding-top="10pt" padding-bottom="5pt">
280
Misc Metrics
281
</fo:block>
282
283
<fo:table>
284
<fo:table-header>
285
<fo:table-cell border="solid black 1px">
286
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold" background-color="#E1E1E1">Metric</fo:block>
287
</fo:table-cell>
288
<fo:table-cell border="solid black 1px">
289
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold" background-color="#E1E1E1">Value</fo:block>
290
</fo:table-cell>
291
</fo:table-header>
292
293
<fo:table-body>
294
<fo:table-row>
295
<fo:table-cell border="solid black 1px">
296
<fo:block font-family="sans-serif" font-size="8pt">Ping Results</fo:block>
297
</fo:table-cell>
298
<fo:table-cell border="solid black 1px">
299
<fo:block font-family="sans-serif" font-size="8pt">
300
<xsl:value-of select="status/@reason"/>
301
<xsl:if test="status/@reasonsrc">
302
<xsl:text> from </xsl:text>
303
<xsl:value-of select="status/@reasonsrc"/>
304
</xsl:if>
305
</fo:block>
306
</fo:table-cell>
307
</fo:table-row>
308
309
<xsl:if test="uptime/@seconds != ''">
310
<fo:table-row>
311
<fo:table-cell border="solid black 1px">
312
<fo:block font-family="sans-serif" font-size="8pt">System Uptime</fo:block>
313
</fo:table-cell>
314
<fo:table-cell border="solid black 1px">
315
<fo:block font-family="sans-serif" font-size="8pt">
316
<xsl:value-of select="uptime/@seconds" /> seconds (last reboot: <xsl:value-of select="uptime/@lastboot" />)
317
</fo:block>
318
</fo:table-cell>
319
</fo:table-row>
320
</xsl:if>
321
322
<xsl:if test="distance/@value != ''">
323
<fo:table-row>
324
<fo:table-cell border="solid black 1px">
325
<fo:block font-family="sans-serif" font-size="8pt">Network Distance</fo:block>
326
</fo:table-cell>
327
<fo:table-cell border="solid black 1px">
328
<fo:block font-family="sans-serif" font-size="8pt">
329
<xsl:value-of select="distance/@value" /> hops
330
</fo:block>
331
</fo:table-cell>
332
</fo:table-row>
333
</xsl:if>
334
335
336
<xsl:if test="tcpsequence/@index != ''">
337
<fo:table-row>
338
<fo:table-cell border="solid black 1px">
339
<fo:block font-family="sans-serif" font-size="8pt">TCP Sequence Prediction</fo:block>
340
</fo:table-cell>
341
<fo:table-cell border="solid black 1px">
342
<fo:block font-family="sans-serif" font-size="8pt">
343
Difficulty=<xsl:value-of select="tcpsequence/@index" /> (<xsl:value-of select="tcpsequence/@difficulty" />)
344
</fo:block>
345
</fo:table-cell>
346
</fo:table-row>
347
</xsl:if>
348
349
<xsl:if test="ipidsequence/@class != ''">
350
<fo:table-row>
351
<fo:table-cell border="solid black 1px">
352
<fo:block font-family="sans-serif" font-size="8pt">IP ID Sequence Geneation</fo:block>
353
</fo:table-cell>
354
<fo:table-cell border="solid black 1px">
355
<fo:block font-family="sans-serif" font-size="8pt">
356
<xsl:value-of select="ipidsequence/@class" />
357
</fo:block>
358
</fo:table-cell>
359
</fo:table-row>
360
</xsl:if>
361
362
</fo:table-body>
363
</fo:table>
364
365
<fo:block>&#160;</fo:block>
366
367
<fo:block font-size="6pt" font-family="sans-serif">
368
<fo:basic-link internal-destination="head">Back to top</fo:basic-link>
369
</fo:block>
370
371
<fo:block>&#160;</fo:block>
372
373
</xsl:template>
374
<!-- ............................................................ -->
375
376
<!-- hostnames -->
377
<xsl:template match="hostnames">
378
<xsl:if test="hostname/@name != ''">
379
<fo:block font-size="10pt" font-family="sans-serif" font-weight="bold" padding-top="10pt" padding-bottom="5pt" color="#000000" id="hostname.{generate-id()}">
380
Hostnames
381
</fo:block>
382
<xsl:apply-templates/>
383
</xsl:if>
384
385
</xsl:template>
386
<!-- ............................................................ -->
387
388
<!-- hostname -->
389
<xsl:template match="hostname">
390
<fo:block font-size="8pt" font-family="sans-serif" start-indent="15pt" color="#000000">
391
&#8226; <xsl:value-of select="@name"/> (<xsl:value-of select="@type"/>)
392
</fo:block>
393
</xsl:template>
394
<!-- ............................................................ -->
395
396
<!-- Ports -->
397
<xsl:template match="ports">
398
<xsl:variable name="var_address" select="../address/@addr" />
399
400
<fo:block font-size="10pt" font-family="sans-serif" font-weight="bold" padding-top="10pt" padding-bottom="5pt" color="#000000" id="port.{generate-id()}">
401
Ports
402
</fo:block>
403
404
<xsl:for-each select="extraports">
405
<xsl:if test="@count > 0">
406
<fo:block font-size="8pt" font-family="sans-serif" padding-bottom="5pt" color="#000000">
407
The <xsl:value-of select="@count"/> ports scanned but not shown below are in state: <fo:inline font-weight="bold"> <xsl:value-of select="@state"/> </fo:inline>
408
</fo:block>
409
</xsl:if>
410
411
<xsl:for-each select="extrareasons">
412
<xsl:if test="@count > 0">
413
<fo:block font-size="8pt" font-family="sans-serif" start-indent="15pt" color="#000000">
414
&#8226; <xsl:value-of select="@count"/> ports replied with: <fo:inline font-weight="bold"> <xsl:value-of select="@reason"/> </fo:inline>
415
</fo:block>
416
</xsl:if>
417
</xsl:for-each>
418
</xsl:for-each>
419
420
<fo:block font-size="8pt" font-family="sans-serif">&#160;</fo:block>
421
422
<xsl:if test="count(port) > 0">
423
<fo:table>
424
<fo:table-header>
425
<fo:table-row>
426
<fo:table-cell background-color="#CCFFCC" border="solid black 1px" number-columns-spanned="2">
427
<fo:block font-size="8pt" font-family="sans-serif" background-color="#E1E1E1" font-weight="bold">Port</fo:block>
428
</fo:table-cell>
429
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
430
<fo:block font-size="8pt" font-family="sans-serif" background-color="#E1E1E1" font-weight="bold">State</fo:block>
431
</fo:table-cell>
432
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
433
<fo:block font-size="8pt" font-family="sans-serif" background-color="#E1E1E1" font-weight="bold">Service</fo:block>
434
</fo:table-cell>
435
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
436
<fo:block font-size="8pt" font-family="sans-serif" background-color="#E1E1E1" font-weight="bold">Reason</fo:block>
437
</fo:table-cell>
438
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
439
<fo:block font-size="8pt" font-family="sans-serif" background-color="#E1E1E1" font-weight="bold">Product</fo:block>
440
</fo:table-cell>
441
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
442
<fo:block font-size="8pt" font-family="sans-serif" background-color="#E1E1E1" font-weight="bold">Version</fo:block>
443
</fo:table-cell>
444
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
445
<fo:block font-size="8pt" font-family="sans-serif" background-color="#E1E1E1" font-weight="bold">Extra Info</fo:block>
446
</fo:table-cell>
447
</fo:table-row>
448
</fo:table-header>
449
450
<fo:table-body>
451
<xsl:apply-templates/>
452
</fo:table-body>
453
454
</fo:table>
455
</xsl:if>
456
457
</xsl:template>
458
<!-- ............................................................ -->
459
460
<!-- port -->
461
<xsl:template match="port">
462
463
<xsl:choose>
464
<xsl:when test="state/@state = 'open'">
465
<fo:table-row>
466
<fo:table-cell background-color="#CCFFCC" border="solid black 1px" width="35pt">
467
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="@portid" /></fo:block>
468
</fo:table-cell>
469
<fo:table-cell background-color="#CCFFCC" border="solid black 1px" width="25pt">
470
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="@protocol" /></fo:block>
471
</fo:table-cell>
472
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
473
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="state/@state" /></fo:block>
474
</fo:table-cell>
475
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
476
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@name" /><xsl:text>&#xA0;</xsl:text></fo:block>
477
</fo:table-cell>
478
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
479
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="state/@reason"/></fo:block>
480
</fo:table-cell>
481
<xsl:if test="state/@reason_ip">
482
<xsl:text> from </xsl:text>
483
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
484
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="state/@reason_ip"/></fo:block>
485
</fo:table-cell>
486
</xsl:if>
487
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
488
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@product" /><xsl:text>&#xA0;</xsl:text></fo:block>
489
</fo:table-cell>
490
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
491
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@version" /><xsl:text>&#xA0;</xsl:text></fo:block>
492
</fo:table-cell>
493
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
494
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@extrainfo" /><xsl:text>&#xA0;</xsl:text></fo:block>
495
</fo:table-cell>
496
</fo:table-row>
497
<xsl:for-each select="script">
498
<fo:table-row>
499
<fo:table-cell background-color="#EFFFF7" border="solid black 1px">
500
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="@id"/> <xsl:text>&#xA0;</xsl:text></fo:block>
501
</fo:table-cell>
502
<fo:table-cell background-color="#EFFFF7" border="solid black 1px" number-columns-spanned="7">
503
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="@output"/> <xsl:text>&#xA0;</xsl:text></fo:block>
504
</fo:table-cell>
505
</fo:table-row>
506
</xsl:for-each>
507
</xsl:when>
508
509
<xsl:when test="state/@state = 'filtered'">
510
<fo:table-row>
511
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
512
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="@portid" /></fo:block>
513
</fo:table-cell>
514
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
515
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="@protocol" /></fo:block>
516
</fo:table-cell>
517
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
518
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="state/@state" /></fo:block>
519
</fo:table-cell>
520
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
521
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@name" /><xsl:text>&#xA0;</xsl:text></fo:block>
522
</fo:table-cell>
523
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
524
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="state/@reason"/></fo:block>
525
</fo:table-cell>
526
<xsl:if test="state/@reason_ip">
527
<xsl:text> from </xsl:text>
528
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
529
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="state/@reason_ip"/></fo:block>
530
</fo:table-cell>
531
</xsl:if>
532
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
533
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@product" /><xsl:text>&#xA0;</xsl:text></fo:block>
534
</fo:table-cell>
535
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
536
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@version" /><xsl:text>&#xA0;</xsl:text></fo:block>
537
</fo:table-cell>
538
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
539
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@extrainfo" /><xsl:text>&#xA0;</xsl:text></fo:block>
540
</fo:table-cell>
541
</fo:table-row>
542
</xsl:when>
543
544
<xsl:when test="state/@state = 'closed'">
545
<fo:table-row>
546
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
547
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="@portid" /></fo:block>
548
</fo:table-cell>
549
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
550
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="@protocol" /></fo:block>
551
</fo:table-cell>
552
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
553
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="state/@state" /></fo:block>
554
</fo:table-cell>
555
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
556
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@name" /><xsl:text>&#xA0;</xsl:text></fo:block>
557
</fo:table-cell>
558
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
559
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="state/@reason"/></fo:block>
560
</fo:table-cell>
561
<xsl:if test="state/@reason_ip">
562
<xsl:text> from </xsl:text>
563
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
564
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="state/@reason_ip"/></fo:block>
565
</fo:table-cell>
566
</xsl:if>
567
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
568
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@product" /><xsl:text>&#xA0;</xsl:text></fo:block>
569
</fo:table-cell>
570
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
571
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@version" /><xsl:text>&#xA0;</xsl:text></fo:block>
572
</fo:table-cell>
573
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
574
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@extrainfo" /><xsl:text>&#xA0;</xsl:text></fo:block>
575
</fo:table-cell>
576
</fo:table-row>
577
</xsl:when>
578
579
<xsl:otherwise>
580
<fo:table-row>
581
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
582
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="@portid" /></fo:block>
583
</fo:table-cell>
584
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
585
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="@protocol" /></fo:block>
586
</fo:table-cell>
587
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
588
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="state/@state" /></fo:block>
589
</fo:table-cell>
590
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
591
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@name" /><xsl:text>&#xA0;</xsl:text></fo:block>
592
</fo:table-cell>
593
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
594
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="state/@reason"/></fo:block>
595
</fo:table-cell>
596
<xsl:if test="state/@reason_ip">
597
<xsl:text> from </xsl:text>
598
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
599
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="state/@reason_ip"/></fo:block>
600
</fo:table-cell>
601
</xsl:if>
602
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
603
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@product" /><xsl:text>&#xA0;</xsl:text></fo:block>
604
</fo:table-cell>
605
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
606
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@version" /><xsl:text>&#xA0;</xsl:text></fo:block>
607
</fo:table-cell>
608
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
609
<fo:block font-size="8pt" font-family="sans-serif"><xsl:value-of select="service/@extrainfo" /><xsl:text>&#xA0;</xsl:text></fo:block>
610
</fo:table-cell>
611
</fo:table-row>
612
</xsl:otherwise>
613
</xsl:choose>
614
615
</xsl:template>
616
<!-- ............................................................ -->
617
618
<!-- os -->
619
<xsl:template match="os">
620
<fo:block font-size="10pt" font-family="sans-serif" font-weight="bold" padding-top="15pt" padding-bottom="5pt" color="#000000" id="remote.{generate-id()}">
621
Remote Operating System Detection
622
</fo:block>
623
624
<xsl:if test="count(osmatch) = 0">
625
<fo:block font-size="8pt" font-family="sans-serif" color="#000000">
626
Unable to identify operating system.
627
</fo:block>
628
</xsl:if>
629
630
<xsl:for-each select="portused">
631
<fo:block font-size="8pt" font-family="sans-serif" start-indent="15pt" color="#000000">
632
&#8226; Used port: <fo:inline font-weight="bold"> <xsl:value-of select="@portid" />/<xsl:value-of select="@proto"/> (<xsl:value-of select="@state"/>) </fo:inline>
633
</fo:block>
634
</xsl:for-each>
635
636
<xsl:for-each select="osmatch">
637
<fo:block font-size="8pt" font-family="sans-serif" start-indent="15pt" color="#000000">
638
&#8226; OS match: <fo:inline font-weight="bold"> <xsl:value-of select="@name"/> (<xsl:value-of select="@accuracy"/>%) </fo:inline>
639
</fo:block>
640
</xsl:for-each>
641
642
643
<xsl:apply-templates select="osfingerprint"/>
644
645
</xsl:template>
646
<!-- ............................................................ -->
647
648
<!-- osfingerprint -->
649
<xsl:template match="osfingerprint">
650
651
<fo:block>&#160;</fo:block>
652
653
<xsl:choose>
654
<xsl:when test="count(../osmatch)=0">
655
<fo:block font-family="sans-serif" font-size="10pt" font-weight="bold">
656
Cannot determine exact operating system. Fingerprint provided below.
657
If you know what OS is running on it, see https://nmap.org/submit/
658
</fo:block>
659
660
<fo:table>
661
<fo:table-header>
662
<fo:table-row>
663
<fo:table-cell border="solid black 1px" background-color="#E1E1E1">
664
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold">
665
Operating System fingerprint
666
</fo:block>
667
</fo:table-cell>
668
</fo:table-row>
669
</fo:table-header>
670
671
<fo:table-body>
672
<fo:table-row>
673
<fo:table-cell border="solid black 1px">
674
<fo:block font-family="sans-serif" font-size="8pt">
675
<xsl:value-of select="@fingerprint"/>
676
</fo:block>
677
</fo:table-cell>
678
</fo:table-row>
679
</fo:table-body>
680
</fo:table>
681
</xsl:when>
682
683
<xsl:otherwise>
684
<fo:table>
685
<fo:table-header>
686
<fo:table-cell border="solid black 1px" background-color="#E1E1E1">
687
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold">
688
Operating System fingerprint
689
</fo:block>
690
</fo:table-cell>
691
</fo:table-header>
692
693
<fo:table-body>
694
<fo:table-row>
695
<fo:table-cell border="solid black 1px">
696
<fo:block font-family="sans-serif" font-size="8pt">
697
<xsl:value-of select="@fingerprint"/>
698
</fo:block>
699
</fo:table-cell>
700
</fo:table-row>
701
</fo:table-body>
702
</fo:table>
703
</xsl:otherwise>
704
705
</xsl:choose>
706
707
</xsl:template>
708
<!-- ............................................................ -->
709
710
<!-- Pre-Scan script -->
711
<xsl:template match="prescript">
712
<fo:block font-family="sans-serif" font-size="11pt" font-weight="bold" padding-top="3" background-color="#F0F8FF" id="prescript">
713
Pre-Scan Script Output
714
</fo:block>
715
716
<fo:block>&#160;</fo:block>
717
718
<fo:table start-indent="10pt">
719
<fo:table-header>
720
<fo:table-row>
721
<fo:table-cell background-color="#E1E1E1" border="solid black 1px">
722
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold">Script Name</fo:block>
723
</fo:table-cell>
724
<fo:table-cell background-color="#E1E1E1" border="solid black 1px">
725
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold">Output</fo:block>
726
</fo:table-cell>
727
</fo:table-row>
728
</fo:table-header>
729
730
<fo:table-body>
731
<xsl:for-each select="script">
732
<fo:table-row>
733
<fo:table-cell background-color="#EFFFF7" border="solid black 1px">
734
<fo:block font-family="sans-serif" font-size="8pt">
735
<xsl:value-of select="@id"/>
736
</fo:block>
737
</fo:table-cell>
738
<fo:table-cell background-color="#EFFFF7" border="solid black 1px">
739
<fo:block font-family="sans-serif" font-size="8pt" white-space-treatment="preserve" white-space-collapse="false" linefeed-treatment="preserve">
740
<xsl:value-of select="@output"/><xsl:text>&#xA0;</xsl:text>
741
</fo:block>
742
</fo:table-cell>
743
</fo:table-row>
744
</xsl:for-each>
745
</fo:table-body>
746
747
</fo:table>
748
749
<fo:block font-size="6pt" font-family="sans-serif" padding-top="10pt">
750
<fo:basic-link internal-destination="head">Back to top</fo:basic-link>
751
</fo:block>
752
753
<fo:block>&#160;</fo:block>
754
755
</xsl:template>
756
<!-- ............................................................ -->
757
758
<!-- Post-Scan Script -->
759
<xsl:template match="postscript">
760
<fo:block font-family="sans-serif" font-size="11pt" font-weight="bold" padding-top="3pt" background-color="#F0F8FF" id="postscript">
761
Post-Scan Script Output
762
</fo:block>
763
764
<fo:block>&#160;</fo:block>
765
766
<fo:table>
767
<fo:table-header>
768
<fo:table-row>
769
<fo:table-cell background-color="#E1E1E1" border="solid black 1px">
770
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold">Script Name</fo:block>
771
</fo:table-cell>
772
<fo:table-cell background-color="#E1E1E1" border="solid black 1px">
773
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold">Output</fo:block>
774
</fo:table-cell>
775
</fo:table-row>
776
</fo:table-header>
777
778
<fo:table-body>
779
<xsl:for-each select="script">
780
<fo:table-row>
781
<fo:table-cell background-color="#EFFFF7" border="solid black 1px">
782
<fo:block font-family="sans-serif" font-size="8pt">
783
<xsl:value-of select="@id"/> <xsl:text>&#xA0;</xsl:text>
784
</fo:block>
785
</fo:table-cell>
786
<fo:table-cell background-color="#EFFFF7" border="solid black 1px" white-space-treatment="preserve" white-space-collapse="false" linefeed-treatment="preserve">
787
<fo:block font-family="sans-serif" font-size="8pt">
788
<xsl:value-of select="@output"/> <xsl:text>&#xA0;</xsl:text>
789
</fo:block>
790
</fo:table-cell>
791
</fo:table-row>
792
</xsl:for-each>
793
</fo:table-body>
794
795
</fo:table>
796
797
<fo:block font-size="6pt" font-family="sans-serif" padding-top="10pt">
798
<fo:basic-link internal-destination="head">Back to top</fo:basic-link>
799
</fo:block>
800
801
<fo:block>&#160;</fo:block>
802
803
</xsl:template>
804
<!-- ............................................................ -->
805
806
<!-- Host-Scan Script -->
807
<xsl:template match="hostscript">
808
809
<fo:block>&#160;</fo:block>
810
811
<fo:block font-family="sans-serif" font-size="11pt" font-weight="bold" padding-top="3pt" background-color="#F0F8FF" id="hostscript.{generate-id()}">
812
Host-Scan Script Output
813
</fo:block>
814
815
<fo:block>&#160;</fo:block>
816
817
<fo:table>
818
<fo:table-header>
819
<fo:table-row>
820
<fo:table-cell background-color="#E1E1E1" border="solid black 1px">
821
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold">Script Name</fo:block>
822
</fo:table-cell>
823
<fo:table-cell background-color="#E1E1E1" border="solid black 1px">
824
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold">Output</fo:block>
825
</fo:table-cell>
826
</fo:table-row>
827
</fo:table-header>
828
829
<fo:table-body>
830
<xsl:for-each select="script">
831
<fo:table-row>
832
<fo:table-cell background-color="#EFFFF7" border="solid black 1px">
833
<fo:block font-family="sans-serif" font-size="8pt">
834
<xsl:value-of select="@id"/>
835
</fo:block>
836
</fo:table-cell>
837
<fo:table-cell background-color="#EFFFF7" border="solid black 1px" white-space-treatment="preserve" white-space-collapse="false" linefeed-treatment="preserve">
838
<fo:block font-family="sans-serif" font-size="8pt">
839
<xsl:value-of select="@output"/> <xsl:text>&#xA0;</xsl:text>
840
</fo:block>
841
</fo:table-cell>
842
</fo:table-row>
843
</xsl:for-each>
844
</fo:table-body>
845
846
</fo:table>
847
848
<fo:block font-size="6pt" font-family="sans-serif" padding-top="10pt">
849
<fo:basic-link internal-destination="head">back to top</fo:basic-link>
850
</fo:block>
851
852
<fo:block>&#160;</fo:block>
853
854
</xsl:template>
855
<!-- ............................................................ -->
856
857
<!-- smurf -->
858
<xsl:template match="smurf">
859
<xsl:if test="@responses != ''">
860
<fo:block font-family="sans-serif" font-size="10pt" font-weight="bold" padding-top="10pt" padding-bottom="5pt">
861
Smurf Responses
862
</fo:block>
863
864
<fo:block font-family="sans-serif" font-size="8pt">
865
<xsl:value-of select="@responses" /> responses counted
866
</fo:block>
867
</xsl:if>
868
</xsl:template>
869
<!-- ............................................................ -->
870
871
<!-- Traceroute -->
872
<xsl:template match="trace">
873
<xsl:if test="@proto">
874
875
<fo:block font-family="sans-serif" font-size="10pt" font-weight="bold" padding-top="10pt" padding-bottom="5pt" id="traceroute.{generate-id()}">
876
Traceroute Information
877
</fo:block>
878
879
<xsl:choose>
880
<xsl:when test="@port">
881
<fo:block font-family="sans-serif" font-size="8pt">
882
Traceroute data generated using port <xsl:value-of select="@port" />/<xsl:value-of select="@proto"/>
883
</fo:block>
884
</xsl:when>
885
886
<xsl:when test="@proto='icmp'">
887
<fo:block font-family="sans-serif" font-size="8pt">
888
Traceroute data generated using ICMP
889
</fo:block>
890
</xsl:when>
891
</xsl:choose>
892
893
<fo:table>
894
<fo:table-header>
895
<fo:table-cell background-color="#E1E1E1" border="solid black 1px">
896
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold">Hop</fo:block>
897
</fo:table-cell>
898
<fo:table-cell background-color="#E1E1E1" border="solid black 1px">
899
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold">RTT</fo:block>
900
</fo:table-cell>
901
<fo:table-cell background-color="#E1E1E1" border="solid black 1px">
902
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold">IP</fo:block>
903
</fo:table-cell>
904
<fo:table-cell background-color="#E1E1E1" border="solid black 1px">
905
<fo:block font-family="sans-serif" font-size="8pt" font-weight="bold">Host</fo:block>
906
</fo:table-cell>
907
</fo:table-header>
908
909
<fo:table-body>
910
<xsl:for-each select="hop">
911
<fo:table-row>
912
<xsl:choose>
913
<xsl:when test="@rtt = '--'">
914
<fo:table-cell background-color="#F2F2F2" border="solid black 1px" width="25pt">
915
<fo:block font-family="sans-serif" font-size="8pt"><xsl:value-of select="@ttl"/></fo:block>
916
</fo:table-cell>
917
<fo:table-cell background-color="#F2F2F2" border="solid black 1px" width="45pt">
918
<fo:block font-family="sans-serif" font-size="8pt">--</fo:block>
919
</fo:table-cell>
920
<fo:table-cell background-color="#F2F2F2" border="solid black 1px" width="70pt">
921
<fo:block font-family="sans-serif" font-size="8pt"><xsl:value-of select="@ipaddr"/></fo:block>
922
</fo:table-cell>
923
<fo:table-cell background-color="#F2F2F2" border="solid black 1px">
924
<fo:block font-family="sans-serif" font-size="8pt"><xsl:value-of select="@host"/></fo:block>
925
</fo:table-cell>
926
</xsl:when>
927
928
<xsl:when test="@rtt > 0">
929
<fo:table-cell background-color="#CCFFCC" border="solid black 1px" width="25pt">
930
<fo:block font-family="sans-serif" font-size="8pt"><xsl:value-of select="@ttl"/></fo:block>
931
</fo:table-cell>
932
<fo:table-cell background-color="#CCFFCC" border="solid black 1px" width="45pt">
933
<fo:block font-family="sans-serif" font-size="8pt"><xsl:value-of select="@rtt"/></fo:block>
934
</fo:table-cell>
935
<fo:table-cell background-color="#CCFFCC" border="solid black 1px" width="70pt">
936
<fo:block font-family="sans-serif" font-size="8pt"><xsl:value-of select="@ipaddr"/></fo:block>
937
</fo:table-cell>
938
<fo:table-cell background-color="#CCFFCC" border="solid black 1px">
939
<fo:block font-family="sans-serif" font-size="8pt"><xsl:value-of select="@host"/></fo:block>
940
</fo:table-cell>
941
</xsl:when>
942
943
<xsl:otherwise>
944
<fo:table-cell border="solid black 1px" background-color="#F2F2F2" width="25pt">
945
<fo:block font-family="sans-serif" font-size="8pt"><xsl:value-of select="@ttl"/></fo:block>
946
</fo:table-cell>
947
</xsl:otherwise>
948
</xsl:choose>
949
</fo:table-row>
950
</xsl:for-each>
951
</fo:table-body>
952
953
</fo:table>
954
955
</xsl:if>
956
957
</xsl:template>
958
<!-- ............................................................ -->
959
960
</xsl:stylesheet>
961
962