
Programmi di esempio in Go, Java, Node, Perl, Python, Ruby, Rust e curl che verificano se un trust store TLS rifiuta le connessioni a siti noti come malevoli della CA eMudhra.
https://emudhra.we-have-a-problem.com/
Certo, i tuoi browser fanno la cosa giusta, ma TLS avviene in qualche altro posto oltre che nel browser. Quindi devi controllare tutti i posti in cui un bundle potrebbe nascondersi. Che seccatura!
Non ho una soluzione per te, mi dispiace -- beh, potresti eseguire questo strumento per rilevare e correggere i bundle.
Ma se vuoi solo verificare se un linguaggio specifico fa la cosa giusta fin da subito, ecco alcuni semplici programmi di esempio. Ognuno di essi restituirà silenziosamente nulla (perché è il modo Unix) se tutto va bene e segnalerà un errore se riesce a connettersi ai siti noti come malevoli.
Lo strumento utilizzerà qualunque sia il valore predefinito per il framework/linguaggio dato, ma puoi anche specificare un bundle alternativo con cui confrontarsi. Se sa come fare, mostrerà quale bundle / percorso ha utilizzato.
$ go run emudhra.go
$ go run emudhra.go /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
exit status 2
$
$ java emudhra.java
Using CA file: /opt/homebrew/Cellar/openjdk/23.0.2/libexec/openjdk.jdk/Contents/Home/lib/security/cacerts
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$ java emudhra.java /etc/ssl/cert.pem
Using CA file: /etc/ssl/cert.pem
$
Valuta di aggiungere gli intermedi al tuo
blocked.certs come discusso
qui.
$ node emudhra.js
$ node emudhra.js /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
$ perl emudhra.pl
Using SSL_ca_file: /private/etc/ssl/cert.pem
$ perl emudhra.pl /tmp/cert.pem.bad
Using SSL_ca_file: /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
$ python3 emudhra.py
Using CA file: /opt/homebrew/etc/openssl@4/cert.pem
$ python3 emudhra.py /tmp/cert.pem.bad
Using CA file: /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
$ ruby emudhra.rb
Using CA file: /usr/lib/ssl/cert.pem
$ ruby emudhra.rb /tmp/cert.pem.bad
Using CA file: /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
$ sh emudhra.sh
Used CA file: /etc/ssl/certs/ca-certificates.crt
$ sh emudhra.sh
/tmp/cert.pem.bad
Used CA file: /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
Nota: su macOS, puoi chiedere a curl(1) di usare il
backend nativo, che poi rifiuta la connessione in
tutti i casi:
$ CURL_SSL_BACKEND=secure-transport sh emudhra.sh /tmp/cert.pem.bad
Used CA file:
$
$ cd rs
$ cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.35s
Running `target/debug/rs`
$ cargo run -- /tmp/cert.pem.bad
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.17s
Running `target/debug/rs /tmp/cert.pem.bad`
$
Da qualche parte nelle sue dipendenze, Rust esegue un'effettiva verifica della blocklist sugli intermedi compromessi, quindi anche con un bundle che si fida della root di eMudhra, non riesce a connettersi.