Skip to content

Commit 2d191cf

Browse files
committed
Added ncrack test
1 parent 81612c9 commit 2d191cf

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,20 @@ services:
155155
- ENGINE_BASIC_AUTH_USER=${ENGINE_SCANNERSERVICES_USER}
156156
- ENGINE_BASIC_AUTH_PASSWORD=${ENGINE_SCANNERSERVICES_PASSWORD}
157157

158+
scanner-infrastructure-ncrack:
159+
image: securecodebox/ncrack:${DEFAULT_TAG}
160+
depends_on:
161+
engine:
162+
condition: service_healthy
163+
networks:
164+
- scanner
165+
labels:
166+
container_group: scanner
167+
environment:
168+
- ENGINE_ADDRESS=http://engine:8080
169+
- ENGINE_BASIC_AUTH_USER=${ENGINE_SCANNERSERVICES_USER}
170+
- ENGINE_BASIC_AUTH_PASSWORD=${ENGINE_SCANNERSERVICES_PASSWORD}
171+
158172
persistence-elasticsearch:
159173
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.1
160174
ports:

test/ncrack.test.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const { startSecurityTest, Time } = require('./sdk');
2+
3+
test(
4+
'bruteforce scan juiceshop',
5+
async () => {
6+
const securityTest = await startSecurityTest({
7+
context: 'BruteforceScanJuiceShop',
8+
metaData: {},
9+
name: 'ncrack',
10+
target: {
11+
name: 'JuiceShop Container',
12+
location: 'juice-shop',
13+
attributes: {
14+
NCRACK_PARAMETER: '--user admin --pass 1234',
15+
},
16+
},
17+
});
18+
19+
const { report } = securityTest;
20+
21+
const [finding1, ...otherFindings] = report.findings.map(
22+
({ description, category, name, osi_layer, severity }) => ({
23+
description,
24+
category,
25+
name,
26+
osi_layer,
27+
severity,
28+
})
29+
);
30+
31+
expect(finding1).toEqual([]);
32+
},
33+
1 * Time.Minute
34+
);

0 commit comments

Comments
 (0)