什么是第二级SQL注入 [英] What is second level SQL Injection

查看:72
本文介绍了什么是第二级SQL注入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于第二级SQL注入的所有内容.这是参考问题 使用mysql_query的参数 ..其中一个答案的一部分使用了这个术语...

What is all about the second level SQL Injection.. This is with reference to the question Use of parameters for mysql_query.. and a part of one of the answers had this term...

推荐答案

我不确定,但我认为它是在帖子中定义"的:

I'm not exactly sure but I thought it was 'defined' in the post: Use of parameters for mysql_query

节选(请参阅第2点):

Excerpt (see point 2):

magic_quotes_gpc自动 转义您在请求中收到的内容 来自客户...但是它无法检测到 所谓的二级注射:

magic_quotes_gpc automatically escapes things you receive in requests from clients... but it cannot detect so-called second-level injections:

  1. 您从客户端收到恶意查询,并将其内容存储在 数据库. magic_quotes_gpc防止 SQL注入恶意字符串 正确存储.
  2. 稍后,您从数据库中获取此字符串并将其包含在 另一个查询.现在字符串没有 来自请求,所以 magic_quotes_gpc不能逃脱 细绳. Voilà,SQL注入;你的 数据现在可能不见了.
  1. You get a malicious query from a client and store its contents in the database. magic_quotes_gpc prevents SQL injection; the malicious string gets stored correctly.
  2. Later on, you fetch this string from the database and include it in another query. Now the string didn't come out of a request, so magic_quotes_gpc doesn't escape the string. Voilà, SQL injection; your data is now probably gone.

这是我搜索过的另一个网站( http://www.osix.net /modules/article/?id = 624 ):

Here's another I've googled (http://www.osix.net/modules/article/?id=624):

当心变量内部是否存储了 过程并不总是不受SQL影响 注射要么.如果存放 过程包含添加的构造 第二层解析,例如 在MS SQL Server中的字符串上执行EXEC,您 将不得不处理元字符 再次.这次里面存储了 程序.

Beware that variables inside a stored procedure aren't always immune to SQL Injection either. If the stored procedure contains constructs that add a second level of parsing, such as EXEC on a string in MS SQL Server, you will have to handle metacharacters again. This time inside the stored procedure.

这篇关于什么是第二级SQL注入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆