
P-256/384/521에서 사소할 정도로 작은 EC 개인 키(예: eMudhra 약한 키 클래스)가 포함된 인증서를 찾기 위해 Certificate Transparency 로그를 모니터링합니다.
타원 곡선 개인 키가 사소할 정도로 작은 정수인 X.509 인증서를 탐지합니다(작은 d에 대해 공개점 Q = d*G) — eMudhra 오발급 유형입니다. 곡선: P-256, P-384, P-521.
p4mon/ — 프로덕션 모니터: 인메모리 Rust 검사기, CT 로그 테일러, systemd 유닛common/ — targets.tsv, answers.tsv (기지 답안 벡터)benchmarks/ — rust c cpp go 탐지기 구현reference/ — Python 탐지기 및 CCADB / BSGS 스위퍼| 지표 | 값 |
|---|---|
| 스캔한 인증서 | 하루 약 2억 2천만 건 관측 → 약 1,100만 개의 고유 키(로그 간 중복 제거 90%) |
| 발견된 취약 키 | 0 |
| CPU | 단일 코어의 약 5%(1 코어로 하드 제한, SCHED_IDLE) |
| RAM | 약 580 MB(최대 642 MB, 1 GB 상한) |
| 네트워크 | 인그레스 약 30–40 Mbit/s(하루 약 300–430 GB), 이그레스는 무시할 수준 |
| 디스크 I/O | 거의 없음(테이블은 페이지 캐시에서 한 번 로드되며, 발견 시에만 결과 기록) |
CT 발급량에 따라 확장됩니다. AWS m7g.large(aarch64), 로그 16개에서 측정했습니다.
cargo build --release --manifest-path p4mon/Cargo.toml
cd p4mon
curl -fsSo loglist.json https://www.gstatic.com/ct/log_list/v3/log_list.json
./target/release/p4mon build table.bin # precompute d*G, d=1..1_000_000 (~80s, once)
./target/release/p4mon selftest # known-answer gate
./target/release/p4mon cert <file> # -> WEAK d=<n> | clean
python3 ct_tail_live.py | ./target/release/p4mon stream table.bin # live tail
유닛은 체크아웃이 /home/ec2-user/p4-inventory/p4mon에 있다고 가정합니다. 그렇지 않으면 경로를 조정하세요.
cd p4mon
python3 -m pip install --user apprise # delivery library (alerts)
mkdir -p ~/.config/p4mon && cp apprise.txt.example ~/.config/p4mon/apprise.txt
chmod 600 ~/.config/p4mon/apprise.txt # then edit: add your target URL(s)
sudo cp systemd/p4mon-*.service systemd/p4mon-*.path systemd/p4mon-*.timer /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now p4mon-ct.service p4mon-find.path p4mon-report.timer
p4mon-ct는 loglist.json이 없으면 자동으로 가져옵니다(ExecStartPre). 알림(발견 시 + 일일)은 ~/.config/p4mon/apprise.txt에 나열한 대상으로 Apprise를 통해 전달됩니다 — 이메일, ntfy, Pushover, Telegram, Slack, webhook 등(apprise.txt.example 참조). LLM은 사용하지 않습니다. 대상이 구성되지 않은 경우 보고서는 전송되지 않고 저널에 기록됩니다.