
Go, Java, Node, Perl, Python, Ruby, Rust 및 curl로 작성된 예제 프로그램으로, TLS 트러스트 스토어가 알려진 악성 eMudhra CA 사이트에 대한 연결을 거부하는지 테스트합니다.
https://emudhra.we-have-a-problem.com/
물론, 브라우저는 올바르게 동작하고 있습니다. 하지만 TLS는 브라우저 외에도 몇 군데 더 존재합니다. 따라서 번들이 숨을 수 있는 모든 곳을 확인해야 합니다. 정말 번거롭죠!
죄송하지만 해결책은 없습니다. 다만 특정 언어가 기본 설정으로 올바르게 동작하는지 확인하고 싶다면, 아래에 간단한 예제 프로그램들이 있습니다. 각 프로그램은 모든 것이 정상이면 아무것도 반환하지 않고(이것이 Unix 방식이니까요), 알려진 악성 사이트에 연결할 수 있으면 오류를 보고합니다.
이 도구는 해당 프레임워크/언어의 기본값을 사용하지만, 검사할 대체 번들을 지정할 수도 있습니다. 가능한 경우 사용한 번들/경로를 표시합니다.
$ 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
$
여기에서
설명한 대로 blocked.certs에 중간 인증서를 추가하는 것을
고려하세요.
$ 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/
$
참고: macOS에서는 curl(1)에 네이티브 백엔드를 사용하도록
요청할 수 있으며, 그러면 모든 경우에 연결을 거부합니다:
$ 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`
$
Rust는 의존성 어딘가에서 손상된 중간 인증서에 대해 실제 차단 목록 검사를 수행하므로, eMudhra의 루트를 신뢰하는 번들을 사용하더라도 연결에 실패합니다.