
Programas de exemplo em Go, Java, Node, Perl, Python, Ruby, Rust e curl que testam se um repositório de confiança TLS rejeita conexões a sites conhecidos como maliciosos da CA eMudhra.
https://emudhra.we-have-a-problem.com/
Claro, seus navegadores estão fazendo a coisa certa, mas o TLS acontece em mais alguns lugares além do navegador. Então você precisa verificar todos os lugares onde um bundle poderia se esconder. Que dor de cabeça!
Não tenho uma solução para você, desculpe. Mas se você quiser apenas verificar se uma linguagem específica faz a coisa certa logo de cara, aqui estão alguns programas de exemplo simples. Cada um retornará silenciosamente nada (porque esse é o jeito Unix) se tudo estiver tranquilo e reportará um erro se conseguir se conectar aos sites maliciosos conhecidos.
A ferramenta usará o padrão do framework/linguagem em questão, mas você também pode especificar um bundle alternativo para verificar. Se ela souber como, exibirá qual bundle / caminho foi usado.
$ 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
$
Considere adicionar os intermediários ao seu
blocked.certs conforme discutido
aqui.
$ 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: no macOS, você pode pedir ao curl(1) para usar o
backend nativo, que então rejeita a conexão em
todos os casos:
$ 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`
$
Em algum lugar de suas dependências, o Rust faz uma verificação real de blocklist nos intermediários comprometidos, então mesmo com um bundle que confia na raiz da eMudhra, ele falha ao conectar.