Skip to content

Commit

Permalink
Merge pull request #48 from tls-attacker/licenseUpdate
Browse files Browse the repository at this point in the history
License Update and Formatting
  • Loading branch information
mmaehren authored Feb 22, 2024
2 parents 1728009 + d8f4c4d commit ab03ab1
Show file tree
Hide file tree
Showing 179 changed files with 5,991 additions and 4,514 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
/**
/*
* TLS-Breaker - A tool collection of various attacks on TLS based on TLS-Attacker
*
* Copyright 2021-2022 Ruhr University Bochum, Paderborn University, Hackmanit GmbH
* Copyright 2021-2024 Ruhr University Bochum, Paderborn University, and Hackmanit GmbH
*
* Licensed under Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0.txt
*/

package de.rub.nds.tlsbreaker.bleichenbacher;

import java.io.IOException;

import com.beust.jcommander.JCommander;

import de.rub.nds.tlsattacker.core.config.delegate.GeneralDelegate;
import de.rub.nds.tlsbreaker.bleichenbacher.config.BleichenbacherCommandConfig;
import de.rub.nds.tlsbreaker.bleichenbacher.impl.BleichenbacherAttacker;
Expand All @@ -21,6 +17,7 @@
import de.rub.nds.tlsbreaker.breakercommons.attacker.Attacker;
import de.rub.nds.tlsbreaker.breakercommons.attacker.PcapFileHandler;
import de.rub.nds.tlsbreaker.breakercommons.config.delegate.GeneralAttackDelegate;
import java.io.IOException;

public class Main {
public static void main(String[] args) throws IOException {
Expand All @@ -34,8 +31,8 @@ public static void main(String[] args) throws IOException {

PcapFileHandler pcapFileHandler = new BleichenbacherPcapFileHandler(attackConfig);
if (!CommonMain.optionallyHandlePcap(attackConfig, pcapFileHandler)) {
Attacker<?> attacker = new BleichenbacherAttacker(attackConfig,
attackConfig.createConfig());
Attacker<?> attacker =
new BleichenbacherAttacker(attackConfig, attackConfig.createConfig());
attacker.run();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/**
/*
* TLS-Breaker - A tool collection of various attacks on TLS based on TLS-Attacker
*
* Copyright 2021-2022 Ruhr University Bochum, Paderborn University, Hackmanit GmbH
* Copyright 2021-2024 Ruhr University Bochum, Paderborn University, and Hackmanit GmbH
*
* Licensed under Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0.txt
*/

package de.rub.nds.tlsbreaker.bleichenbacher.config;

import com.beust.jcommander.Parameter;
Expand All @@ -24,62 +23,60 @@
import de.rub.nds.tlsbreaker.breakercommons.config.PcapAttackConfig;
import de.rub.nds.tlsbreaker.breakercommons.config.delegate.AttackDelegate;
import de.rub.nds.tlsbreaker.breakercommons.config.delegate.ClientDelegate;

import java.util.LinkedList;
import java.util.List;

/**
*
*/
/** */
public class BleichenbacherCommandConfig extends AttackConfig implements PcapAttackConfig {

/**
*
*/
@ParametersDelegate
private ClientDelegate clientDelegate;
/** */
@ParametersDelegate private ClientDelegate clientDelegate;

@ParametersDelegate
private CipherSuiteDelegate ciphersuiteDelegate;
@ParametersDelegate private CipherSuiteDelegate ciphersuiteDelegate;

@ParametersDelegate
private ProtocolVersionDelegate protocolVersionDelegate;
@ParametersDelegate private ProtocolVersionDelegate protocolVersionDelegate;

@ParametersDelegate
private AttackDelegate attackDelegate;
@ParametersDelegate private AttackDelegate attackDelegate;

@Parameter(names = "-encrypted_premaster_secret",
description = "Encrypted premaster secret from the RSA client "
+ "key exchange message. You can retrieve this message from the Wireshark traffic. Find the client key "
+ "exchange message, right click on the \"EncryptedPremaster\" value and copy this value as a Hex Stream.")
@Parameter(
names = "-encrypted_premaster_secret",
description =
"Encrypted premaster secret from the RSA client "
+ "key exchange message. You can retrieve this message from the Wireshark traffic. Find the client key "
+ "exchange message, right click on the \"EncryptedPremaster\" value and copy this value as a Hex Stream.")
private String encryptedPremasterSecret;

@Parameter(names = "-type", description = "Type of the Bleichenbacher test. FAST contains only basic server test "
+ "queries. FULL results in a comprehensive server evaluation.")
@Parameter(
names = "-type",
description =
"Type of the Bleichenbacher test. FAST contains only basic server test "
+ "queries. FULL results in a comprehensive server evaluation.")
private Type type = Type.FAST;

@Parameter(names = { "-msgPkcsConform", "-msg_pkcs_conform" },
description = "Used by the real Bleichenbacher attack. Indicates whether the "
+ "original message that we are going to decrypt is PKCS#1 conform or not (more precisely, whether it starts "
+ "with 0x00 0x02).",
arity = 1)
@Parameter(
names = {"-msgPkcsConform", "-msg_pkcs_conform"},
description =
"Used by the real Bleichenbacher attack. Indicates whether the "
+ "original message that we are going to decrypt is PKCS#1 conform or not (more precisely, whether it starts "
+ "with 0x00 0x02).",
arity = 1)
private boolean msgPkcsConform = true;

@ParametersDelegate
private StarttlsDelegate starttlsDelegate;
@ParametersDelegate private StarttlsDelegate starttlsDelegate;

@Parameter(names = { "-workflowType", "-workflow_type" },
description = "Which workflow traces should be tested with")
@Parameter(
names = {"-workflowType", "-workflow_type"},
description = "Which workflow traces should be tested with")
private BleichenbacherWorkflowType workflowType = BleichenbacherWorkflowType.CKE_CCS_FIN;

@Parameter(names = "-pcap",
description = "Location of the pcap file that will be used for the Bleichenbacher attack."
+ "The server to be attacked and the pre-master secret will be extracted automatically from the given pcap file.")
@Parameter(
names = "-pcap",
description =
"Location of the pcap file that will be used for the Bleichenbacher attack."
+ "The server to be attacked and the pre-master secret will be extracted automatically from the given pcap file.")
private String pcapFileLocation;

/**
* How many rescans should be done
*/
/** How many rescans should be done */
private int numberOfIterations = 3;

/**
Expand Down Expand Up @@ -123,7 +120,8 @@ public Config createConfig() {
List<CipherSuite> cipherSuites = new LinkedList<>();
for (CipherSuite suite : CipherSuite.getImplemented()) {
if (AlgorithmResolver.getKeyExchangeAlgorithm(suite) == KeyExchangeAlgorithm.RSA
|| AlgorithmResolver.getKeyExchangeAlgorithm(suite) == KeyExchangeAlgorithm.PSK_RSA) {
|| AlgorithmResolver.getKeyExchangeAlgorithm(suite)
== KeyExchangeAlgorithm.PSK_RSA) {
cipherSuites.add(suite);
}
}
Expand Down Expand Up @@ -202,18 +200,12 @@ public ClientDelegate getClientDelegate() {
return clientDelegate;
}

/**
*
*/
/** */
public enum Type {

/**
*
*/
/** */
FULL,
/**
*
*/
/** */
FAST
}
}
Loading

0 comments on commit ab03ab1

Please sign in to comment.