Examples of SQL Injections through addslashes()?(通过 addlashes() 进行 SQL 注入的示例?)
问题描述
在 PHP 中,我知道 mysql_real_escape 比使用 addslashes 安全得多.但是,我找不到 addslashes 会导致 SQL 注入发生的示例.
In PHP, I know that mysql_real_escape is much safer than using addslashes.
However, I could not find an example of a situation where addslashes would let an SQL Injection happen.
谁能举几个例子?
推荐答案
嗯,这是你想要的文章.
基本上,攻击的工作方式是让 addslashes() 将反斜杠放在多字节字符的中间,这样反斜杠就会因为成为有效多字节序列的一部分而失去意义.
Basically, the way the attack works is by getting addslashes() to put a backslash in the middle of a multibyte character such that the backslash loses its meaning by being part of a valid multibyte sequence.
文章中的一般警告:
这种类型的攻击对于任何字符编码都是可能的有一个以 0x5c 结尾的有效多字节字符,因为addslashes() 可以被欺骗来创建一个有效的多字节字符而不是转义后面的单引号.UTF-8 不适合这个描述.
This type of attack is possible with any character encoding where there is a valid multi-byte character that ends in
0x5c, becauseaddslashes()can be tricked into creating a valid multi-byte character instead of escaping the single quote that follows. UTF-8 does not fit this description.
这篇关于通过 addlashes() 进行 SQL 注入的示例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:通过 addlashes() 进行 SQL 注入的示例?
基础教程推荐
- PHP 类:全局变量作为类中的属性 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何替换eregi() 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
