{"id":427382,"date":"2021-04-16T07:57:32","date_gmt":"2021-04-15T23:57:32","guid":{"rendered":"http:\/\/4563.org\/?p=427382"},"modified":"2021-04-16T07:57:32","modified_gmt":"2021-04-15T23:57:32","slug":"%e6%b1%82%e8%a7%a3%e4%b8%80%e4%b8%aa-vb-%e4%bb%a3%e7%a0%81%e4%bf%ae%e6%94%b9%e6%96%87%e4%bb%b6%e5%90%8d%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=427382","title":{"rendered":"\u6c42\u89e3\u4e00\u4e2a VB \u4ee3\u7801\u4fee\u6539\u6587\u4ef6\u540d\u7684\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6c42\u89e3\u4e00\u4e2a VB \u4ee3\u7801\u4fee\u6539\u6587\u4ef6\u540d\u7684\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : vitozyf <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4ee3\u7801\uff1a <\/p>\n<pre><code>My.Computer.FileSystem.RenameFile(\"C:WindowsINFusbstor.inf\", \"usbstop.inf\") <\/code><\/pre>\n<p>\u672c\u610f\u4e3a\u4fee\u6539 <code>C:WindowsINFusbstor.inf<\/code> \u7684\u6587\u4ef6\u540d\uff0c\u63d0\u793a\u9519\u8bef\u201c\u5bf9\u8def\u5f84\u7684\u8bbf\u95ee\u88ab\u62d2\u7edd\u201d<\/p>\n<p>\u7406\u89e3\u4e3a\u6743\u9650\u95ee\u9898\uff0c\u4f46\u662f\u7a0b\u5e8f\u6743\u9650\u4fee\u6539\u4e3a <code>requireAdministrator<\/code>\u6216\u8005<code>highestAvailable<\/code>\u90fd\u4e0d\u884c\uff0cgoogle \u6ca1\u89e3\u51b3<\/p>\n<p>ps: \u624b\u52a8\u4fee\u6539\u8be5\u6587\u4ef6\u540d\u7cfb\u7edf\u4e5f\u4f1a\u63d0\u793a<code>\u4f60\u9700\u8981<\/code>trustedinstaller<code>\u63d0\u4f9b\u7684\u6743\u9650\u624d\u80fd\u5bf9\u6b64\u6587\u4ef6\u8fdb\u884c\u66f4\u6539<\/code>,\u65e0\u6cd5\u4fee\u6539<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>14<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5736356\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ho121 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Windows \u6587\u4ef6\u5939\u4e0b\u7684\u4e1c\u897f\u5c31\u662f\u88ab\u7cfb\u7edf\u4fdd\u62a4\u7684\uff0c\u4e0d\u80fd\u968f\u610f\u4fee\u6539\u3002\u5982\u679c\u4e00\u5b9a\u8981\u4f5c\u6b7b\u4fee\u6539\uff0c\u53ef\u4ee5\u628a\u6587\u4ef6\u7684\u6743\u9650\u548c\u62e5\u6709\u8005\u6539\u6389\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736357\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : typetraits <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6709\u4e24\u79cd\u65b9\u6cd5<br \/>1. \u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884c\u4f60\u7684\u7a0b\u5e8f\uff0c\u901a\u8fc7\u4ee3\u7801\u83b7\u53d6\u8be5\u6587\u4ef6\u6240\u6709\u6743\uff0c\u7136\u540e\u66f4\u6539\u6743\u9650\u5141\u8bb8\u4f60\u7684\u8d26\u6237\u8bfb\u5199\uff0c\u4e4b\u540e\u4fee\u6539\u6587\u4ef6\uff0c\u4fee\u6539\u5b8c\u6bd5\u540e\u518d\u6062\u590d\u6743\u9650<br \/>2. \u4f7f\u7528\u7f51\u4e0a\u7684\u5404\u79cd\u63d0\u6743\u5de5\u5177\uff0c\u8ba9\u4f60\u7684\u7a0b\u5e8f\u76f4\u63a5\u4ee5 System \u6216 TrustedInstaller \u7528\u6237\u6743\u9650\u8fd0\u884c\uff0c\u8fd9\u6837\u4f60\u7684\u4ee3\u7801\u5c31\u4e0d\u7528\u4fee\u6539\uff0c\u4f46\u662f\u7f3a\u70b9\u662f\u5fc5\u987b\u901a\u8fc7\u63d0\u6743\u5de5\u5177\u624d\u80fd\u6267\u884c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736358\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : vitozyf <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ho121 \u6709\u6ca1\u6709\u529e\u6cd5\u4ece\u5e94\u7528\u7ea7\u522b\u76f4\u63a5\u7533\u8bf7\u6700\u9ad8\u7684\u6743\u9650\uff1f\u5426\u5219\u4f7f\u7528\u8005\u8981\u81ea\u5df1\u624b\u52a8\u66f4\u6539\u76ee\u5f55\u6743\u9650\u7684\u8bdd\u5f88\u9ebb\u70e6\u3002\u5c1d\u8bd5\u7533\u8bf7\u7684 requireAdministrator \u6216\u8005 highestAvailable \u6743\u9650\u8c8c\u4f3c\u90fd\u6ca1\u6cd5 =_=                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736359\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : vitozyf <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @typetraits \u6211\u6ca1\u6709\u5199\u8fc7 VB\uff0c\u56e0\u6b64\u5728\u7f51\u4e0a\u627e\u5230\u4ee5\u4e0b\u4ee3\u7801\u4ee5\u5c1d\u8bd5\u65b9\u6cd5 1 \u4e2d`\u901a\u8fc7\u4ee3\u7801\u83b7\u53d6\u8be5\u6587\u4ef6\u6240\u6709\u6743`,\u4f46\u662f\u5e76\u672a\u6210\u529f\u3002\u8fd9\u6bb5\u4ee3\u7801\u662f C#\u7684\u4f8b\u5b50[https:\/\/docs.microsoft.com\/zh-tw\/dotnet\/api\/system.security.permissions.fileiopermission?view=net-5.0]( https:\/\/docs.microsoft.com\/zh-tw\/dotnet\/api\/system.security.permissions.fileiopermission?view=net-5.0)<\/p>\n<p>&#8220;`<br \/>FileIOPermission f2 = new FileIOPermission(FileIOPermissionAccess.Read, &#8220;C:\\test_r&#8221;);<br \/>f2.AddPathList(FileIOPermissionAccess.Write | FileIOPermissionAccess.Read, &#8220;C:\\example\\out.txt&#8221;);<br \/>try<br \/>{<br \/> f2.Demand();<br \/>}<br \/>catch (SecurityException s)<br \/>{<br \/> Console.WriteLine(s.Message);<br \/>}<br \/>&#8220;`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736360\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : typetraits <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @vitozyf #4 \u56e0\u4e3a\u8fd9\u4e2a\u6587\u4ef6\u6240\u6709\u8005\u662f NT SERVICETrustedInstaller\uff0c\u4f60\u8981\u5148\u4fee\u6539\u6587\u4ef6\u6240\u6709\u8005\u624d\u884c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736361\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ysc3839 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6000\u7591\u662f X-Y Problem https:\/\/coolshell.cn\/articles\/10804.html<br \/>\u4f60\u6700\u7ec8\u8981\u5b9e\u73b0\u4ec0\u4e48\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736362\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wevsty <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5e94\u8be5\u662f\u9700\u8981 TrustedInstaller \u6743\u9650\u6765\u64cd\u4f5c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736363\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : vitozyf <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ysc3839 \u62b1\u6b49\uff0c\u786e\u5b9e\u63d0\u7684\u6709\u70b9\u95ee\u9898\u3002<\/p>\n<p>\u6211\u6700\u7ec8\u60f3\u8981\u5b9e\u73b0\u7684\u662f\u7981\u7528 usb \u5b58\u50a8\u7684\u529f\u80fd\u3002\u76ee\u524d\u7684\u65b9\u6848\u662f\u5c06\u6ce8\u518c\u8868 HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesUSBSTORStart \u7684\u503c\u8bbe\u7f6e\u4e3a 4\uff0c\u5f53\u524d\u76ee\u7684\u4f1a\u751f\u6548\u3002\u4f46\u662f\u7535\u8111\u91cd\u542f\u540e\uff0c\u867d\u7136\u8be5\u503c\u4efb\u7136\u662f 4\uff0c\u4f46\u662f usb \u5b58\u50a8\u8bbe\u5907\u4f9d\u7136\u80fd\u88ab\u8bc6\u522b\u3002<\/p>\n<p>\u4e3a\u6b64\u6211\u5728\u7f51\u4e0a\u627e\u5230\u4ee5\u4e0a\u65b9\u6cd5, \u4fee\u6539 C:WindowsINFusbstor.inf \u6587\u4ef6\u540d\u8ba9\u7cfb\u7edf\u8bfb\u4e0d\u5230\uff0c\u5219\u4e0d\u4f1a\u51fa\u73b0\u8fd9\u4e2a usb \u5b58\u50a8\u8bbe\u5907\u4f9d\u7136\u88ab\u8bc6\u522b\u7684\u95ee\u9898\u3002\u4f46\u662f\uff0c\u5728\u6211\u5c1d\u8bd5\u4fee\u6539\u8be5\u6587\u4ef6\u540d\u540e\uff0c\u91cd\u542f\u7535\u8111\u80fd\u67e5\u5230\u6ce8\u518c\u8868\u503c\u4e3a 4\uff0cusbstor.inf \u6587\u4ef6\u540d\u5df2\u7ecf\u88ab\u4fee\u6539\uff0c\u4f46\u662f\u7cfb\u7edf\u4ecd\u7136\u80fd\u8bc6\u522b usb \u5b58\u50a8\u8bbe\u5907\u3002<\/p>\n<p>\u5bf9\u6b64\u60a8\u6709\u4ec0\u4e48\u5efa\u8bae\u4e48\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736364\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : no1xsyzy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             TrustedInstaller &gt; SYSTEM &gt; Admin<br \/>\u4f60\u8fd9\u6837\u63d0\u6743\u4f3c\u4e4e\u662f\u63d0\u4e0d\u5230 TrustedInstaller \u7684<br \/>\u641c\u7d22\u4e86\u4e00\u4e0b\uff0c\u91cd\u542f\u7535\u8111\u7684\u95ee\u9898\u4f3c\u4e4e\u662f BIOS \u4e2d\u5c06 USB \u5b58\u50a8\u542f\u52a8\u4e86\uff08\u4e3a\u4e86\u68c0\u67e5\u542f\u52a8\u4ecb\u8d28\uff1f\uff09<br \/>Windows \u5185\u9664\u4e86\u5f39\u51fa\u4ee5\u5916\u6ca1\u6709\u529e\u6cd5\uff0c\u4f60\u8003\u8651\u4e0b\u505a\u4e2a\u79fb\u9664\u53ef\u79fb\u52a8\u5b58\u50a8\u7684\u5de5\u5177\u653e shell:startup \u91cc\u53bb\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736365\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : g00001 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             VB \u4e0d\u4f1a\uff0c\u7528 aardio \u8bd5\u4e86\u4e00\u4e0b\u63d0\u6743\u4ee5\u540e\u53ef\u4ee5\u6539\u540d\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>\/\/RUNAS\/\/ <br \/>import fsys;<br \/>import fsys.acl;<\/p>\n<p>\/\/\u83b7\u53d6\u6743\u9650<br \/>fsys.acl.takeOwn(&#8220;C:WindowsINFusbstor.inf&#8221;)<br \/>fsys.acl.icacls(&#8220;C:WindowsINFusbstor.inf&#8221;,&#8221;\/grant&#8221;,&#8221;Administrators:(F)&#8221;)<\/p>\n<p>\/\/\u5148\u5907\u4efd\u4e3a usbstor2.inf<br \/>string.save(&#8220;C:WindowsINFusbstor2.inf&#8221;,string.load(&#8220;C:WindowsINFusbstor.inf&#8221;) )<\/p>\n<p>\/\/\u79fb\u9664\u7cfb\u7edf\u5c5e\u6027<br \/>fsys.attrib(&#8220;C:WindowsINFusbstor.inf&#8221;,4\/*_FILE_ATTRIBUTE_SYSTEM*\/)<\/p>\n<p>\/\/\u5220\u9664\u6587\u4ef6\u5b9e\u73b0\u6539\u540d\u6548\u679c<br \/>fsys.delete(&#8220;C:WindowsINFusbstor.inf&#8221;)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736366\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : vitozyf <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @g00001 \u975e\u5e38\u611f\u8c22<\/p>\n<p>\u5bf9\u4e8e\u6700\u7ec8\u76ee\u7684\u6765\u8bf4\uff0c\u4fee\u6539\u6587\u4ef6 \/\u5220\u9664\u6587\u4ef6\uff0c\u5728\u7535\u8111\u91cd\u542f\u540e\u5bf9 usb \u7684\u7981\u7528\u4fee\u6539\uff0c\u4ecd\u7136\u5931\u6548\u4e86\u3002\u76ee\u524d\u770b\u4e00\u4e0b\u5176\u4ed6\u529e\u6cd5                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736367\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : no1xsyzy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @vitozyf \u90a3\u4e0d\u5c31\u9a8c\u8bc1\u7684\u4e86 #9 \u7684\u8bf4\u6cd5\uff1f<br \/>\u56e0\u4e3a\u4f60\u5bf9 Windows \u505a\u7684\u4efb\u4f55\u64cd\u4f5c\u90fd\u5fc5\u987b\u5728\u8fdb\u5165 Windows \u4e4b\u540e\u624d\u4f1a\u8d77\u4f5c\u7528<br \/>\u4f46\u662f\u91cd\u542f\u65f6 BIOS\/UEFI \u4f1a\u5148\u542f\u7528\u6b64 USB \u5b58\u50a8\uff0c\u4e4b\u540e Windows \u4f1a\u7ee7\u627f\u6b64\u7ee7\u627f\u60c5\u51b5\u3002<br \/>\u91cd\u542f\u540e\u91cd\u65b0\u62d4\u63d2 USB \u5b58\u50a8\u5c31\u4e0d\u4f1a\u51fa\u73b0\u4e86\u5427<\/p>\n<p>\u4f60\u8981\u4e48\u8fdb BIOS \u8bbe\u7f6e\u5173\u6389\uff0c\u8981\u4e48 RunService \u91cc\u585e\u4e2a\u81ea\u52a8\u5f39\u51fa\u6240\u6709 USB \u5b58\u50a8\u7684\u5de5\u5177\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736368\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : no1xsyzy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @no1xsyzy s\/\u4e4b\u540e Windows \u4f1a\u7ee7\u627f\u6b64\u7ee7\u627f\u60c5\u51b5 \/\u4e4b\u540e Windows \u4f1a\u7ee7\u627f\u6b64\u542f\u7528\u60c5\u51b5 \/                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5736369\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : vitozyf <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @no1xsyzy \u6d4b\u8bd5\u4e86\u4e00\u4e0b\u5927\u52bf\u81f3\u7ba1\u7406\u8f6f\u4ef6\u7684\u505a\u6cd5\uff0c\u597d\u50cf\u53ea\u5728\u8bbe\u5907\u7ba1\u7406\u5668\u5c42\u9762\u505a\u7684\u5904\u7406\uff0c\u4e0d\u8fc7\u8981\u4e00\u76f4\u6302\u5728\u540e\u53f0\u4fdd\u62a4                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6c42\u89e3\u4e00\u4e2a VB \u4ee3\u7801\u4fee\u6539\u6587\u4ef6\u540d\u7684\u95ee&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/427382"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=427382"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/427382\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=427382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=427382"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=427382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}