Skip to content
This repository was archived by the owner on Feb 26, 2021. It is now read-only.

Commit 6aa0282

Browse files
authored
Merge pull request #137 from secureCodeBox/ncrack-process
Add Ncrack Bruteforce Scan
2 parents c21e9fa + 1657fb9 commit 6aa0282

File tree

11 files changed

+600
-3
lines changed

11 files changed

+600
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COPY --from=builder ./scb-scanprocesses/arachni-process/target/arachni-process-1
2323
COPY --from=builder ./scb-scanprocesses/ssh-process/target/ssh-process-1.0-SNAPSHOT.jar /scb-engine/lib/
2424
COPY --from=builder ./scb-scanprocesses/amass-process/target/amass-process-1.0-SNAPSHOT.jar /scb-engine/lib/
2525
COPY --from=builder ./scb-scanprocesses/wordpress-process/target/wordpress-process-1.0-SNAPSHOT.jar /scb-engine/lib/
26-
26+
COPY --from=builder ./scb-scanprocesses/ncrack-process/target/ncrack-process-0.0.1-SNAPSHOT.jar /scb-engine/lib/
2727

2828
COPY --from=builder ./scb-persistenceproviders/elasticsearch-persistenceprovider/target/elasticsearch-persistenceprovider-0.0.1-SNAPSHOT-jar-with-dependencies.jar /scb-engine/lib/
2929
COPY --from=builder ./scb-persistenceproviders/s3-persistenceprovider/target/s3-persistenceprovider-0.0.1-SNAPSHOT-jar-with-dependencies.jar /scb-engine/lib/

scb-engine/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@
235235
<version>1.0-SNAPSHOT</version>
236236
<scope>runtime</scope>
237237
</dependency>
238+
<dependency>
239+
<groupId>io.securecodebox.scanprocesses</groupId>
240+
<artifactId>ncrack-process</artifactId>
241+
<version>0.0.1-SNAPSHOT</version>
242+
<scope>runtime</scope>
243+
</dependency>
238244
<dependency>
239245
<groupId>io.securecodebox.persistenceproviders</groupId>
240246
<artifactId>elasticsearch-persistenceprovider</artifactId>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
<!--
3+
~ /*
4+
~ * SecureCodeBox (SCB)
5+
~ * Copyright 2015-2018 iteratec GmbH
6+
~ *
7+
~ * Licensed under the Apache License, Version 2.0 (the "License");
8+
~ * you may not use this file except in compliance with the License.
9+
~ * You may obtain a copy of the License at
10+
~ *
11+
~ * http://www.apache.org/licenses/LICENSE-2.0
12+
~ *
13+
~ * Unless required by applicable law or agreed to in writing, software
14+
~ * distributed under the License is distributed on an "AS IS" BASIS,
15+
~ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
~ * See the License for the specific language governing permissions and
17+
~ * limitations under the License.
18+
~ */
19+
-->
20+
21+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<parent>
26+
<groupId>io.securecodebox.scanprocesses</groupId>
27+
<artifactId>default-process-collection</artifactId>
28+
<version>0.0.1-SNAPSHOT</version>
29+
</parent>
30+
31+
<groupId>io.securecodebox.scanprocesses</groupId>
32+
<artifactId>ncrack-process</artifactId>
33+
<version>0.0.1-SNAPSHOT</version>
34+
35+
36+
<dependencies>
37+
<dependency>
38+
<groupId>io.securecodebox.core</groupId>
39+
<artifactId>sdk</artifactId>
40+
<version>${project.parent.version}</version>
41+
</dependency>
42+
43+
<!-- Test Dependencies -->
44+
<dependency>
45+
<groupId>com.h2database</groupId>
46+
<artifactId>h2</artifactId>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.camunda.bpm.springboot</groupId>
50+
<artifactId>camunda-bpm-spring-boot-starter-test</artifactId>
51+
<scope>test</scope>
52+
</dependency>
53+
<dependency>
54+
<groupId>org.camunda.bpm.extension.mockito</groupId>
55+
<artifactId>camunda-bpm-mockito</artifactId>
56+
<scope>test</scope>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.camunda.bpm.extension</groupId>
60+
<artifactId>camunda-bpm-assert-scenario</artifactId>
61+
<scope>test</scope>
62+
</dependency>
63+
<dependency>
64+
<groupId>org.camunda.bpm.extension</groupId>
65+
<artifactId>camunda-bpm-process-test-coverage</artifactId>
66+
<scope>test</scope>
67+
</dependency>
68+
<dependency>
69+
<groupId>org.camunda.bpm.extension</groupId>
70+
<artifactId>camunda-bpm-assert</artifactId>
71+
</dependency>
72+
</dependencies>
73+
74+
</project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
*
3+
* SecureCodeBox (SCB)
4+
* Copyright 2015-2018 iteratec GmbH
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
* /
18+
*/
19+
20+
package io.securecodebox.scanprocess;
21+
22+
import org.springframework.context.annotation.ComponentScan;
23+
import org.springframework.context.annotation.Configuration;
24+
25+
/**
26+
* The secureCodeBox by default only scans for components in the package io.securecodebox.scanprocess.
27+
* <p>
28+
* This configuration ensures that your defined package io.securecodebox.scanprocesses also gets scanned, please don't move or remove this configuration.
29+
*
30+
* @author Rüdiger Heins - iteratec GmbH
31+
* @since 09.05.18
32+
*/
33+
@ComponentScan("io.securecodebox.scanprocesses")
34+
@Configuration
35+
public class ProcessInitConfiguration {
36+
}

scb-scanprocesses/ncrack-process/src/main/resources/META-INF/processes.xml

Whitespace-only changes.
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.5.0">
3+
<bpmn:process id="ncrack-process" name="Ncrack Bruteforce Scan" isExecutable="true" camunda:versionTag="1" camunda:historyTimeToLive="1">
4+
<bpmn:startEvent id="StartEvent_Configure" name="target configured" camunda:formKey="embedded:app:forms/ncrack/configure-target.html">
5+
<bpmn:extensionElements>
6+
<camunda:executionListener delegateExpression="${checkForAutomatedRunListener}" event="start" />
7+
<camunda:formData>
8+
<camunda:formField id="DEFAULT_CONTEXT" type="string" defaultValue="${propertyValueProvider.defaultContext}" />
9+
<camunda:formField id="DEFAULT_TARGET_NAME" type="string" defaultValue="${propertyValueProvider.defaultTargetName}" />
10+
<camunda:formField id="DEFAULT_TARGET_LOCATION" type="string" defaultValue="${propertyValueProvider.defaultTargetLocation}" />
11+
<camunda:formField id="DEFAULT_TARGET_URI" type="string" defaultValue="${propertyValueProvider.defaultTargetUri}" />
12+
</camunda:formData>
13+
</bpmn:extensionElements>
14+
<bpmn:outgoing>SequenceFlow_TargetConfigured</bpmn:outgoing>
15+
</bpmn:startEvent>
16+
<bpmn:sequenceFlow id="SequenceFlow_TargetConfigured" sourceRef="StartEvent_Configure" targetRef="ServiceTask_DoScan" />
17+
<bpmn:endEvent id="EndEvent_FinishedScan" name="Scan finished">
18+
<bpmn:incoming>SequenceFlow_SummaryCreated</bpmn:incoming>
19+
</bpmn:endEvent>
20+
<bpmn:sequenceFlow id="SequenceFlow_ScanFinished" name="finished&#10;&#10;" sourceRef="ServiceTask_DoScan" targetRef="ExclusiveGateway_AutomatedFinish" />
21+
<bpmn:sequenceFlow id="SequenceFlow_ResultReviewed" name="result reviewed" sourceRef="UserTask_ApproveResults" targetRef="ExclusiveGateway_ResultApproved" />
22+
<bpmn:userTask id="UserTask_ApproveResults" name="Review scan results" camunda:formKey="embedded:app:forms/ncrack/approve-results.html" camunda:candidateGroups="_securebox_admin, _securebox_productowner, _securebox_developer, approver">
23+
<bpmn:extensionElements>
24+
<camunda:formData />
25+
</bpmn:extensionElements>
26+
<bpmn:incoming>SequenceFlow_ManualFinish</bpmn:incoming>
27+
<bpmn:outgoing>SequenceFlow_ResultReviewed</bpmn:outgoing>
28+
</bpmn:userTask>
29+
<bpmn:exclusiveGateway id="ExclusiveGateway_ResultApproved" name="Is scan result approved?">
30+
<bpmn:incoming>SequenceFlow_ResultReviewed</bpmn:incoming>
31+
<bpmn:outgoing>SequenceFlow_ResultApproved</bpmn:outgoing>
32+
<bpmn:outgoing>SequenceFlow_ResultRejected</bpmn:outgoing>
33+
</bpmn:exclusiveGateway>
34+
<bpmn:sequenceFlow id="SequenceFlow_ResultApproved" name="result approved" sourceRef="ExclusiveGateway_ResultApproved" targetRef="ServiceTask_CreateSummary">
35+
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${PROCESS_RESULT_APPROVED == 'approved'}</bpmn:conditionExpression>
36+
</bpmn:sequenceFlow>
37+
<bpmn:exclusiveGateway id="ExclusiveGateway_AutomatedFinish" name="is automated run?">
38+
<bpmn:incoming>SequenceFlow_ScanFinished</bpmn:incoming>
39+
<bpmn:outgoing>SequenceFlow_ManualFinish</bpmn:outgoing>
40+
<bpmn:outgoing>SequenceFlow_AutomatedFinish</bpmn:outgoing>
41+
</bpmn:exclusiveGateway>
42+
<bpmn:sequenceFlow id="SequenceFlow_ManualFinish" name="manual finish&#10;&#10;" sourceRef="ExclusiveGateway_AutomatedFinish" targetRef="UserTask_ApproveResults">
43+
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${PROCESS_AUTOMATED == false}</bpmn:conditionExpression>
44+
</bpmn:sequenceFlow>
45+
<bpmn:sequenceFlow id="SequenceFlow_AutomatedFinish" name="automated finish" sourceRef="ExclusiveGateway_AutomatedFinish" targetRef="ServiceTask_CreateSummary">
46+
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${PROCESS_AUTOMATED == true}</bpmn:conditionExpression>
47+
</bpmn:sequenceFlow>
48+
<bpmn:serviceTask id="ServiceTask_DoScan" name="Run the scan" camunda:asyncBefore="true" camunda:type="external" camunda:topic="ncrack_brute_force_scan">
49+
<bpmn:extensionElements />
50+
<bpmn:incoming>SequenceFlow_TargetConfigured</bpmn:incoming>
51+
<bpmn:outgoing>SequenceFlow_ScanFinished</bpmn:outgoing>
52+
</bpmn:serviceTask>
53+
<bpmn:sequenceFlow id="SequenceFlow_SummaryCreated" name="summary created" sourceRef="ServiceTask_CreateSummary" targetRef="EndEvent_FinishedScan" />
54+
<bpmn:serviceTask id="ServiceTask_CreateSummary" name="Create Report Summary" camunda:asyncBefore="true" camunda:delegateExpression="${summaryGeneratorDelegate}">
55+
<bpmn:extensionElements />
56+
<bpmn:incoming>SequenceFlow_ResultApproved</bpmn:incoming>
57+
<bpmn:incoming>SequenceFlow_1i44eck</bpmn:incoming>
58+
<bpmn:incoming>SequenceFlow_AutomatedFinish</bpmn:incoming>
59+
<bpmn:outgoing>SequenceFlow_SummaryCreated</bpmn:outgoing>
60+
</bpmn:serviceTask>
61+
<bpmn:dataObjectReference id="DataObjectReference_0vhjx0n" name="PROCESS_FINDINGS" dataObjectRef="DataObject_0lpf2y8" />
62+
<bpmn:dataObject id="DataObject_0lpf2y8" />
63+
<bpmn:sequenceFlow id="SequenceFlow_ResultRejected" name="result rejected" sourceRef="ExclusiveGateway_ResultApproved" targetRef="DoesNothingTask">
64+
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${PROCESS_RESULT_APPROVED == 'disapproved'}</bpmn:conditionExpression>
65+
</bpmn:sequenceFlow>
66+
<bpmn:task id="DoesNothingTask" name="Does Nothing">
67+
<bpmn:incoming>SequenceFlow_ResultRejected</bpmn:incoming>
68+
<bpmn:outgoing>SequenceFlow_1i44eck</bpmn:outgoing>
69+
</bpmn:task>
70+
<bpmn:sequenceFlow id="SequenceFlow_1i44eck" sourceRef="DoesNothingTask" targetRef="ServiceTask_CreateSummary" />
71+
<bpmn:textAnnotation id="TextAnnotation_0lm3esn">
72+
<bpmn:text>results in a generic format</bpmn:text>
73+
</bpmn:textAnnotation>
74+
<bpmn:association id="Association_16qrr9w" sourceRef="DataObjectReference_0vhjx0n" targetRef="TextAnnotation_0lm3esn" />
75+
</bpmn:process>
76+
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
77+
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ncrack-process">
78+
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_Configure">
79+
<dc:Bounds x="178" y="370" width="36" height="36" />
80+
<bpmndi:BPMNLabel>
81+
<dc:Bounds x="154" y="416" width="83" height="14" />
82+
</bpmndi:BPMNLabel>
83+
</bpmndi:BPMNShape>
84+
<bpmndi:BPMNEdge id="SequenceFlow_093mevy_di" bpmnElement="SequenceFlow_TargetConfigured">
85+
<di:waypoint x="214" y="388" />
86+
<di:waypoint x="292" y="388" />
87+
<bpmndi:BPMNLabel>
88+
<dc:Bounds x="58" y="303" width="90" height="20" />
89+
</bpmndi:BPMNLabel>
90+
</bpmndi:BPMNEdge>
91+
<bpmndi:BPMNShape id="EndEvent_07weexy_di" bpmnElement="EndEvent_FinishedScan">
92+
<dc:Bounds x="1459" y="246" width="36" height="36" />
93+
<bpmndi:BPMNLabel>
94+
<dc:Bounds x="1520" y="257" width="66" height="14" />
95+
</bpmndi:BPMNLabel>
96+
</bpmndi:BPMNShape>
97+
<bpmndi:BPMNEdge id="SequenceFlow_0kjlgbs_di" bpmnElement="SequenceFlow_ScanFinished">
98+
<di:waypoint x="392" y="388" />
99+
<di:waypoint x="587" y="388" />
100+
<bpmndi:BPMNLabel>
101+
<dc:Bounds x="466" y="480" width="38" height="40" />
102+
</bpmndi:BPMNLabel>
103+
</bpmndi:BPMNEdge>
104+
<bpmndi:BPMNEdge id="SequenceFlow_00fmvcb_di" bpmnElement="SequenceFlow_ResultReviewed">
105+
<di:waypoint x="823" y="262" />
106+
<di:waypoint x="910" y="264" />
107+
<bpmndi:BPMNLabel>
108+
<dc:Bounds x="944" y="236" width="74" height="14" />
109+
</bpmndi:BPMNLabel>
110+
</bpmndi:BPMNEdge>
111+
<bpmndi:BPMNShape id="UserTask_0jv6ygb_di" bpmnElement="UserTask_ApproveResults">
112+
<dc:Bounds x="723" y="224" width="100" height="80" />
113+
</bpmndi:BPMNShape>
114+
<bpmndi:BPMNShape id="ExclusiveGateway_0ukn4uh_di" bpmnElement="ExclusiveGateway_ResultApproved" isMarkerVisible="true">
115+
<dc:Bounds x="910" y="239" width="50" height="50" />
116+
<bpmndi:BPMNLabel>
117+
<dc:Bounds x="902" y="299" width="66" height="27" />
118+
</bpmndi:BPMNLabel>
119+
</bpmndi:BPMNShape>
120+
<bpmndi:BPMNEdge id="SequenceFlow_0gjifhk_di" bpmnElement="SequenceFlow_ResultApproved">
121+
<di:waypoint x="960" y="264" />
122+
<di:waypoint x="1227" y="264" />
123+
<bpmndi:BPMNLabel>
124+
<dc:Bounds x="1149" y="210" width="76" height="14" />
125+
</bpmndi:BPMNLabel>
126+
</bpmndi:BPMNEdge>
127+
<bpmndi:BPMNShape id="ExclusiveGateway_1bzno3f_di" bpmnElement="ExclusiveGateway_AutomatedFinish" isMarkerVisible="true">
128+
<dc:Bounds x="587" y="363" width="50" height="50" />
129+
<bpmndi:BPMNLabel>
130+
<dc:Bounds x="648" y="382" width="88" height="14" />
131+
</bpmndi:BPMNLabel>
132+
</bpmndi:BPMNShape>
133+
<bpmndi:BPMNEdge id="SequenceFlow_17bwrf0_di" bpmnElement="SequenceFlow_ManualFinish">
134+
<di:waypoint x="612" y="363" />
135+
<di:waypoint x="612" y="264" />
136+
<di:waypoint x="723" y="264" />
137+
<bpmndi:BPMNLabel>
138+
<dc:Bounds x="529" y="306" width="65" height="40" />
139+
</bpmndi:BPMNLabel>
140+
</bpmndi:BPMNEdge>
141+
<bpmndi:BPMNEdge id="SequenceFlow_0s3limw_di" bpmnElement="SequenceFlow_AutomatedFinish">
142+
<di:waypoint x="612" y="413" />
143+
<di:waypoint x="612" y="516" />
144+
<di:waypoint x="1277" y="516" />
145+
<di:waypoint x="1277" y="304" />
146+
<bpmndi:BPMNLabel>
147+
<dc:Bounds x="953" y="563" width="81" height="14" />
148+
</bpmndi:BPMNLabel>
149+
</bpmndi:BPMNEdge>
150+
<bpmndi:BPMNShape id="ServiceTask_0pps66n_di" bpmnElement="ServiceTask_DoScan">
151+
<dc:Bounds x="292" y="348" width="100" height="80" />
152+
</bpmndi:BPMNShape>
153+
<bpmndi:BPMNEdge id="SequenceFlow_150f8k2_di" bpmnElement="SequenceFlow_SummaryCreated">
154+
<di:waypoint x="1327" y="264" />
155+
<di:waypoint x="1459" y="264" />
156+
<bpmndi:BPMNLabel>
157+
<dc:Bounds x="1337" y="269" width="85" height="14" />
158+
</bpmndi:BPMNLabel>
159+
</bpmndi:BPMNEdge>
160+
<bpmndi:BPMNShape id="ServiceTask_1foo790_di" bpmnElement="ServiceTask_CreateSummary">
161+
<dc:Bounds x="1227" y="224" width="100" height="80" />
162+
</bpmndi:BPMNShape>
163+
<bpmndi:BPMNShape id="DataObjectReference_0vhjx0n_di" bpmnElement="DataObjectReference_0vhjx0n">
164+
<dc:Bounds x="438" y="420" width="36" height="50" />
165+
<bpmndi:BPMNLabel>
166+
<dc:Bounds x="413" y="391" width="86" height="27" />
167+
</bpmndi:BPMNLabel>
168+
</bpmndi:BPMNShape>
169+
<bpmndi:BPMNShape id="TextAnnotation_0lm3esn_di" bpmnElement="TextAnnotation_0lm3esn">
170+
<dc:Bounds x="529" y="480" width="102" height="50" />
171+
</bpmndi:BPMNShape>
172+
<bpmndi:BPMNEdge id="Association_16qrr9w_di" bpmnElement="Association_16qrr9w">
173+
<di:waypoint x="474" y="454" />
174+
<di:waypoint x="529" y="480" />
175+
</bpmndi:BPMNEdge>
176+
<bpmndi:BPMNEdge id="SequenceFlow_1z0e6c0_di" bpmnElement="SequenceFlow_ResultRejected">
177+
<di:waypoint x="935" y="239" />
178+
<di:waypoint x="935" y="125" />
179+
<di:waypoint x="1145" y="125" />
180+
<bpmndi:BPMNLabel>
181+
<dc:Bounds x="1000" y="156" width="69" height="14" />
182+
</bpmndi:BPMNLabel>
183+
</bpmndi:BPMNEdge>
184+
<bpmndi:BPMNShape id="Task_1691u70_di" bpmnElement="DoesNothingTask">
185+
<dc:Bounds x="1145" y="85" width="100" height="80" />
186+
</bpmndi:BPMNShape>
187+
<bpmndi:BPMNEdge id="SequenceFlow_1i44eck_di" bpmnElement="SequenceFlow_1i44eck">
188+
<di:waypoint x="1245" y="125" />
189+
<di:waypoint x="1277" y="125" />
190+
<di:waypoint x="1277" y="224" />
191+
<bpmndi:BPMNLabel>
192+
<dc:Bounds x="1066" y="43.5" width="90" height="13" />
193+
</bpmndi:BPMNLabel>
194+
</bpmndi:BPMNEdge>
195+
</bpmndi:BPMNPlane>
196+
</bpmndi:BPMNDiagram>
197+
</bpmn:definitions>

0 commit comments

Comments
 (0)