Skip to content

chaitin/log4j2-vaccine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log4j2-Vaccine

一款用于log4j2漏洞的疫苗,基于Instrumentation机制进行RASP防护,Patch了 org.apache.logging.log4j.core.net.JndiManagerlookup方法,部分代码借用了arthas的实现

Usage1: Java进程已经启动

启动Loader

java -jar loader.jar --agent agent.jar

选择需要Patch的进程(输入序号即可)

[INFO] Found existing java process, please choose one and hit RETURN.
* [1]: 50508 log4j2vuln3-0.0.1-SNAPSHOT.jar

Patch成功

如果Java进程较多,可在启动时添加all参数,Patch所有存活的Java进程

java -jar loader.jar --agent agent.jar all

Usage2: Java进程仍未启动

使用javaagent参数加载agent.jar

java -javaagent:agent.jar -jar web.jar