-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtemplate.go
53 lines (50 loc) · 1.93 KB
/
template.go
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
package main
const tpl = `#### ShadowServer
{{ if .WhiteList }}
##### WhiteList
| Filename | Description | ProductName |
|:-------------:|:----------------:|:----------------:|
| {{index .WhiteList "filename"}} | {{index .WhiteList "description"}} | {{index .WhiteList "product_name"}} |
{{- else if .SandBox.Antivirus -}}
##### AntiVirus
- FirstSeen: {{index .SandBox.MetaData "first_seen"}}
- LastSeen: {{index .SandBox.MetaData "last_seen"}}
| Vendor | Signature |
|:----------------|:-----------------|
{{- range $key, $value := .SandBox.Antivirus }}
| {{ $key }} | {{ $value }} |
{{- end }}
{{- else }}
- Not found
{{- end }}
`
// func printMarkDownTable(ss ShadowServer) {
// fmt.Println("#### ShadowServer")
// if ss.Results.WhiteList != nil {
// fmt.Println("##### WhiteList")
// table := clitable.New([]string{"Found", "Filename", "Description", "ProductName"})
// table.AddRow(map[string]interface{}{
// "Found": ss.Results.Found,
// "Filename": ss.Results.WhiteList["filename"],
// "Description": ss.Results.WhiteList["description"],
// "ProductName": ss.Results.WhiteList["product_name"],
// })
// table.Markdown = true
// table.Print()
// } else if ss.Results.SandBox.Antivirus != nil {
// fmt.Println("##### AntiVirus")
// // fmt.Printf(" - FirstSeen: %s\n", ss.Results.SandBox.MetaData["first_seen"].Format("1/02/2006 3:04PM"))
// fmt.Printf(" - FirstSeen: %s\n", printTableFormattedTime(ss.Results.SandBox.MetaData["first_seen"]))
// fmt.Printf(" - LastSeen: %s\n", printTableFormattedTime(ss.Results.SandBox.MetaData["last_seen"]))
// fmt.Println()
// table := clitable.New([]string{"Vendor", "Signature"})
// for key, value := range ss.Results.SandBox.Antivirus {
// table.AddRow(map[string]interface{}{"Vendor": key, "Signature": value})
// }
// table.Markdown = true
// table.Print()
// } else {
// fmt.Println(" - Not found")
// }
// fmt.Println()
// }