Skip to content

Commit aa3c901

Browse files
authored
Merge branch 'master' into longOracle
2 parents 333022f + 1e4187b commit aa3c901

File tree

494 files changed

+11310
-5175
lines changed

Some content is hidden

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

494 files changed

+11310
-5175
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ Utils/.settings/org.eclipse.core.resources.prefs
4242
Utils/.settings/org.eclipse.jdt.core.prefs
4343
.project
4444
test.sh
45+
.settings/
46+
.classpath

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.8</version>
7+
<version>3.3.1</version>
88
</parent>
99
<artifactId>Attacks</artifactId>
1010
<packaging>jar</packaging>

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/Main.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public static void main(String[] args) {
5959
jc.addCommand(Cve20162107CommandConfig.ATTACK_COMMAND, cve20162107);
6060
EarlyCCSCommandConfig earlyCCS = new EarlyCCSCommandConfig(generalDelegate);
6161
jc.addCommand(EarlyCCSCommandConfig.ATTACK_COMMAND, earlyCCS);
62+
EarlyFinishedCommandConfig earlyFin = new EarlyFinishedCommandConfig(generalDelegate);
63+
jc.addCommand(EarlyFinishedCommandConfig.ATTACK_COMMAND, earlyFin);
6264
PoodleCommandConfig poodle = new PoodleCommandConfig(generalDelegate);
6365
jc.addCommand(PoodleCommandConfig.ATTACK_COMMAND, poodle);
6466
SimpleMitmProxyCommandConfig simpleMitmProxy = new SimpleMitmProxyCommandConfig(generalDelegate);
@@ -100,6 +102,9 @@ public static void main(String[] args) {
100102
case EarlyCCSCommandConfig.ATTACK_COMMAND:
101103
attacker = new EarlyCCSAttacker(earlyCCS, earlyCCS.createConfig());
102104
break;
105+
case EarlyFinishedCommandConfig.ATTACK_COMMAND:
106+
attacker = new EarlyFinishedAttacker(earlyFin, earlyFin.createConfig());
107+
break;
103108
case PoodleCommandConfig.ATTACK_COMMAND:
104109
attacker = new PoodleAttacker(poodle, poodle.createConfig());
105110
break;

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/actions/EarlyCcsAction.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import de.rub.nds.modifiablevariable.bool.BooleanExplicitValueModification;
1212
import de.rub.nds.modifiablevariable.bool.ModifiableBoolean;
13+
import de.rub.nds.modifiablevariable.util.Modifiable;
1314
import de.rub.nds.tlsattacker.core.constants.AlgorithmResolver;
1415
import de.rub.nds.tlsattacker.core.constants.ProtocolMessageType;
1516
import de.rub.nds.tlsattacker.core.protocol.handler.ClientKeyExchangeHandler;
@@ -20,7 +21,6 @@
2021
import de.rub.nds.tlsattacker.core.workflow.action.TlsAction;
2122
import de.rub.nds.tlsattacker.core.workflow.factory.WorkflowConfigurationFactory;
2223
import java.io.IOException;
23-
import java.net.SocketException;
2424
import java.util.LinkedList;
2525
import java.util.List;
2626
import org.apache.logging.log4j.LogManager;
@@ -57,21 +57,16 @@ public EarlyCcsAction(Boolean targetsOpenssl1_0_0) {
5757
*
5858
* @param state
5959
* the State in which the action should be executed in
60-
* @throws IOException
61-
* If something goes wrong during the transmission of the
62-
* ClientKeyExchange message
6360
*/
6461
@Override
65-
public void execute(State state) throws IOException {
62+
public void execute(State state) {
6663
WorkflowConfigurationFactory factory = new WorkflowConfigurationFactory(state.getConfig());
6764
ClientKeyExchangeMessage message = factory.createClientKeyExchangeMessage(AlgorithmResolver
6865
.getKeyExchangeAlgorithm(state.getTlsContext().getChooser().getSelectedCipherSuite()));
69-
ModifiableBoolean modifiableBoolean = new ModifiableBoolean();
70-
modifiableBoolean.setModification(new BooleanExplicitValueModification(false));
7166
if (!targetOpenssl1_0_0) {
72-
message.setIncludeInDigest(modifiableBoolean);
67+
message.setIncludeInDigest(Modifiable.explicit(false));
7368
}
74-
message.setAdjustContext(modifiableBoolean);
69+
message.setAdjustContext(Modifiable.explicit(false));
7570
ClientKeyExchangeHandler handler = (ClientKeyExchangeHandler) message.getHandler(state.getTlsContext());
7671
byte[] protocolMessageBytes = handler.prepareMessage(message);
7772
if (targetOpenssl1_0_0) {
@@ -80,13 +75,15 @@ public void execute(State state) throws IOException {
8075
}
8176
handler.adjustTlsContextAfterSerialize(message);
8277
List<AbstractRecord> recordList = new LinkedList<>();
83-
recordList.add(new Record());
78+
Record r = new Record();
79+
r.setContentMessageType(ProtocolMessageType.HANDSHAKE);
80+
recordList.add(r);
8481
byte[] prepareRecords = state.getTlsContext().getRecordLayer()
8582
.prepareRecords(protocolMessageBytes, ProtocolMessageType.HANDSHAKE, recordList);
8683
try {
8784
state.getTlsContext().getTransportHandler().sendData(prepareRecords);
8885
executedAsPlanned = true;
89-
} catch (SocketException E) {
86+
} catch (IOException E) {
9087
LOGGER.debug("Could not write Data to stream", E);
9188
executedAsPlanned = false;
9289
}

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/bruteforce/IncrementingGuessProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public IncrementingGuessProvider() {
2929

3030
/**
3131
* Returns the last Guess incremented by 1.
32-
*
32+
*
3333
* @return
3434
*/
3535
@Override

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/config/BleichenbacherCommandConfig.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
import com.beust.jcommander.Parameter;
1212
import com.beust.jcommander.ParametersDelegate;
1313
import de.rub.nds.tlsattacker.attacks.config.delegate.AttackDelegate;
14+
import de.rub.nds.tlsattacker.attacks.pkcs1.BleichenbacherWorkflowType;
1415
import de.rub.nds.tlsattacker.core.config.Config;
1516
import de.rub.nds.tlsattacker.core.config.delegate.CiphersuiteDelegate;
1617
import de.rub.nds.tlsattacker.core.config.delegate.ClientDelegate;
1718
import de.rub.nds.tlsattacker.core.config.delegate.GeneralDelegate;
18-
import de.rub.nds.tlsattacker.core.config.delegate.HostnameExtensionDelegate;
1919
import de.rub.nds.tlsattacker.core.config.delegate.ProtocolVersionDelegate;
2020
import de.rub.nds.tlsattacker.core.config.delegate.StarttlsDelegate;
2121
import de.rub.nds.tlsattacker.core.constants.AlgorithmResolver;
@@ -37,8 +37,6 @@ public class BleichenbacherCommandConfig extends AttackConfig {
3737
@ParametersDelegate
3838
private ClientDelegate clientDelegate;
3939
@ParametersDelegate
40-
private HostnameExtensionDelegate hostnameExtensionDelegate;
41-
@ParametersDelegate
4240
private CiphersuiteDelegate ciphersuiteDelegate;
4341
@ParametersDelegate
4442
private ProtocolVersionDelegate protocolVersionDelegate;
@@ -57,20 +55,23 @@ public class BleichenbacherCommandConfig extends AttackConfig {
5755
@ParametersDelegate
5856
private StarttlsDelegate starttlsDelegate;
5957

58+
@Parameter(names = "-workflowType", description = "Which workflow traces should be tested with")
59+
private BleichenbacherWorkflowType workflowType = BleichenbacherWorkflowType.CKE_CCS_FIN;
60+
61+
;
62+
6063
/**
6164
*
6265
* @param delegate
6366
*/
6467
public BleichenbacherCommandConfig(GeneralDelegate delegate) {
6568
super(delegate);
6669
clientDelegate = new ClientDelegate();
67-
hostnameExtensionDelegate = new HostnameExtensionDelegate();
6870
ciphersuiteDelegate = new CiphersuiteDelegate();
6971
protocolVersionDelegate = new ProtocolVersionDelegate();
7072
attackDelegate = new AttackDelegate();
7173
starttlsDelegate = new StarttlsDelegate();
7274
addDelegate(clientDelegate);
73-
addDelegate(hostnameExtensionDelegate);
7475
addDelegate(ciphersuiteDelegate);
7576
addDelegate(protocolVersionDelegate);
7677
addDelegate(attackDelegate);
@@ -157,11 +158,17 @@ public enum Type {
157158
*
158159
*/
159160
FULL,
160-
161161
/**
162162
*
163163
*/
164164
FAST
165165
}
166166

167+
public BleichenbacherWorkflowType getWorkflowType() {
168+
return workflowType;
169+
}
170+
171+
public void setWorkflowType(BleichenbacherWorkflowType workflowType) {
172+
this.workflowType = workflowType;
173+
}
167174
}

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/config/Cve20162107CommandConfig.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import de.rub.nds.tlsattacker.core.config.delegate.CiphersuiteDelegate;
1515
import de.rub.nds.tlsattacker.core.config.delegate.ClientDelegate;
1616
import de.rub.nds.tlsattacker.core.config.delegate.GeneralDelegate;
17-
import de.rub.nds.tlsattacker.core.config.delegate.HostnameExtensionDelegate;
1817
import de.rub.nds.tlsattacker.core.config.delegate.StarttlsDelegate;
1918
import de.rub.nds.tlsattacker.core.constants.CipherSuite;
2019
import de.rub.nds.tlsattacker.core.constants.ProtocolVersion;
@@ -40,8 +39,6 @@ public class Cve20162107CommandConfig extends AttackConfig {
4039
@ParametersDelegate
4140
private CiphersuiteDelegate cipherSuiteDelegate;
4241
@ParametersDelegate
43-
private HostnameExtensionDelegate hostnameExtensionDelegate;
44-
@ParametersDelegate
4542
private StarttlsDelegate starttlsDelegate;
4643

4744
/**
@@ -56,11 +53,9 @@ public Cve20162107CommandConfig(GeneralDelegate delegate) {
5653
versions.add(ProtocolVersion.TLS12);
5754
clientDelegate = new ClientDelegate();
5855
cipherSuiteDelegate = new CiphersuiteDelegate();
59-
hostnameExtensionDelegate = new HostnameExtensionDelegate();
6056
starttlsDelegate = new StarttlsDelegate();
6157
addDelegate(clientDelegate);
6258
addDelegate(cipherSuiteDelegate);
63-
addDelegate(hostnameExtensionDelegate);
6459
addDelegate(starttlsDelegate);
6560

6661
}
@@ -102,7 +97,7 @@ public Config createConfig() {
10297
config.setAddSignatureAndHashAlgorithmsExtension(true);
10398
config.setQuickReceive(true);
10499
config.setStopActionsAfterFatal(true);
105-
config.setStopRecievingAfterFatal(true);
100+
config.setStopReceivingAfterFatal(true);
106101
config.setEarlyStop(true);
107102
if (cipherSuiteDelegate.getCipherSuites() == null) {
108103
List<CipherSuite> cipherSuites = new LinkedList<>();

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/config/DrownCommandConfig.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import de.rub.nds.tlsattacker.core.config.Config;
1313
import de.rub.nds.tlsattacker.core.config.delegate.ClientDelegate;
1414
import de.rub.nds.tlsattacker.core.config.delegate.GeneralDelegate;
15+
import de.rub.nds.tlsattacker.core.config.delegate.StarttlsDelegate;
1516
import de.rub.nds.tlsattacker.core.constants.ProtocolVersion;
1617
import de.rub.nds.tlsattacker.core.record.layer.RecordLayerType;
1718

@@ -28,14 +29,19 @@ public class DrownCommandConfig extends AttackConfig {
2829
@ParametersDelegate
2930
private ClientDelegate clientDelegate;
3031

32+
@ParametersDelegate
33+
private StarttlsDelegate starttlsDelegate;
34+
3135
/**
3236
*
3337
* @param delegate
3438
*/
3539
public DrownCommandConfig(GeneralDelegate delegate) {
3640
super(delegate);
3741
clientDelegate = new ClientDelegate();
42+
starttlsDelegate = new StarttlsDelegate();
3843
addDelegate(clientDelegate);
44+
addDelegate(starttlsDelegate);
3945
}
4046

4147
/**

Attacks/src/main/java/de/rub/nds/tlsattacker/attacks/config/EarlyCCSCommandConfig.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import de.rub.nds.tlsattacker.core.config.delegate.CiphersuiteDelegate;
1414
import de.rub.nds.tlsattacker.core.config.delegate.ClientDelegate;
1515
import de.rub.nds.tlsattacker.core.config.delegate.GeneralDelegate;
16-
import de.rub.nds.tlsattacker.core.config.delegate.HostnameExtensionDelegate;
1716
import de.rub.nds.tlsattacker.core.config.delegate.ProtocolVersionDelegate;
17+
import de.rub.nds.tlsattacker.core.config.delegate.StarttlsDelegate;
1818
import de.rub.nds.tlsattacker.core.constants.AlgorithmResolver;
1919
import de.rub.nds.tlsattacker.core.constants.CipherSuite;
2020
import de.rub.nds.tlsattacker.core.constants.KeyExchangeAlgorithm;
@@ -32,11 +32,11 @@ public class EarlyCCSCommandConfig extends AttackConfig {
3232
@ParametersDelegate
3333
private ClientDelegate clientDelegate;
3434
@ParametersDelegate
35-
private HostnameExtensionDelegate hostnameExtensionDelegate;
36-
@ParametersDelegate
3735
private CiphersuiteDelegate ciphersuiteDelegate;
3836
@ParametersDelegate
3937
private ProtocolVersionDelegate protocolVersionDelegate;
38+
@ParametersDelegate
39+
private StarttlsDelegate starttlsDelegate;
4040

4141
/**
4242
*
@@ -45,13 +45,13 @@ public class EarlyCCSCommandConfig extends AttackConfig {
4545
public EarlyCCSCommandConfig(GeneralDelegate delegate) {
4646
super(delegate);
4747
clientDelegate = new ClientDelegate();
48-
hostnameExtensionDelegate = new HostnameExtensionDelegate();
4948
ciphersuiteDelegate = new CiphersuiteDelegate();
5049
protocolVersionDelegate = new ProtocolVersionDelegate();
50+
starttlsDelegate = new StarttlsDelegate();
5151
addDelegate(clientDelegate);
52-
addDelegate(hostnameExtensionDelegate);
5352
addDelegate(ciphersuiteDelegate);
5453
addDelegate(protocolVersionDelegate);
54+
addDelegate(starttlsDelegate);
5555
}
5656

5757
/**
@@ -75,7 +75,7 @@ public Config createConfig() {
7575
config.setAddSignatureAndHashAlgorithmsExtension(true);
7676
config.setQuickReceive(true);
7777
config.setStopActionsAfterFatal(true);
78-
config.setStopRecievingAfterFatal(true);
78+
config.setStopReceivingAfterFatal(true);
7979
config.setEarlyStop(true);
8080
boolean containsEc = false;
8181
for (CipherSuite suite : config.getDefaultClientSupportedCiphersuites()) {

0 commit comments

Comments
 (0)