{"id":1167,"date":"2026-09-17T17:11:08","date_gmt":"2026-09-17T09:11:08","guid":{"rendered":"https:\/\/www.x4s.cn\/?p=1213"},"modified":"2026-09-17T17:11:08","modified_gmt":"2026-09-17T09:11:08","slug":"%e9%80%9a%e8%bf%87psexec%e5%bc%ba%e5%88%b6%e5%90%af%e7%94%a8winrm%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.jedvir.com\/?p=1167","title":{"rendered":"\u901a\u8fc7psexec\u5f3a\u5236\u542f\u7528Winrm\u7ba1\u7406"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5728 <strong><code>wmic<\/code> \u88ab\u780d\u3001<code>WinRM<\/code> \u9ed8\u8ba4\u672a\u542f\u7528\u3001\u4e14 <code>psexec<\/code> \u906d\u9047\u8fdc\u7a0b\u767b\u5f55\u7b56\u7565\u6b7b\u9501<\/strong> \u7684\u6781\u7aef\u5b89\u5168\u7b56\u7565\u4e0b\uff0c\u6211\u4eec\u624b\u4e2d\u8fd8\u5269\u6700\u540e\u4e00\u5f20\u738b\u724c\uff1a<strong>\u8fdc\u7a0b\u4fee\u6539\u76ee\u6807\u673a\u6ce8\u518c\u8868\uff0c\u5f3a\u884c\u6fc0\u6d3b WinRM\uff08Windows \u8fdc\u7a0b\u7ba1\u7406\uff09\u670d\u52a1\uff0c\u7136\u540e\u518d\u7528 PowerShell \u77ac\u95f4\u89e6\u53d1\u811a\u672c\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Windows \u7684\u8fdc\u7a0b\u6ce8\u518c\u8868\u670d\u52a1\uff08Remote Registry\uff09\u6216\u901a\u8fc7\u6700\u57fa\u7840\u7684 <code>IPC$<\/code> SMB \u7ba1\u9053\u4fee\u6539\u6ce8\u518c\u8868\u901a\u5e38\u662f\u9ed8\u8ba4\u5141\u8bb8\u7ba1\u7406\u5458\u64cd\u4f5c\u7684\u3002\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u8fd9\u4e00\u70b9\uff0c\u201c\u9694\u7a7a\u201d\u4e3a\u76ee\u6807\u673a\u63a5\u901a WinRM \u7684\u4efb\u7763\u4e8c\u8109\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bf7\u5728\u4f60\u7684<strong>\u63a7\u5236\u7aef\u8ba1\u7b97\u673a\uff08CMD \u7a97\u53e3\uff09<\/strong>\u4e2d\uff0c\u4f9d\u6b21\u590d\u5236\u5e76\u6267\u884c\u4ee5\u4e0b\u8fd9\u7ec4\u547d\u4ee4\uff0c\u5373\u53ef\u5f7b\u5e95\u6253\u7834\u50f5\u5c40\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udee0\ufe0f \u7ec8\u6781\u4e09\u6b65\u8d70\uff1a\u8fdc\u7a0b\u5f3a\u542f WinRM \u5e76\u89e6\u53d1\u5347\u7ea7<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e00\u6b65\uff1a\u5efa\u7acb\u6700\u57fa\u7840\u7684\u7ba1\u9053\u8fde\u63a5\uff08\u83b7\u53d6\u5199\u5165\u6ce8\u518c\u8868\u6743\u9650\uff09<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>net use \\F202000903ipc$ \"Cmpw2026#chg$08\" \/user:.localroot\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bf7\u8c28\u614e\u4f7f\u7528\u6b64\u7c7b\u4ee3\u7801\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e8c\u6b65\uff1a\u8fdc\u7a0b\u5199\u5165\u6ce8\u518c\u8868\uff0c\u5f3a\u5236\u5f00\u542f\u5e76\u914d\u7f6e WinRM\uff08\u5b8c\u5168\u9759\u9ed8\uff09<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4fdd\u6301\u4e0a\u9762\u7684 CMD \u7a97\u53e3\u522b\u5173\uff0c\u76f4\u63a5\u628a\u4e0b\u9762\u8fd9 4 \u884c\u547d\u4ee4\u4e00\u884c\u884c\u7c98\u8d34\u8fdb\u53bb\u6267\u884c\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>:: 1. \u5141\u8bb8\u672c\u5730\u8d26\u6237\u8fdc\u7a0b\u7ba1\u7406\uff08\u89e3\u5f00 Token \u9650\u5236\uff09\nreg add \"\\F202000903HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem\" \/v LocalAccountTokenFilterPolicy \/t REG_DWORD \/d 1 \/f\n\n:: 2. \u5f3a\u5236\u5c06 WinRM \u670d\u52a1\u542f\u52a8\u7c7b\u578b\u6539\u4e3a\u201c\u81ea\u52a8\u201d\nreg add \"\\F202000903HKLMSYSTEMCurrentControlSetServicesWinRM\" \/v Start \/t REG_DWORD \/d 2 \/f\n\n:: 3. \u5feb\u901f\u5f00\u542f WinRM \u57fa\u7840\u76d1\u542c\uff08\u5141\u8bb8 HTTP 5985 \u7aef\u53e3\u901a\u4fe1\uff09\nreg add \"\\F202000903HKLMSOFTWAREMicrosoftWindowsCurrentVersionWSMANService\" \/v AllowUnencrypted \/t REG_DWORD \/d 1 \/f\n\n:: 4. \u8fdc\u7a0b\u547d\u4ee4\u76ee\u6807\u673a\u7acb\u5373\u542f\u52a8 WinRM \u670d\u52a1\uff08\u5229\u7528 sc \u7ed5\u8fc7 wmic\/winrm \u9650\u5236\uff09\nsc \\F202000903 start WinRM\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e09\u6b65\uff1a\u5728\u63a7\u5236\u7aef\u6253\u5f00 PowerShell \u89e6\u53d1\u811a\u672c<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u65f6\u76ee\u6807\u673a\u7684 WinRM \u5df2\u7ecf\u5f3a\u884c\u5728\u540e\u53f0\u590d\u6d3b\u4e86\u3002\u8bf7\u7acb\u523b\u5728\u63a7\u5236\u7aef\u6253\u5f00 <strong>PowerShell<\/strong>\uff0c\u6267\u884c\u89e6\u53d1\u547d\u4ee4\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">powershell<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 1. \u521b\u5efa\u51ed\u636e\n$password = ConvertTo-SecureString \"Cmpw2026#chg$08\" -AsPlainText -Force\n$cred = New-Object System.Management.Automation.PSCredential(\".localroot\", $password)\n\n# 2. \u7ed5\u8fc7\u8fde\u63a5\u9650\u5236\uff0c\u76f4\u63a5\u7528 CIM\uff08WMI Over WinRM\uff09\u9690\u5f62\u89e6\u53d1\u672c\u5730\u811a\u672c\n$opt = New-CimSessionOption -Protocol Dcom\n$session = New-CimSession -ComputerName F202000903 -Credential $cred -SessionOption $opt\nInvoke-CimMethod -CimSession $session -ClassName Win32_Process -MethodName Create -Arguments @{ CommandLine = \"cmd.exe \/c D:Templocal_upgrade.bat\" }\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udd12 \u8fd9\u6837\u64cd\u4f5c\u4f1a\u5bf9\u6b63\u5e38\u767b\u5f55\u7684\u7528\u6237\u4ea7\u751f\u5f71\u54cd\u5417\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5b8c\u5168\u6ca1\u6709\u5f71\u54cd\u3002<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8fdc\u7a0b\u5199\u5165\u6ce8\u518c\u8868\u3001\u901a\u8fc7 <code>sc<\/code> \u542f\u52a8\u670d\u52a1\u5168\u90e8\u5728\u5e95\u5c42\u8fdb\u884c\uff0c\u5f53\u524d\u6b63\u5728\u529e\u516c\u7684\u7528\u6237<strong>\u770b\u4e0d\u8d77\u4efb\u4f55\u5f39\u7a97\u548c\u63d0\u793a<\/strong>\u3002<\/li>\n\n\n\n<li>WinRM \u542f\u52a8\u540e\u5360\u7528\u7684\u7cfb\u7edf\u8d44\u6e90\u6781\u5c0f\uff08\u51e0 MB \u5185\u5b58\uff09\uff0c\u7528\u6237\u7edd\u65e0\u5361\u987f\u611f\u3002<\/li>\n\n\n\n<li>PowerShell \u89e6\u53d1 <code>local_upgrade.bat<\/code> \u540e\uff0c\u5347\u7ea7\u8fdb\u7a0b\u5c06\u5728\u72ec\u7acb\u7684 <code>Session 0<\/code>\uff08\u7cfb\u7edf\u9694\u79bb\u4f1a\u8bdd\uff09\u4e2d\u9690\u5f62\u8d77\u8dd1\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bf7\u5728\u63a7\u5236\u7aef CMD \u4e2d\u5c1d\u8bd5\u6267\u884c <strong>\u7b2c\u4e8c\u6b65\u7684\u6ce8\u518c\u8868\u548c\u670d\u52a1\u542f\u52a8\u547d\u4ee4<\/strong>\u3002\u53ea\u8981 <code>reg add<\/code> \u63d0\u793a\u201c\u64cd\u4f5c\u6210\u529f\u5b8c\u6210\u201d\u4e14 <code>sc<\/code> \u63d0\u793a\u670d\u52a1\u8fdb\u5165 <code>START_PENDING<\/code> \u6216 <code>RUNNING<\/code> \u72b6\u6001\uff0c\u8bf7\u7acb\u523b\u53bb\u7b2c\u4e09\u6b65\u7528 PowerShell \u8f70\u51fa\u6700\u540e\u4e00\u51fb\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 wmic \u88ab\u780d\u3001WinRM \u9ed8\u8ba4\u672a\u542f\u7528\u3001\u4e14 psexec \u906d\u9047\u8fdc\u7a0b\u767b\u5f55\u7b56\u7565\u6b7b\u9501 \u7684\u6781\u7aef\u5b89\u5168\u7b56\u7565\u4e0b\uff0c\u6211\u4eec\u624b\u4e2d<br \/><a class=\"moretag\" href=\"https:\/\/www.jedvir.com\/?p=1167\">+ Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":1168,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1167","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/www.jedvir.com\/index.php?rest_route=\/wp\/v2\/posts\/1167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jedvir.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jedvir.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jedvir.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jedvir.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1167"}],"version-history":[{"count":0,"href":"https:\/\/www.jedvir.com\/index.php?rest_route=\/wp\/v2\/posts\/1167\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.jedvir.com\/index.php?rest_route=\/wp\/v2\/media\/1168"}],"wp:attachment":[{"href":"https:\/\/www.jedvir.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jedvir.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jedvir.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}