Skip to content

Commit

Permalink
Merge pull request #391 from RUB-NDS/unmodifiableActions
Browse files Browse the repository at this point in the history
Unmodifiable actions
  • Loading branch information
jurajsomorovsky authored Dec 12, 2017
2 parents 3ef01da + fe38477 commit 8337d3a
Show file tree
Hide file tree
Showing 71 changed files with 565 additions and 289 deletions.
2 changes: 1 addition & 1 deletion Attacks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>de.rub.nds.tlsattacker</groupId>
<artifactId>TLS-Attacker</artifactId>
<version>2.1</version>
<version>2.2</version>
</parent>
<artifactId>Attacks</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ private EqualityError isVulnerable(BleichenbacherWorkflowType bbWorkflowType, Li
List<ResponseFingerprint> responseFingerprintList = new LinkedList<>();
for (Pkcs1Vector pkcs1Vector : pkcs1Vectors) {
State state = executeTlsFlow(bbWorkflowType, pkcs1Vector.getEncryptedValue());
ResponseFingerprint fingerprint = ResponseExtractor.getFingerprint(state);
if (state.getWorkflowTrace().allActionsExecuted()) {
ResponseFingerprint fingerprint = ResponseExtractor.getFingerprint(state);
responseFingerprintList.add(fingerprint);
} else {
LOGGER.warn("Could not execute Workflow. Something went wrong... Check the debug output for more information");
}
clearConnections(state);
responseFingerprintList.add(fingerprint);
}
if (responseFingerprintList.isEmpty()) {
LOGGER.warn("Could not extract Fingerprints");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,21 @@ public Boolean isVulnerable() {
LOGGER.warn("TLS-Attacker failed execute a Handshake. Skipping to next record");
continue;
}
ResponseFingerprint fingerprint = ResponseExtractor.getFingerprint(state);
clearConnections(state);
AbstractRecord lastRecord = state.getWorkflowTrace().getLastSendingAction().getSendRecords()
.get(state.getWorkflowTrace().getLastSendingAction().getSendRecords().size() - 1);
int length = ((Record) lastRecord).getLength().getValue();
List<ResponseFingerprint> responseFingerprintList = responseMap.get(length);
if (responseFingerprintList == null) {
responseFingerprintList = new LinkedList<>();
responseMap.put(length, responseFingerprintList);
if (state.getWorkflowTrace().allActionsExecuted()) {
ResponseFingerprint fingerprint = ResponseExtractor.getFingerprint(state);
clearConnections(state);
AbstractRecord lastRecord = state.getWorkflowTrace().getLastSendingAction().getSendRecords()
.get(state.getWorkflowTrace().getLastSendingAction().getSendRecords().size() - 1);
int length = ((Record) lastRecord).getLength().getValue();
List<ResponseFingerprint> responseFingerprintList = responseMap.get(length);
if (responseFingerprintList == null) {
responseFingerprintList = new LinkedList<>();
responseMap.put(length, responseFingerprintList);
}
responseFingerprintList.add(fingerprint);
} else {
LOGGER.warn("Could not execute Workflow. Something went wrong... Check the debug output for more information");
}
responseFingerprintList.add(fingerprint);

}
LOGGER.log(LogLevel.CONSOLE_OUTPUT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,33 @@ private static SocketState extractSocketState(State state) {

private static List<Class<AbstractRecord>> extractRecordClasses(ReceivingAction action) {
List<Class<AbstractRecord>> classList = new LinkedList<>();
for (AbstractRecord record : action.getReceivedRecords()) {
classList.add((Class<AbstractRecord>) record.getClass());
if (action.getReceivedRecords() != null) {
for (AbstractRecord record : action.getReceivedRecords()) {
classList.add((Class<AbstractRecord>) record.getClass());
}
}
return classList;
}

private static List<Class<ProtocolMessage>> extractMessageClasses(ReceivingAction action) {
List<Class<ProtocolMessage>> classList = new LinkedList<>();
for (ProtocolMessage message : action.getReceivedMessages()) {
classList.add((Class<ProtocolMessage>) message.getClass());
if (action.getReceivedMessages() != null) {
for (ProtocolMessage message : action.getReceivedMessages()) {
classList.add((Class<ProtocolMessage>) message.getClass());
}
}
return classList;
}

private static boolean didReceiveEncryptedAlert(ReceivingAction action) {
for (AbstractRecord abstractRecord : action.getReceivedRecords()) {
if (abstractRecord instanceof Record) {
Record record = (Record) abstractRecord;
if (record.getContentMessageType() == ProtocolMessageType.ALERT) {
if (record.getLength().getValue() > 6) {
return true;
if (action.getReceivedRecords() != null) {
for (AbstractRecord abstractRecord : action.getReceivedRecords()) {
if (abstractRecord instanceof Record) {
Record record = (Record) abstractRecord;
if (record.getContentMessageType() == ProtocolMessageType.ALERT) {
if (record.getLength().getValue() > 6) {
return true;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion TLS-Client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>de.rub.nds.tlsattacker</groupId>
<artifactId>TLS-Attacker</artifactId>
<version>2.1</version>
<version>2.2</version>
</parent>
<name>TLS-Client</name>
<artifactId>TLS-Client</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion TLS-Core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>de.rub.nds.tlsattacker</groupId>
<artifactId>TLS-Attacker</artifactId>
<version>2.1</version>
<version>2.2</version>
</parent>
<artifactId>TLS-Core</artifactId>
<packaging>jar</packaging>
Expand Down
Loading

0 comments on commit 8337d3a

Please sign in to comment.