HTTP Status 403 – Access to the requested resource has been
访问地址: http://localhost:8080/manager/status http://localhost:8080/manager/html 错误提示 HTTP Status 403 – Access to the requested resource has been denied type Status report message Access to the requested resource has been denied des
访问地址:
http://localhost:8080/manager/status
http://localhost:8080/manager/html
错误提示
HTTP Status 403 – Access to the requested resource has been denied
type Status report
message Access to the requested resource has been denied
description Access to the specified resource (Access to the requested resource has been denied) has been forbidden.
Apache Tomcat/7.0.21
解决方法:
先进入manager所在目录
[root@localhost tomcat]# cd webapps/manager/WEB-INF/
查看 web.xml
[root@localhost WEB-INF]# more web.xml
<!-- Define a Security Constraint on this Application --> <!-- NOTE: None of these roles are present in the default users file --> <security-constraint> <web-resource-collection> <web-resource-name>HTML Manager interface (for humans)</web-resource-name> <span> <url-pattern>/html/*</url-pattern> 对应:http://localhost:8080/manager/html</span> </web-resource-collection> <auth-constraint> <span> <role-name>manager-gui</role-name> 定义了访问这个页面的角色名:manage-gui</span> </auth-constraint> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>Text Manager interface (for scripts)</web-resource-name> <url-pattern>/text/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>manager-script</role-name> </auth-constraint> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>JMX Proxy interface</web-resource-name> <url-pattern>/jmxproxy/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>manager-jmx</role-name> </auth-constraint> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>Status interface</web-resource-name> <span> <url-pattern>/status/*</url-pattern> 对应:http://localhost:8080/manager/status </span> </web-resource-collection> <auth-constraint> <span> <role-name>manager-gui</role-name> </span> <role-name>manager-script</role-name> <role-name>manager-jmx</role-name> <role-name>manager-status</role-name> </auth-constraint> </security-constraint>
进入host-manager所在目录
[root@localhost tomcat]# cd webapps/host-manager/WEB-INF/
查看 web.xml
[root@localhost WEB-INF]# more web.xml
<security-constraint> <web-resource-collection> <web-resource-name>HTMLHostManager commands</web-resource-name> <url-pattern><span>/html/*</span></url-pattern> <span>对应:<span>http://192.168.14.219:8080/host-manager/</span>htm</span>l </web-resource-collection> <auth-constraint> <!-- NOTE: This role is not present in the default users file --> <span> <role-name>admin-gui</role-name> 定义了管理角色名称</span></auth-constraint> </security-constraint>
<!-- Security roles referenced by this web application --> <security-role> <description> <span>The role that is required to log in to the Host Manager Application HTML</span> <span> interface</span> </description> <span><role-name>admin-gui</role-name></span> </security-role> <security-role> <description> The role that is required to log in to the Host Manager Application text interface </description> <role-name>admin-script</role-name> </security-role>
编辑Tomcat用户配置文件,添加角色
[root@localhost tomcat]# vi conf/tomcat-users.xml
<tomcat-users> <!-- NOTE: By default, no user is included in the "manager-gui" role required to operate the "/manager/html" web application. If you wish to use this app, you must define such a user - the username and password are arbitrary. --> <!-- NOTE: The sample user and role entries below are wrapped in a comment and thus are ignored when reading this file. Do not forget to remove <!.. ..> that surrounds them. --> <span><!-- 这里有个注释符号去掉,使下面的生效</span> <role rolename="tomcat"/> <role rolename="role1"/> <!--添加管理页面访问角色--> <span> <role rolename="manager-gui"></role> </span> <span> <role rolename="admin-gui"></role></span> <span><user username="manager" password="manager" roles="manager-gui,admin-gui">> <user username="tomcat" password="tomcat" roles="tomcat"></user> <user username="both" password="tomcat" roles="tomcat,role1"></user> <user username="role1" password="tomcat" roles="role1"></user> <span>--> 这里有个注释符号去掉,是下面的生效</span> </user></span></span></tomcat-users>
重启 tomcat
[root@localhost tomcat]# ./bin/shutdown.sh
[root@localhost tomcat]# ./bin/startup.sh
总结:
虚拟目录/WEB-INF/web.xml一般定义了访问这个目录的安全角色名称,得知这个安全角色名称后便可在conf/tomcat-users.xml添加对应的访问角色,获得访问权限。(于是这里也是个黑客可以利用的后门。。。)

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

热门话题

1、在Windows11中打开设置。您可以使用Win+I快捷方式或任何其他方法。2、转到应用程序部分,然后单击应用程序和功能。3、查找要阻止在后台运行的应用程序。单击三点按钮并选择高级选项。4、找到【后台应用程序权限】部分并选择所需的值。默认情况下,Windows11设置电源优化模式。它允许Windows管理应用程序在后台的工作方式。例如,一旦启用省电模式以保留电池,系统将自动关闭所有应用程序。5、选择【从不】可防止应用程序在后台运行。请注意,如果您注意到程序不向您发送通知、无法更新数据等,您可

DeepSeek 无法直接将文件转换为 PDF。根据文件类型,可以使用不同方法:常见文档(Word、Excel、PowerPoint):使用微软 Office、LibreOffice 等软件导出为 PDF。图片:使用图片查看器或图像处理软件保存为 PDF。网页:使用浏览器“打印成 PDF”功能或专用的网页转 PDF 工具。不常见格式:找到合适的转换器,将其转换为 PDF。选择合适的工具并根据实际情况制定方案至关重要。

Oracle 可以通过以下步骤读取 dbf 文件:创建外部表,引用 dbf 文件;查询外部表,检索数据;将数据导入 Oracle 表。

Java反射机制允许程序动态修改类的行为,无需修改源代码。通过Class对象操作类,可以通过newInstance()创建实例,修改私有字段值,调用私有方法等。但应谨慎使用反射,因为它可能会导致意外的行为和安全问题,并有性能开销。

Java函数开发中常见的异常类型及其修复措施在Java函数开发过程中,可能遇到各种异常,影响函数的正确执行。以下是常见的异常类型及其修复措施:1.NullPointerException描述:当访问一个还未初始化的对象时抛出。修复措施:确保在使用对象之前对其进行非空检查。示例代码:try{Stringname=null;System.out.println(name.length());}catch(NullPointerExceptione){

在 Vue 中解决 iframe 跨域问题的方法:CORS:启用后端服务器中的 CORS 支持,在 Vue 中使用 XMLHttpRequest 或 fetch API 发送 CORS 请求。JSONP:使用后端服务器中的 JSONP 端点,在 Vue 中动态加载 JSONP 脚本。代理服务器:设置代理服务器转发请求,在 Vue 中使用第三方库(如 axios)发送请求并设置代理服务器 URL。

如何在C++中实现HTTP流传输?使用Boost.Asio和asiohttps客户端库创建SSL流套接字。连接到服务器并发送HTTP请求。接收HTTP响应头并打印它们。接收HTTP响应正文并打印它。

昨日,BotanixLabs宣布累计完成1150万美元融资,PolychainCapital、PlaceholderCapital等参投。融资将用于构建去中心化的EVM等效BTCL2Botanix。Spiderchain结合了EVM的易用性与比特币的安全性。自2023年11月测试网上线以来,已有超过20万个活跃地址。Odaily将于本文解析Botanix的特色机制与测试网交互流程。Botanix按照官方定义,Botanix是一个基于比特币构建的去中心化的图灵完备L2EVM,由两个核心组件以太坊虚
