
Log4j 漏洞本地检测脚本。 Scan all java processes on your host to check whether it's affected by log4j2 remote code execution vulnerability (CVE-2021-45046)
Log4j 漏洞本地检测脚本,扫描主机上所有java进程,检测是否引入了有漏洞的log4j-core jar包,是否可能遭到远程代码执行攻击(CVE-2021-45046)。上传扫描报告到指定的服务器。
Scan all java processes on your host to check whether it's affected by log4j2 remote code execution(CVE-2021-45046), then upload the report to your api server.
Works under python2.7 / 2.6 / 3.x, no extra lib required.
java进程java进程打开的jar包log4j-core-* jar包log4j-core-* jar包JndiLookup.classJndiLookup.class后,根据其版本号 、jvm参数、OS环境变量、是否docker容器进程、k8s进程,输出是否存在漏洞,输出升级提示java process on the hostjar files open by the java processlog4j-core-*.jarlog4j-core-*.jarJndiLookup.class in log4j-core-*.jarJndiLookup.class found,output some tips based on its version 、jvm args、OS env args、is docker container、is k8s可以集成到Agent,或者下发该扫描脚本一次性执行。也可以运维机登入,一键全网扫描。
You can use the script as a module by your agent, or deliver and run it only once.
Those who don't have an easy to use agent can run command below on your OPS server.
cat hosts.txt|xargs -P 5 -I{} sh -c 'ssh root@{} -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null "wget http://your_site/to_download/log4j2_vul_scanner.py -O /tmp/log4j2_vul_scanner.py -q && python /tmp/log4j2_vul_scanner.py && /usr/bin/rm /tmp/log4j2_vul_scanner.py" > ./logs.txt||exit 0'