2010-02-15 18:47:18 +0000 2010-02-15 18:47:18 +0000
276
276
Advertisement

Come posso elencare le suite di cifratura SSL/TLS offerte da un particolare sito web?

Advertisement

Come posso recuperare un elenco delle suite di cifratura SSL/TLS offerte da un particolare sito web?

Ho provato openssl, ma se si esamina l'output:

$ echo -n | openssl s_client -connect www.google.com:443 
CONNECTED(00000003)
depth=1 /C=ZA/O=Thawte Consulting (Pty) Ltd./CN=Thawte SGC CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
 0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=www.google.com
   i:/C=ZA/O=Thawte Consulting (Pty) Ltd./CN=Thawte SGC CA
 1 s:/C=ZA/O=Thawte Consulting (Pty) Ltd./CN=Thawte SGC CA
   i:/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIDITCCAoqgAwIBAgIQL9+89q6RUm0PmqPfQDQ+mjANBgkqhkiG9w0BAQUFADBM
MQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkg
THRkLjEWMBQGA1UEAxMNVGhhd3RlIFNHQyBDQTAeFw0wOTEyMTgwMDAwMDBaFw0x
MTEyMTgyMzU5NTlaMGgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlh
MRYwFAYDVQQHFA1Nb3VudGFpbiBWaWV3MRMwEQYDVQQKFApHb29nbGUgSW5jMRcw
FQYDVQQDFA53d3cuZ29vZ2xlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC
gYEA6PmGD5D6htffvXImttdEAoN4c9kCKO+IRTn7EOh8rqk41XXGOOsKFQebg+jN
gtXj9xVoRaELGYW84u+E593y17iYwqG7tcFR39SDAqc9BkJb4SLD3muFXxzW2k6L
05vuuWciKh0R73mkszeK9P4Y/bz5RiNQl/Os/CRGK1w7t0UCAwEAAaOB5zCB5DAM
BgNVHRMBAf8EAjAAMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwudGhhd3Rl
LmNvbS9UaGF3dGVTR0NDQS5jcmwwKAYDVR0lBCEwHwYIKwYBBQUHAwEGCCsGAQUF
BwMCBglghkgBhvhCBAEwcgYIKwYBBQUHAQEEZjBkMCIGCCsGAQUFBzABhhZodHRw
Oi8vb2NzcC50aGF3dGUuY29tMD4GCCsGAQUFBzAChjJodHRwOi8vd3d3LnRoYXd0
ZS5jb20vcmVwb3NpdG9yeS9UaGF3dGVfU0dDX0NBLmNydDANBgkqhkiG9w0BAQUF
AAOBgQCfQ89bxFApsb/isJr/aiEdLRLDLE5a+RLizrmCUi3nHX4adpaQedEkUjh5
u2ONgJd8IyAPkU0Wueru9G2Jysa9zCRo1kNbzipYvzwY4OA8Ys+WAi0oR1A04Se6
z5nRUP8pJcA2NhUzUnC+MY+f6H/nEQyNv4SgQhqAibAxWEEHXw==
-----END CERTIFICATE-----
subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=www.google.com
issuer=/C=ZA/O=Thawte Consulting (Pty) Ltd./CN=Thawte SGC CA
---
No client certificate CA names sent
---
SSL handshake has read 1777 bytes and written 316 bytes
---
New, TLSv1/SSLv3, Cipher is AES256-SHA
Server public key is 1024 bit
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol : TLSv1
    Cipher : AES256-SHA
    Session-ID: 748E2B5FEFF9EA065DA2F04A06FBF456502F3E64DF1B4FF054F54817C473270C
    Session-ID-ctx: 
    Master-Key: C4284AE7D76421F782A822B3780FA9677A726A25E1258160CA30D346D65C5F4049DA3D10A41F3FA4816DD9606197FAE5
    Key-Arg : None
    Start Time: 1266259321
    Timeout : 300 (sec)
    Verify return code: 20 (unable to get local issuer certificate)
---

mostra solo che la suite di cifratura è qualcosa con AES256-SHA. So che potrei dare un'occhiata all'hex dump della conversazione, ma speravo in qualcosa di un po’ più elegante.

Preferirei farlo su Linux, ma Windows (o altro) andrebbe bene. Questa domanda è motivata dai test di sicurezza che faccio per il PCI e dai test di penetrazione generale.

Aggiornamento:

GregS sottolinea qui sotto che il server SSL sceglie tra le suite di cifratura del client. Quindi sembra che dovrei testare tutte le suite di cifratura una alla volta. Penso di poter hackerare qualcosa insieme, ma c'è un modo più semplice e a prova di futuro (ad esempio nuovi cifrari) per farlo?

Advertisement

Risposte (21)

246
246
246
2010-12-20 23:41:17 +0000

Ho scritto un copione di bash per testare le suite di cifratura. Esso ottiene da OpenSSL un elenco delle suite di cifratura supportate e cerca di connettersi utilizzando ciascuna di esse. Se la stretta di mano ha successo, stampa YES. Se l'handshake non ha successo, stampa NO, seguito dal testo di errore di OpenSSL.

#!/usr/bin/env bash

# OpenSSL requires the port number.
SERVER=$1
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')

echo Obtaining cipher list from $(openssl version).

for cipher in ${ciphers[@]}
do
echo -n Testing $cipher...
result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1)
if [["$result" =~ ":error:"]] ; then
  error=$(echo -n $result | cut -d':' -f6)
  echo NO \($error\)
else
  if [["$result" =~ "Cipher is ${cipher}" || "$result" =~ "Cipher :"]] ; then
    echo YES
  else
    echo UNKNOWN RESPONSE
    echo $result
  fi
fi
sleep $DELAY
done
``` ```
[@linux ~]$ ./test_ciphers 192.168.1.11:443
Obtaining cipher list from OpenSSL 0.9.8k 25 Mar 2009.
Testing ADH-AES256-SHA...NO (sslv3 alert handshake failure)
Testing DHE-RSA-AES256-SHA...NO (sslv3 alert handshake failure)
Testing DHE-DSS-AES256-SHA...NO (sslv3 alert handshake failure)
Testing AES256-SHA...YES

Ecco un esempio di output che mostra 3 cifrari non supportati, e 1 cifrario supportato:

&001

EDIT: aggiungere flessibilità come host e porta sono forniti come parametro allo script

170
170
170
2014-06-05 09:29:14 +0000

Nmap con ssl-enum-ciphers

Non esiste un modo migliore o più veloce per ottenere una lista dei cifrari disponibili da un servizio di rete. Inoltre, nmap fornirà una valutazione di forza di forte, debole o sconosciuto per ogni cifrario disponibile.

Innanzitutto, scaricare lo script ssl-enum-ciphers.nse nmap spiegazione qui ). Poi, dalla stessa directory dello script, eseguire nmap come segue:

Elenca i cifrari supportati da un server HTTP

$ nmap --script ssl-enum-ciphers -p 443 www.example.com

Elenca i cifrari supportati da un server IMAP

$ nmap --script ssl-enum-ciphers -p 993 mail.example.com

Ecco un frammento di output da un server IMAP Dovecot:

993/tcp open imaps
| ssl-enum-ciphers:
| SSLv3:
| ciphers:
| TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - strong
| TLS_DHE_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_DHE_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_RSA_WITH_IDEA_CBC_SHA - weak
...
| TLSv1.0:
| ciphers:
| TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - strong
| TLS_DHE_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_DHE_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_RSA_WITH_IDEA_CBC_SHA - weak
...
|_ least strength: weak

Nmap done: 1 IP address (1 host up) scanned in 1.03 seconds
106
Advertisement
106
106
2010-02-20 18:02:27 +0000

Esiste uno strumento in grado di testare le suite di cifratura SSL/TLS offerte da un particolare sito web?

Sì, è possibile utilizzare lo strumento online sul sito web SSL Labs ’ per interrogare il database pubblico del server SSL.

Ecco un frammento di informazioni che fornisce:

(screenshot dei risultati di google.com)

57
57
57
2010-03-18 22:21:08 +0000

sslscan è una piccola utility.

Test di connessione con TLS e SSL (e lo script di compilazione può collegarsi con la propria copia di OpenSSL in modo che vengano controllate anche le versioni obsolete di SSL) e rapporti sulle suite di cifratura del server e sul certificato.

Uscita di esempio per google.com (tagliata per la leggibilità):

$ sslscan google.com
Testing SSL server google.com on port 443

 TLS renegotiation:
Secure session renegotiation supported

  TLS Compression:
Compression disabled

  Heartbleed:
TLS 1.2 not vulnerable to heartbleed
TLS 1.1 not vulnerable to heartbleed
TLS 1.0 not vulnerable to heartbleed

  Supported Server Cipher(s):
Preferred TLSv1.2 128 bits ECDHE-RSA-AES128-GCM-SHA256 Curve P-256 DHE 256
Accepted TLSv1.2 128 bits ECDHE-RSA-AES128-SHA Curve P-256 DHE 256
Accepted TLSv1.2 128 bits ECDHE-RSA-RC4-SHA Curve P-256 DHE 256
Accepted TLSv1.2 128 bits AES128-GCM-SHA256
Accepted TLSv1.2 128 bits AES128-SHA
<snip>
Preferred TLSv1.1 128 bits ECDHE-RSA-AES128-SHA Curve P-256 DHE 256
Accepted TLSv1.1 128 bits ECDHE-RSA-RC4-SHA Curve P-256 DHE 256
Accepted TLSv1.1 128 bits AES128-SHA
<snip>
Preferred TLSv1.0 128 bits ECDHE-RSA-AES128-SHA Curve P-256 DHE 256
Accepted TLSv1.0 128 bits ECDHE-RSA-RC4-SHA Curve P-256 DHE 256
Accepted TLSv1.0 128 bits AES128-SHA
<snip>
Preferred SSLv3 128 bits RC4-SHA
Accepted SSLv3 128 bits RC4-MD5
<snip>

  SSL Certificate:
Signature Algorithm: sha256WithRSAEncryption
RSA Key Strength: 2048

Subject: *.google.com
Altnames: DNS:*.google.com, DNS:*.android.com, <snip>
Issuer: Google Internet Authority G2

Not valid before: Apr 7 08:24:31 2016 GMT
Not valid after: Jun 30 08:20:00 2016 GMT
15
Advertisement
15
15
2014-09-16 11:25:38 +0000

Dato che questo è un ottimo filo di riferimento per gli strumenti di scansione SSL, elencherò CipherScan che è stato creato un anno fa e può anche identificare problemi con i cifrari di scambio di chiavi https://github.com/jvehent/cipherscan

Se volete il mio fork che supporta SNI e FreeBSD, l'URL i https://github. com/oparoz/cipherscan

È uno script che chiama openssl s_client e supporta l'uso del proprio binario OpenSSL in modo da poter testare le prossime funzionalità o i nuovi cifrari (chacha20+poly1305 per esempio).

Consente inoltre di collegarsi a qualsiasi porta si desideri e di utilizzare starttlss.

Ecco una tipica uscita

# ./cipherscan -o ./openssl api.mycompany.com:443
...................
prio ciphersuite protocols pfs_keysize
1 DHE-RSA-AES256-GCM-SHA384 TLSv1.2 DH,4096bits
2 DHE-RSA-AES256-SHA256 TLSv1.2 DH,4096bits
3 ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 ECDH,P-384,384bits
4 ECDHE-RSA-AES256-SHA384 TLSv1.2 ECDH,P-384,384bits
5 DHE-RSA-AES128-GCM-SHA256 TLSv1.2 DH,4096bits
6 DHE-RSA-AES128-SHA256 TLSv1.2 DH,4096bits
7 ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 ECDH,P-384,384bits
8 ECDHE-RSA-AES128-SHA256 TLSv1.2 ECDH,P-384,384bits
9 DHE-RSA-CAMELLIA256-SHA TLSv1,TLSv1.1,TLSv1.2 DH,4096bits
10 DHE-RSA-AES256-SHA TLSv1,TLSv1.1,TLSv1.2 DH,4096bits
11 ECDHE-RSA-AES256-SHA TLSv1,TLSv1.1,TLSv1.2 ECDH,P-384,384bits
12 DHE-RSA-CAMELLIA128-SHA TLSv1,TLSv1.1,TLSv1.2 DH,4096bits
13 DHE-RSA-AES128-SHA TLSv1,TLSv1.1,TLSv1.2 DH,4096bits
14 ECDHE-RSA-AES128-SHA TLSv1,TLSv1.1,TLSv1.2 ECDH,P-384,384bits
15 CAMELLIA256-SHA TLSv1,TLSv1.1,TLSv1.2
16 AES256-SHA TLSv1,TLSv1.1,TLSv1.2
17 CAMELLIA128-SHA TLSv1,TLSv1.1,TLSv1.2
18 AES128-SHA TLSv1,TLSv1.1,TLSv1.2

Certificate: trusted, 4096 bit, sha256WithRSAEncryption signature
TLS ticket lifetime hint: 300
OCSP stapling: supported

Ed ecco una lista di opzioni

-a | --allciphers Test all known ciphers individually at the end.
-b | --benchmark Activate benchmark mode.
-d | --delay Pause for n seconds between connections
-D | --debug Output ALL the information.
-h | --help Shows this help text.
-j | --json Output results in JSON format.
-o | --openssl path/to/your/openssl binary you want to use.
-v | --verbose Increase verbosity.
``` &001 


L'uscita json è utile se la si chiama da altri script.
13
13
13
2012-01-25 14:01:34 +0000

https://github.com/iSECPartners/sslyze &003

Questo è basato su Python, funziona in Linux/Mac/Windows da riga di comando.

8
Advertisement
8
8
2010-02-20 16:30:05 +0000

Dopo un piccolo googling ho trovato questo Test per SSL-TLS (OWASP-CM-001) :

Lo scanner nmap , tramite l'opzione di scansione “-sV”, è in grado di identificare i servizi SSL. Gli scanner di vulnerabilità, oltre ad eseguire il rilevamento dei servizi, possono includere controlli contro i cifrari deboli (per esempio, lo scanner Nessus scanner ha la capacità di controllare i servizi SSL su porte arbitrarie, e segnalerà i cifrari deboli).

e anche: Foundstone SSL Digger è uno strumento per valutare la forza dei server SSL testando i cifrari supportati. Alcuni di questi cifrari sono noti per essere insicuri.

6
6
6
2015-01-10 17:36:14 +0000

Sto usando per la maggior parte dei test SSL testssl.sh (vedi https://testssl.sh / devel version @ https://github.com/drwetter/testssl.sh . Esso testa le vulnerabilità, i cifrari, i protocolli, ecc.

2
Advertisement
2
2
2014-04-09 18:31:47 +0000

Se si desidera un bell'output grepable (e il supporto per il controllo di tutte le versioni SSL/TLS)

Usage: ./script.sh www.url.com

#!/usr/bin/env bash
ciphers2=$(openssl ciphers -ssl2 'ALL:eNULL' | sed -e 's/:/ /g')
ciphers3=$(openssl ciphers -ssl3 'ALL:eNULL' | sed -e 's/:/ /g')
cipherst1=$(openssl ciphers -tls1 'ALL:eNULL' | sed -e 's/:/ /g')
cipherst11=$(openssl ciphers -tls1.1 'ALL:eNULL' | sed -e 's/:/ /g')
cipherst12=$(openssl ciphers -tls1.2 'ALL:eNULL' | sed -e 's/:/ /g')

SSL2="SSL2("
for cipher in ${ciphers2[@]}
do
result=$(echo -n | openssl s_client -ssl2 -cipher "$cipher" -connect $1:443 2>&1)
if [["$result" =~ "Cipher is ${cipher}"]] ; then
  SSL2="${SSL2}${cipher}:"
fi
done
SSL2=$(echo "${SSL2})" | sed -e 's/:)/)/g')

SSL3="SSL3("
for cipher in ${ciphers3[@]}
do
result=$(echo -n | openssl s_client -ssl3 -cipher "$cipher" -connect $1:443 2>&1)
if [["$result" =~ "Cipher is ${cipher}"]] ; then
  SSL3="${SSL3}${cipher}:"
fi
done
SSL3=$(echo "${SSL3})" | sed -e 's/:)/)/g')
TLS1="TLS1("
for cipher in ${cipherst1[@]}
do
result=$(echo -n | openssl s_client -tls1 -cipher "$cipher" -connect $1:443 2>&1)
if [["$result" =~ "Cipher is ${cipher}"]] ; then
  TLS1="${TLS1}${cipher}:"
fi
done
TLS1=$(echo "${TLS1})" | sed -e 's/:)/)/g')

TLS11="TLS1.1("
for cipher in ${cipherst11[@]}
do
result=$(echo -n | openssl s_client -tls1_1 -cipher "$cipher" -connect $1:443 2>&1)
if [["$result" =~ "Cipher is ${cipher}"]] ; then
  TLS11="${TLS11}${cipher}:"
fi
done
TLS11=$(echo "${TLS11})" | sed -e 's/:)/)/g')

TLS12="TLS1.2("
for cipher in ${cipherst12[@]}
do
result=$(echo -n | openssl s_client -tls1_2 -cipher "$cipher" -connect $1:443 2>&1)
if [["$result" =~ "Cipher is ${cipher}"]] ; then
  TLS12="${TLS12}${cipher}:"
fi
done
TLS12=$(echo "${TLS12})" | sed -e 's/:)/)/g')

echo "$1,$SSL2,$SSL3,$TLS1,$TLS11,$TLS12";
2
2
2
2010-12-01 20:40:29 +0000

SSLScan è fantastico; un nuovo strumento SSLDiagnos funziona per Windows, oppure si può semplicemente scrivere uno script usando il client openssl s _client.

2
Advertisement
2
2
2016-02-05 00:55:55 +0000

Sulla base della risposta di @indiv risposta e del suggerimento di pubblicarla come risposta propria, sto fornendo la mia versione modificata dello script di @indiv. Si può fornire un host come primo argomento, e produrrà gli stessi risultati dello script originale, ma un po’ più formattato:

#!/usr/bin/env bash
# adapted from https://superuser.com/questions/109213/how-do-i-list-the-ssl-tls-cipher-suites-a-particular-website-offers

# OpenSSL requires the port number.
# SERVER=192.168.1.1:443
SERVER=$1
if [[-z "$SERVER"]]; then echo "ERROR: no server specified"; exit 1; fi;

## Set up colors, if possible
if [[$(tput colors)]];then
  COLOR_BOLD="$(tput bold)" # "\e[1;32m"
  COLOR_GREEN="$(tput setaf 2)" # "\e[1;32m"
  COLOR_RESET="$(tput sgr0)" # "\e[0m"
fi

SERVER=$1:443
echo Server is ${COLOR_BOLD}"$SERVER"${COLOR_RESET}

DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')

echo Obtaining cipher list from $(openssl version).

for cipher in ${ciphers[@]}
  do
  printf "%-42s" "Testing $cipher... "
  result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1)
  if [["$result" =~ ":error:"]] ; then
    error=$(echo -n $result | cut -d':' -f6)
    echo NO \($error\)
  else
    if [["$result" =~ "Cipher is ${cipher}" || "$result" =~ "Cipher :"]] ; then
      echo ${COLOR_BOLD}${COLOR_GREEN}YES${COLOR_RESET}
    else
      echo UNKNOWN RESPONSE
      echo $result
    fi
  fi
  sleep $DELAY
done
2
2
2
2012-01-19 05:39:21 +0000

C'è un piccolo e simpatico script su pentesterscripting.com per utilizzare sia SSLScan che OpenSSL per controllare:

Duplicato qui per il futureproofing in quanto il sito principale è ora morto:

#!/usr/bin/env bash

# Description:
# Script to extract the most security relevant details from a 
# target SSL/TLS implementation by using sslscan.
# Author: Raul Siles (raul _AT_ taddong _DOT_ com)
# Taddong (www.taddong.com)
# Date: 2011-05-27
# Version: 1.0
#
# - Current SSL/TLS tests: 
# SSLv2, NULL cipher, weak ciphers -key length-, strong 
# ciphers -AES-, MD5 signed cert, SSL/TLS renegotiation
#
# Requires: 
# - sslscan
# https://sourceforge.net/projects/sslscan/
#
# Credits: Based on ssl_test.sh by Aung Khant, http://yehg.net.
# 

#
# / **************************************************************************
# * Copyright 2011 by Taddong (Raul Siles) *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License as published by *
# * the Free Software Foundation; either version 3 of the License, or *
# * (at your option) any later version. *
# * *
# * This program is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU General Public License for more details. *
# * *
# * You should have received a copy of the GNU General Public License *
# * along with this program. If not, see <http://www.gnu.org/licenses/>. *
# * *
# ************************************************************************** /
#

VERSION=1.0

OPENSSLVERSION=$(openssl version)
SSLSCANVERSION=$(sslscan --version | grep version | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g")

echo ------------------------------------------------------
echo " TLSSLed - ($VERSION) based on sslscan and openssl"
echo " by Raul Siles (www.taddong.com)"
echo " ( inspired by ssl_test.sh by Aung Khant )"
echo ------------------------------------------------------
echo + openssl version: $OPENSSLVERSION
echo + $SSLSCANVERSION
echo ------------------------------------------------------
echo

if [$# -ne 2]; then 
   echo Usage: $0 IP PORT
   exit
fi

HOST=$1
PORT=$2

echo [*] Analyzing SSL/TLS on $HOST:$PORT ...
echo 

# Run sslcan once, store the results to a log file and
# analyze that file for all the different tests:
DATE=$(date +%F_%R:%S)
TARGET=$HOST:$PORT
LOGFILE=sslscan\_$TARGET\_$DATE.log
ERRFILE=sslscan\_$TARGET\_$DATE.err

echo [*] Running sslscan on $HOST:$PORT...
sslscan $HOST:$PORT > $LOGFILE 2> $ERRFILE

echo
echo [*] Testing for SSLv2 ...
cat $LOGFILE | grep "Accepted SSLv2"
echo
echo [*] Testing for NULL cipher ...
cat $LOGFILE | grep "NULL" | grep Accepted
echo
echo [*] Testing for weak ciphers \(based on key length\) ...
cat $LOGFILE | grep " 40 bits" | grep Accepted
echo 
cat $LOGFILE | grep " 56 bits" | grep Accepted
echo
echo [*] Testing for strong ciphers \(AES\) ...
cat $LOGFILE | grep "AES" | grep Accepted

echo 
echo [*] Testing for MD5 signed certificate ...
#cat $LOGFILE | grep -E 'MD5WithRSAEncryption|md5WithRSAEncryption'
cat $LOGFILE | grep -i 'MD5WithRSAEncryption'

echo 
echo [*] Checking preferred server ciphers ...
cat $LOGFILE | sed '/Prefered Server Cipher(s):/,/^$/!d' | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"

echo
echo [*] Testing for SSLv3/TLSv1 renegotiation vuln. \(CVE-2009-3555\) ...
#echo [*] echo R \| openssl s_client -connect $HOST:$PORT \| grep "DONE"
#
# Renegotiation details go to stderr (2>)
#
# if $OPENSSLVERSION is updated (version?) it supports RFC5746 and will print:
# Secure Renegotiation IS NOT supported
# Secure Renegotiation IS supported
#

echo R | openssl s_client -connect $HOST:$PORT | grep -E "Secure Renegotiation IS|DONE"

echo
echo [*] New files created:
ls -l $LOGFILE
if [! -s $ERRFILE]; then
        # Error file is empty
        rm $ERRFILE
else
        ls -l $ERRFILE
fi

echo
echo 
echo [*] done
echo
``` &001 


Useage: ./ssltest.sh PORTO HOST
2
Advertisement
2
2
2014-03-25 21:58:08 +0000

Lo script ssl-enum-ciphers di Nmap può elencare i cifrari supportati e le versioni SSL/TLS, così come i compressori supportati.

2
2
2
2016-09-19 03:01:09 +0000

Il (gratuito) OpenSSL Cookbook di Ivan Ristić, che ha sviluppato lo strumento online SSL Labs indicato nella risposta di Kez , afferma:

Se si desidera determinare tutte le suite supportate da un particolare server, iniziare invocando openssl ciphers ALL per ottenere una lista di tutte le suite supportate dalla propria versione di OpenSSL. Poi inviatele al server una ad una per testarle singolarmente. Non vi sto suggerendo di farlo manualmente; questa è una situazione in cui un po’ di automazione fa molta strada. In realtà, questa è una situazione in cui ** cercare un buon strumento potrebbe essere appropriato**.

C'è uno svantaggio nel testare in questo modo, tuttavia. Si possono testare solo le suite che OpenSSL supporta. …

** Nessuna singola libreria SSL/TLS supporta tutte le suite di cifratura** , e questo rende difficile un test completo. Per i laboratori SSL, Ho fatto ricorso all'uso di strette di mano parziali per questo scopo, con un client personalizzato che finge di supportare suite arbitrarie. In realtà non può negoziare nemmeno una singola suite, ma il solo fatto di proporre di negoziare è sufficiente perché i server vi dicano se supportano o meno una suite. Non solo si possono testare tutte le suite in questo modo, ma si può anche farlo in modo molto efficiente.

(La mia enfasi.)

Uno strumento che non ho visto menzionato in altre risposte è SSLTest di Stephen Bradshaw, che, tra le altre cose, ha lo scopo di confrontare “i cifrari e i protocolli rilevati con gli standard di conformità come DSD ISM e PCI-DSS. ”

Quindi, provate questo o uno degli strumenti menzionati nelle altre risposte, oppure costruite il vostro e considerate di utilizzare l'approccio di Ristić di strette di mano parziali.

1
Advertisement
1
1
2020-02-11 13:25:43 +0000

Questa risposta riassume le risposte migliori e spiega perché scegliere un'alternativa (o no!)._


Per trovare la soluzione migliore, dovremmo prima rispondere ‘perché vogliamo elencare tutti i cifrari supportati? Qui l'attenzione è focalizzata sull'aspetto della sicurezza, ovvero, per scoprire se un server è vulnerabile o meno. La prossima domanda a cui rispondere è se l'output deve essere leggibile dalla macchina, ad esempio, per essere ulteriormente utilizzato in uno script, oppure no.

1. testssl.sh (https://testssl.sh/testssl.1.html)

  • CLI (Bash)
  • TLSv1. 3
  • Verifica delle vulnerabilità note
  • Autocontenuta (non è necessaria l'installazione)
  • Supporta 370 cifrari (dalla versione 3.1) compresi i cifrari deprecati (non inclusi nelle più recenti versioni openSSL)
  • Produce risultati leggibili a macchina (CSV e JSON)
  • (parallelizzato) elaborazione batch
  • Lento

Forse il vantaggio più importante di testssl.sh rispetto alle seguenti alternative è l'uso di un insieme di binari che sono fatti su misura per i test di vulnerabilità (leggere la spiegazione dello sviluppatore qui ).

2. cipherscan (https://github.com/ssllabs/research/wiki/Assessment-Tools)

  • CLI (pitone)
  • No TLSv1.3
  • Autocontenuto
  • Suite di cifratura limitata (hard-coded)
  • Produce risultati leggibili a macchina (JSON)
  • Veloce

3. [ nmap ssl-enum-ciphers ]&003

  • CLI (nmap script)
  • No TLSv1.3
  • Autocontenuto
  • Suite di cifratura limitata (hard-coded)
  • Controlli per vulnerabilità note
  • Nessun risultato leggibile a macchina

Per una panoramica completa degli strumenti disponibili vedere [ sslLabs Assessment Tools ]&003.

1
1
1
2015-09-26 11:24:14 +0000

SSLyze, originariamente a https://github.com/iSECPartners/sslyze , è ora a https://github.com/nabla-c0d3/sslyze . E’ stato menzionato in un'altra risposta , ma senza molti dettagli.

SSLyze è basato su Python, e funziona su Linux/Mac/Windows da riga di comando. Utilizza OpenSSL, e su Windows, viene fornito con una copia in bundle di OpenSSL.

elenca protocolli, suite di cifratura, e dettagli chiave, oltre a test per alcune vulnerabilità comuni. È possibile abilitare o disabilitare particolari controlli, per ottenere più dati o velocizzare la scansione.

1
Advertisement
1
1
2014-05-25 13:34:41 +0000

Ho scritto uno strumento che fa esattamente questo. Si chiama tlsenum ed è disponibile su GitHub .

[ayrx@division tlsenum]$ ./tlsenum.py twitter.com 443
TLS Versions supported by server: 3.0, 1.0, 1.1, 1.2
Supported Cipher suites in order of priority:
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_RC4_128_SHA
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_AES_128_GCM_SHA256
TLS_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_RC4_128_MD5
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_3DES_EDE_CBC_SHA
``` &001 


Ecco un output di esempio dello strumento contro `twitter.com`. 


È simile a quello che fa SSL Lab ma trovo che avere uno strumento a riga di comando che si può automatizzare e analizzare sia molto più utile.
0
0
0
2014-11-04 20:45:59 +0000

Tutte queste risposte vanno bene. Una parte della risposta potrebbe spiegare perché abbiamo bisogno di uno strumento per scoprire la lista dei server e non chiedere direttamente in TLS che il server dia tutte le sue suite di cifratura supportate proprio come fa il client TLS quando si connette ad un server.

La risposta è che server non invia mai una lista , si limita a selezionare nella lista dei cifrari del client il cifrario che vuole usare, questo è il modo in cui è scritto il protocollo SSL/TLS : http://wiki. opensslfoundation.com/index.php/SSLandTLS__Protocols#Cipher_Suites

Ecco perché il client deve enumerare i cifrari per poter trovare quelli supportati dal server e per questo deve fare almeno una nuova stretta di mano (ClientHello) per ogni suite di cifrario.

0
Advertisement
0
0
2010-02-15 21:51:27 +0000

L'unica cosa che si può fare è provarli tutti, uno alla volta, e vedere quali sono accettati. Non sono a conoscenza di uno strumento per fare questo, anche se non dovrebbe essere difficile metterne insieme uno tra gli strumenti di scripting e openssl s_client.

Mentre il client pubblicizza quale cifrario accetterà, il server ne sceglie semplicemente uno e lo usa o fallisce la connessione se non trova nulla di suo gradimento.

0
0
0
2016-03-02 10:02:12 +0000

TestSSLServer è una soluzione puramente basata su Java. Vantaggi:

  • funziona a bassissimo livello, solo su semplici Sockets, quindi è indipendente da possibili cifrari non disponibili da JDK o OpenSSL.

  • non richiede porte aggiuntive (come ICMP per il ping) per essere aperto

  • funziona con i certificati dei clienti presenti

Svantaggi:

  • a partire dal 2016, l'elenco dei cifrari potrebbe essere obsoleto (anche se non sono un esperto a giudicare questo)

La mia esperienza personale: dato un server con una sola porta HTTPS aperta (nessun'altra porta), certificati client richiesti e iptables attivi, era ancora in grado di elencare i cifrari disponibili, mentre le soluzioni top-voted non lo erano (stavo provando piccoli script shell, SSL Labs, NMap, sslscan)

0
Advertisement
0
0
2014-12-20 23:56:37 +0000

Mentre cercavo qualcosa che facesse AUTH TLS su FTP, ho scoperto questo strumento: ssl-cipher-suite-enum

È uno script perl che fondamentalmente fa quello che fa lo script shell di hackajar, solo più sofisticato.

Offre anche una valutazione di base dei cifrari e dei protocolli offerti. È un po’ come gli strumenti SSL Labs, solo per uso domestico. :)

Per impostazione predefinita, supporta solo AUTH SSL su FTP, ma una semplice ricerca e sostituzione può risolvere il problema. Come bonus, sostiene anche di supportare SMTP con STARTTLS e RDP.

Advertisement
Advertisement