标签: authenticode

使用PowerShell获取文件的证书链?

我正在寻找一种方法,仅使用PowerShell,列出签名文件的证书链.专门获取Root证书.

因为我需要获取某些非Microsoft根证书的列表,某些可执行文件(在已安装的软件上)依赖于.这是由于操作系统基准指南,它使用Microsoft KB293781中的PKI过程.只有特定的Root证书才能放在特定的计算机上.例如,经常使用的"VeriSign Class 3 Primary CA-G5"仅在必要时使用.

Get-AuthenticodeSignature仅列出颁发者.例如:Get-AuthenticodeSignature C:\windows\system32\MRT.exe

像"SysInternals SigCheck"这样的工具能够做到这一点sigcheck.exe -i C:\windows\System32\mrt.exe,并且可以进一步解析此信息.此外SignTool.exe,Windows SDK和AnalyzePESigDidier Stevens 等其他工具也可以获取此信息.

但是这可以仅使用PowerShell来完成吗?也许在Windows中使用WinVerifyTrust API. https://msdn.microsoft.com/en-us/library/windows/desktop/aa382384(v=vs.85).aspx http://support2.microsoft.com/kb/323809/en-us

干杯,Tekk

powershell scripting certificate pki authenticode

3
推荐指数
1
解决办法
3001
查看次数

有没有办法签署Go编译器生成的Windows可执行文件?

我试图找出是否有可能签署Go编译器生成的可执行文件.我在构建/编译选项中看不到这一点.这甚至可能吗?

go authenticode

3
推荐指数
1
解决办法
266
查看次数

对于经过authenticode cert签名的install4j安装程序,避免出现“Windows保护您的PC”消息

有什么线索可以避免我的安装程序在启动时触发Windows 保护你的电脑消息吗?我认为使用 Authenticode 签名应该可以解决这个问题,但可惜没有。

虽然未签名的安装程序将发布者描述为未知,但签名的副本将我们公司列为发布者,并且 exe 肯定已签名,因为我可以看到附加的相应证书。

我的问题是我仍然是“不运行”保护对话框。

如果您有如何正确注册我的证书以避免此安全检查的链接,请告诉我。

sign authenticode install4j windows-10

2
推荐指数
1
解决办法
1118
查看次数

Set-AuthenticodeSignature 不会执行 SHA256 时间戳?

使用 Visual Studio 2019 Community 对 Server Core Windows Server 2019 Datacenter Edition 上的 Windows 二进制文件进行签名。 signtool.exe行为不正确(打开 PFX 文件时出现问题),因此建议我们切换到 PowerShell + Set-AuthenticodeSignature

使用以下命令:

$securepassword = ConvertTo-SecureString -String $password -AsPlainText -Force

$pfx = Get-PfxData -FilePath $certificate -Password $securepassword
$cert = $pfx.EndEntityCertificates[0]

Set-AuthenticodeSignature -FilePath $target -Certificate $cert -HashAlgorithm "SHA256" -TimestampServer http://timestamp.digicert.com

Run Code Online (Sandbox Code Playgroud)

结果是具有预期 SHA256 签名的二进制文件,但是时间戳签名是 SHA1。也尝试过用作http://timestamp.digicert.com?alg=sha256服务器,但是Set-AuthenticodeSignature根本不添加时间戳签名。

由于该命令不允许您指定时间戳算法的哈希值,我们该如何实现这一点呢?

windows powershell code-signing authenticode

2
推荐指数
1
解决办法
3538
查看次数

你怎么知道结构中的某些字段是数组?

我正在看微软wincrypt.h头文件中的这段C代码

//+-------------------------------------------------------------------------
//  Attributes
//
//  Where the Value's PATTR_BLOBs are in their encoded representation.
//--------------------------------------------------------------------------
// certenrolls_begin -- CRYPT_ATTRIBUTE
typedef struct _CRYPT_ATTRIBUTE {
    LPSTR               pszObjId;
    DWORD               cValue;
    PCRYPT_ATTR_BLOB    rgValue;
} CRYPT_ATTRIBUTE, *PCRYPT_ATTRIBUTE;

typedef struct _CRYPT_ATTRIBUTES {
    DWORD                cAttr;
    PCRYPT_ATTRIBUTE     rgAttr;
} CRYPT_ATTRIBUTES, *PCRYPT_ATTRIBUTES;
// certenrolls_end
Run Code Online (Sandbox Code Playgroud)

我正在运行此示例如何从Authenticode签名的可执行文件中获取信息.我可以在这两个代码中看到rgValue,并rgAttr作为阵列,例如访问

pSignerInfo->AuthAttrs.rgAttr[n].rgValue[0].pbData,
pSignerInfo->AuthAttrs.rgAttr[n].rgValue[0].cbData,
Run Code Online (Sandbox Code Playgroud)

如果我没有看到这个例子,我永远不会得到这个.是特定于Windows还是我对C中的结构和类型声明完全无知?

c windows winapi code-signing authenticode

1
推荐指数
1
解决办法
133
查看次数