Skip to main content

Crate ms_icpr

Crate ms_icpr 

Source
Expand description

ms-icpr — ICertPassage (MS-ICPR) / WCCE client with an ESC1 CSR-SAN injection primitive.

§Purpose

Submit certificate requests to an AD-CS Enterprise CA over RPC and retrieve the issued certificate. The offensive path this crate enables is ESC1: against an enrollee-supplies-subject template, a low-privileged user ships a CSR with a SubjectAltName{otherName, userPrincipalName=...} extension and the CA emits a client-auth certificate bound to any UPN in the domain (e.g. administrator@corp.local).

§Status: 0.1.0-dev (pre-alpha)

§Example

use ms_icpr::{build_csr_with_upn_san, IcprClient};
let csr = build_csr_with_upn_san("recon", "administrator@corp.local", key_pem)?;
let mut client = IcprClient::stub("corp-CA");
// On a live DC this would issue the cert. Offline: Err(LiveDcOnly).
let _ = client.submit_request(&template, &csr);

Re-exports§

pub use csr::build_csr_with_upn_san;
pub use csr::build_csr_with_upn_san_and_ekus;
pub use csr::parse_rsa_private_key_pem;
pub use csr::EkuCarrier;
pub use error::Error;
pub use error::Result;
pub use esc3::build_cmc_pkidata;
pub use esc3::build_esc3_request;
pub use esc3::sign_pkidata_as_agent;
pub use esc3::OID_ENROLLMENT_AGENT_EKU;
pub use kerberos::encode_kerberos_auth3_pdu;
pub use kerberos::encode_kerberos_bind_pdu;
pub use kerberos::KrbTicket;
pub use kerberos::ICPR_SYNTAX_UUID;
pub use kerberos::RPC_C_AUTHN_GSS_KERBEROS;
pub use rpc::decode_cert_server_response;
pub use rpc::encode_cert_server_request;
pub use rpc::encode_cert_server_request_with_attribs;
pub use rpc::encode_cert_server_request_with_san;
pub use rpc::CertServerResponse;
pub use rpc::IcprClient;
pub use rpc::IcprTransport;
pub use rpc::IssuedCert;
pub use rpc::StubTransport;
pub use rpc::CERT_SERVER_REQUEST_OPNUM;
pub use rpc::KerberosTransport;
pub use rpc::NetworkTransport;

Modules§

csr
PKCS#10 CertificationRequest builder with ESC1’s ergonomic knob: injecting otherName{userPrincipalName, "administrator@corp.local"} into the requested SubjectAltName extension.
der
Minimal DER encoder — just enough to build a PKCS#10 CertificationRequest with a SubjectAltName otherName(UPN) extension. Hand-rolled to keep the dep graph flat and the ESC1 primitive fully auditable.
error
Error types for ms-icpr.
esc3
ESC3 — CMC EnrollOnBehalfOf.
kerberos
MS-ICPR Kerberos sealed-bind wire encoder.
oids
Well-known OIDs used by MS-ICPR / WCCE certificate requests.
rpc
MS-ICPR / MS-WCCE RPC client.