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: