php mysql 绕过_php – 绕过MySQL查询

In MySQL, comments can be inserted within keywords themselves,

which provides another means of bypassing some input validation

filters while preserving the syntax of the actual query. For example:

SEL/*foo*/ECT username,password FR/*foo*/OM users

但是如何在保留的单词之间注释掉东西呢?有什么好处?

为什么它是一种绕过?

看起来有点儿!

解决方法:

That quote is from a book from 2007 …对于早期版本的MySql可能是这样,但我找不到MySQL版本,其中该语法不会返回错误.

这种语法背后的原始想法是,如果应用程序试图将某些SQL关键字列入黑名单,那么这种攻击会欺骗应用程序.

例如……如果应用程序试图阻止攻击者使用Sql Injection从数据库中删除记录,则禁止使用的黑名单列表将过滤掉DELETE …但无法过滤掉DEL / ** / ETE.

但是,尝试在动态查询中创建一个不允许的术语黑名单是防止SQL注入的一种可怕的,无效的方法……并且有一些更简单有效的方法可以防止SQL注入攻击,例如参数化查询嵌入式注释语法即使仍然有效也没用.

As is almost always the case, blacklisting is riddled with loopholes

that make it ineffective at preventing SQL injection attacks. For

example, attackers can:

Target fields that are not quoted

Find ways to bypass the need for certain escaped meta-characters

Use stored procedures to hide the injected meta-characters

标签:php,mysql,sql-injection

来源: https://codeday.me/bug/20190520/1142994.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值