5

CNVD-2020-10487(CVE-2020-1938)tomcat ajp 文件读取漏洞_Apache Tomcat 8 < 8.5.5...

 1 year ago
source link: https://blog.51cto.com/sry2004/5994517
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

CNVD-2020-10487(CVE-2020-1938)tomcat ajp 文件读取漏洞_Apache Tomcat 8 < 8.5.51 存在漏洞

精选 原创

运维瑞勇 2023-01-06 18:41:23 博主文章分类:安全 ©著作权

文章标签 tomcat CNVD-2020-10487 文章分类 其它 系统/运维 yyds干货盘点 阅读数216

一、详细说明:其中包括场景、截图、漏洞重现的方法,涉及账号相关漏洞,请提供测试账号。

1、场景:在进入到内网后,且远程tomcat8009后能通的情况下,Apache Tomcat 8 < 8.5.51 时候可以通过ajp读取代码文件;当前部分tomcat版本在8.5.13会有此漏洞。

2、截图:

CNVD-2020-10487(CVE-2020-1938)tomcat ajp 文件读取漏洞_Apache Tomcat 8 < 8.5.51 存在漏洞_CNVD-2020-10487

3、漏洞重现方法:

3.1ROOT下写一个jsp文件

#cat tomcat/webapps/ROOT/1.jsp

root/1.jsp

aa

3.2命令执行获取1.jsp内容

# python tomcat.py 192.168.0.3 -p 8009 -f 1.jsp

Getting resource at ajp13://192.168.0.3:8009/asdf

----------------------------

root/1.jsp

二、修复方案:

2.1 Apache Tomcat版本官方升级

目前官方在最新版本中修改该漏洞,用户可自行前往官方地址下载并升级。

Apache Tomcat 7.0.100官方下载地址:

 ​http://tomcat.apache.org/download-70.cgi​

Apache Tomcat 8.5.51官方下载地址:

 ​http://tomcat.apache.org/download-80.cgi​

Apache Tomcat 9.0.31官方下载地址:

 ​http://tomcat.apache.org/download-90.cgi​

2.2 临时修复

若用户由于业务等原因无法进行版本升级,可采用临时防护措施。

2.2.1若不需要使用Tomcat AJP协议,可直接关闭AJP Connector,或将其监听地址改为仅监听本机localhost。

具体操作:

(1)编辑Tomcat 的工作目录下的/conf/server.xml,找到如下行:

<Connector port="8009"protocol="AJP/1.3" redirectPort="8443" />

(2)将此行注释掉(也可删掉该行):

<!--<Cnotallow="8009" protocol="AJP/1.3"redirectPort="8443" />-->

(3)保存后需重新启动Tomcat,规则方可生效。

2.2.2若需使用Tomcat AJP协议,可根据使用版本配置协议属性设置认证凭证。

使用Tomcat 7和Tomcat 9的用户可为AJP Connector配置secret来设置AJP协议的认证凭证。例如:

<Connector port="8009"protocol="AJP/1.3" redirectPort="8443" address="Tomcat的IP地址" secret="需要设置的复杂口令"/>

使用Tomcat 8的用户可为AJP Connector配置requiredSecret来设置AJP协议的认证凭证:

<Connector port="8009"protocol="AJP/1.3" redirectPort="8443" address="Tomcat的IP地址" requiredSecret="需要设置的复杂口令" />

其他:可以隐藏tomcat版本,减少针对性。

    ​ ​https://blog.51cto.com/sry2004/5995424​

  • 打赏
  • 收藏
  • 评论
  • 分享
  • 举报

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK