Detection rules › Elastic
Java Drop followed by network activity
Identifies attempts to execute a JAVA application that was recently dropped followed by network connection. Adversaries may abuse this utility to execute malicious code.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution |
Rule body
[rule]
description = """
Identifies attempts to execute a JAVA application that was recently dropped followed by network connection. Adversaries
may abuse this utility to execute malicious code.
"""
id = "bb794072-bdcb-4877-bc81-06d2cdd9014b"
license = "Elastic License v2"
name = "Java Drop followed by network activity"
os_list = ["windows"]
version = "1.0.1"
query = '''
sequence by process.entity_id with maxspan=1m
[process where event.action == "start" and
(process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
(process.name : "javaw.exe" or process.pe.original_file_name == "javaw.exe") and process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*") and user.id != "S-1-5-18" and
(
(process.args_count == 3 and process.args : "-jar") or
(process.args_count == 4 and process.args : ("-cp", "-classpath") and process.command_line : " *.* ")
)]
[dns where event.action == "lookup_requested" and dns.question.name like "*.*"]
'''
min_endpoint_version = "8.10.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[internal]
min_endpoint_version = "8.10.0"
Stages and Predicates
Ordered sequence: each step below must occur in order within 1m, correlated by process.entity_id.
Stage 1: process
[process where event.action == "start" and
(process.Ext.relative_file_creation_time <= 500 or process.Ext.relative_file_name_modify_time <= 500) and
(process.name : "javaw.exe" or process.pe.original_file_name == "javaw.exe") and process.executable : ("?:\\Users\\*", "?:\\ProgramData\\*", "?:\\Windows\\Temp\\*") and user.id != "S-1-5-18" and
(
(process.args_count == 3 and process.args : "-jar") or
(process.args_count == 4 and process.args : ("-cp", "-classpath") and process.command_line : " *.* ")
)]
Stage 2: dns
[dns where event.action == "lookup_requested" and dns.question.name like "*.*"]
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
dns.question.name | wildcard |
| field:"QueryName" kind:wildcard value:"*.*" |
event.action | eq |
| field:"EventType" kind:eq |
process.Ext.relative_file_creation_time | le |
| field:"process.Ext.relative_file_creation_time" kind:le value:"500" |
process.Ext.relative_file_name_modify_time | le |
| field:"process.Ext.relative_file_name_modify_time" kind:le value:"500" |
process.args | wildcard |
| field:"process.args" kind:wildcard |
process.args_count | eq |
| field:"process.args_count" kind:eq |
process.command_line | wildcard |
| field:"CommandLine" kind:wildcard value:" *.* " |
process.executable | wildcard |
| field:"Image" kind:wildcard |
process.name | wildcard |
| field:"process_name" kind:wildcard value:"javaw.exe" |
process.pe.original_file_name | eq |
| field:"OriginalFileName" kind:eq value:"javaw.exe" |
user.id | ne |
| field:"user.id" kind:ne value:"S-1-5-18" |