search
Homephp教程php手册jsp与php混用的漏洞

接手一个项目是jsp写的,用起来感觉开发是在太麻烦了。于是新功能就用php写的,jsp、php两者之间相互跳转, 突然一天发现在tomcat的web站下打开php竟然显示了php源码,在php站下看jsp也是显示的源码, 立即度娘解决问题 apache增加: FilesMatch \.(jsp|inc)

接手一个项目是jsp写的,用起来感觉开发是在太麻烦了。于是新功能就用php写的,jsp、php两者之间相互跳转,

突然一天发现在tomcat的web站下打开php竟然显示了php源码,在php站下看jsp也是显示的源码,

 

立即度娘解决问题

apache增加:

<filesmatch>
Order Deny,Allow
Deny from all
</filesmatch>


 

tomcat web.xml增加:

<security-constraint>
                 <web-resource-collection>
			<web-resource-name>Members Only</web-resource-name>
                        <url-pattern>*.php</url-pattern>
                 </web-resource-collection>
                 <auth-constraint></auth-constraint>
         </security-constraint>


 

重启,访问都回得到403错误
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools