Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on Windows Server 2016 #6

Open
BlackyFox opened this issue Sep 8, 2021 · 5 comments
Open

Crash on Windows Server 2016 #6

BlackyFox opened this issue Sep 8, 2021 · 5 comments

Comments

@BlackyFox
Copy link

BlackyFox commented Sep 8, 2021

Hi,

I was trying out some requests and an exception is returned during execution.
Compiled on Windows Server 2022 with VS2019.

.\Certify.exe find /vulnerable or .\Certify.exe find /clientauth works fine.
The error comes when I try the following command: .\Certify.exe request /ca:REDACTED /template:REDACTED /altname:DOMAIN\REDACTED

[*] Action: Request a Certificates

[!] Unhandled Certify exception:

System.IO.FileNotFoundException: Could not load file or assembly 'Interop.CERTENROLLLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'Interop.CERTENROLLLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
   at Certify.Cert.RequestCert(String CA, Boolean machineContext, String templateName, String subject, String altName, Boolean install)
   at Certify.Commands.Request.Execute(Dictionary`2 arguments)
   at Certify.CommandCollection.ExecuteCommand(String commandName, Dictionary`2 arguments)
   at Certify.Program.MainExecute(String commandName, Dictionary`2 parsedArgs)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

No cert is returned after the exception.
The script is executed directly on a AD CS, with admin rights.

Edit: This exception also occurs when using the download function.

@leechristensen
Copy link
Member

leechristensen commented Oct 6, 2021

This should be fixed now with 4c24a83. If you could test and verify, please let us know if it solved your problem!

@uzi3
Copy link

uzi3 commented Oct 21, 2021

This still doesn't work even with 4c24a83. I was trying to run request command:

Certify.exe request /ca:SERVERname\ca-name /template:TemplateName /onbehalfof:DOMAIN\USER /enrollcert:C:\Temp\enroll.pfx /enrollcertpw:password

Getting this error:

System.IO.FileNotFoundException: Could not load file or assembly 'Interop.CERTENROLLLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'Interop.CERTENROLLLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
at Certify.Cert.CreateCertRequestOnBehalfMessage(String templateName, String onBehalfUser, String signerCertPath, String signerCertPassword, Boolean machineContext)
at Certify.Cert.RequestCertOnBehalf(String CA, String templateName, String onBehalfUser, String signerCertPath, String signerCertPassword, Boolean machineContext)
at Certify.Commands.Request.Execute(Dictionary2 arguments) at Certify.CommandCollection.ExecuteCommand(String commandName, Dictionary2 arguments)
at Certify.Program.MainExecute(String commandName, Dictionary`2 parsedArgs)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

@Envincion
Copy link

Same issue ,can someone help how to solve this thing ..?

@Julienpeps
Copy link

Hey, just ran into the issue, found a quick fix. Just added the following in packages.config, hope it helps!

<package id="Interop.CERTENROLLLib" version="1.0.0" targetFramework="net40" developmentDependency="true" />

@OlivierLaflamme
Copy link

I somehow still ran into this issue.

The solution is to use run ILRepack (nuget download) and add Interop.CERTENROLLLib.dll standalone

C:\Users\X\.nuget\packages\ilrepack\2.0.35\tools\ILRepack.exe standaloneCertipy.exe C:\Mac\Home\Downloads\Certify-main\Certify\bin\Debug\Certify.exe Interop.CERTENROLLLib.dll

should be good after

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants