text code block:sequence by host.id with maxspan=1m [network where event.action == "connection_attempted" and process.name : "java" and /* outbound connection attempt to LDAP, RMI or DNS standard ports by JAVA process */ destination.port in (1389, 389, 1099, 53, 5353)] by process.pid [process where event.type == "start" and /* Suspicious JAVA child process */ process.parent.name : "java" and process.name : ("sh", "bash", "dash", "ksh", "tcsh", "zsh", "curl", "perl*", "python*", "ruby*", "php*", "wget") and not process.command_line like~ ( "bash -c ulimit -u", "bash /opt/flutter/bin/flutter*", "bash -c echo $$", "/bin/bash /opt/python3/bin/jira*", "/bin/sh -c env LC_ALL=C /usr/sbin/lpc status*" )] by process.parent.pid
Install detection rules in Elastic Security
Detect Potential JAVA/JNDI Exploitation Attempt in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).