documentation/modules/auxiliary/scanner/ssl/bleichenbacher_oracle.md
Some TLS implementations handle errors processing RSA key exchanges and encryption (PKCS #1 v1.5 messages) in a broken way that leads an adaptive chosen-chiphertext attack. Attackers cannot recover a server's private key, but they can decrypt and sign messages with it. A strong oracle occurs when the TLS server does not strictly check message formatting and needs less than a million requests on average to decode a given ciphertext. A weak oracle server strictly checks message formatting and often requires many more requests to perform the attack.
(source: https://robotattack.org/#patches)
This module requires a working Python 3 install with the cryptography and gmpy2 packages installed (e.g. via pip3 install cryptography gmpy2).
Perhaps the easiest way to reproduce is to install an older version of Erlang on Linux (the stock erlang package on Ubuntu 17.10 and before is unpatched), and run the ssl_hello_world example from Cowboy (additionally requires git and make, be sure to use the 1.1.x branch for Erlang < 19).
msf4 > use auxiliary/scanner/ssl/robot
msf4 auxiliary(scanner/ssl/robot) > set RHOSTS 192.168.244.128
RHOSTS => 192.168.244.128
msf4 auxiliary(scanner/ssl/robot) > set RPORT 8443
RPORT => 8443
msf4 auxiliary(scanner/ssl/robot) > set VERBOSE true
VERBOSE => true
msf4 auxiliary(scanner/ssl/robot) > run
[*] Running for 192.168.244.128...
[*] 192.168.244.128:8443 - Scanning host for Bleichenbacher oracle
[*] 192.168.244.128:8443 - RSA N: 0xcdb5b51a3102cc751cfd6493a8b8801aa8c235c711e6c6954beca8cf648f461a68c9fd3fa81ad7e41634b739a0a33a138917c4e300a2543f7d09cf83ae9fc5338f6be04a59768708a2fa6b98e9affe0c24a23f79cda03a3ca367d4e7660e9da1c09b17d999b79296c65194f18c392471c9a051be048cbeea347abbb1a42d8af5
[*] 192.168.244.128:8443 - RSA e: 0x10001
[*] 192.168.244.128:8443 - Modulus size: 1024 bits, 128 bytes
[+] 192.168.244.128:8443 - Vulnerable: (strong) oracle found TLSv1.2 with standard message flow
[*] 192.168.244.128:8443 - Result of good request: TLS alert 10 of length 7
[*] 192.168.244.128:8443 - Result of bad request 1 (wrong first bytes): TLS alert 51 of length 7
[*] 192.168.244.128:8443 - Result of bad request 2 (wrong 0x00 position): TLS alert 10 of length 7
[*] 192.168.244.128:8443 - Result of bad request 3 (missing 0x00): TLS alert 51 of length 7
[*] 192.168.244.128:8443 - Result of bad request 4 (bad TLS version): TLS alert 10 of length 7
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf4 auxiliary(scanner/ssl/robot) >
The scanner takes the normal RHOSTS and RPORT options to specify the hosts to scan on the port on which to scan them. In addition, it takes two options for the TLS behaviour: cipher_group and timeout.
The cipher_group option:
Select the ciphers to use to negotiate: all TLS_RSA ciphers (all, the default), TLS_RSA_WITH_AES_128_CBC_SHA (cbc), or TLS-RSA-WITH-AES-128-GCM-SHA256 (gcm).
set cipher_group gcm
The timeout option:
Set the interval to wait before considering the TLS connection timed out. The default is 5 seconds.
set timeout 10