Tomcat漏洞之——通過PUT遠程代碼執行

來源:互聯網
上載者:User

原文連結:http://www.dubby.cn/detail.html?id=9034

本文僅為技術分享,任何利用裡技術的行為都和本文無關。

這是Tomcat在2017.9.19日公布的一個漏洞:

根據郵件描述,我們下了windows版tomcat 7.0.79,安裝成功後,需要首先允許tomcat進行PUT操作,也就是修改/conf/web.xml:

<servlet>        <servlet-name>default</servlet-name>        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>        <init-param>            <param-name>debug</param-name>            <param-value>0</param-value>        </init-param>        <init-param>            <param-name>listings</param-name>            <param-value>false</param-value>        </init-param>        <init-param>            <param-name>readonly</param-name>            <param-value>false</param-value>        </init-param>        <load-on-startup>1</load-on-startup></servlet>

其中新增了:

<init-param>            <param-name>readonly</param-name>            <param-value>false</param-value></init-param>

然後啟動tomcat,使用postman發送一個put請求:

再在瀏覽器中正常訪問http://localhost:8080/helloworld.jsp:

註:localhost:8080/helloworld.jsp/也可以替換成localhost:8080/helloworld.jsp%20,因為在windows下,%20(空格)和/都是不合法的檔案命名,都會被去掉。

最後再去tomcat的目錄webapps\ROOT下看看:

這就是剛才通過漏洞添加上去的檔案,OK,這就是tomcat的put漏洞,解決方案,最簡單的就是升級。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.