Logback 漏洞集合

漏洞描述

Logback 远程代码执行漏洞 ,建议 将 Logback 升级到 1.2.9 及以上版本,这里直接升级到 1.2.10,参考如下

1、下载地址

logback-1.2.10.zip

2、升级步骤(以下操作均用安装用户操作如 isearch 用户)


1、查找需要替换的文件
 find /isearch/isa/datas/tomcat/ -name logback\*-1.2.*.jar
  
2、重命名原文件(x需改成查询到替换的文件名)
   mv /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/logback-classic-1.2.x.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/logback-classic-1.2.x.jar.bak
   mv /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/logback-core-1.2.x.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/logback-core-1.2.x.jar.bak
   mv /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/logback-classic-1.2.x.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/logback-classic-1.2.x.jar.bak
   mv /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/logback-core-1.2.x.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/logback-core-1.2.x.jar.bak

3、将附件中的所有lib上传到/isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/、/isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/目录下 

4、重启tomcat
 

3、还原


1、备份文件还原
   mv /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/logback-classic-1.2.x.jar.bak /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/logback-classic-1.2.x.jar
   mv /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/logback-core-1.2.x.jar.bak /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/logback-core-1.2.x.jar
   mv /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/logback-classic-1.2.x.jar.bak /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/logback-classic-1.2.x.jar
   mv /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/logback-core-1.2.x.jar.bak /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/logback-core-1.2.x.jar

2、将替换文件重命名
   mv /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/logback-classic-1.2.10.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/logback-classic-1.2.10.jar.bak
   mv /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/logback-core-1.2.10.jar /isearch/isa/datas/tomcat/Snapshot/WEB-INF/lib/logback-core-1.2.10.jar.bak
   mv /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/logback-classic-1.2.10.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/logback-classic-1.2.10.jar.bak
   mv /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/logback-core-1.2.10.jar /isearch/isa/datas/tomcat/ROOT/WEB-INF/lib/logback-core-1.2.10.jar.bak
 
3、重启tomcat