-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathmarkdown.tmpl
143 lines (116 loc) · 4.77 KB
/
markdown.tmpl
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
NMAP Scan Result: {{ .NMAPRun.StartStr }}
==========================================
{{ $skipDownHosts := .OutputOptions.MarkdownOptions.SkipDownHosts }}
{{ $skipSummary := .OutputOptions.MarkdownOptions.SkipSummary }}
{{ $skipPortScripts := .OutputOptions.MarkdownOptions.SkipPortScripts }}
{{ $skipMetrics := .OutputOptions.MarkdownOptions.SkipMetrics }}
{{ $skipTraceroute := .OutputOptions.MarkdownOptions.SkipTraceroute }}
## TOC
{{ if not $skipSummary }}
* [Scan Summary](#scan-summary)
{{- end }}{{/* if $skipSummary */}}
{{- range .NMAPRun.Host -}}
{{- if .ShouldNotSkipHost $skipDownHosts }}
* [{{ md_title . }}](#{{ md_link . }})
{{- end -}}{{/* .ShouldNotSkipHost $skipDownHosts */}}
{{- end -}}{{/* range .Host */}}
{{- if not $skipSummary }}
----
## Scan Summary
| Name | Value |
|----|----|
| Scanner | {{ .NMAPRun.Scanner }} |
| Start time | {{ .NMAPRun.StartStr }} |
| Finished | {{ .NMAPRun.RunStats.Finished.TimeStr }} |
| Elapsed | {{ .NMAPRun.RunStats.Finished.Elapsed }} |
| Version | {{ .NMAPRun.Version }} |
| Type of scan | {{ .NMAPRun.ScanInfo.Type }} |
| Protocol | {{ .NMAPRun.ScanInfo.Protocol }} |
| Number of services | {{ .NMAPRun.ScanInfo.NumServices }} |
| Arguments | `{{ md .NMAPRun.Args }}` |
| Verbosity | {{ .NMAPRun.Verbose.Level }} |
| Debug | {{ .NMAPRun.Debugging.Level }} |
| Exit (success) | {{ .NMAPRun.RunStats.Finished.Exit }} |
| Summary | {{ .NMAPRun.RunStats.Finished.Summary }} |
| Hosts | Up: {{ .NMAPRun.RunStats.Hosts.Up }}, Down: {{ .NMAPRun.RunStats.Hosts.Down }}, Total: {{ .NMAPRun.RunStats.Hosts.Total }} |
### Services Scanned
```
{{ md .NMAPRun.ScanInfo.Services }}
```
{{ end }}{{/* if not $skipSummary */}}
{{ if .CustomOptions }}
## Custom Values
| Key | Value |
| --- | ----- |
{{ range $key, $value := .CustomOptions -}}
| **{{ md $key }}** | `{{ md $value }}` |
{{ end }}{{/* range $key, $value := .CustomOptions */}}
{{ end }}{{/* if .CustomOptions */}}
----
{{ range .NMAPRun.Host -}}
{{- if .ShouldNotSkipHost $skipDownHosts }}
## {{ md_title . }}
{{- if .ShouldNotSkipHost $skipDownHosts }}
### Info:
| Name | Value |
| ---- | ----- |
| Address(es) | {{ .JoinedAddresses "/" }} |
| Hostnames | `{{ range .HostNames.HostName }} / {{ .Name }} ({{ .Type }}){{ else }}N/A{{ end }}` |
{{- if .OS }}
{{- range .OS.OSPortUsed }}
| Used port | **{{ .PortID }}/{{ .Protocol }} ({{ .State }})** |
{{- end -}}{{/* range .OS.OSPortUsed */}}
{{- range .OS.OSMatch }}
| OS | **{{ .Name }} ({{ .Accuracy }}%)** |
{{- else }}{{/* if .OS.OSMatch.Name */}}
| OS | N/A |
{{- end -}}{{/* if .OS.OSMatch.Name */}}
{{ end }}{{/* if .OS */}}
### Ports:
| Port | Protocol | State | Service | Reason | Product | Version | Extra Info |
| ---- | -------- | ----- | ------- | ------ | ------- | ------- | ---------- |
{{ range .Port -}}
| {{ .PortID }} | {{ .Protocol }} | {{ .State.State }} | {{ .Service.Name }} | {{ .State.Reason }} | {{ .Service.Product }} | {{ .Service.Version }} | {{ .Service.ExtraInfo }} |
{{ end }}{{/* range .Port */}}
{{ if not $skipPortScripts }}
{{ if and (.Trace) (not $skipTraceroute) }}
### Traceroute information:
{{ if .Trace.Hops }}
`(open) Generated traceroute data {{ if .Trace.Port }}using {{ .Trace.Port }}{{ if .Trace.Protocol }}/{{ .Trace.Protocol }}{{ end }}{{ end }}`
| Hop | Rtt | IP | Host |
| --- | --- | -- | ---- |
{{ range .Trace.Hops -}}
| {{ .TTL }} | {{ .RTT }} | {{ .IPAddr }} | {{ .Host }} |
{{ end }}{{/* range .Trace.Hops */}}
{{ else }}
`No traceroute information`
{{ end }}{{/* if .Trace.Hops */}}
{{ end }}{{/* if and (.Trace) (not $skipTraceroute) */}}
{{ if not $skipMetrics }}
### Misc Metrics
| Metric | Value |
| ------ | ----- |
| Ping Results | {{ if .Status.Reason }}{{ .Status.Reason }}{{ else }}N/A{{ end }} |
| System Uptime | {{ if .Uptime.Seconds }}{{ .Uptime.Seconds }} (last boot: {{ .Uptime.LastBoot }}){{ else }}N/A{{ end }} |
| Network Distance | {{ if .Distance.Value }}{{ .Distance.Value }}{{ else }}N/A{{ end }} |
| TCP Sequence Prediction | {{ if .TCPSequence.Difficulty }}{{ .TCPSequence.Difficulty }} ```{{ .TCPSequence.Values }}```{{ else }}N/A{{ end }} |
| IP ID Sequence Generation | {{ if .IPIDSequence.Class }}{{ .IPIDSequence.Class }} ```{{ .IPIDSequence.Values }}```{{ else }}N/A{{ end }} |
| TCP TS Sequence | {{ if .TCPTSSequence.Class }}{{ .TCPTSSequence.Class }} ```{{ .TCPTSSequence.Values }}```{{ else }}N/A{{ end }} |
{{ end }}{{/* if not $skipMetrics */}}
### Scripts:
{{ range .Port -}}
{{- if .Script -}}
#### PORT {{ .PortID }}
{{ range .Script }}
**Script ID:** `{{ md .ID }}`
```
{{ noesc .Output }}
```
{{- end -}}{{/* range .Script */}}
{{- end -}}{{/* if .Script */}}
{{ end -}}{{/* if not $skipPortScripts */}}
{{ end -}}{{/* range .Port */}}
{{- end -}}{{/* if .ShouldNotSkipHost $skipDownHosts */}}
----
{{- end -}}{{/* if .ShouldNotSkipHost $skipDownHosts */}}
{{- end -}}{{/* range .NMAPRun.Host */}}