- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
04-13-2022 02:06 PM - edited 04-13-2022 02:07 PM
Brief:
Spring4Shell Vulnerability Exists in the Spring Framework. Java based application are developed using this framework, we would not see direct installation of spring framework on the system but as part of a Java application. (At least what I have seen.)
Goal:
Our goal is to find out where can we see the traces of spring-beans and spring-core in our environment which will help us identify the application using spring framework and what hosts the application is on for patching of the software.
The first XQL looks for any file "writes and create" where key word is spring-beans and spring-core:
config case_sensitive = false
| dataset = xdr_data
| filter event_sub_type = ENUM.FILE_WRITE or event_sub_type = ENUM.FILE_CREATE_NEW
| filter action_file_name contains "spring-beans" or action_file_name contains "spring-core"
| filter action_file_name ~= ".*spring-(beans|core)-\d.\d.\d.*"
| fields
_time as Timestamp,
agent_hostname as Hostname,
action_file_name as File_Name,action_file_path as File_Path,actor_process_image_name as Proces_Name
| comp count_distinct(Hostname) as Count by File_Name,Hostname,File_Path
| sort desc Count
The second XQL looks for any process start which has command-line parameter such as "spring-core and spring-beans":
config case_sensitive = false | dataset = xdr_data
| filter event_sub_type = ENUM.PROCESS_START
| filter action_process_image_command_line contains "spring-beans" or action_process_image_command_line contains "spring-core"
| filter action_process_image_command_line ~= ".*spring-(beans|core)-\d.\d.\d.*"
| fields
_time as Timestamp,
agent_hostname as Hostname,
action_process_image_name as Process_Name,action_process_image_command_line as Process_CMD
| comp count_distinct(Process_Name) as Count by Hostname,Process_Name,Process_CMD
| sort desc Count
FYI:
Having a vulnerable version of spring framework does not mean that an exploit will be successful as there are other pre-requites as well. But it is good to have the software patched. "Hence the hunt"
More information: https://unit42.paloaltonetworks.com/cve-2022-22965-springshell/
Thoughts? Suggestions? All welcome and I hope this helps others too.