Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jar patcher command to log4shell cli #308

Merged
merged 16 commits into from
Dec 27, 2021
Merged

Add jar patcher command to log4shell cli #308

merged 16 commits into from
Dec 27, 2021

Conversation

breadchris
Copy link
Contributor

@breadchris breadchris commented Dec 15, 2021

The jar patcher will attempt to remove the JNDILookup class from log4j dependencies that have been discovered.

Read more about this approach here: https://www.lunasec.io/docs/blog/log4j-zero-day-mitigation-guide/#option-3-jndi-patch

We can possibly use this tool to perform the fix as well: https://github.com/nccgroup/log4j-jndi-be-gone

https://www.trendmicro.com/en_us/research/21/l/patch-now-apache-log4j-vulnerability-called-log4shell-being-acti.html

For 2.0-beta9 to 2.10.0, remove JndiLookup.class from class path: zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class.

@mikebell90
Copy link

Please dont do bytte buddy or dynamic patching. There are many many flaws to this technique and IMO it's mostly showing off and not realistic.

@breadchris
Copy link
Contributor Author

@mikebell90 i completely agree, simple is def better here. My approach for implementing this will be to only remove files that match known hashes like I have when scanning so that the risk of a false positive is very low.

@breadchris breadchris marked this pull request as ready for review December 27, 2021 08:21
@breadchris breadchris merged commit 74e545a into master Dec 27, 2021
@breadchris breadchris deleted the add-jar-patcher branch December 27, 2021 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants