1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        快速修復 Log4j2 遠程代碼執(zhí)行漏洞步驟,文末送10本書

        共 488字,需瀏覽 1分鐘

         ·

        2021-12-23 05:26



        來源:blog.csdn.net/weixin_48990070/

        article/details/121861553

        文末送10本書《Elasticsearch搜索引擎構建入門與實戰(zhàn)》

        目錄

        • 漏洞說明
        • 修復步驟
          1. 下載源碼zip包到本地
          2. 解壓到本地
          3. 用IDEA打開項目
          4. 執(zhí)行Maven Deploy,將log4j2修復的版本包安裝到Nexus
          5. 修改項目中的pom.xml
          6. 測試驗證

        Apache Log4j2 遠程代碼執(zhí)行漏洞修復步驟

        漏洞說明

        Apache Log4j2是一個基于Java的日志記錄工具。由于Apache Log4j2某些功能存在遞歸解析功能,攻擊者可直接構造惡意請求,觸發(fā)遠程代碼執(zhí)行漏洞。漏洞利用無需特殊配置,經阿里云安全團隊驗證,Apache Struts2、Apache Solr、Apache Druid、Apache Flink等均受影響。

        漏洞適用版本為2.0 <= Apache log4j2 <= 2.14.1,只需檢測Java應用是否引入 log4j-api , log4j-core 兩個jar。若存在應用使用,極大可能會受到影響。

        修復步驟

        1、下載源碼zip包到本地

        下載地址:

        • github.com/apache/logging-log4j2/archive/refs/tags/log4j-2.15.0-rc2.zip
        2、解壓到本地
        3、用IDEA打開項目
        4、執(zhí)行Maven Deploy,將log4j2修復的版本包安裝到Nexus

        1.修改toolchains-sample-win.xml文件的JDK安裝路徑:

        <toolchain>
        ????<type>jdktype>
        ????<provides>
        ??????<version>1.8version>
        ??????<vendor>sunvendor>
        ????provides>
        ????<configuration>
        ??????<jdkHome>C:\\Program?Files\\Java\\jdk1.8.0_202jdkHome>
        ????configuration>
        ??toolchain>
        ??<toolchain>
        ????<type>jdktype>
        ????<provides>
        ??????<version>9version>
        ??????<vendor>sunvendor>
        ????provides>
        ????<configuration>
        ??????<jdkHome>C:\\Program?Files\\Java\\jdk-9.0.4jdkHome>
        ????configuration>
        ??toolchain>

        2.執(zhí)行Maven命令mvn clean install -t ./toolchains-sample-win.xml -Dmaven.test.skip=true -f pom.xml

        3.將生成安裝在本地Jar包,安裝到Nexus

        注意事項:

        1、確保本地當前Java的環(huán)境為Java8,如果本地有個Java環(huán)境,請先修改Java環(huán)境為Java8,再重啟IDEA。

        2、確保本地有JDK9的環(huán)境

        3、建議跳過test步驟,否則安裝的時間太長了

        5、修改項目中的pom.xml

        排除掉通過其他依賴方式引入的log4j相關的包

        手動引入前面安裝的log4j包

        <dependency>
        ??????<groupId>org.apache.logging.log4jgroupId>
        ??????<artifactId>log4j-slf4j-implartifactId>
        ??????<version>2.15.0version>
        ??????<scope>compilescope>
        ??????<exclusions>
        ????????<exclusion>
        ??????????<artifactId>log4j-apiartifactId>
        ??????????<groupId>org.apache.logging.log4jgroupId>
        ????????exclusion>
        ????????<exclusion>
        ??????????<artifactId>log4j-coreartifactId>
        ??????????<groupId>org.apache.logging.log4jgroupId>
        ????????exclusion>
        ??????exclusions>
        ????dependency>
        ?
        ????<dependency>
        ??????<groupId>org.apache.logging.log4jgroupId>
        ??????<artifactId>log4j-apiartifactId>
        ??????<version>2.15.0version>
        ??????<scope>compilescope>
        ????dependency>
        ?
        ?
        ????<dependency>
        ??????<groupId>org.apache.logging.log4jgroupId>
        ??????<artifactId>log4j-coreartifactId>
        ??????<version>2.15.0version>
        ??????<scope>compilescope>
        ??????<exclusions>
        ????????<exclusion>
        ??????????<artifactId>log4j-apiartifactId>
        ??????????<groupId>org.apache.logging.log4jgroupId>
        ????????exclusion>
        ??????exclusions>
        ????dependency>
        6、測試驗證
        @RunWith(SpringRunner.class)
        @SpringBootTest
        @Log4j2
        public?class?SpringTests?
        {
        ?
        ????@Test
        ????public?void?test(){
        ????????log.error("${jndi:ldap://127.0.0.1:1389/#Exploit}");
        ????????log.error("${}","jndi:ldap://127.0.0.1:1389/#Exploit");
        ????}
        }




        福利環(huán)節(jié)

        內容簡介

        《Elasticsearch搜索引擎構建入門與實戰(zhàn)》從Elasticsearch的基本概念和原理講起,然后系統(tǒng)介紹Elasticsearch的使用場景,帶領讀者近距離接觸Elasticsearch。本書全面涵蓋Elasticsearch客戶端的安裝和使用、索引創(chuàng)建、文檔操作、搜索匹配、搜索排序和聚合等技術,可以幫助讀者循序漸進地掌握Elasticsearch的相關知識。


        做技術也不容易,最后給大家抽個獎吧,送 10?本Elasticsearch搜索引擎構建入門與實戰(zhàn)》,12?月 26?日(下周日)20:00?開獎 中獎者記得加微信 itwang005

        參加方式 關注 【Java項目分享】?后臺回復?送書

        中獎后3天內不聯系就送其他粉絲了哦

        瀏覽 68
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        分享
        舉報
        評論
        圖片
        表情
        推薦
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        分享
        舉報
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            国产ts网站 | 黄色免费网站视频 | 亚洲AV色成人无码影院 | 亚洲无码论坛 | 女主播做爰视频直播 | 逼逼视频免费 | 欧美性猛交xxxx乱大交91 | 全免费A级毛片在线视频微信 | 大鸡吧搞逼 | 夜夜拍天天干 |