Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
emuddler — Proof-of-concept tool for recovering EC private keys affected by the October 2026 eMudhra intermediate CA key compromise (CVE-2026-111943, CVE-2026-111944) | Kitploit
Tools/GitHubGitHub/shaofeihuang/emuddler
Encryption/Decryption ToolsVulnerability AnalysisExploitationHash AnalysisCryptographyLearning & Education
GitHubshaofeihuang/emuddler

emuddler

Proof-of-concept tool for recovering EC private keys affected by the October 2026 eMudhra intermediate CA key compromise (CVE-2026-111943, CVE-2026-111944)

View Repository
9h 13m agoNot yet reviewed
Share

Digital risks Image credit: Forbes India

eMuddler

A proof-of-concept tool for recovering EC private keys affected by the October 2026 eMudhra intermediate CA key compromise (CVE-2026-111943, CVE-2026-111944), in which a flawed key-generation ceremony produced trivially small P-384 private scalars instead of properly random 384-bit values. Where the vulnerable keys are small enough, the private scalar's non-zero bytes are confined to the last byte (or last few bytes) of the 384-bit value, which makes brute-force recovery from the public key alone computationally trivial — a 256-value search per byte, rather than a ~2^384 search.

Background

In October 2026, eMudhra disclosed that eight intermediate Certificate Authority (CA) private keys (six TLS and two code-signing) were compromised due to an April 2025 key-generation script error that produced trivially guessable keys.

See also: emudhra.we-have-a-problem.com

This tool was built to understand and reproduce the mechanics of that disclosed flaw: given a vulnerable certificate's public key, and the knowledge that the corresponding private scalar is a small integer (effectively zero in all but its last byte(s)), recover the private key by exhaustive search and verify it against the certificate's public key.

Scope and limitations

This is not a general attack on ECDSA/EC private keys. Brute-forcing an EC-384 scalar in the general case is a ~2^384 search and is computationally infeasible. This tool only works because the specific vulnerability class it targets produces scalars that are not uniformly random — they are small integers, meaning almost every byte of the 48-byte secp384r1 scalar is zero. That is what reduces the practical search space to 256 candidates per unknown byte.

If a key was generated correctly (a uniformly random 384-bit scalar), this tool cannot recover it. It only applies to certificates affected by this class of weak key generation, or to test keys you've deliberately constructed to resemble them.

Requirements

  • Python 3
  • openssl on PATH (the script shells out to openssl ec, openssl pkey, and openssl x509)
    • On macOS, the system openssl is LibreSSL and does not support -no_public. Install OpenSSL 3 via Homebrew (brew install openssl@3) and point --openssl at /opt/homebrew/opt/openssl@3/bin/openssl if you need to strip the public key from a freshly generated key.

Usage

usage: emuddler.py [-h] [--openssl OPENSSL] [--start START] [--end END]
                      [--bootstrap] [--curve CURVE] [--outdir OUTDIR] [-q]
                      [--der private_key.der] [--cert cert.pem]
 
options:
  -h, --help            show this help message and exit
  --openssl OPENSSL     path to the openssl binary (default: openssl)
  --start START         override scalar start offset in the DER file
  --end END             override scalar end offset (exclusive)
  --bootstrap           generate a fresh key pair and use it as the nopub
                        input
  --curve CURVE         curve for --bootstrap (default: secp384r1)
  --outdir OUTDIR       directory for --bootstrap output (default: .)
  -q, --quiet           suppress per-iteration output; print only the final
                        result
  --der private_key.der
                        input key in DER, e.g. ecdsa-secp384r1-key-nopub.der
  --cert cert.pem       cert PEM to compare the recovered public key
                        against

--der is required unless --bootstrap is given (in which case the freshly generated -nopub key is used automatically). --cert is optional: without it, the script parses the DER, reports the scalar offsets, and exits without doing the brute-force search.

1. Generate a test key pair

python3 emuddler.py --bootstrap --curve secp384r1

This runs, under the hood:

openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:secp384r1 \
  -outform DER -out ecdsa-secp384r1-key.der
openssl ec -in ecdsa-secp384r1-key.der -no_public \
  -outform DER -out ecdsa-secp384r1-key-nopub.der

producing ecdsa-secp384r1-key.der (full key pair) and ecdsa-secp384r1-key-nopub.der (private key only, no embedded public key) in --outdir. For realistic testing of the vulnerable scenario, manually zero out all but the last byte(s) of the scalar in the -nopub file before recovery (or use --start/--end to tell the tool which bytes to treat as unknown).

2. Recover the private key against a known public key / certificate

python3 emuddler.py --der ecdsa-secp384r1-key-nopub.der --cert EM-DV-TLS-CA-G3B.crt.pem

The script:

  1. Parses the DER file to locate the private scalar (the OCTET STRING inside the ECPrivateKey SEQUENCE), without assuming a fixed header length, so it works across different curves and encodings.
  2. Zeroes the entire scalar except the last byte.
  3. For each value 0x00–0xff in the last byte, writes a candidate DER key, runs openssl ec -text -noout on it, derives the public key with openssl ec -pubout, and compares it (base64 body only) against the public key extracted from --cert via openssl x509 -pubkey -noout.
  4. Reports the first matching byte value in both hex and decimal, or reports that no match was found.

3. Quiet mode

python3 emuddler.py --der ecdsa-secp384r1-key-nopub.der --cert EM-DV-TLS-CA-G3B.crt.pem -q

Suppresses all per-iteration output and prints only:

*** MATCH FOUND: last byte = 9c (hex) / 156 (dec) ***
elapsed time to match: 0.842s

or

No match found across 00..ff.
elapsed time: 21.407s

Overriding scalar offsets

If the automatic DER parser ever gets the offsets wrong for a given file (e.g. an unusual encoding), or the vulnerable key has more than one non-zero byte, you can force the search range manually:

python3 emuddler.py --der private_key.der --cert cert.pem --start 7 --end 55

--end is exclusive; the byte at --end - 1 is the one that gets iterated. Searching a wider range (more than one unknown byte) requires extending the loop in the script to iterate over multiple byte positions rather than just the last one.

How it works

emuddler.py has a small number of pieces:

  • parse_der(b, pos) — a minimal DER length-field parser. DER lengths are either "short form" (a single byte under 0x80 giving the length directly) or "long form" (a byte with the top bit set, whose low 7 bits say how many following bytes encode the actual length). Returns (length, new_position) so the caller can keep walking the buffer.
  • find_privkey(b) — locates the private key bytes inside a SEC1 ECPrivateKey DER structure without hardcoding offsets, so it works across different curves and key sizes. It expects:
30 <len>              -- outer SEQUENCE
  02 01 01            -- INTEGER 1 (version)
  04 <len> <scalar>    -- OCTET STRING holding the private scalar
  (a0 ... curve OID, a1 ... public key — ignored)

It checks the SEQUENCE tag, skips the length, confirms the version integer is exactly 02 01 01, then reads the tag/length of the following OCTET STRING and returns (start, end) — the byte range of the actual scalar (e.g. the 48 bytes for secp384r1).

  • normalize_pem(pem_text) — strips the -----BEGIN/END----- lines and all newlines from a PEM block, leaving just the base64 body as one string, so two PEM public keys can be compared for equality regardless of line-wrapping.
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    972
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    666
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    424
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

    389
  • 5

    SafeLine

    chaitin/safeline

    Self-hosted WAF and reverse proxy that filters malicious HTTP traffic, blocks SQL injection, XSS, and bot attacks, with rate limiting and dynamic HTML/JS encryption.

    337
  • 6

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    331

Explore all tools

Browse our collection of tools

View all tools →