Skip to content

Commit 8337d3a

Browse files
Merge pull request #391 from RUB-NDS/unmodifiableActions
Unmodifiable actions
2 parents 3ef01da + fe38477 commit 8337d3a

File tree

71 files changed

+565
-289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+565
-289
lines changed

Attacks/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>de.rub.nds.tlsattacker</groupId>
66
<artifactId>TLS-Attacker</artifactId>
7-
<version>2.1</version>
7+
<version>2.2</version>
88
</parent>
99
<artifactId>Attacks</artifactId>
1010
<packaging>jar</packaging>

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/impl/BleichenbacherAttacker.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,13 @@ private EqualityError isVulnerable(BleichenbacherWorkflowType bbWorkflowType, Li
8787
List<ResponseFingerprint> responseFingerprintList = new LinkedList<>();
8888
for (Pkcs1Vector pkcs1Vector : pkcs1Vectors) {
8989
State state = executeTlsFlow(bbWorkflowType, pkcs1Vector.getEncryptedValue());
90-
ResponseFingerprint fingerprint = ResponseExtractor.getFingerprint(state);
90+
if (state.getWorkflowTrace().allActionsExecuted()) {
91+
ResponseFingerprint fingerprint = ResponseExtractor.getFingerprint(state);
92+
responseFingerprintList.add(fingerprint);
93+
} else {
94+
LOGGER.warn("Could not execute Workflow. Something went wrong... Check the debug output for more information");
95+
}
9196
clearConnections(state);
92-
responseFingerprintList.add(fingerprint);
9397
}
9498
if (responseFingerprintList.isEmpty()) {
9599
LOGGER.warn("Could not extract Fingerprints");

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/impl/PaddingOracleAttacker.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,21 @@ public Boolean isVulnerable() {
179179
LOGGER.warn("TLS-Attacker failed execute a Handshake. Skipping to next record");
180180
continue;
181181
}
182-
ResponseFingerprint fingerprint = ResponseExtractor.getFingerprint(state);
183-
clearConnections(state);
184-
AbstractRecord lastRecord = state.getWorkflowTrace().getLastSendingAction().getSendRecords()
185-
.get(state.getWorkflowTrace().getLastSendingAction().getSendRecords().size() - 1);
186-
int length = ((Record) lastRecord).getLength().getValue();
187-
List<ResponseFingerprint> responseFingerprintList = responseMap.get(length);
188-
if (responseFingerprintList == null) {
189-
responseFingerprintList = new LinkedList<>();
190-
responseMap.put(length, responseFingerprintList);
182+
if (state.getWorkflowTrace().allActionsExecuted()) {
183+
ResponseFingerprint fingerprint = ResponseExtractor.getFingerprint(state);
184+
clearConnections(state);
185+
AbstractRecord lastRecord = state.getWorkflowTrace().getLastSendingAction().getSendRecords()
186+
.get(state.getWorkflowTrace().getLastSendingAction().getSendRecords().size() - 1);
187+
int length = ((Record) lastRecord).getLength().getValue();
188+
List<ResponseFingerprint> responseFingerprintList = responseMap.get(length);
189+
if (responseFingerprintList == null) {
190+
responseFingerprintList = new LinkedList<>();
191+
responseMap.put(length, responseFingerprintList);
192+
}
193+
responseFingerprintList.add(fingerprint);
194+
} else {
195+
LOGGER.warn("Could not execute Workflow. Something went wrong... Check the debug output for more information");
191196
}
192-
responseFingerprintList.add(fingerprint);
193197

194198
}
195199
LOGGER.log(LogLevel.CONSOLE_OUTPUT,

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/util/response/ResponseExtractor.java

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,27 +61,33 @@ private static SocketState extractSocketState(State state) {
6161

6262
private static List<Class<AbstractRecord>> extractRecordClasses(ReceivingAction action) {
6363
List<Class<AbstractRecord>> classList = new LinkedList<>();
64-
for (AbstractRecord record : action.getReceivedRecords()) {
65-
classList.add((Class<AbstractRecord>) record.getClass());
64+
if (action.getReceivedRecords() != null) {
65+
for (AbstractRecord record : action.getReceivedRecords()) {
66+
classList.add((Class<AbstractRecord>) record.getClass());
67+
}
6668
}
6769
return classList;
6870
}
6971

7072
private static List<Class<ProtocolMessage>> extractMessageClasses(ReceivingAction action) {
7173
List<Class<ProtocolMessage>> classList = new LinkedList<>();
72-
for (ProtocolMessage message : action.getReceivedMessages()) {
73-
classList.add((Class<ProtocolMessage>) message.getClass());
74+
if (action.getReceivedMessages() != null) {
75+
for (ProtocolMessage message : action.getReceivedMessages()) {
76+
classList.add((Class<ProtocolMessage>) message.getClass());
77+
}
7478
}
7579
return classList;
7680
}
7781

7882
private static boolean didReceiveEncryptedAlert(ReceivingAction action) {
79-
for (AbstractRecord abstractRecord : action.getReceivedRecords()) {
80-
if (abstractRecord instanceof Record) {
81-
Record record = (Record) abstractRecord;
82-
if (record.getContentMessageType() == ProtocolMessageType.ALERT) {
83-
if (record.getLength().getValue() > 6) {
84-
return true;
83+
if (action.getReceivedRecords() != null) {
84+
for (AbstractRecord abstractRecord : action.getReceivedRecords()) {
85+
if (abstractRecord instanceof Record) {
86+
Record record = (Record) abstractRecord;
87+
if (record.getContentMessageType() == ProtocolMessageType.ALERT) {
88+
if (record.getLength().getValue() > 6) {
89+
return true;
90+
}
8591
}
8692
}
8793
}

TLS-Client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>de.rub.nds.tlsattacker</groupId>
66
<artifactId>TLS-Attacker</artifactId>
7-
<version>2.1</version>
7+
<version>2.2</version>
88
</parent>
99
<name>TLS-Client</name>
1010
<artifactId>TLS-Client</artifactId>

TLS-Core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>de.rub.nds.tlsattacker</groupId>
66
<artifactId>TLS-Attacker</artifactId>
7-
<version>2.1</version>
7+
<version>2.2</version>
88
</parent>
99
<artifactId>TLS-Core</artifactId>
1010
<packaging>jar</packaging>

0 commit comments

Comments
 (0)