SSLYZE comprueba la configuración de tu SSL
Hola!
Muy buenas a todos/as!
Cada vez mas es mas importante la seguridad en nuestra página web de SSL, no solo por presencia y seguridad sino por aportar un grado extra a los clientes y que sepan qu están seguros sus datos viajando por tu página web.
Con esta herramienta podremos comprobar la seguridad de nuestra configuración SSL.
La herramienta está disponible en Code Google aquí.
- Comprobando la renegociación SSL:
El que un servidor permite renegociar la sesión es un problema muy grave si no se controla, el que no hayan medidas preventivas como aceleradores SSL o que sólo se pueda renegociar una serie de veces puede acarrear que el servidor sufra una denegación de servicio.
Podemos comprobar si el servidor soporta renegociación:
REGISTERING AVAILABLE PLUGINS —————————–
PluginOpenSSLCipherSuites – OK PluginSessionResumption – OK PluginCertInfo – OK PluginEmpty – OK PluginSessionRenegotiation – OK
CHECKING HOST(S) AVAILABILITY —————————–
example.com:443 => example.com:443
SCAN RESULTS FOR example.com:443 – example.com:443 ——————————————————–
* Session Renegotiation :
Client-initiated Renegotiations: Rejected
Secure Renegotiation: Supported
SCAN COMPLETED IN 0.61 S ————————
Podemos ver en este caso que el servidor soporta renegociación, es susceptible a sufrir un ataque de denegación de servicio
Otra de las comprobaciones que podemos hacer es hacer un resumen de los diferentes “niveles de ssl”
REGISTERING AVAILABLE PLUGINS —————————–
PluginOpenSSLCipherSuites – OK PluginSessionResumption – OK PluginCertInfo – OK PluginEmpty – OK PluginSessionRenegotiation – OK
CHECKING HOST(S) AVAILABILITY —————————–
example.com:443 => example.com:443
SCAN RESULTS FOR example.com:443 – example.com:443 ——————————————————–
* Session Resumption : Using TLSv1 Session IDs: Supported Using TLSv1 Session Tickets: Supported Using SSLv3 Session IDs: Error => SSL Handshake failed: Failed – SSL Bad decompression
SCAN COMPLETED IN 0.65 S ————————
Podemos ver que soporta renegociación con diferentes ssl.
En muchas ocasiones el servidor se encuentra detrás de un balanceador de carga que se encarga de balancear las peticiones web que hacen los usuarios. Con sslyze podemos detectar si el servidor puede encontrarse detrás de un balanceador:
REGISTERING AVAILABLE PLUGINS —————————–
PluginOpenSSLCipherSuites – OK PluginSessionResumption – OK PluginCertInfo – OK PluginEmpty – OK PluginSessionRenegotiation – OK
CHECKING HOST(S) AVAILABILITY —————————–
example.com:443 => example.com:443
SCAN RESULTS FOR example.com:443 – example.com:443 ——————————————————–
* Session Resumption Rate : 0 resumptions successful out of 100 attempts. Errors were encountered.
SCAN COMPLETED IN 5.10 S ————————
En este caso el servidor NO se encuenta detrás de un balanceador
- Obtener información aerca del certificado
Otra información útil que podemos obtener es información sobre el certificado, información básica
REGISTERING AVAILABLE PLUGINS —————————–
PluginOpenSSLCipherSuites – OK PluginSessionResumption – OK PluginCertInfo – OK PluginEmpty – OK PluginSessionRenegotiation – OK
CHECKING HOST(S) AVAILABILITY —————————–
example.com:443 => example.com:443
SCAN RESULTS FOR example.com:443 – example.com:443 ——————————————————–
* Certificate : Validation w/ Mozilla’s CA Store: Certificate is NOT Trusted Subject CN: plesk Issuer: /C=US/ST=Virginia/L=Herndon/O=Parallels/OU=Plesk/CN=plesk/emailAddress=info@plesk.com Serial Number: 4D75F9B5 Not before: Mar 8 09:41:09 2011 GMT Not after: Mar 7 09:41:09 2012 GMT Keysize: 2048 bits Signature Algorithm: sha1WithRSAEncryption Version: 1 (0×0) SHA1 Fingerprint: A61526A0E8FD6D1A1A028573376EA9BB7C9578C9 Number of Extensions: 0
SCAN COMPLETED IN 0.67 S ————————
Aquí hay información básica sobre el certificado.
- Información completa sobre un certificado en concreto
REGISTERING AVAILABLE PLUGINS —————————–
PluginOpenSSLCipherSuites – OK PluginSessionResumption – OK PluginCertInfo – OK PluginEmpty – OK PluginSessionRenegotiation – OK
CHECKING HOST(S) AVAILABILITY —————————–
example.com:443 => example.com:443
SCAN RESULTS FOR example.com:443 – example.com:443 ——————————————————–
* Certificate : Validation w/ Mozilla’s CA Store: Certificate is NOT Trusted Data: Version: 1 (0×0) Serial Number: 1299577269 (0x4d75f9b5) Signature Algorithm: sha1WithRSAEncryption Issuer: C=US, ST=Virginia, L=Herndon, O=Parallels, OU=Plesk, CN=plesk/emailAddress=info@plesk.com Validity Not Before: Mar 8 09:41:09 2011 GMT Not After : Mar 7 09:41:09 2012 GMT Subject: C=US, ST=Virginia, L=Herndon, O=Parallels, OU=Plesk, CN=plesk/emailAddress=info@plesk.com Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (2048 bit) Modulus (2048 bit): 00:ae:f7:6a:2f:de:db:17:bd:2b:4e:57:f5:d7:96: fb:50:b9:04:54:8b:1b:5e:61:fe:77:24:99:12:8f: cc:1d:49:91:e4:d3:a0:4b:46:0e:b4:80:e4:a7:dd: ed:13:1e:90:21:2b:cc:72:54:a8:f7:b3:e1:12:62: a7:e5:52:24:66:58:07:25:ab:a0:7d:1a:cc:6c:f5: dd:66:4c:aa:07:32:8b:6b:d4:51:eb:f7:93:2f:0a: e8:36:f3:8f:7c:b0:68:c7:21:46:65:87:4e:48:92: dd:31:c9:d2:81:5f:b2:c1:32:f4:1f:bf:4c:23:65: ad:5d:ff:d9:72:ea:a9:90:e7:14:ea:9a:39:b9:43: 21:cb:ea:37:74:dd:11:e0:c9:35:e2:50:c2:10:6c: 0d:76:58:b9:74:73:fb:c9:7f:e9:7d:5d:00:05:92: 1f:3a:8b:fd:ba:7d:e5:c0:1f:16:01:05:9d:88:a4: f1:b4:36:5b:cf:67:d3:86:ee:b7:d9:b5:6c:31:c0: a9:b3:4a:ba:eb:2b:d7:d4:54:bf:dc:87:2c:66:2c: 0b:85:ac:6d:4b:7c:e7:ee:04:ca:6c:1c:a1:e9:74: c7:b7:fa:38:44:bb:e0:f1:e8:4b:b6:e6:c1:e7:1e: 9d:06:92:88:55:c2:b0:bf:5b:99:34:db:cc:1b:bf: cb:35 Exponent: 65537 (0×10001) Signature Algorithm: sha1WithRSAEncryption 8b:f0:45:e6:93:ba:8f:75:51:4c:14:68:47:f6:d1:0c:3b:da: d9:c9:15:b2:c8:b2:b8:8f:09:35:69:c8:d4:72:cc:3d:6d:e3: ae:72:90:81:9d:39:8a:62:81:13:42:0a:3a:2f:8c:a6:d4:fb: 40:f1:44:8c:a4:ea:da:c4:a4:c5:ea:96:e2:4f:f8:7d:90:a3: fd:77:06:e7:92:e1:c3:ab:af:ff:48:b3:69:8f:1f:94:79:11: b1:98:ac:54:ea:94:e7:e8:7b:5f:6c:fc:d3:8e:69:84:4d:83: 31:ed:4f:b5:b2:0e:60:e9:00:56:29:f5:13:b1:ac:97:84:5c: 55:4c:e3:8b:2f:54:ad:94:39:05:1d:55:27:88:c8:65:be:91: 48:b6:df:09:d0:00:db:b1:cf:c5:8c:c6:23:11:1a:a1:7a:b8: e0:19:f1:96:b8:75:c3:80:60:93:8e:cd:57:18:fb:14:9d:11: 15:82:69:4d:08:5a:5d:14:18:28:a2:65:dc:8f:69:31:b0:11: f5:85:18:58:ee:ef:4c:ea:fa:0d:81:a4:e1:9f:bf:da:9d:0f: 0c:f6:41:ce:0b:41:79:2f:ac:a3:1f:88:87:fa:d0:40:10:26: 69:51:86:16:24:e2:ac:a8:ed:12:08:53:85:71:10:4d:19:d6: a4:25:48:e5
SCAN COMPLETED IN 0.68 S ————————
Aparte de la información básica podemos obtener toda la información sobre el certificado
- Obtener información sobre el key size del certificado
REGISTERING AVAILABLE PLUGINS —————————–
PluginOpenSSLCipherSuites – OK PluginSessionResumption – OK PluginCertInfo – OK PluginEmpty – OK PluginSessionRenegotiation – OK
CHECKING HOST(S) AVAILABILITY —————————–
example.com:443 => example.com:443
SCAN RESULTS FOR example.com:443 – example.com:443 ——————————————————–
* Certificate : Validation w/ Mozilla’s CA Store: Certificate is NOT Trusted Keysize: 2048 bits
SCAN COMPLETED IN 0.66 S ————————
Si solo queremos tener información acerca del tamaño del certificado podemos hacer esta consulta
- Obtener el CN del certificado
Si por el contrario sólo queremos obtenert el CN del certificado podemos hacer la consulta que nos devolverá:
REGISTERING AVAILABLE PLUGINS —————————–
PluginOpenSSLCipherSuites – OK PluginSessionResumption – OK PluginCertInfo – OK PluginEmpty – OK PluginSessionRenegotiation – OK
CHECKING HOST(S) AVAILABILITY —————————–
example.com:443 => example.com:443
SCAN RESULTS FOR example.com:443 – example.com:443 ——————————————————–
* Certificate : Validation w/ Mozilla’s CA Store: Certificate is NOT Trusted Subject CN: plesk
SCAN COMPLETED IN 0.91 S ————————
- Permitir negociar con un cifrado mas bajo
Un atacante podría hacer fuerza bruta con los civfrados mas bajo del servidor. Solo se debe permitir negociar con el cifrado mas fuerte
REGISTERING AVAILABLE PLUGINS —————————–
PluginOpenSSLCipherSuites – OK PluginSessionResumption – OK PluginCertInfo – OK PluginEmpty – OK PluginSessionRenegotiation – OK
CHECKING HOST(S) AVAILABILITY —————————–
example.com:443 => example.com:443
SCAN RESULTS FOR example.com:443 – example.com:443 ——————————————————–
* TLSV1 Cipher Suites : Cipher Suite: SSL Handshake: HTTP GET: DHE-RSA-AES256-SHA 256bits Preferred 200 OK RC4-SHA 128bits Accepted 200 OK RC4-MD5 128bits Accepted 200 OK EXP-RC4-MD5 40bits Accepted 200 OK EXP-RC2-CBC-MD5 40bits Accepted 200 OK EXP-EDH-RSA-DES-CBC-SHA 40bits Accepted 200 OK EXP-DES-CBC-SHA 40bits Accepted 200 OK EDH-RSA-DES-CBC3-SHA 168bits Accepted 200 OK EDH-RSA-DES-CBC-SHA 56bits Accepted 200 OK DHE-RSA-AES128-SHA 128bits Accepted 200 OK DES-CBC3-SHA 168bits Accepted 200 OK DES-CBC-SHA 56bits Accepted 200 OK AES256-SHA 256bits Accepted 200 OK AES128-SHA 128bits Accepted 200 OK NULL-SHA Rejected – SSL Alert N/A NULL-MD5 Rejected – SSL Alert N/A EXP-EDH-DSS-DES-CBC-SHA Rejected – SSL Alert N/A EXP-ADH-RC4-MD5 Rejected – SSL Alert N/A EXP-ADH-DES-CBC-SHA Rejected – SSL Alert N/A EDH-DSS-DES-CBC3-SHA Rejected – SSL Alert N/A EDH-DSS-DES-CBC-SHA Rejected – SSL Alert N/A DHE-DSS-AES256-SHA Rejected – SSL Alert N/A DHE-DSS-AES128-SHA Rejected – SSL Alert N/A ADH-RC4-MD5 Rejected – SSL Alert N/A ADH-DES-CBC3-SHA Rejected – SSL Alert N/A ADH-DES-CBC-SHA Rejected – SSL Alert N/A ADH-AES256-SHA Rejected – SSL Alert N/A ADH-AES128-SHA Rejected – SSL Alert N/A
* SSLV3 Cipher Suites : Cipher Suite: SSL Handshake: HTTP GET: DHE-RSA-AES256-SHA 256bits Preferred 200 OK RC4-SHA 128bits Accepted 200 OK RC4-MD5 128bits Accepted 200 OK EXP-RC4-MD5 40bits Accepted 200 OK EXP-RC2-CBC-MD5 40bits Accepted 200 OK EXP-EDH-RSA-DES-CBC-SHA 40bits Accepted 200 OK EXP-DES-CBC-SHA 40bits Accepted 200 OK EDH-RSA-DES-CBC3-SHA 168bits Accepted 200 OK EDH-RSA-DES-CBC-SHA 56bits Accepted 200 OK DHE-RSA-AES128-SHA 128bits Accepted 200 OK DES-CBC3-SHA 168bits Accepted 200 OK DES-CBC-SHA 56bits Accepted 200 OK AES256-SHA 256bits Accepted 200 OK AES128-SHA 128bits Accepted 200 OK NULL-SHA Rejected – SSL Alert N/A NULL-MD5 Rejected – SSL Alert N/A EXP-EDH-DSS-DES-CBC-SHA Rejected – SSL Alert N/A EXP-ADH-RC4-MD5 Rejected – SSL Alert N/A EXP-ADH-DES-CBC-SHA Rejected – SSL Alert N/A EDH-DSS-DES-CBC3-SHA Rejected – SSL Alert N/A EDH-DSS-DES-CBC-SHA Rejected – SSL Alert N/A DHE-DSS-AES256-SHA Rejected – SSL Alert N/A DHE-DSS-AES128-SHA Rejected – SSL Alert N/A ADH-RC4-MD5 Rejected – SSL Alert N/A ADH-DES-CBC3-SHA Rejected – SSL Alert N/A ADH-DES-CBC-SHA Rejected – SSL Alert N/A ADH-AES256-SHA Rejected – SSL Alert N/A ADH-AES128-SHA Rejected – SSL Alert N/A
* SSLV2 Cipher Suites : Cipher Suite: SSL Handshake: HTTP GET: DES-CBC3-MD5 168bits Preferred 200 OK RC4-MD5 128bits Accepted 200 OK RC2-CBC-MD5 128bits Accepted 200 OK EXP-RC4-MD5 40bits Accepted 200 OK EXP-RC2-CBC-MD5 40bits Accepted 200 OK DES-CBC-MD5 56bits Accepted 200 OK
SCAN COMPLETED IN 2.10 S ————————
En este caso podemos negociar cualquiera de los certificados
Ya tenéis otra herramienta para testear tu seguridad ssl.
Saludos cordiales
Explotar vulnerabilidad SSL
Hola!
Muy buenas a todos/as!
En una negociación SSL entre cliente servidor, cuando se negocia el cifrado en la parte servidor existe una gran carga de trabajo, en el servidor la carga de trabajo es 15 veces mayor que en el cliente. La vulnerabilidad se puede explotar con un simple openssl y pasándole unos parámetros. El atacante para explotar esta vulnerabilidad, buscará que el servidor además soporte renegociación, para que en una misma conexión TCP se pueda pedir varias veces renegociar la conexión de manera que el servidor se cargará con una gran carga de trabajo. He montado un servidor en local en el cual haremos las pruebas. La herramienta para explotar este fallo es thc-ssl-ddos
Aquí tenéis una imagen de la carga de un servidor web:

La carga del servidor es totálmente normal, ejecutamos la herramienta para explotar la vulnerabilidad.

La carga del servidor sube hasta el 100 por 100

Hemos podido comprobar como la carga del servidor ha subido bastante.
Las medidas para mitigar este ataque se basa e, configurar que el servidor NO sporte renegociación y, además instalar aceleradores SSL por ejemplo.
El código del THC, se puede modificar y añadirle mas funcionalidades, por ejemplo el que se muestra aquí
Un saludo a todos
TLSSLed comprobando la seguridad SSL/TLS
Hola!
Muy buenas a todos/as
En aquellas páginas web donde tengamos que gestionar datos de caracter personal es importante que sepamos que la seguridad del certificado SSL es seguro y que, el servidor por ejemplo no permite renegociar SSL. Los chicos de Taddong han echo un script para comprobar diferentes aspectos del SSL.
Vamos ha descargarnos el script y hacer una prueba,
Descargamos el script
root@bt:~/Desktop# ./TLSSLed_v1.1.sh www.informatica64.com 443
——————————————————
TLSSLed – (1.1) based on sslscan and openssl
by Raul Siles (www.taddong.com)
( inspired by ssl_test.sh by Aung Khant )
——————————————————
+ openssl version: OpenSSL 0.9.8k 25 Mar 2009
+ sslscan version 1.8.2
——————————————————[-] Analyzing SSL/TLS on www.informatica64.com:443 ..
[-] Running sslscan on www.informatica64.com:443…
[*] Testing for SSLv2 …
Accepted SSLv2 168 bits DES-CBC3-MD5
Accepted SSLv2 56 bits DES-CBC-MD5
Accepted SSLv2 40 bits EXP-RC2-CBC-MD5
Accepted SSLv2 128 bits RC2-CBC-MD5
Accepted SSLv2 40 bits EXP-RC4-MD5
Accepted SSLv2 128 bits RC4-MD5[*] Testing for NULL cipher …
[*] Testing for weak ciphers (based on key length) …
Accepted SSLv2 40 bits EXP-RC2-CBC-MD5
Accepted SSLv2 40 bits EXP-RC4-MD5
Accepted SSLv3 40 bits EXP-RC2-CBC-MD5
Accepted SSLv3 40 bits EXP-RC4-MD5
Accepted TLSv1 40 bits EXP-RC2-CBC-MD5
Accepted TLSv1 40 bits EXP-RC4-MD5Accepted SSLv2 56 bits DES-CBC-MD5
Accepted SSLv3 56 bits DES-CBC-SHA
Accepted TLSv1 56 bits DES-CBC-SHA[*] Testing for strong ciphers (AES) …
[*] Testing for MD5 signed certificate …
[*] Testing for certificate public key length …
RSA Public Key: (4096 bit)[*] Testing for certificate subject …
Subject: /description=197113-dnYcHqWO08ip2DsF/C=ES/ST=Madrid/L=Mostoles/postalCode=28932/streetAddress=Juan Ramon Jimenez 8 Local Posterior/O=Informatica 64 S.L./OU=StartCom Extended Validation/CN=www.informatica64.com/emailAddress=i64@informatica64.com/serialNumber=B82441775/2.5.4.15=V1.2, Clause 7.2.2/1.3.6.1.4.1.311.60.2.1.1=Mostoles/1.3.6.1.4.1.311.60.2.1.2=Madrid/1.3.6.1.4.1.311.60.2.1.3=ES[*] Testing for certificate CA issuer …
Issuer: /C=IL/O=StartCom Ltd./OU=StartCom Certification Authority/CN=StartCom Extended Validation Server CA[*] Testing for certificate validity period …
Today: Mon Jul 11 14:28:54 UTC 2011
Not valid before: May 17 05:25:22 2010 GMT
Not valid after: May 17 14:32:04 2012 GMT[*] Checking preferred server ciphers …
Prefered Server Cipher(s):
SSLv2 168 bits DES-CBC3-MD5
SSLv3 128 bits RC4-MD5
TLSv1 128 bits RC4-MD5[-] Testing for SSLv3/TLSv1 renegotiation vuln. (CVE-2009-3555) …
[*] Testing for secure renegotiation …
Secure Renegotiation IS supported[-] Testing for SSL/TLS security headers …
[*] Testing for Strict-Transport-Security header …
[*] Testing for cookies with the secure flag …
[*] Testing for cookies without the secure flag …
[-] New files created:
-rw-r–r– 1 root root 7805 2011-07-11 10:28 sslscan_www.informatica64.com:443_2011-07-11_10:28:26.log
-rw-r–r– 1 root root 5447 2011-07-11 10:29 openssl_HEAD_www.informatica64.com:443_2011-07-11_10:28:26.log
-rw-r–r– 1 root root 5100 2011-07-11 10:28 openssl_RENEG_www.informatica64.com:443_2011-07-11_10:28:26.log
-rw-r–r– 1 root root 283 2011-07-11 10:28 openssl_RENEG_www.informatica64.com:443_2011-07-11_10:28:26.err
-rw-r–r– 1 root root 196 2011-07-11 10:29 openssl_HEAD_www.informatica64.com:443_2011-07-11_10:28:26.err[-] done
Aquí podéis ver el resultado del script.
Os insto a que lo podáis probar con vuestro servidor.
Un saludo
Forzando conexiones SSL mediante .htaccess
Hola!
Muy buenas a todos/as!
Hay muchísimas webs que a la hora de hacer login en su aplicación web. Lo hacen mediante http, es decir, el tráfico no está cifrado.
Para automatizar este tipo de tareas, se puede, mediante .htaccess obligar que siempre se acceda por SSL.
Para hacer por ejemplo que todo sl site web estuviera cifrado por SSL pondríamos estas lineas en el .htaccess
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
Todo lo que entrara vía web que es el puerto 80. Entraría con https, es decir, ya cifrado.
Pero, si en cambio queremos que sólo se cifre una carpeta lo hacemos mediantes la siguiente directiva:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} mi-carpeta
RewriteRule ^(.*)$ https://www.mi-sitio.com/mi-carpeta/$1 [R,L]
Ahora todo lo que fuera hacia http://www.mi-sitio.com/mi-carpeta se convertiría de manera automática en:
https://www.mi-sitio.com/mi-carpeta
Ahora ya podremos utilizar SSL en las conexiones donde nos interese.
Recordad que para habilitar esta opción hay que tener mod_rewrite activado.
Un saludo