$_server[' php_self '] is often used in development, commonly used to refer to the current page address, and it is the system automatically generated global variables, also have any problems? Let's look at the following code first:
">This code is
One, Web server security
PHP is nothing but a Web server module function, so first of all to ensure the security of the Web server. Of course, the Web server to be secure and must first ensure that the system security, so it is far, endless. PHP can
1.register_globals=onif (Check_admin ()){ $is _admin=true;} if ($is _admin){ do_something ();} ?>This section of code does not initialize $is_admin to Flase, if Register_globals is on, then we submit http://www.sectop.com/ex1.php?is_admin=true
a similar problem with a session exposure is conversation injection . This type of attack is based on your Web server's write permissions in addition to the Read permission to the session store directory. Therefore, there is a possibility to write a
Do not trust external sources
$_get
$_post
$_request
$_cookie
$argv
Php://stdin
Php://input
File_get_contents ()
Remote Database
Remote API
Data from the client
Htmlentities '; Echo htmlentities ($input,
#1: Managing Installation ScriptsIf a developer has installed a PHP script for a third-party application, the script is used to install the entire application's working component and provide an access point. Most third-party packages recommend that
Yahoo's approach to forging cross-site requests is to add a random string of called. Crumb to the form, and Facebook has a similar solution, and its table dropdowns often have post_form_id and FB_DTSG.A more common and inexpensive precaution is to
Safety
One, Web server security
PHP is nothing but a Web server module function, so first of all to ensure the security of the Web server. Of course, the Web server to be secure and must first ensure that the system security, so it is far, endless.
Modify the php.ini configuration file, by default in the C:\Windows directory
Safe Mode
PHP's Safe_mode function restricts or disables many functions, and can solve PHP's security problems to a large extent. Find in the Safe Mode section:
Safe_
5, File Upload
PHP's file upload mechanism is to save the user uploaded files in the php.ini Upload_tmp_dir defined temporary directory (default is the system's temporary directory, such as:/tmp) in a similar phpxxuoxg random temporary file, the
Principle:
1.2.1. Deep precautions
The principle of deep precaution is a well-known principle of security professionals, which illustrates the value of redundant security measures, as evidenced by history.
The principle of deep precaution can be
One, Web server security
PHP is nothing but a Web server module function, so first of all to ensure the security of the Web server. Of course, the Web server to be secure and must first ensure that the system security, so it is far, endless. PHP
Ziadoz a list of PHP resources that are maintained on GitHub, including libraries, frameworks, templates, security, code Analysis, logs, third-party libraries, configuration tools, Web tools, books, ebooks, classic blogs, and more. Bó Lè has
Www.php100.comhtmldujia201501058267.htmlwww.php100.comhtmldujia201501068277.html benefits are coming, PHP fans! Foreign programmer ziadoz collects various PHP resources on Github, including libraries and tools for templates, frameworks, databases,
Learn the essence of PHP and write efficient PHP code for security. I. filtering input and avoiding output sometimes we filter input by phrase and avoid abbreviated output as FIEO, which has become a security mantra for PHP applications. 1. use
At present, the Web site development based on PHP has become the mainstream of the current website development, the author focuses on the PHP website attack and security precautions to explore, aimed at reducing the vulnerability of the website, I
Dependency ManagementDependency and Package Management Library
Composer/packagist: A package and dependency manager
Composer Installers: A multi-frame Composer Library Installer
Pickle: a php extension installer
Other
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.