6

GitHub - chaitin/log4j2-vaccine: log4j2-vaccine

 3 years ago
source link: https://github.com/chaitin/log4j2-vaccine
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

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

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK