Skip to content

Commit 32ab692

Browse files
committed
#33: Support multiple values for OSMatch
1 parent f06687b commit 32ab692

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

formatter/nmap_host.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ type HostName struct {
7474
type OS struct {
7575
OSPortUsed []OSPortUsed `xml:"portused"`
7676
OSClass OSClass `xml:"osclass"`
77-
OSMatch OSMatch `xml:"osmatch"`
77+
OSMatch []OSMatch `xml:"osmatch"`
7878
}
7979

8080
// OSPortUsed defines which ports were used for OS detection

formatter/resources/templates/markdown.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ NMAP Scan Result: {{ .NMAPRun.StartStr }}
6565
{{- range .OS.OSPortUsed }}
6666
| Used port | **{{ .PortID }}/{{ .Protocol }} ({{ .State }})** |
6767
{{- end -}}{{/* range .OS.OSPortUsed */}}
68-
{{- if .OS.OSMatch.Name }}
69-
| OS | **{{ .OS.OSMatch.Name }} ({{ .OS.OSMatch.Accuracy }}%)** |
68+
{{- range .OS.OSMatch }}
69+
| OS | **{{ .Name }} ({{ .Accuracy }}%)** |
7070
{{- else }}{{/* if .OS.OSMatch.Name */}}
7171
| OS | N/A |
7272
{{- end -}}{{/* if .OS.OSMatch.Name */}}

formatter/resources/templates/simple-html.gohtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@
204204
{{ range .OS.OSPortUsed }}
205205
<li>Used port: <strong>{{ .PortID }}/{{ .Protocol }} ({{ .State }})</strong></li>
206206
{{ end }}
207-
{{ if .OS.OSMatch.Name }}
208-
<li>OS: <strong>{{ .OS.OSMatch.Name }} ({{ .OS.OSMatch.Accuracy }}%)</strong></li>
207+
{{ range .OS.OSMatch }}
208+
<li>OS: <strong>{{ .Name }} ({{ .Accuracy }}%)</strong></li>
209209
{{ else }}
210210
<li>OS: N/A</li>
211211
{{ end }}

0 commit comments

Comments
 (0)