{"id":47820,"date":"2024-10-07T16:54:15","date_gmt":"2024-10-07T08:54:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/47820\/"},"modified":"2024-10-07T16:54:15","modified_gmt":"2024-10-07T08:54:15","slug":"iis%e5%ae%89%e5%85%a8%e6%95%99%e7%a8%8b%ef%bc%9a%e4%bd%bf%e7%94%a8x-content-type-options%e9%a0%ad%e9%98%b2%e6%ad%a2%e5%85%a7%e5%ae%b9%e9%a1%9e%e5%9e%8b%e5%97%85%e6%8e%a2","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/47820\/","title":{"rendered":"IIS\u5b89\u5168\u6559\u7a0b\uff1a\u4f7f\u7528X-Content-Type-Options\u982d\u9632\u6b62\u5167\u5bb9\u985e\u578b\u55c5\u63a2"},"content":{"rendered":"<h1 id=\"iis%e5%ae%89%e5%85%a8%e6%95%99%e7%a8%8b%ef%bc%9a%e4%bd%bf%e7%94%a8x-content-type-options%e9%a0%ad%e9%98%b2%e6%ad%a2%e5%85%a7%e5%ae%b9%e9%a1%9e%e5%9e%8b%e5%97%85%e6%8e%a2-AtsaxAtCld\">IIS\u5b89\u5168\u6559\u7a0b\uff1a\u4f7f\u7528X-Content-Type-Options\u982d\u9632\u6b62\u5167\u5bb9\u985e\u578b\u55c5\u63a2<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0c\u7db2\u7ad9\u5b89\u5168\u6027\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u91cd\u8981\u3002\u96a8\u8457\u7db2\u7d61\u653b\u64ca\u624b\u6bb5\u7684\u65e5\u76ca\u589e\u591a\uff0c\u7db2\u7ad9\u7ba1\u7406\u8005\u5fc5\u9808\u63a1\u53d6\u6709\u6548\u7684\u63aa\u65bd\u4f86\u4fdd\u8b77\u5176\u61c9\u7528\u7a0b\u5e8f\u548c\u7528\u6236\u6578\u64da\u3002\u672c\u6587\u5c07\u91cd\u9ede\u4ecb\u7d39\u5982\u4f55\u5728IIS\uff08Internet Information Services\uff09\u4e2d\u4f7f\u7528X-Content-Type-Options\u982d\u4f86\u9632\u6b62\u5167\u5bb9\u985e\u578b\u55c5\u63a2\uff0c\u5f9e\u800c\u589e\u5f37\u7db2\u7ad9\u7684\u5b89\u5168\u6027\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af%e5%85%a7%e5%ae%b9%e9%a1%9e%e5%9e%8b%e5%97%85%e6%8e%a2%ef%bc%9f-AtsaxAtCld\">\u4ec0\u9ebc\u662f\u5167\u5bb9\u985e\u578b\u55c5\u63a2\uff1f<\/h2>\n<p>\u5167\u5bb9\u985e\u578b\u55c5\u63a2\u662f\u6307\u700f\u89bd\u5668\u5728\u7121\u6cd5\u78ba\u5b9a\u8cc7\u6e90\u7684MIME\u985e\u578b\u6642\uff0c\u6839\u64da\u5167\u5bb9\u81ea\u52d5\u63a8\u65b7\u5176\u985e\u578b\u7684\u904e\u7a0b\u3002\u9019\u7a2e\u884c\u70ba\u53ef\u80fd\u5c0e\u81f4\u5b89\u5168\u6f0f\u6d1e\uff0c\u56e0\u70ba\u653b\u64ca\u8005\u53ef\u4ee5\u5229\u7528\u9019\u4e00\u9ede\u4f86\u57f7\u884c\u60e1\u610f\u4ee3\u78bc\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4e00\u500b\u7db2\u7ad9\u932f\u8aa4\u5730\u5c07\u4e00\u500bJavaScript\u6587\u4ef6\u4f5c\u70ba\u7d14\u6587\u672c\u6587\u4ef6\u63d0\u4f9b\uff0c\u700f\u89bd\u5668\u53ef\u80fd\u6703\u6839\u64da\u5167\u5bb9\u63a8\u65b7\u5176\u70ba\u53ef\u57f7\u884c\u7684JavaScript\uff0c\u5f9e\u800c\u57f7\u884c\u653b\u64ca\u8005\u7684\u4ee3\u78bc\u3002<\/p>\n<h2 id=\"x-content-type-options%e9%a0%ad%e7%9a%84%e4%bd%9c%e7%94%a8-AtsaxAtCld\">X-Content-Type-Options\u982d\u7684\u4f5c\u7528<\/h2>\n<p>X-Content-Type-Options\u662f\u4e00\u500bHTTP\u97ff\u61c9\u982d\uff0c\u7528\u65bc\u544a\u8a34\u700f\u89bd\u5668\u4e0d\u8981\u9032\u884c\u5167\u5bb9\u985e\u578b\u55c5\u63a2\u3002\u7576\u8a2d\u7f6e\u70ba\u201cnosniff\u201d\u6642\uff0c\u700f\u89bd\u5668\u5c07\u50c5\u6839\u64daHTTP\u97ff\u61c9\u4e2d\u7684Content-Type\u4f86\u8655\u7406\u8cc7\u6e90\uff0c\u800c\u4e0d\u6703\u6839\u64da\u5167\u5bb9\u9032\u884c\u63a8\u65b7\u3002\u9019\u6a23\u53ef\u4ee5\u6709\u6548\u9632\u6b62\u67d0\u4e9b\u985e\u578b\u7684\u653b\u64ca\uff0c\u7279\u5225\u662f\u8de8\u7ad9\u8173\u672c\uff08XSS\uff09\u653b\u64ca\u3002<\/p>\n<h2 id=\"%e5%a6%82%e4%bd%95%e5%9c%a8iis%e4%b8%ad%e8%a8%ad%e7%bd%aex-content-type-options%e9%a0%ad-AtsaxAtCld\">\u5982\u4f55\u5728IIS\u4e2d\u8a2d\u7f6eX-Content-Type-Options\u982d<\/h2>\n<p>\u5728IIS\u4e2d\u8a2d\u7f6eX-Content-Type-Options\u982d\u76f8\u5c0d\u7c21\u55ae\u3002\u4ee5\u4e0b\u662f\u5177\u9ad4\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"%e6%ad%a5%e9%a9%9f1%ef%bc%9a%e6%89%93%e9%96%8biis%e7%ae%a1%e7%90%86%e5%99%a8-AtsaxAtCld\">\u6b65\u9a5f1\uff1a\u6253\u958bIIS\u7ba1\u7406\u5668<\/h3>\n<ul>\n<li>\u5728Windows\u4e2d\uff0c\u6309\u4e0b\u201cWindows\u9375 + R\u201d\uff0c\u8f38\u5165\u201cinetmgr\u201d\uff0c\u7136\u5f8c\u6309Enter\u9375\u3002<\/li>\n<\/ul>\n<h3 id=\"%e6%ad%a5%e9%a9%9f2%ef%bc%9a%e9%81%b8%e6%93%87%e7%b6%b2%e7%ab%99-AtsaxAtCld\">\u6b65\u9a5f2\uff1a\u9078\u64c7\u7db2\u7ad9<\/h3>\n<ul>\n<li>\u5728IIS\u7ba1\u7406\u5668\u4e2d\uff0c\u627e\u5230\u4e26\u9078\u64c7\u60a8\u8981\u914d\u7f6e\u7684\u7db2\u7ad9\u3002<\/li>\n<\/ul>\n<h3 id=\"%e6%ad%a5%e9%a9%9f3%ef%bc%9a%e6%89%93%e9%96%8bhttp%e9%9f%bf%e6%87%89%e6%a8%99%e9%a0%ad-AtsaxAtCld\">\u6b65\u9a5f3\uff1a\u6253\u958bHTTP\u97ff\u61c9\u6a19\u982d<\/h3>\n<ul>\n<li>\u5728\u7db2\u7ad9\u7684\u529f\u80fd\u8996\u5716\u4e2d\uff0c\u627e\u5230\u4e26\u96d9\u64ca\u201cHTTP\u97ff\u61c9\u6a19\u982d\u201d\u3002<\/li>\n<\/ul>\n<h3 id=\"%e6%ad%a5%e9%a9%9f4%ef%bc%9a%e6%b7%bb%e5%8a%a0%e6%96%b0%e7%9a%84%e9%9f%bf%e6%87%89%e6%a8%99%e9%a0%ad-AtsaxAtCld\">\u6b65\u9a5f4\uff1a\u6dfb\u52a0\u65b0\u7684\u97ff\u61c9\u6a19\u982d<\/h3>\n<ul>\n<li>\u5728\u53f3\u5074\u7684\u64cd\u4f5c\u9762\u677f\u4e2d\uff0c\u9ede\u64ca\u201c\u6dfb\u52a0\u201d\u4ee5\u5275\u5efa\u65b0\u7684HTTP\u97ff\u61c9\u6a19\u982d\u3002<\/li>\n<li>\u5728\u201c\u540d\u7a31\u201d\u5b57\u6bb5\u4e2d\u8f38\u5165\u201cX-Content-Type-Options\u201d\u3002<\/li>\n<li>\u5728\u201c\u503c\u201d\u5b57\u6bb5\u4e2d\u8f38\u5165\u201cnosniff\u201d\u3002<\/li>\n<li>\u9ede\u64ca\u201c\u78ba\u5b9a\u201d\u4ee5\u4fdd\u5b58\u66f4\u6539\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%b8%ac%e8%a9%a6%e8%a8%ad%e7%bd%ae%e6%98%af%e5%90%a6%e6%88%90%e5%8a%9f-AtsaxAtCld\">\u6e2c\u8a66\u8a2d\u7f6e\u662f\u5426\u6210\u529f<\/h2>\n<p>\u8a2d\u7f6e\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u700f\u89bd\u5668\u7684\u958b\u767c\u8005\u5de5\u5177\u4f86\u6aa2\u67e5HTTP\u97ff\u61c9\u6a19\u982d\u3002\u6253\u958b\u958b\u767c\u8005\u5de5\u5177\uff0c\u5207\u63db\u5230\u201c\u7db2\u7d61\u201d\u9078\u9805\u5361\uff0c\u7136\u5f8c\u91cd\u65b0\u52a0\u8f09\u9801\u9762\u3002\u9078\u64c7\u4e00\u500b\u8cc7\u6e90\uff0c\u67e5\u770b\u5176\u97ff\u61c9\u6a19\u982d\uff0c\u78ba\u8a8d\u662f\u5426\u5305\u542b\u201cX-Content-Type-Options: nosniff\u201d\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-AtsaxAtCld\">\u7d50\u8ad6<\/h2>\n<p>\u901a\u904e\u5728IIS\u4e2d\u8a2d\u7f6eX-Content-Type-Options\u982d\uff0c\u7db2\u7ad9\u7ba1\u7406\u8005\u53ef\u4ee5\u6709\u6548\u9632\u6b62\u5167\u5bb9\u985e\u578b\u55c5\u63a2\uff0c\u5f9e\u800c\u589e\u5f37\u7db2\u7ad9\u7684\u5b89\u5168\u6027\u3002\u9019\u662f\u4e00\u500b\u7c21\u55ae\u4f46\u6709\u6548\u7684\u63aa\u65bd\uff0c\u80fd\u5920\u986f\u8457\u964d\u4f4e\u6f5b\u5728\u7684\u5b89\u5168\u98a8\u96aa\u3002\u96a8\u8457\u7db2\u7d61\u5b89\u5168\u5a01\u8105\u7684\u589e\u52a0\uff0c\u63a1\u53d6\u9019\u6a23\u7684\u9810\u9632\u63aa\u65bd\u662f\u975e\u5e38\u5fc5\u8981\u7684\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u53ef\u9760\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\u4ee5\u6eff\u8db3\u60a8\u7684\u9700\u6c42\u3002\u7121\u8ad6\u662f\u7db2\u7ad9\u6258\u7ba1\u9084\u662f\u61c9\u7528\u7a0b\u5e8f\u90e8\u7f72\uff0c\u6211\u5011\u7684\u670d\u52d9\u90fd\u80fd\u70ba\u60a8\u63d0\u4f9b\u7a69\u5b9a\u548c\u5b89\u5168\u7684\u74b0\u5883\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728IIS\u4e2d\u4f7f\u7528X-Content-Type-Options\u6a19\u982d\u4f86\u9632\u6b62\u5167\u5bb9\u985e\u578b\u55c5\u63a2\uff0c\u589e\u5f37\u7db2\u7ad9\u5b89\u5168\u6027\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-47820","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47820","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=47820"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47820\/revisions"}],"predecessor-version":[{"id":47821,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/47820\/revisions\/47821"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=47820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=47820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=47820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}