{"id":6971,"date":"2024-11-14T13:12:17","date_gmt":"2024-11-14T05:12:17","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6971\/"},"modified":"2024-11-14T13:12:17","modified_gmt":"2024-11-14T05:12:17","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88-mysql-sql-%e8%af%ad%e5%8f%a5%e4%b8%ad%e4%bc%9a%e4%bd%bf%e7%94%a8-11-%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6971\/","title":{"rendered":"\u4e3a\u4ec0\u4e48 MySQL SQL \u8bed\u53e5\u4e2d\u4f1a\u4f7f\u7528 1=1 \uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173020163646938.jpg\" class=\"aligncenter\" title=\"\u4e3a\u4ec0\u4e48 MySQL SQL \u8bed\u53e5\u4e2d\u4f1a\u4f7f\u7528 1=1 \uff1f\u63d2\u56fe\" alt=\"\u4e3a\u4ec0\u4e48 MySQL SQL \u8bed\u53e5\u4e2d\u4f1a\u4f7f\u7528 1=1 \uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>1=1 \u5728 MySQL SQL \u8bed\u53e5\u4e2d\u7684\u5999\u7528<\/strong><\/p>\n<p>\u5728 MySQL \u7684 SQL \u8bed\u53e5\u4e2d\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u7c7b\u4f3c\u4e8e SELECT &#8230; FROM table WHERE 1=1 AND \u6761\u4ef6A \u7684\u5199\u6cd5\u3002\u8fd9\u5e76\u975e\u5076\u7136\uff0c\u800c\u662f\u51fa\u4e8e\u4ee5\u4e0b\u51e0\u79cd\u539f\u56e0\uff1a<\/p>\n<p><strong>\u6027\u80fd\u4f18\u5316<\/strong><\/p>\n<p>1=1 \u59cb\u7ec8\u4e3a\u771f\uff0c\u56e0\u6b64\u6267\u884c\u8ba1\u5212\u4f1a\u5ffd\u7565\u8be5\u6761\u4ef6\uff0c\u8fd9\u6709\u52a9\u4e8e\u63d0\u9ad8\u590d\u6742\u6761\u4ef6\u67e5\u8be2\u7684\u6027\u80fd\u3002\u5728 SQL Server\u3001Oracle\u3001MySQL \u548c PostgreSQL \u4e2d\u5747\u5df2\u5f97\u5230\u9a8c\u8bc1\u3002<\/p>\n<p><strong>\u907f\u514d SQL \u8bed\u6cd5\u9519\u8bef<\/strong><\/p>\n<p>\u590d\u6742\u6761\u4ef6\u67e5\u8be2\u53ef\u80fd\u5305\u542b\u8bb8\u591a AND\/OR \u8bed\u53e5\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u8bed\u6cd5\u9519\u8bef\u3002\u6dfb\u52a0 1=1 \u53ef\u4ee5\u786e\u4fdd WHERE \u5b50\u53e5\u59cb\u7ec8\u6709\u6548\uff0c\u5373\u4f7f\u5176\u4ed6\u6761\u4ef6\u4e3a\u7a7a\u6216\u4e0d\u6ee1\u8db3\u65f6\u4e5f\u662f\u5982\u6b64\u3002<\/p>\n<p><strong>\u5904\u7406\u7a7a\u503c<\/strong><\/p>\n<p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6761\u4ef6\u53ef\u80fd\u4f1a\u57fa\u4e8e\u7a7a\u503c\u8fdb\u884c\u8bc4\u4f30\uff0c\u8fd9\u4f1a\u5bfc\u81f4 SQL \u8bed\u53e5\u62a5\u9519\u3002\u6dfb\u52a0 1=1 \u53ef\u4ee5\u9632\u6b62\u8fd9\u79cd\u60c5\u51b5\u53d1\u751f\uff0c\u56e0\u4e3a\u5b83\u59cb\u7ec8\u4e3a\u771f\uff0c\u5e76\u4e14\u4f18\u5148\u4e8e\u5176\u4ed6\u6761\u4ef6\u3002<\/p>\n<p><strong>\u4f46\u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a<\/strong><\/p>\n<p>\u4e0d\u8981\u8fc7\u5ea6\u4f7f\u7528 1=1\u3002\u5982\u679c\u53ef\u80fd\u7684\u8bdd\uff0c\u5e94\u4f7f\u7528\u66f4\u660e\u786e\u7684\u6761\u4ef6\u6765\u63d0\u9ad8\u67e5\u8be2\u6548\u7387\u3002<\/p>\n<p>\u4e5f\u4e0d\u5efa\u8bae\u5c06\u7a7a\u503c\u4f20\u9012\u7ed9\u6761\u4ef6\u3002\u76f8\u53cd\uff0c\u53ef\u4ee5\u5728 SQL \u6267\u884c\u524d\u5bf9\u8fd9\u4e9b\u503c\u8fdb\u884c\u68c0\u67e5\uff0c\u5e76\u4ec5\u5728\u6ee1\u8db3\u6761\u4ef6\u65f6\u624d\u5c06\u5176\u6dfb\u52a0\u5230 WHERE \u5b50\u53e5\u4e2d\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4e3a\u4ec0\u4e48 MySQL SQL \u8bed\u53e5\u4e2d\u4f1a\u4f7f\u7528 1=1 \uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1=1 \u5728 MySQL SQL \u8bed\u53e5\u4e2d\u7684\u5999\u7528 \u5728 MySQL \u7684 SQL \u8bed\u53e5\u4e2d\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u7c7b\u4f3c\u4e8e SELECT &#8230; FROM table WHERE 1=1 AND \u6761\u4ef6A \u7684\u5199\u6cd5\u3002\u8fd9\u5e76\u975e\u5076\u7136\uff0c\u800c\u662f\u51fa\u4e8e\u4ee5\u4e0b\u51e0\u79cd\u539f\u56e0\uff1a \u6027\u80fd\u4f18\u5316 1=1 \u59cb\u7ec8\u4e3a\u771f\uff0c\u56e0\u6b64\u6267\u884c\u8ba1\u5212\u4f1a\u5ffd\u7565\u8be5\u6761\u4ef6\uff0c\u8fd9\u6709\u52a9\u4e8e\u63d0\u9ad8\u590d\u6742\u6761\u4ef6\u67e5\u8be2\u7684\u6027\u80fd\u3002\u5728 SQL Server\u3001Oracle\u3001MySQL \u548c PostgreSQL \u4e2d\u5747\u5df2\u5f97\u5230\u9a8c\u8bc1\u3002 \u907f\u514d SQL \u8bed\u6cd5\u9519\u8bef \u590d\u6742\u6761\u4ef6\u67e5\u8be2\u53ef\u80fd\u5305\u542b\u8bb8\u591a AND\/OR \u8bed\u53e5\uff0c\u8fd9\u53ef\u80fd\u5bfc\u81f4\u8bed\u6cd5\u9519\u8bef\u3002\u6dfb\u52a0 1=1 \u53ef\u4ee5\u786e\u4fdd WHERE \u5b50\u53e5\u59cb\u7ec8\u6709\u6548\uff0c\u5373\u4f7f\u5176\u4ed6\u6761\u4ef6\u4e3a\u7a7a\u6216\u4e0d\u6ee1\u8db3\u65f6\u4e5f\u662f\u5982\u6b64\u3002 \u5904\u7406\u7a7a\u503c \u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6761\u4ef6\u53ef\u80fd\u4f1a\u57fa\u4e8e\u7a7a\u503c\u8fdb\u884c\u8bc4\u4f30\uff0c\u8fd9\u4f1a\u5bfc\u81f4 SQL \u8bed\u53e5\u62a5\u9519\u3002\u6dfb\u52a0 1=1 \u53ef\u4ee5\u9632\u6b62\u8fd9\u79cd\u60c5\u51b5\u53d1\u751f\uff0c\u56e0\u4e3a\u5b83\u59cb\u7ec8\u4e3a\u771f\uff0c\u5e76\u4e14\u4f18\u5148\u4e8e\u5176\u4ed6\u6761\u4ef6\u3002 \u4f46\u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a \u4e0d\u8981\u8fc7\u5ea6\u4f7f\u7528 1=1\u3002\u5982\u679c\u53ef\u80fd\u7684\u8bdd\uff0c\u5e94\u4f7f\u7528\u66f4\u660e\u786e\u7684\u6761\u4ef6\u6765\u63d0\u9ad8\u67e5\u8be2\u6548\u7387\u3002 \u4e5f\u4e0d\u5efa\u8bae\u5c06\u7a7a\u503c\u4f20\u9012\u7ed9\u6761\u4ef6\u3002\u76f8\u53cd\uff0c\u53ef\u4ee5\u5728 SQL \u6267\u884c\u524d\u5bf9\u8fd9\u4e9b\u503c\u8fdb\u884c\u68c0\u67e5\uff0c\u5e76\u4ec5\u5728\u6ee1\u8db3\u6761\u4ef6\u65f6\u624d\u5c06\u5176\u6dfb\u52a0\u5230 WHERE \u5b50\u53e5\u4e2d\u3002 \u4ee5\u4e0a\u5c31\u662f\u4e3a\u4ec0\u4e48 MySQL SQL \u8bed\u53e5\u4e2d\u4f1a\u4f7f\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6971","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6971"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6971\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}