TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

SQL Injection Pocket Reference (Google Doc)

112 点作者 rudenoise将近 14 年前

2 条评论

nbpoole将近 14 年前
Noticed a small mistake in the MySQL section:<p><pre><code> Error Based: AND (SELECT * FROM SOME_EXISTING_TABLE) = 1 </code></pre> Unless SOME_EXISTING_TABLE has no more than one row, that query will fail. See <a href="http://dev.mysql.com/doc/refman/5.0/en/comparisons-using-subqueries.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/comparisons-using-sub...</a>:<p>"<i>For a comparison of the subquery to a scalar, the subquery must return a scalar.</i>"<p>It's easy to fix: just add <i>LIMIT 1</i> to the end of the sub-select.<p>---<p>This document is very useful. I've been doing web app security for a while and I haven't run across some of these techniques before (eg: PROCEDURE ANALYSE()). I didn't realize that PDO_MYSQL allowed for multiple queries by default either (although it makes sense, since historically other RDBMS have supported it).
评论 #2822843 未加载
评论 #2823603 未加载
NY_Entrepreneur将近 14 年前
HELP! I don't 'get it'!<p>Looking at that list of SQL injection attack techniques, I don't see the threat.<p>Or: Yes, I'm building a Web site, and the server will be running SQL Server.<p>Some of my Web pages have users enter data in text boxes. So, they could enter a SQL command in a text box.<p>Then when the Web page is returned to my Web server as a 'post back', my software reads the data in the text boxes.<p>I have the page built, have code for extracting the data from the text boxes and putting it in, say, string variables in Visual Basic .NET, and now am writing the code for looking at the data in the strings from the text boxes.<p>So far, I see no threat.<p>So, I intend to look at the data in the strings and see if it looks anything like a SQL command. Anything that looks like a SQL command will get rejected as bad data and not get near my SQL Server database. Maybe I will write the bad data to my log file.<p>So, I'm checking the input data from the users. I am assuming that the input data could be anything at all until my code establishes otherwise.<p>Doesn't everyone do such checking?<p>With such checking, where is the threat of 'SQL injection'?<p>If SQL injection is a threat, then why? Just from people not checking input data from users? Some other reason?
评论 #2822592 未加载
评论 #2822570 未加载
评论 #2822466 未加载