Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
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.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Invoke-RunAsWithCert — A PowerShell script to perform PKINIT authentication with the Windows API from a non domain-joined machine. | Kitploit
Tools/GitHubGitHub/synacktiv/invoke-runaswithcert
Lateral MovementPost-ExploitationPenetration TestingAuthenticationRed Teaming
GitHubsynacktiv/invoke-runaswithcert

Invoke-RunAsWithCert

A PowerShell script to perform PKINIT authentication with the Windows API from a non domain-joined machine.

View Repository
1781522 years agoReviewed by Kitploit

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Invoke-RunAsWithCert

A PowerShell script to perform PKINIT authentication with the Windows API from a non domain-joined machine.

Description

This cmdlet creates a new logon session with the specified certificate via PKINIT.

It is meant to be run on a non domain-joined VM. The cmdlet has two modes: one that sets registry keys and one that patches LSASS memory to bypass client-side checks related to the domain controller's certificate. These checks fail when running on a machine that is not joined to the domain.

In registry mode (the default), administrator privileges are needed to set the relevant registry keys (and restore them at the end). If the keys are already set, administrator privileges are not required. Moreover, the CA certificate must be added to the list of trusted certification authorities. If this method fails (e.g. because of a check that is not bypassed with the registry keys), the patch method can be tried instead. It is less elegant but will bypass any client-side check related to the KDC certificate.

In patch mode (-PatchLsass), the KerbCheckKdcCertificate function in LSASS will be patched. As KerbCheckKdcCertificate is not exported by kerberos.dll, symbols need to be retrieved. For the symbols to be automatically retrieved by this cmdlet, the environment variable _NT_SYMBOL_PATH needs to be defined (e.g. ). If the symbols are not already on disk, an Internet connection is needed to download them. The Windows SDK is also needed to download the symbols. By default, the script will look in to find the DLLs it needs ( and ).

SRV*c:\symbols*https://msdl.microsoft.com/download/symbols
C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
dbghelp.dll
symsrv.dll

For a more detailed explanation, see the associated blogpost.

Usage

root@kitploit:~
PS > Invoke-RunAsWithCert user.pfx -Domain CORP.LOCAL
Download Tool