-
Notifications
You must be signed in to change notification settings - Fork 4
/
vulnerability-scan.yaml
65 lines (58 loc) · 3.15 KB
/
vulnerability-scan.yaml
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
name: vulnerability-scan
desc: Run common Vulnerability scan on list of HTTP file
# this is the files will listed in the Web UI
report:
final:
- "{{.Output}}/vuln/active/{{.Workspace}}-report.html"
- "{{.Output}}/vuln/sensitive/{{.Workspace}}-sensitive.html"
- "{{.Output}}/vuln/nuclei/{{.Workspace}}-nuclei.html"
- "{{.Output}}/vuln/active/jaeles-summary.txt"
- "{{.Output}}/vuln/sensitive/jaeles-summary.txt"
params:
- inputFile: "{{.Target}}" # inputs-host-with-port
- httpFile: "{{.Output}}/vuln/http-{{.Workspace}}.txt"
- sign: "~/.jaeles/base-signatures/products/.*"
- sign2: "~/.jaeles/base-signatures/sensitive/.*"
- final: "sensitive"
- nuclei: "true"
- jaelesThreads: "100"
- nucleiThreads: "200"
- limit: "100000"
- out: "{{.Output}}/vuln"
# in case we want to add -p 'dest=xx.burpcollab.net' or something
- extra: " "
pre_run:
- CreateFolder("{{.Output}}/vuln")
- CreateFolder("{{.Output}}/vuln/raw")
# osmedeus scan -m demo-osm/vulnerability-scan.yaml -t demo-osm/inputs-host-with-port -p 'jaelesThreads=200' -p 'nucleiThreads=300'
steps:
- required:
- "{{.inputFile}}" # check if inputFile is exist
commands:
# probing http first which basically turn the input `1.2.3.4` to `http://1.2.3.4:80`
- "cat {{.inputFile}} | {{.Binaries}}/httprobe -c 100 > {{.httpFile}}"
# run jaeles scan then generate the HTML report
- required:
- "{{.Binaries}}/jaeles"
- "{{.httpFile}}"
commands:
- "{{.Binaries}}/jaeles scan -c {{.jaelesThreads}} -s '{{.sign}}' -U {{.httpFile}} -o {{.Output}}/vuln/active/ {{.extra}}"
- "{{.Binaries}}/jaeles scan --fi -c {{.jaelesThreads}} -s '{{.sign2}}' -U {{.httpFile}} -o {{.Output}}/vuln/sensitive/ {{.extra}}"
scripts:
- ExecCmd('{{.Binaries}}/jaeles report -o {{.Output}}/vuln/active/ -R {{.Output}}/vuln/active/{{.Workspace}}-report.html')
- ExecCmd('{{.Binaries}}/jaeles report -o {{.Output}}/vuln/sensitive/ -R {{.Output}}/vuln/sensitive/{{.Workspace}}-sensitive.html')
# this will show the result in console
- Cat("{{.Output}}/vuln/active/jaeles-summary.txt")
- Cat("{{.Output}}/vuln/sensitive/jaeles-summary.txt")
# nuclei scan
- required:
- "{{.httpFile}}"
- "{{.Binaries}}/nuclei"
scripts:
- CreateFolder('{{.Output}}/vuln/nuclei')
- "ExecCmd(\"{{.Binaries}}/nuclei -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4581.0 Safari/537.36' -silent -c {{.nucleiThreads}} -json -severity critical,high,medium,low -t ~/nuclei-templates/ -l {{.httpFile}} -irr -o {{.Output}}/vuln/nuclei/{{.Workspace}}-nuclei-json.txt\")"
# Built-in HTML report to generate the result
- GenNucleiReport('{{.Output}}/vuln/nuclei/{{.Workspace}}-nuclei-json.txt', '{{.Output}}/vuln/nuclei/{{.Workspace}}-nuclei.html')
# select important field to show in the console
- ExecCmd("cat {{.Output}}/vuln/nuclei/{{.Workspace}}-nuclei-json.txt | jq -r '[.info.severity,.\"template-id\",.\"matched-at\"] | join(\" - \")' > {{.Output}}/vuln/nuclei/{{.Workspace}}-nuclei-scan.txt")
- Cat("{{.Output}}/vuln/nuclei/{{.Workspace}}-nuclei-scan.txt")