Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 4282da5

Browse files
J12934SebieF
andcommitted
Add example how to mount user & password lists into ncrack scans
Co-authored-by: Sebastian Franz <32578476+SebieF@users.noreply.github.com>
1 parent 6ac36be commit 4282da5

File tree

4 files changed

+36
-7
lines changed

4 files changed

+36
-7
lines changed

scanners/ncrack/examples/dummy-ssh/README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,28 @@ In this example we execute an ncrack scan against the intentional vulnerable ssh
22

33
### Install dummy-ssh
44

5-
Before executing the scan, make sure to have dummy-ssh installed:
5+
Before executing the scan, make sure to have dummy-ssh installed, and have the proper username & password lists:
66

77
```bash
8-
helm install dummy-ssh ./demo-apps/dummy-ssh/ --wait
9-
```
8+
# Create user & password list files, you can edit them later if you want
9+
echo "root\nadmin" > users.txt
10+
echo "THEPASSWORDYOUCREATED\n123456\npassword" > passwords.txt
1011

12+
# Create a Kubernetes secret containing these files
13+
kubectl create secret generic --from-file users.txt --from-file passwords.txt ncrack-lists
1114

15+
# Install dummy-ssh app. We'll use ncrack to enumerate its ssh username and password
16+
helm install dummy-ssh ./demo-apps/dummy-ssh/ --wait
1217

18+
# Install the ncrack scanType and set mount the files from the ncrack-lists Kubernetes secret
19+
cat <<EOF | helm install ncrack ./scanners/ncrack --values -
20+
scannerJob:
21+
extraVolumes:
22+
- name: ncrack-lists
23+
secret:
24+
secretName: ncrack-lists
25+
extraVolumeMounts:
26+
- name: ncrack-lists
27+
mountPath: "/ncrack/"
28+
EOF
29+
```

scanners/ncrack/examples/dummy-ssh/scan.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ metadata:
55
spec:
66
scanType: "ncrack"
77
parameters:
8+
# Enable verbose logging
89
- -v
9-
- --user=root,admin
10-
- --pass=THEPASSWORDYOUCREATED,12345
10+
- -U
11+
- /ncrack/users.txt
12+
- -P
13+
- /ncrack/passwords.txt
1114
- ssh://dummy-ssh
12-

scanners/ncrack/templates/ncrack-scan-type.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,12 @@ spec:
1919
command: ["ncrack", "-oX", "/home/securecodebox/ncrack-results.xml"]
2020
resources:
2121
{{- toYaml .Values.scannerJob.resources | nindent 16 }}
22+
volumeMounts:
23+
{{- if .Values.scannerJob.extraVolumeMounts }}
24+
{{- toYaml .Values.scannerJob.extraVolumeMounts | nindent 14 }}
25+
{{- end }}
26+
volumes:
27+
{{- if .Values.scannerJob.extraVolumes }}
28+
{{- toYaml .Values.scannerJob.extraVolumes | nindent 10 }}
29+
{{- end }}
30+

scanners/ncrack/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ parserImage:
55

66
scannerJob:
77
resources: {}
8-
8+
extraVolumes: []
9+
extraVolumeMounts: []

0 commit comments

Comments
 (0)