{"id":10006320,"date":"2022-08-26T09:36:07","date_gmt":"2022-08-26T01:36:07","guid":{"rendered":"https:\/\/ityet.com\/?p=10006320"},"modified":"2022-08-26T09:36:07","modified_gmt":"2022-08-26T01:36:07","slug":"%e6%b8%97%e9%80%8f%e6%94%bb%e9%98%b2web%e7%af%87-%e6%b7%b1%e5%85%a5%e6%b5%85%e5%87%basql%e6%b3%a8%e5%85%a5","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006320","title":{"rendered":"\u6e17\u900f\u653b\u9632Web\u7bc7-\u6df1\u5165\u6d45\u51faSQL\u6ce8\u5165"},"content":{"rendered":"<p><strong>1 \u80cc\u666f<\/strong><\/p>\n<p>\u4eac\u4e1cSRC(Security Response Center)\u6536\u5f55\u5927\u91cf\u5916\u90e8\u767d\u5e3d\u5b50\u63d0\u4ea4\u7684sql\u6ce8\u5165\u6f0f\u6d1e\uff0c\u6f0f\u6d1e\u53d1\u751f\u7684\u539f\u56e0\u591a\u4e3asql\u8bed\u53e5\u62fc\u63a5\u548cMybatis\u4f7f\u7528\u4e0d\u5f53\u5bfc\u81f4\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YU8\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p><strong>2 \u624b\u5de5\u68c0\u6d4b<\/strong><\/p>\n<p>2.1 \u524d\u7f6e\u77e5\u8bc6<\/p>\n<p>mysql5.0\u4ee5\u4e0a\u7248\u672c\u4e2d\u5b58\u5728\u4e00\u4e2a\u91cd\u8981\u7684\u7cfb\u7edf\u6570\u636e\u5e93information_schema\uff0c\u901a\u8fc7\u6b64\u6570\u636e\u5e93\u53ef\u8bbf\u95eemysql\u4e2d\u5b58\u5728\u7684\u6570\u636e\u5e93\u540d\u3001\u8868\u540d\u3001\u5b57\u6bb5\u540d\u7b49\u5143\u6570\u636e\u3002information_schema\u4e2d\u6709\u4e09\u4e2a\u8868\u6210\u4e3a\u4e86sql\u6ce8\u5165\u6784\u9020\u7684\u5173\u952e\u3002<\/p>\n<p>1\uff09infromation_schema.columns:<br \/>table_schema \u6570\u636e\u5e93\u540d<br \/>table_name \u8868\u540d<br \/>column_name \u5217\u540d<\/p>\n<p>2)information_schema.tables<br \/>table_schema \u6570\u636e\u5e93\u540d<br \/>table_name \u8868\u540d<\/p>\n<p>3)information_schema.schemata<br \/>schema_name \u6570\u636e\u5e93\u540d<br \/>SQL\u6ce8\u5165\u5e38\u7528SQL\u51fd\u6570<\/p>\n<p>length(str) \uff1a\u8fd4\u56de\u5b57\u7b26\u4e32str\u7684\u957f\u5ea6<br \/>substr(str, pos, len) \uff1a\u5c06str\u4ecepos\u4f4d\u7f6e\u5f00\u59cb\u622a\u53d6len\u957f\u5ea6\u7684\u5b57\u7b26\u8fdb\u884c\u8fd4\u56de\u3002\u6ce8\u610f\u8fd9\u91cc\u7684pos\u4f4d\u7f6e\u662f\u4ece1\u5f00\u59cb\u7684\uff0c\u4e0d\u662f\u6570\u7ec4\u76840\u5f00\u59cb<br \/>mid(str,pos,len) \uff1a\u8ddf\u4e0a\u9762\u7684\u4e00\u6837\uff0c\u622a\u53d6\u5b57\u7b26\u4e32<br \/>ascii(str) \uff1a\u8fd4\u56de\u5b57\u7b26\u4e32str\u7684\u6700\u5de6\u9762\u5b57\u7b26\u7684ASCII\u4ee3\u7801\u503c<br \/>ord(str) \uff1a\u5c06\u5b57\u7b26\u6216\u5e03\u5c14\u7c7b\u578b\u8f6c\u6210ascll\u7801<br \/>if(a,b,c) \uff1aa\u4e3a\u6761\u4ef6\uff0ca\u4e3atrue\uff0c\u8fd4\u56deb\uff0c\u5426\u5219\u8fd4\u56dec\uff0c\u5982if(1&gt;2,1,0),\u8fd4\u56de0<\/p>\n<p>2.2 \u6ce8\u5165\u7c7b\u578b<\/p>\n<p>2.2.1 \u53c2\u6570\u7c7b\u578b\u5206\u7c7b<br \/>\u6574\u578b\u6ce8\u5165<br \/>\u4f8b\u5982?id=1\uff0c\u5176\u4e2did\u4e3a\u6ce8\u5165\u70b9\uff0c\u7c7b\u578b\u4e3aint\u7c7b\u578b\u3002<\/p>\n<p>\u5b57\u7b26\u578b\u6ce8\u5165<br \/>\u4f8b\u5982?id=\u201d1\u201d\uff0c\u5176\u4e2did\u4e3a\u6ce8\u5165\u70b9\uff0c\u7c7b\u578b\u4e3a\u5b57\u7b26\u578b\uff0c\u8981\u8003\u8651\u95ed\u5408\u540e\u7aefsql\u8bed\u53e5\u4e2d\u7684\u5f15\u53f7\u3002<\/p>\n<p>2.2.2 \u6ce8\u5165\u65b9\u5f0f\u5206\u7c7b<\/p>\n<p>\u76f2\u6ce8<br \/>\u5e03\u5c14\u76f2\u6ce8\uff1a\u53ea\u80fd\u4ece\u5e94\u7528\u8fd4\u56de\u4e2d\u63a8\u65ad\u8bed\u53e5\u6267\u884c\u540e\u7684\u5e03\u5c14\u503c\u3002<br \/>\u65f6\u95f4\u76f2\u6ce8\uff1a\u5e94\u7528\u6ca1\u6709\u660e\u786e\u7684\u56de\u663e\uff0c\u53ea\u80fd\u4f7f\u7528\u7279\u5b9a\u7684\u65f6\u95f4\u51fd\u6570\u6765\u5224\u65ad\uff0c\u4f8b\u5982sleep\uff0cbenchmark\u7b49\u3002<br \/>\u62a5\u9519\u6ce8\u5165\uff1a\u5e94\u7528\u4f1a\u663e\u793a\u5168\u90e8\u6216\u8005\u90e8\u5206\u7684\u62a5\u9519\u4fe1\u606f<br \/>\u5806\u53e0\u6ce8\u5165\uff1a\u6709\u7684\u5e94\u7528\u53ef\u4ee5\u52a0\u5165 ; \u540e\u4e00\u6b21\u6267\u884c\u591a\u6761\u8bed\u53e5<br \/>\u5176\u4ed6<\/p>\n<p>2.3 \u624b\u52a8\u68c0\u6d4b\u6b65\u9aa4(\u5b57\u7b26\u578b\u6ce8\u5165\u4e3a\u4f8b\uff09<\/p>\n<pre><code> \/\/ sqli vuln code\n            Statement statement = con.createStatement();\n            String sql = &quot;select * from users where username = '&quot; + username + &quot;'&quot;;\n            logger.info(sql);\n            ResultSet rs = statement.executeQuery(sql);\n\/\/ fix code \u5982\u679c\u8981\u4f7f\u7528\u539f\u59cbjdbc\uff0c\u8bf7\u91c7\u7528\u9884\u7f16\u8bd1\u6267\u884c\n            String sql = &quot;select * from users where username = ?&quot;;\n            PreparedStatement st = con.prepareStatement(sql);<\/code><\/pre>\n<p>\u4f7f\u7528\u672a\u9884\u7f16\u8bd1\u539f\u59cbjdbc\u4f5c\u4e3ademo\uff0c\u6ce8\u610f\u6b64demo\u4e2dsql\u8bed\u53e5\u53c2\u6570\u91c7\u7528\u5355\u5f15\u53f7\u95ed\u5408\u3002<\/p>\n<p>2.3.1 \u786e\u5b9a\u6ce8\u5165\u70b9<br \/>\u5bf9\u4e8e\u5b57\u7b26\u7c7b\u578b\u6ce8\u5165\uff0c\u901a\u5e38\u5148\u5c1d\u8bd5\u5355\u5f15\u53f7\uff0c\u5224\u65ad\u5355\u5f15\u53f7\u662f\u5426\u88ab\u62fc\u63a5\u5230SQL\u8bed\u53e5\u4e2d\u3002\u63a8\u8350\u4f7f\u7528\u6d4f\u89c8\u5668\u6269\u5c55harkbar\u4f5c\u4e3a\u624b\u5de5\u6d4b\u8bd5\u5de5\u5177\u3002<a href=\"https:\/\/link.segmentfault.com\/?enc=pbBAq2224m05xR4uxb4MfA%3D%3D.LFn%2Fj8yrMb8MmLE%2BjBdb%2FZftcGcWLHOrulNdYCf99Veb2mYqaaqNgCBQsQzHI23pDZoCdt%2B4NmvjiXoeqzGyX2jnR9W0U8k5FYlnh8Th%2Fvm0MducEFdODI1mqdTRTBbn\" rel=\"nofollow\">https:\/\/chrome.google.com\/web&#8230;<\/a><\/p>\n<p>\u6b63\u5e38\u9875\u9762\u5e94\u8be5\u663e\u793a\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YU9\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>admin\u540e\u52a0\u5355\u5f15\u53f7\u5bfc\u81f4\u65e0\u4fe1\u606f\u56de\u663e\uff0c\u539f\u56e0\u662f\u540e\u7aefsql\u6267\u884c\u62a5\u9519\uff0c\u8bf4\u660e\u5f15\u53f7\u88ab\u62fc\u63a5\u81f3SQL\u8bed\u53e5\u4e2d<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVh\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVi\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<pre><code>select * from users where username = 'admin'  #\u6b63\u5e38sql\nselect * from users where username = 'admin'' #admin'\u88ab\u5e26\u5165sql\u6267\u884c\u5bfc\u81f4\u62a5\u9519\u65e0\u6cd5\u663e\u793a\u4fe1\u606f<\/code><\/pre>\n<p>2.3.2 \u5224\u65ad\u5b57\u6bb5\u6570<br \/>mysql\u4e2d\u4f7f\u7528order by \u8fdb\u884c\u6392\u5e8f\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u662f\u5b57\u6bb5\u540d\u4e5f\u53ef\u4ee5\u662f\u5b57\u6bb5\u5e8f\u53f7\u3002\u6240\u4ee5\u53ef\u4ee5\u7528\u6765\u5224\u65ad\u8868\u4e2d\u5b57\u6bb5\u6570\uff0corder by \u8d85\u8fc7\u5b57\u6bb5\u4e2a\u6570\u7684\u6570\u5b57\u5c31\u4f1a\u62a5\u9519\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVj\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>\u5224\u65ad\u5b57\u6bb5\u6570<\/p>\n<p>\u5f53order by \u8d85\u8fc74\u65f6\u4f1a\u62a5\u9519\uff0c\u6240\u4ee5\u6b64\u8868\u5171\u56db\u4e2a\u5b57\u6bb5\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVk\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>\u540e\u7aef\u6240\u6267\u884c\u7684sql\u8bed\u53e5<\/p>\n<pre><code>select * from users where username = 'admin' order by 1-- '<\/code><\/pre>\n<p>\u6b64\u5904\u6211\u4eec\u5c06\u539f\u672cusername\u7684\u503cadmin\u66ff\u6362\u4e3aadmin\u2019 order by 1 \u2014+\uff0c\u5176\u4e2dadmin\u540e\u7684\u5355\u5f15\u53f7\u7528\u4e8e\u95ed\u5408\u539f\u672csql\u8bed\u53e5\u4e2d\u7684\u524d\u5f15\u53f7\uff0c\u2014+\u7528\u4e8e\u6ce8\u91casql\u8bed\u53e5\u4e2d\u7684\u540e\u5f15\u53f7\u3002\u2014\u540e\u7684+\u53f7\u4e3b\u8981\u4f5c\u7528\u662f\u63d0\u4f9b\u4e00\u4e2a\u7a7a\u683c\uff0csql\u8bed\u53e5\u5355\u884c\u6ce8\u91ca\u540e\u9700\u6709\u7a7a\u683c\uff0c+\u4f1a\u88ab\u89e3\u7801\u4e3a\u7a7a\u683c\u3002<\/p>\n<p>2.3.3 \u786e\u5b9a\u56de\u663e\u4f4d\u7f6e<\/p>\n<p>\u4e3b\u8981\u7528\u4e8e\u5b9a\u4f4d\u540e\u7aefsql\u5b57\u6bb5\u5728\u524d\u7aef\u663e\u793a\u7684\u4f4d\u7f6e\uff0c\u91c7\u7528\u8054\u5408\u67e5\u8be2\u7684\u65b9\u5f0f\u786e\u5b9a\u3002\u6ce8\u610f\u8054\u5408\u67e5\u8be2\u524d\u540e\u5b57\u6bb5\u9700\u4e00\u81f4\uff0c\u8fd9\u4e5f\u5c31\u662f\u6211\u4eec\u4e3a\u4ec0\u4e48\u505a\u7b2c\u4e8c\u6b65\u7684\u539f\u56e0\u3002<\/p>\n<p>\u901a\u8fc7\u4e0b\u56fe\u53ef\u77e5\uff0c\u540e\u7aef\u67e5\u8be2\u5e76\u56de\u663e\u7684\u5b57\u6bb5\u4f4d\u7f6e\u4e3a2\uff0c3\u4f4d\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVl\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>\u8054\u5408\u67e5\u8be2\u540e\u7684\u5b57\u6bb5\u53ef\u4ee5\u968f\u610f\uff0c\u672c\u6b21\u91c7\u7528\u7684\u662f\u6570\u5b571\u52304\u76f4\u89c2\u65b9\u4fbf\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVm\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>2.3.4 \u5229\u7528information_schema\u5e93\u5b9e\u73b0\u6ce8\u5165<br \/>group_concat()\u51fd\u6570\u7528\u4e8e\u5c06\u67e5\u8be2\u7ed3\u679c\u62fc\u63a5\u4e3a\u5b57\u7b26\u4e32\u3002<\/p>\n<p>\u67e5\u770b\u5b58\u5728\u6570\u636e\u5e93<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVn\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>\u67e5\u770b\u5f53\u524d\u6570\u636e\u5e93\u4e2d\u7684\u8868<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVo\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>\u67e5\u770b\u6307\u5b9a\u8868\u4e2d\u5b57\u6bb5<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVv\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>\u5229\u7528\u4ee5\u4e0a\u83b7\u53d6\u4fe1\u606f\u8bfb\u53d6users\u8868\u4e2dusername\u548cpassword<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVx\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>3 \u81ea\u52a8\u5316\u68c0\u6d4b<\/p>\n<p>3.1 sqlmap \u4f7f\u7528<br \/>sqlmap\u517c\u5bb9python2\u548cpython3\uff0c\u53ef\u4ee5\u81ea\u52a8\u5316\u68c0\u6d4b\u5404\u7c7b\u6ce8\u5165\u548c\u51e0\u4e4e\u6240\u6709\u6570\u636e\u5e93\u7c7b\u578b\u3002<\/p>\n<p>3.1.1 \u5e38\u7528\u547d\u4ee4<\/p>\n<pre><code>-u  \u53ef\u80fd\u5b58\u5728\u6ce8\u5165\u7684url\u94fe\u63a5\n-r\u8bfb\u53d6http\u6570\u636e\u5305\n--data \u6307\u5b9apost\u6570\u636e\n--cookie \u6307\u5b9acookie\n--headers \u6307\u5b9ahttp\u5934 \u5982\u91c7\u7528token\u8ba4\u8bc1\u7684\u60c5\u51b5\u4e0b\n--threads \u6307\u5b9a\u7ebf\u7a0b\u6570\n--dbms \u6307\u5b9a\u540e\u7aef\u7684\u6570\u636e\u5e93\n--os \u6307\u5b9a\u540e\u7aef\u7684\u64cd\u4f5c\u7cfb\u7edf\u7c7b\u578b\n--current-user \u5f53\u524d\u7528\u6237\n--users \u6240\u6709\u7528\u6237\n--is-dba \u662f\u5426\u662fdba\n--sql-shell \u4ea4\u4e92\u5f0f\u7684sqlshell\n-p\u6307\u5b9a\u53ef\u80fd\u5b58\u5728\u6ce8\u5165\u70b9\u7684\u53c2\u6570\n--dbs \u7a77\u4e3e\u7cfb\u7edf\u5b58\u5728\u7684\u6570\u636e\u5e93\n-D\u6307\u5b9a\u6570\u636e\u5e93\n--tables \u7a77\u4e3e\u5b58\u5728\u7684\u8868\n-T\u6307\u5b9a\u8868\n--column \u7a77\u4e3e\u5b57\u6bb5\n-C\u6307\u5b9a\u5b57\u6bb5\n--dump dump\u6570\u636e<\/code><\/pre>\n<p>\u76f4\u63a5\u68c0\u6d4b<br \/>\u5176\u4e2d\u2014cookie\u7528\u4e8e\u6307\u5b9acookie\uff0c\u2014batch \u81ea\u52a8\u5316\u6267\u884c\uff0c\u2014dbms\u6307\u5b9a\u6570\u636e\u5e93\u7c7b\u578b<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVF\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>\u68c0\u6d4b\u7ed3\u679c<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVG\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>\u8bfb\u53d6\u7cfb\u7edf\u4e2d\u5b58\u5728\u6570\u636e\u5e93<br \/>\u2014dbs\u8bfb\u53d6\u5f53\u524d\u7528\u6237\u4e0b\u7684\u6570\u636e\u5e93<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVH\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>\u8bfb\u53d6\u6307\u5b9a\u5e93\u4e0b\u7684\u8868<br \/>-D java_sec_code \u2014tables<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVI\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p>dump users\u8868\u6570\u636e<br \/>-D java_sec_code -T users \u2014dump<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc1YVJ\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<p><strong>4 \u8fdb\u9636<\/strong><\/p>\n<p>4.1 Mybatis\u6ce8\u5165<\/p>\n<p>1\uff09$\u9519\u8bef\u4f7f\u7528\u5bfc\u81f4\u6ce8\u5165<\/p>\n<pre><code>\/\/\u91c7\u7528#\u4e0d\u4f1a\u5bfc\u81f4sql\u6ce8\u5165,mybatis\u4f1a\u4f7f\u7528\u9884\u7f16\u8bd1\u6267\u884c\n    @Select(&quot;select * from users where username = #{username}&quot;)\n    User findByUserName(@Param(&quot;username&quot;) String username);\n\/\/\u91c7\u7528$\u4f5c\u4e3a\u5165\u53c2\u53ef\u5bfc\u81f4sql\u6ce8\u5165\n    @Select(&quot;select * from users where username = '${username}'&quot;)\n    List&lt;User&gt; findByUserNameVuln01(@Param(&quot;username&quot;) String username);<\/code><\/pre>\n<p>2\uff09\u6a21\u7cca\u67e5\u8be2\u62fc\u63a5<\/p>\n<pre><code>\/\/\u9519\u8bef\u5199\u6cd5\n  &lt;select id=&quot;findByUserNameVuln02&quot; parameterType=&quot;String&quot; resultMap=&quot;User&quot;&gt;\n        select * from users where username like '%${_parameter}%'\n    &lt;\/select&gt;\n \/\/\u6b63\u786e\u5199\u6cd5\n &lt;select id=&quot;findByUserNameVuln02&quot; parameterType=&quot;String&quot; resultMap=&quot;User&quot;&gt;\n        select * from users where username like concat(\u2018%\u2019,#{_parameter}, \u2018%\u2019)  \n    &lt;\/select&gt;<\/code><\/pre>\n<p>3\uff09order by \u6ce8\u5165<br \/>order by \u540e\u82e5\u4f7f\u7528#{}\u4f1a\u5bfc\u81f4\u62a5\u9519\uff0c\u56e0\u4e3a#{}\u9ed8\u8ba4\u6dfb\u52a0\u5f15\u53f7\u4f1a\u5bfc\u81f4\u627e\u4e0d\u5230\u5b57\u6bb5\u4ece\u800c\u62a5\u9519\u3002<\/p>\n<pre><code>   \/\/\u9519\u8bef\u5199\u6cd5 \n&lt;select id=&quot;findByUserNameVuln03&quot; parameterType=&quot;String&quot; resultMap=&quot;User&quot;&gt;\n        select * from users\n        &lt;if test=&quot;order != null&quot;&gt;\n            order by ${order} asc\n        &lt;\/if&gt;\n    &lt;\/select&gt;\n\/\/\u6b63\u786e\u5199\u6cd5 id\u6307\u5b57\u6bb5id \u6b64\u8868\u5b57\u6bb5\u5171\u56db\u4e2a \u6240\u4ee5id\u4e3a1-4\n    &lt;select id=&quot;OrderByUsername&quot; resultMap=&quot;User&quot;&gt;\n        select * from users order by id asc limit 1\n    &lt;\/select&gt;<\/code><\/pre>\n<p><strong>\u4ee5\u4e0a\u6d4b\u8bd5\u5747\u5728\u672c\u5730\u8fdb\u884c\uff0c\u8bf7\u52ff\u672a\u6388\u6743\u8fdb\u884c\u6e17\u900f\u6d4b\u8bd5<\/strong><\/p>\n<p><strong>5 \u6587\u7ae0\u53ca\u8d44\u6599\u63a8\u8350<\/strong><br \/>slqmap\u624b\u518c\uff1a<a href=\"https:\/\/link.segmentfault.com\/?enc=Eewd%2BFCfwE20vTwuzgpupg%3D%3D.J62wPGEmWRyvyEHRAI1h5X7ZkxmvwUHmhTI%2BI38reDLpXDEiEp%2BtzruuNZedSnBizzI5ueSRR%2BmbuVEXjNxyBrNTZG5scOZQMtB5sCRIzz7ytdsn2quRUVcI7bJL1ZTL\" rel=\"nofollow\">https:\/\/octobug.gitbooks.io\/s&#8230;<\/a><br \/>sql\u6ce8\u5165\u8be6\u89e3\uff1a<a href=\"https:\/\/link.segmentfault.com\/?enc=SZrZ6it7oXnGHsq6D83byA%3D%3D.ORJ9w7Ha4%2BXd6zIfbJ4GCeHBGd%2B23Xryjl%2BHizcQTTY%3D\" rel=\"nofollow\">http:\/\/sqlwiki.radare.cn\/#\/<\/a><\/p>\n<p>\u4f5c\u8005\uff1a\u7f57\u5b87\uff08\u7269\u6d41\u5b89\u5168\u5c0f\u5206\u961f\uff09<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000042379218\">https:\/\/segmentfault.com\/a\/1190000042379218<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1 \u80cc\u666f \u4eac\u4e1cSRC(Security Response Center)\u6536\u5f55\u5927\u91cf\u5916\u90e8\u767d\u5e3d\u5b50\u63d0\u4ea4\u7684sql\u6ce8\u5165\u6f0f\u6d1e [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-10006320","post","type-post","status-publish","format-standard","hentry"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006320"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006320\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}