Skip to main content

D(HE)ater is an attacking tool heating the CPU by enforcing DHE KEX in case of TLS and SSH

Project description

D(HE)ater

D(HE)ater is an attacking tool based on CPU heating in that it forces the ephemeral variant of Diffie-Hellman key exchange (DHE) in given cryptography protocols (e.g. TLS, SSH). It is performed without calculating a cryptographically correct ephemeral key on the client side, but with a significant amount of calculation on the server side. Based on this, D(HE)ater can initiate a denial-of-service (DoS) attack.

Quick start

D(HE)ater can be installed directly via pip from PyPi

pip install dheater
dheat --protocol tls ecc256.badssl.com
dheat --protocol ssh ecc256.badssl.com

or can be used via Docker from Docker Hub

docker pull balasys/dheater
docker run --tty --rm balasys/dheater --protocol tls ecc256.badssl.com
docker run --tty --rm balasys/dheater --protocol ssh ecc256.badssl.com

You can increase load by string extra threads.

dheat --thread-num 4 --protocol tls ecc256.badssl.com
docker run --tty --rm balasys/dheater --thread-num 4 --protocol tls ecc256.badssl.com
docker run --tty --rm balasys/dheater --thread-num 4 --protocol ssh ecc256.badssl.com

Mitigation

Configuration

Diffie-Hellman (DHE) key exchange should be disabled if no other mitigation mechanism can be used and either elliptic-curve variant of Diffie-Hellman (ECDHE) or RSA key exchange is supported by the clients. The fact that RSA key exchange is not forward secret should be considered.

TLS

Apache
SSLCipherSuite ...:!kDHE
NGINX
ssl_ciphers ...:!kDHE;
Postfix
  1. Diffie-Hellman key exchange algorithms can be removed by setting the tls_medium_cipherlist configuration option.

    tls_medium_cipherlist ...:!kDHE

  2. Maximal number of new TLS sessions that a remote SMTP client is allowed to negotiate can be controlled by configuration option smtpd_client_new_tls_session_rate_limit configuration option.

    smtpd_client_new_tls_session_rate_limit 100

Others

See moz://a SSL Configuration Generator for configuration syntax.

SSH

OpenSSH
  1. Diffie-Hellman key exchange algorithms can be removed by setting the KexAlgorithms configuration option.

    KexAlgorithms -diffie-hellman-group1-sha1,diffie-hellman-group1-sha256,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group15-sha256,diffie-hellman-group15-sha512,diffie-hellman-group16-sha256,diffie-hellman-group16-sha512,diffie-hellman-group17-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha512

  2. Maximum number of concurrent unauthenticated connections can be controlled by configuration option MaxStartups configuration option.

    MaxStartups 10:30:100

Fail2Ban

TLS

Apache

There are no relevant filters.

  1. apache-ssl.conf in fail2ban directory should be copied to the filter.d directory under the fail2ban configuration directory

  2. the followings should be added to the jail.local file in the fail2ban configuration directory

    [apache-ssl]
    
    port    = https
    logpath = %(apache_error_log)s
    maxretry = 1
    
Postfix

There is a relevant filter, but it is applied only in ddos mode. The followings should be added to jail.local.

[postfix]
mode = ddos
Dovecot

There is a relevant filter, but it is applied only in ddos mode. The followings should be added to jail.local.

[dovecot]
mode = aggressive

or a specific filter can be used without changing the mode of dovecot.

  1. dovecot-ssl.conf in fail2ban directory should be copied to the filter.d directory under the fail2ban configuration directory

  2. the followings should be added to jail.local in tge fail2ban configuration directory

    [dovecot-ssl]
    
    port    = pop3,pop3s,imap,imaps,submission,465,sieve
    logpath = %(dovecot_log)s
    backend = %(dovecot_backend)s
    maxretry = 1
    

SSH

OpenSSH

There is a relevant filter, but it is applied only in ddos mode. The followings should be added to jail.local.

[sshd]
mode = ddos

License

The code is available under the terms of Apache License Version 2.0. A non-comprehensive, but straightforward description and also the full license text can be found at Choose an open source license website.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

DHEater-0.2.2.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

DHEater-0.2.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file DHEater-0.2.2.tar.gz.

File metadata

  • Download URL: DHEater-0.2.2.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.8

File hashes

Hashes for DHEater-0.2.2.tar.gz
Algorithm Hash digest
SHA256 a947e9f2e395bf39628f10c6ff7d7c59fed7087edf5f7d6ed4d4fe0087da7fbf
MD5 36214027654cfa3b9b10ac4506faa2ea
BLAKE2b-256 93411eb20808ab1555947acb8f71436a5c331bcea6a3c0e3e18bf6a954a2a776

See more details on using hashes here.

File details

Details for the file DHEater-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: DHEater-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.8

File hashes

Hashes for DHEater-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e82f17accd9e229509e3d613e6acdf79f4ab6bf09b62353b551a3d405fe6085b
MD5 8cec62c9477ea961cca06085d993b914
BLAKE2b-256 e3d697618277fd2ce8dc9052a30262918fd3b4c0f35def6c10ea2ec76146b470

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page