Index.php and content protection

What are the chances that hackers can download the index.php file from the server (and not the result, but the contents of the index.php file)? Do you recommend putting the contents of index.php in modules / index_content.php, where the modules folder is protected by .htaccess And does index.php contain a single line <?php require_once('modules/index_content.php') ?>? Does it make sense?

+5
source share
6 answers

Source code disclosures can occur on a well-tuned server and are not as rare as you might think. As others have said, if your server configuration sounds, then there will be no problems with people directly accessing PHP files.

However, you can still be vulnerable to:

Script ,

, ~ .bak. PHP, . , .

, webapp, . script , LFI. , , , , . "../" , Directory Traversal, , .

,

, (index.html, index.php, default.htm ..). - , ( ) , .

, - (, ) . - PHP, . , , - URL ( ). Tomcat /.

SQL-

, . ( ), . , .

, , , . , - . , , , .

+4

*.php Apache (, ), , , , - script ( script modules/index_content.php ).

+1

.

index.php, .

+1

.php http, , (, PHP). , , .php .

(public_html, htdocs ..) .

+1

php , PHP -.

: htaccess index.php , - index.php, .

+1

. :

  • "" ( SSH, FTP ..)...
  • : script, , , php .
0

All Articles