alert tcp any any → [$HOME_NET,$HTTP_SERVERS] any (msg:“ET EXPLOIT Apache Obfuscated log4j RCE Attempt (tcp ldap) (CVE-2021-44228)”; flow:established,to_server; content:“|24 7b 24 7b|env|3a|NaN|3a|-j|7d|ndi|24 7b|env|3a|NaN|3a|”; nocase; fast_pattern; content:“|24 7b|env|3a|NaN|3a|-l|7d|dap|24|”; reference:url,x.com; reference:cve,2021-44228; classtype:attempted-admin; sid:2034755; rev:1; metadata:attack_target Server, created_at 2021_12_17, cve CVE_2021_44228, deployment Perimeter, former_category EXPLOIT, signature_severity Major, updated_at 2021_12_17;)
alert udp any any → [$HOME_NET,$HTTP_SERVERS] any (msg:“ET EXPLOIT Apache log4j RCE Attempt - lower/upper UDP Bypass M1 (CVE-2021-44228)”; content:“%7bjndi%3a”; nocase; fast_pattern; pcre:“/^(l|r|d|(\x24|%24)(\x7b|%7b)(lower|upper)(\x3a|%3a)(l|r|d)(\x7d|%7d))(d|n|m|(\x24|%24)(\x7b|%7b)(lower|upper)(\x3a|%3a)(d|n|m)(\x7d|%7d))(a|i|s|(\x24|%24)(\x7b|%7b)(lower|upper)(\x3a|%3a)(a|i|s)(\x7d|%7d))(p|(\x24|%24)(\x7b|%7b)(lower|upper)(\x3a|%3a)p(\x7d|%7d))/Ri”; reference:cve,2021-44228; classtype:attempted-admin; sid:2034660; rev:3; metadata:attack_target Server, created_at 2021_12_11, cve CVE_2021_44228, deployment Perimeter, deployment Internal, former_category EXPLOIT, signature_severity Major, tag Exploit, updated_at 2021_12_14;)
-
So for the first alert, I can use a hex converter to decipher what 24, 7b, 3a, are supposed to map to. Roughly, this should be the beginning of a JNDI lookup. But when it comes to “NaN” or “ndi” I am totally puzzled, as well as what “env” is supposed to be (I’m assuming it’s an environmental variable). My guess is that as this is obfusfaction, the payload is being packed into multiple curly brackets. Feel free to correct me.
-
For the second alert, what is the purpose behind using the % in the content and the pcre, and how %24 may differ from x24? That I’m confused about. In addition, what are character sequences like “l|r|d|” or “a|i|s” looking for? Is it just a mere requirement of the regular expression that some of the strings have one of these letters at those positions?