Hướng dẫn hardened php - php cứng

  • Giới thiệu
  • Xem xét chung
  • Được cài đặt dưới dạng nhị phân CGI
    • Có thể tấn công
    • Trường hợp 1: Chỉ các tệp công khai được phục vụ
    • Trường hợp 2: Sử dụng CGI.Force_Redirect
    • Trường hợp 3: Cài đặt doc_root hoặc user_dir
    • Trường hợp 4: Trình phân tích cú pháp PHP bên ngoài cây web
  • Được cài đặt dưới dạng mô -đun Apache
  • Bảo mật phiên
  • Bảo mật hệ thống tập tin
    • Các vấn đề liên quan đến byte null
  • Bảo mật cơ sở dữ liệu
    • Thiết kế cơ sở dữ liệu
    • Kết nối với cơ sở dữ liệu
    • Mô hình lưu trữ được mã hóa
    • SQL tiêm
  • Báo cáo lỗi
  • Người dùng đã gửi dữ liệu
  • Ẩn PHP
  • Giữ hiện tại

djjokla tại gmail dot com ¶

16 năm trước

If a single file has to be included than I use the following

index.php [ where the file is gonna be included ]
___________


and the footer file [for example] looks this way then

footer.inc.php [ the file to be inluded ]
___________


So when someone tries to access the footer.php file directly he/she/it will get the "Not with me my friend" messages written on the screen. An alternative option is to redirect the person who wants to access the file directly to a different location, so instead of the above code you would have to write the following in the footer.inc.php file.



In normal case a redirection to an external site would be annoying to the visitor, but since this visitor is more interested in hacking the site than in reading the content, I think it's only fair to create such an redirection. We dont' realy want someome like this on our sites.

For the file protection I use .htaccess in which I say to protect the file itself and every .inc file


Order allow,deny
Deny from all
Satisfy All

The .htaccess file should result an Error 403 if someone tries to access the files directly. If for some reason this shouldn't work, then the "Not with me my friend" text apears or a redirection [depending what is used]

In my eyes this looks o.k. and safe.

ocrow tại simplexity dot net ¶ ¶

19 năm trước

If your PHP pages include[] or require[] files that live within the web server document root, for example library files in the same directory as the PHP pages, you must account for the possibility that attackers may call those library files directly. 

index.php [ where the file is gonna be included ]
___________


and the footer file [for example] looks this way then
0

index.php [ where the file is gonna be included ]
___________


and the footer file [for example] looks this way then
1

index.php [ where the file is gonna be included ]
___________


and the footer file [for example] looks this way then
2

k ¶ ¶

15 năm trước

index.php [ where the file is gonna be included ]
___________


and the footer file [for example] looks this way then
4

index.php [ where the file is gonna be included ]
___________


and the footer file [for example] looks this way then
5

index.php [ where the file is gonna be included ]
___________


and the footer file [for example] looks this way then
6

index.php [ where the file is gonna be included ]
___________


and the footer file [for example] looks this way then
7

index.php [ where the file is gonna be included ]
___________


and the footer file [for example] looks this way then
8

Dangan tại Blackjaguargaming Dot Net ¶

15 năm trước

footer.inc.php [ the file to be inluded ]
___________


So when someone tries to access the footer.php file directly he/she/it will get the "Not with me my friend" messages written on the screen. An alternative option is to redirect the person who wants to access the file directly to a different location, so instead of the above code you would have to write the following in the footer.inc.php file.
0

footer.inc.php [ the file to be inluded ]
___________


So when someone tries to access the footer.php file directly he/she/it will get the "Not with me my friend" messages written on the screen. An alternative option is to redirect the person who wants to access the file directly to a different location, so instead of the above code you would have to write the following in the footer.inc.php file.
1

Dangan tại Blackjaguargaming Dot Net ¶

Ẩn danh ¶

footer.inc.php [ the file to be inluded ]
___________


So when someone tries to access the footer.php file directly he/she/it will get the "Not with me my friend" messages written on the screen. An alternative option is to redirect the person who wants to access the file directly to a different location, so instead of the above code you would have to write the following in the footer.inc.php file.
3

7 năm trước ¶

16 năm trước

footer.inc.php [ the file to be inluded ]
___________


So when someone tries to access the footer.php file directly he/she/it will get the "Not with me my friend" messages written on the screen. An alternative option is to redirect the person who wants to access the file directly to a different location, so instead of the above code you would have to write the following in the footer.inc.php file.
4

footer.inc.php [ the file to be inluded ]
___________


So when someone tries to access the footer.php file directly he/she/it will get the "Not with me my friend" messages written on the screen. An alternative option is to redirect the person who wants to access the file directly to a different location, so instead of the above code you would have to write the following in the footer.inc.php file.
5

footer.inc.php [ the file to be inluded ]
___________


So when someone tries to access the footer.php file directly he/she/it will get the "Not with me my friend" messages written on the screen. An alternative option is to redirect the person who wants to access the file directly to a different location, so instead of the above code you would have to write the following in the footer.inc.php file.
6

ocrow tại simplexity dot net ¶ ¶

16 năm trước

footer.inc.php [ the file to be inluded ]
___________


So when someone tries to access the footer.php file directly he/she/it will get the "Not with me my friend" messages written on the screen. An alternative option is to redirect the person who wants to access the file directly to a different location, so instead of the above code you would have to write the following in the footer.inc.php file.
8

footer.inc.php [ the file to be inluded ]
___________


So when someone tries to access the footer.php file directly he/she/it will get the "Not with me my friend" messages written on the screen. An alternative option is to redirect the person who wants to access the file directly to a different location, so instead of the above code you would have to write the following in the footer.inc.php file.
9



In normal case a redirection to an external site would be annoying to the visitor, but since this visitor is more interested in hacking the site than in reading the content, I think it's only fair to create such an redirection. We dont' realy want someome like this on our sites.
0



In normal case a redirection to an external site would be annoying to the visitor, but since this visitor is more interested in hacking the site than in reading the content, I think it's only fair to create such an redirection. We dont' realy want someome like this on our sites.
1



In normal case a redirection to an external site would be annoying to the visitor, but since this visitor is more interested in hacking the site than in reading the content, I think it's only fair to create such an redirection. We dont' realy want someome like this on our sites.
2

ocrow tại simplexity dot net ¶ ¶

19 năm trước



In normal case a redirection to an external site would be annoying to the visitor, but since this visitor is more interested in hacking the site than in reading the content, I think it's only fair to create such an redirection. We dont' realy want someome like this on our sites.
4

k ¶ ¶

19 năm trước



In normal case a redirection to an external site would be annoying to the visitor, but since this visitor is more interested in hacking the site than in reading the content, I think it's only fair to create such an redirection. We dont' realy want someome like this on our sites.
5

k ¶ ¶

15 năm trước



In normal case a redirection to an external site would be annoying to the visitor, but since this visitor is more interested in hacking the site than in reading the content, I think it's only fair to create such an redirection. We dont' realy want someome like this on our sites.
6



In normal case a redirection to an external site would be annoying to the visitor, but since this visitor is more interested in hacking the site than in reading the content, I think it's only fair to create such an redirection. We dont' realy want someome like this on our sites.
7



In normal case a redirection to an external site would be annoying to the visitor, but since this visitor is more interested in hacking the site than in reading the content, I think it's only fair to create such an redirection. We dont' realy want someome like this on our sites.
8

Dangan tại Blackjaguargaming Dot Net ¶

Ẩn danh ¶

For the file protection I use .htaccess in which I say to protect the file itself and every .inc file0

For the file protection I use .htaccess in which I say to protect the file itself and every .inc file1

For the file protection I use .htaccess in which I say to protect the file itself and every .inc file2

For the file protection I use .htaccess in which I say to protect the file itself and every .inc file3

For the file protection I use .htaccess in which I say to protect the file itself and every .inc file4

For the file protection I use .htaccess in which I say to protect the file itself and every .inc file5

For the file protection I use .htaccess in which I say to protect the file itself and every .inc file6

7 năm trước ¶

15 năm trước

For the file protection I use .htaccess in which I say to protect the file itself and every .inc file8

For the file protection I use .htaccess in which I say to protect the file itself and every .inc file9

Dangan tại Blackjaguargaming Dot Net ¶


Order allow,deny
Deny from all
Satisfy All
1


Order allow,deny
Deny from all
Satisfy All
2


Order allow,deny
Deny from all
Satisfy All
3


Order allow,deny
Deny from all
Satisfy All
4

Bài Viết Liên Quan

Chủ Đề