$ show GhostPack/Certify
Certify is a monolithic C# CLI tool for enumerating and attacking misconfigurations in Active Directory Certificate Services (AD CS). It provides over a dozen verbs covering discovery (enum-cas, enum-templates, enum-pkiobjects), certificate request (request, request-agent, request-download, request-renew), certificate forging (forge), and CA/template management (manage-ca, manage-template, manage-self). The architecture is a single .NET 4.7.2 console application using CommandLineParser for argument handling and COM interop (CERTENROLLLib, ICertAdminD2) for enrollment and CA administration. It queries Active Directory via LDAP (System.DirectoryServices) and uses BouncyCastle for cryptographic operations. The codebase is well-structured, with clear separation of concerns into commands, domain models, libraries, and utilities, and demonstrates deep knowledge of Windows PKI internals, including DCOM communication, remote registry access, and certificate chain manipulation.
The LLM identified 2 files worth highlighting for reuse:
Provides a managed wrapper around the ICertAdminD2 COM interface for remote Certificate Authority administration. It defines the COM interface with precise StructLayout and marshaling, and implements methods for setting extensions, issuing/denying requests, revoking certificates, managing templates, and modifying CA security. This is a reusable component for any .NET project needing to interact with Windows AD CS via DCOM, demonstrating non-obvious skill in COM interop and protocol compliance.
Encodes a security identifier (SID) extension for X.509 certificates using the Crypt32 API and manual ASN.1 construction. This is a self-contained utility that handles the specific OID (1.3.6.1.4.1.311.25.2.1) and marshaling of CERT_ALT_NAME structures. It can be extracted and reused in any certificate generation tool that needs to embed a SID extension, and it demonstrates advanced knowledge of Windows certificate encoding APIs.