The principle of a function to prevent SQL injection is to use regular expressions to match the syntax of SQL injection and add restrictions, which effectively limits SQL injection.
The principle of a function to prevent
For SQL injection and anti-injection is actually an attack and defense, today we want to tell you the most basic injection and prevention methods, the principle is to take advantage of some PHP or MySQL features and we did not pay attention to the cause.
A simple
SQL Injection and anti-injection are actually attacks and defenses. Today we want to tell you the most basic injection and prevention methods, the principle is caused by the use of some features of php or mysql.
A simple SQL
Talking about PHP security and anti-SQL injection, prevent XSS attack, anti-theft chain, anti-CSRF
Objective:
First of all, the author is not a web security experts, so this is not a Web security expert-level article, but learning notes, careful summary of the article, there are some of our phper not easy to find or say not to pay attention to things. So I writ
1. The magic_quotes_gpc option in the php. ini configuration file of the php tutorial is not enabled and is set to off. 2. The developer does not check and escape the data type.
But in fact, the second point is the most important. In my opinion, it should be the most basic quality for a web programmer to check the data types entered by users and submit the correct data types to the mysql tutorial. But in re
executed several SQL commands in the background by code, showing the names of all the tables. So the mysql_query () function can take the role of further protection. We further evolve the code just now to get the following code:
The code is as follows
Copy Code
?Connection$database = mysql_connect ("localhost", "username", "password");DB selectionmysql_select_db ("Database", $database);$q = mysql_query ("SELECT" id ' from
1. The MAGIC_QUOTES_GPC option in PHP tutorial configuration file php.ini is not turned on and is set to off 2. The developer does not check and escape the data type
But in fact, the 2nd is the most important. I think that checking the type of data entered by the user and submitting the correct data type to the MySQL tutorial should be the most basic quality of a web programmer. But in reality, many small white web developers often forget this, causi
normal administrative user, you can query to the data! In fact, there are many "user names" that can be injected into SQL, such as: ' or 1 or ' 1 Select * from where admin_name="or1or" and Admin_ Pass=MD5 ('ewsdfgbnvb') Special emphasis: 1, not only when the user logged in, the SQL statement can be injected, any other user's data as long as the implementation, it is possible to inject! 2,
1. The MAGIC_QUOTES_GPC option in the PHP tutorial configuration file php.ini is not turned on and is set to off 2. The developer did not check and escape the data type
But in fact, the 2nd is the most important. I think that it is the most basic quality of a web programmer to check the data type entered by the user and submit the correct data type to the MySQL tutorial. But in reality, many small white web developers often forget this, leading to a
PHP to prevent the SQL injection method in detail, phpsql injection of detailed
Problem Description:If the data entered by the user is inserted into an SQL query statement without processing, then the application is likely to suffer a S
. Contains 6,080 CJK kanji in GB 13000.1.(2) GBK/4: aa40-fea0. CJK Chinese characters and supplemental kanji are included in 8,160. CJK Chinese characters in the front, by the UCS code size, the addition of Chinese characters (including radicals and components) in the following, according to the "Kangxi Dictionary" page number/word rank.
As you can see, the two characters in the GBK encoding are a Chinese character, and the first character needs to be greater than 128. Original link: http:
PHP prevents simple SQL injection analysis, Phpsql injection
This paper analyzes the simple method of PHP to prevent SQL injection. Share to everyone for your reference. Specific as fo
the value of the variable ID, resulting in a SQL injection vulnerability.4.SQL Injection Typical process1. Determine the scripting language used by the web system, discover the injection point, and determine if there is a SQL
Label:0x01 backgroundToday's web programs basically have a global filter for SQL injection, like PHP to open the GPC or on the global file common.php using the Addslashes () function to filter the received parameters, especially single quotes. Two injections is also a more common injection, it involves warehousing and
:
Http://www.4ngel.net/article/36.htm (SQL injection with MySQL) Chinese
http://www.phpe.net/mysql_manual/06-4.html (MySQL statement reference)
A safety test for sohu.com
Posted in Hacker defenses
Posted in Http://www.loveshell.net
Sohu.com is a relatively large domestic portal, providing a lot of services, including mailboxes. Such a large web site, no problem is difficult, as the saying goes, the more the
0x01 background
Today's web programs basically have a global filter for SQL injection, like PHP to open the GPC or on the global file common.php using the Addslashes () function to filter the received parameters, especially single quotes. Two injections is also a more common injection, it involves warehousing and out
Release date:Updated on:
Affected Systems:MyBB Profile BlogDescription:--------------------------------------------------------------------------------Bugtraq id: 56897
MyBB is a popular Web forum program. The Profile Blog plug-in can write information on the configuration page.
Profile Blog 1.2 and other versions of/plugins/profileblogs. php have security vulnerabilities, which can cause SQL
SQL injection attacks with PHP vulnerabilities. SQL injection is an attack that allows attackers to add additional logical expressions and commands to query existing SQL statements. The attack is successful and the data submitted
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.