Common PHP vulnerabilities: Injection Vulnerability injection brings controllable user variables into database operations and changes the original SQL intention. For example, in the logic of registering a user, when detecting whether the user name
I think this vulnerability is a bit interesting ~~, Around me for half a day. PS: If gpc is not enabled, it doesn't matter if you are in line 59 of/system/init. php.
If (function_exists ('get _ magic_quotes_gpc ') {if (@ get_magic_quotes_gpc () //
One, GPC
Integer type not affected by GPC
$_server variable is not protected by GPC
$_files variable is not protected by GPC
Wide byte injection
Database operations easy to forget to add single quotation marks where: in
0x01 backgroundThe current Web application's protection against SQL injection is basically to determine if the GPC is turned on, and then use the Addlashes function to escape special characters such as single quotes. But the only use of such
Sometimes, to be safe, we need to escape the strings entered by the user. There is an incorrect or ambiguous place in the article, please point out the problem ~ ~ ~The configuration and functions associated with the PHP string escape are as follows:
How to filter character in PHP
The configuration and functions associated with the PHP string escape are as follows:1.magic_quotes_runtime2.magic_quotes_gpc3.addslashes () and Stripslashes ()4.mysql_escape_string ()5.addcslashes () and
PHP character escaping correlation function summary, sometimes for security reasons, we need to escape the user input string
There are incorrect or unclear points in the article, please point out the problem ~ ~ ~The configuration and functions
The MAGIC_QUOTES_GPC method is based on your php.ini configuration, if you open the MAGIC_QUOTES_GPC to generate, his role and addslashes is the same, let me give a detailed introduction about MAGIC_QUOTES_GPC usage.
Read the Thinksaas part of the
Special view of the next manual, about PHP magic quotes, a few common settings are as follows, Magic_quotes_gpc,magic_quotes_sybase,magic_quote_runtime, These functions are configured in php.ini, and it can be seen from the manual that these
0x01 backgroundFirst we understand the next wide-byte injection, which stems from the programmer setting the MySQL connection with an error configured as: Set CHARACTER_SET_CLIENT=GBK, which causes an injection vulnerability caused by the encoding
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.