下沙论坛

 找回密码
 注册论坛(EC通行证)

用新浪微博连接

一步搞定

QQ登录

QQ登录

下沙大学生网QQ群8(千人群)
群号:6490324 ,验证:下沙大学生网。
用手机发布本地信息严禁群发,各种宣传贴请发表在下沙信息版块有问必答,欢迎提问 提升会员等级,助你宣传
新会员必读 大学生的论坛下沙新生必读下沙币获得方法及使用
查看: 6287|回复: 0
打印 上一主题 下一主题

Apache Log4j2 远程代码执行漏洞

[复制链接]
  • TA的每日心情
    奋斗
    10 小时前
  • 签到天数: 2370 天

    [LV.Master]伴坛终老

    跳转到指定楼层
    1
    发表于 2021-12-15 10:10:25 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
    漏洞描述

    Apache Log4j2 是一个基于 Java 的日志记录工具。该工具重写了 Log4j 框架,并且引入了大量丰富的特性。该日志框架被大量用于业务系统开发,用来记录日志信息。

    在大多数情况下,开发者可能会将用户输入导致的错误信息写入日志中。攻击者利用此特性可通过该漏洞构造特殊的数据请求包,最终触发远程代码执行。由于该漏洞影响范围极广,建议广大用户及时排查相关漏洞,经过白帽汇安全研究院分析确认,目前市面有多款流行的系统都受影响。

    该漏洞危害等级:严重

    影响范围

    Apache Log4j 2.x < 2.15.0-rc2

    已知影响组件
    • Apache Struts2
    • Apache Solr
    • Apache Flink
    • Apache Druid
    • flume
    • dubbo
    • logstash
    • VMware Horizon
    • VMware vCenter Server
    • VMware HCX
    • VMware NSX-T Data Center
    • VMware Unified Access Gateway
    • VMware WorkspaceOne Access
    • VMware Identity Manager`
    • VMware vRealize Operations
    • VMware vRealize Operations Cloud Proxy
    • VMware vRealize Log Insight
    • VMware vRealize Automation
    • VMware vRealize Lifecycle Manager
    • VMware Telco Cloud Automation
    • VMware Site Recovery Manager
    • VMware Carbon Black Cloud Workload Appliance
    • VMware Carbon Black EDR Server
    • VMware Tanzu GemFire
    • VMware Tanzu Greenplum
    • VMware Tanzu Operations Manager
    • VMware Tanzu Application Service for VMs
    • VMware Tanzu Kubernetes Grid Integrated Edition
    • VMware Tanzu Observability by Wavefront Nozzle
    • Healthwatch for Tanzu Application Service
    • Spring Cloud Services for VMware Tanzu
    • Spring Cloud Gateway for VMware Tanzu
    • Spring Cloud Gateway for Kubernetes
    • API Portal for VMware Tanzu
    • Single Sign-On for VMware Tanzu Application Service
    • App Metrics
    • VMware vCenter Cloud Gateway
    • VMware Tanzu SQL with MySQL for VMs
    • VMware vRealize Orchestrator
    • VMware Cloud Foundation
    • VMware Workspace ONE Access Connector
    • VMware Horizon DaaS
    • VMware Horizon Cloud Connector
      $ L" C, H( f, s# Z. d, a, v
    受影响开源组件
    项目
    仓库地址
    版本
    ; t7 Z" N6 H* c1 l, P7 y# e& j
    elasticsearch(org.elasticsearch)https://github.com/elastic/elasticsearch8.0.0-alpha2 等(共 100 个)5 y" J, v; ^# W8 b+ i$ J7 a
    spring-webflux(org.springframework)https://github.com/spring-projects/spring-framework5.2.6.RELEASE 等(共 40 个)* X7 h  J; ?4 p! {
    druid(com.alibaba)https://github.com/alibaba/druid1.2.8 等(共 68 个)7 F6 L3 [% `& J. g8 Z; C
    hystrix-rx-netty-metrics-stream(com.netflix.hystrix)https://github.com/Netflix/Hystrix1.5.4 等(共 2 个)
    7 s3 q! z1 I3 Q& K0 ospring-cloud-starter-alibaba-sentinel(com.alibaba.cloud)https://github.com/alibaba/spring-cloud-alibaba2021.1 等(共 14 个)# v9 q: i2 x" q2 C
    spring-boot-starter-ahas-sentinel-client(com.alibaba.csp)https://github.com/alibaba/Sentinel1.3.2 等(共 17 个)
    # T1 g5 @# ^& _- P( D7 Q( B$ hredisson(org.redisson)https://github.com/redisson/redisson2.2.24 等(共 3 个)+ e* y  ?0 ~, _
    HikariCP(com.zaxxer)https://github.com/brettwooldridge/HikariCP5.0.0 等(共 27 个)
    5 u( K* N( i8 B' D1 P" }zipkin-collector-service(io.zipkin)https://github.com/openzipkin/zipkin1.40.2 等(共 27 个)
    : s; a; @# H; M+ w/ V- [: ?! m1 wmybatis-plus(com.baomidou)https://github.com/baomidou/mybatis-plus3.4.3.4 等(共 41 个)9 t9 y. ^; y, }) _- ?
    zuul-sample(com.netflix.zuul)https://github.com/Netflix/zuul2.3.0 等(共 10 个)
    # ]( s4 R6 n# ^! |watson-data-api-client(com.ibm.watson.data)https://github.com/OpenAPITools/openapi-generator0.1 等(共 1 个)1 Q) x3 `2 Y! t; F" B" c
    spring-boot-admin-sample-consul(de.codecentric)https://github.com/codecentric/spring-boot-admin2.5.4 等(共 40 个)
    4 a6 ~% e4 M4 @7 Tjedis(redis.clients)https://github.com/redis/jedisjedis-3.6.2 等(共 36 个)
    1 _) M" {( V! K* ~. p1 N$ n  E) ^grpc-benchmarks(io.grpc)https://github.com/grpc/grpc-java1.9.1 等(共 65 个)
    : r6 ]5 n- G  ]; lktor-client-json-tests(io.ktor)https://github.com/ktorio/ktor1.6.7 等(共 32 个)
    & D. Q2 e2 @* mgitbucket_2.13(io.github.gitbucket)https://github.com/gitbucket/gitbucket4.32.0 等(共 27 个)- ~) q, ^- k( O( K6 O4 `
    finagle-zipkin_2.12(com.twitter)https://github.com/twitter/finagle7.1.0 等(共 56 个)1 u% F) y. O8 d" Q
    resilience4j-vertx(io.github.resilience4j)https://github.com/resilience4j/resilience4j0.9.0 等(共 9 个)  _6 m* q* \  v5 I+ N% x9 o
    elasticsearch-sql(org.nlpcn)https://github.com/NLPchina/elasticsearch-sql6.8.13.0 等(共 9 个)
    - @4 U3 G4 v% k; k( T6 e2 a- t  z* {exposed-spring-boot-starter(org.jetbrains.exposed)https://github.com/JetBrains/Exposed0.36.2 等(共 11 个)
    , o3 k8 M& d9 P; W+ L. v( wblade-sql2o(com.bladejava)https://github.com/lets-blade/blade1.2.9 等(共 1 个); h& B( ^9 B4 [
    netty-socketio(com.corundumstudio.socketio)https://github.com/mrniko/netty-socketio1.7.19 等(共 8 个)# |4 v; M- e" H0 ~: |1 L$ z1 C
    springfox-swagger2(io.springfox)https://github.com/springfox/springfox2.10.5 等(共 6 个)% H* A/ [( y* j1 F( G+ Z* `: D9 P
    main_2.12(org.scala-sbt)https://github.com/sbt/sbt1.6.0-RC1 等(共 88 个)4 j% E6 K4 E9 {$ F# H4 t: g
    lettuce-core(io.lettuce)https://github.com/lettuce-io/lettuce-core6.1.5.RELEASE 等(共 42 个)
    1 k: Q- o* S) T) w# Zrepository-azure(org.opensearch.plugin)https://github.com/opensearch-project/OpenSearch1.2.0 等(共 3 个)
    % n9 u5 X- ?9 L! I# q& creactor-test(io.projectreactor)https://github.com/reactor/reactor-core3.3.4.RELEASE 等(共 3 个)
    & m; m% P# _8 f+ a. i2 Wcorda-webserver-impl(net.corda)https://github.com/corda/cordacorda-3.0 等(共 32 个)" n. j/ v  C# T; @: H% D
    conductor-redis-persistence(com.netflix.conductor)https://github.com/Netflix/conductor3.3.6 等(共 100 个)
    $ |0 K, X8 k; N5 l0 B6 Z5 l) D  tarmeria(com.linecorp.armeria)https://github.com/line/armeria0.26.1.Final 等(共 2 个)
    , l+ R$ X! Y& G( k: A8 Hbreeze-parent_2.13(org.scalanlp)https://github.com/scalanlp/breeze2.0.1-RC1 等(共 5 个)
    # F7 z- V( {$ v+ K' k  u6 tmicrometer-core(io.micrometer)https://github.com/micrometer-metrics/micrometer1.8.1 等(共 98 个)
    % M  p, y9 g6 ]1 z( G* oalink_connector_jdbc_sqlite_flink-1.9_2.11(com.alibaba.alink)https://github.com/alibaba/Alink1.5.1 等(共 3 个)( e5 a0 b5 p" S" d  r
    initializr-actuator(io.spring.initializr)https://github.com/spring-io/initializr0.9.0 等(共 6 个)' W& w* L4 _4 Y' h, t; M
    telegrambots-spring-boot-starter(org.telegram)https://github.com/rubenlagus/TelegramBots4.9.1 等(共 17 个)
    ' L4 w8 ^$ s9 b" Z  @  Hspring-data-elasticsearch(org.springframework.data)https://github.com/spring-projects/spring-data-elasticsearch4.3.0 等(共 86 个)
    , t1 Q- ~( @: @* C$ Q! y% F4 ofeast-common(dev.feast)https://github.com/feast-dev/feast0.9.2 等(共 26 个)& f7 t9 A) M, X5 p! X2 r6 O  p
    javamelody-core(net.bull.javamelody)https://github.com/javamelody/javamelody1.88.0 等(共 13 个)/ V; t' V( \0 o6 i- W4 B& t+ }
    analytics-zoo-bigdl_0.13.0-spark_3.0.0(com.intel.analytics.zoo)https://github.com/intel-analytics/analytics-zoo0.11.0-RC1 等(共 4 个)9 q: w) d2 t' Q
    scio-tensorflow_2.13(com.spotify)https://github.com/spotify/scio0.9.6 等(共 97 个)8 m7 f/ S. ?. y7 a" e
    grpc-client-spring-boot-autoconfigure(net.devh)https://github.com/yidongnan/grpc-spring-boot-starter2.9.0.RELEASE 等(共 16 个)
    , x9 D3 H( ~1 o2 Y0 ]1 ~- jinject-server_2.12(com.twitter)https://github.com/twitter/finatra21.9.0 等(共 56 个)
    " M8 f/ ?" h6 {- Y( c5 |client-java-examples(io.kubernetes)https://github.com/kubernetes-client/java8.0.2 等(共 1 个)7 J" C( h- r9 o0 c* n" `
    reactivesocket-tck-drivers(io.reactivesocket)https://github.com/rsocket/rsocket-java0.6.0 等(共 1 个)2 E0 K8 G% K( V! o' h$ u9 U
    jest-droid(io.searchbox)https://github.com/searchbox-io/Jest6.3.1 等(共 8 个)
    6 [" n- R; m4 v2 ]graphql-dgs-example-java-webflux(com.netflix.graphql.dgs)https://github.com/Netflix/dgs-framework4.9.7 等(共 36 个)
    7 U; I* }5 `. N$ P" Uquill-jdbc-monix_2.11(io.getquill)https://github.com/getquill/quill3.9.0 等(共 62 个)
    : g% b+ y/ m7 [# p/ W/ kdoobie-quill_2.12(org.tpolecat)https://github.com/tpolecat/doobie1.0.0-RC1 等(共 61 个)
    - R" |* F7 s3 ~6 r+ B0 v% Jhttp4k(org.http4k)https://github.com/http4k/http4k4.3.4.1 等(共 3 个)
    0 E6 Q! m; X  u& C; z. Xelasticsearch-hadoop(org.elasticsearch)https://github.com/elastic/elasticsearch-hadoop8.0.0-beta1 等(共 100 个): L, F7 B; f3 ]7 v* n' [
    sbt-shading(io.get-coursier)https://github.com/coursier/coursier1.0.0-RC8 等(共 1 个); t6 c6 s" [2 m7 L& }
    spark-cassandra-connector-unshaded_2.10(com.datastax.spark)https://github.com/datastax/spark-cassandra-connector2.0.9 等(共 54 个)" C  y$ N! }9 U2 e: s1 i) n) N
    webdrivermanager(io.github.bonigarcia)https://github.com/bonigarcia/webdrivermanager4.0.0 等(共 15 个)
    ) `+ }: _+ Q' f" D0 o/ \& Xcommon-auth-v3(com.tencent.bk.devops.ci.common)https://github.com/Tencent/bk-ci1.2.0-rc.7-RELEASE 等(共 3 个)3 ~& M% }& u1 o/ r! I
    reactor-netty(io.projectreactor.netty)https://github.com/reactor/reactor-netty1.0.9 等(共 75 个)
    5 ^, q9 B7 S- Q6 D; C9 tevcache-client-sample(com.netflix.evcache)https://github.com/Netflix/EVCache5.18.9 等(共 63 个)6 s8 b  a* O8 Q- Y+ z* |
    xtdb-test(com.xtdb)https://github.com/xtdb/xtdb1.20.0 等(共 9 个)- x; _+ E& V( t$ m4 F, M
    transport-netty4(com.strapdata.elasticsearch.plugin)https://github.com/strapdata/elassandra6.2.3.31 等(共 14 个)3 d- Z8 J9 o7 [9 y" `
    sbt-metals(org.scalameta)https://github.com/scalameta/metals0.9.9 等(共 17 个)
    7 v/ C1 f4 V" c5 j% @elastic4s-embedded_2.12(com.sksamuel.elastic4s)https://github.com/sksamuel/elastic4s6.7.8 等(共 100 个)
    8 p! N( j0 F/ g0 }7 Lgenie-agent(com.netflix.genie)https://github.com/Netflix/genie4.0.4 等(共 100 个)
    / B% T0 v; P8 v. k7 Kspring-kafka(org.springframework.kafka)https://github.com/spring-projects/spring-kafka2.7.9 等(共 79 个)
    " O9 K$ C7 \% I- s; qdb-async-common_2.13(com.dripower)https://github.com/mauricio/postgresql-async0.3.109 等(共 19 个)
    & n# w0 r8 k* j2 v0 c4 oselenide(com.codeborne)https://github.com/selenide/selenide5.25.0-selenium-4.0.0-rc-2 等(共 18 个)
    & A+ n8 B" H# ?/ `5 r. h2 N' pcloudfoundry-identity-server(org.cloudfoundry.identity)https://github.com/cloudfoundry/uaa4.30.0 等(共 1 个)
    * |7 v5 s6 f- c$ L" u! X0 b9 _servo-atlas(com.netflix.servo)https://github.com/Netflix/servo0.13.2 等(共 20 个)
      [( K4 t) f; [2 d/ Hrxnetty-spectator-tcp(io.reactivex)https://github.com/ReactiveX/RxNetty0.5.3-rc.4 等(共 12 个)4 W2 |( H2 e: I+ |% f
    mleap-tensorflow_2.10(ml.combust.mleap)https://github.com/combust/mleap0.9.6 等(共 25 个)
    * F1 u. n# a3 x; \spark-testing-base_2.12(com.holdenkarau)https://github.com/holdenk/spark-testing-base2.4.4_1.1.1 等(共 100 个)' R/ H! Q: `% b' _1 L
    graphql-kotlin-spring-client(com.expediagroup)https://github.com/ExpediaGroup/graphql-kotlin5.0.0-alpha.0 等(共 20 个)
    7 Q. y: g" m0 ]& E: Igraphql-spring-boot-test-autoconfigure(com.graphql-java-kickstart)https://github.com/graphql-java-kickstart/graphql-spring-boot8.1.1 等(共 33 个)
    . t! z  ]( _8 F9 ]2 N1 d, c5 e8 bdiscord4j-rest(com.discord4j)https://github.com/Discord4J/Discord4J3.2.1 等(共 15 个): N7 y: v$ Z1 g! d) d8 C% s& B
    twitter-server-logback-classic_2.13(com.twitter)https://github.com/twitter/twitter-server21.9.0 等(共 54 个)' D/ g3 C5 h. \1 @: [- x. @: `
    synthea(org.mitre.synthea)https://github.com/synthetichealth/synthea2.7.0 等(共 2 个)
    0 Q6 a' J- ?$ a3 |& E/ d7 ?! q) wspring-integration-redis(org.springframework.integration)https://github.com/spring-projects/spring-integration5.5.6 等(共 30 个)
    * j2 C3 b, \" A% ^- _( Q5 _  a# N, }% vcyclops-reactor-integration(com.oath.cyclops)https://github.com/aol/cyclops10.4.0 等(共 1 个)
    6 c" @: c% ~* k& K3 p9 Jakka-stream-alpakka-geode_2.12(com.lightbend.akka)https://github.com/akka/alpakka1.0-M1 等(共 13 个)
    5 }6 |; t+ k& v1 P' s! {# j8 y+ M) }mantis-client(io.mantisrx)https://github.com/Netflix/mantis1.3.9 等(共 83 个)
    / L. B% Q1 w) M# D- Imybatis-generator-plugin(com.itfsw)https://github.com/itfsw/mybatis-generator-plugin1.2.9 等(共 31 个)8 p$ O8 n3 Y! |' i  x
    ktorm-support-sqlserver(org.ktorm)https://github.com/kotlin-orm/ktorm3.3.0 等(共 11 个)
    , x! a- X" z( Q5 ]) h. Z2 `gatk(org.broadinstitute)https://github.com/broadinstitute/gatk4.beta.2 等(共 39 个)( N& i9 u. Q5 G( |* F* n  t
    azure-messaging-servicebus(com.azure)https://github.com/Azure/azure-sdk-for-java7.5.1 等(共 100 个)
    9 r/ b9 b3 P! Amica-metrics(net.dreamlu)https://github.com/lets-mica/mica2.5.7 等(共 7 个); d, f+ x9 U" t9 A% |. v' K& T
    shiro-redis(org.crazycake)https://github.com/alexxiyang/shiro-redis3.3.1 等(共 2 个)
    4 x1 B- w% H- i1 g6 Genumeratum-play_2.12(com.beachape)https://github.com/lloydmeta/enumeratum1.5.16 等(共 2 个)6 l4 Y8 Y7 x$ u( s( n. V3 S# ?
    jdonframework(org.jdon)https://github.com/banq/jdonframework6.6.8 等(共 1 个)% `0 f# {& _* n6 }7 f/ G* _* F
    weid-java-sdk(com.webank)https://github.com/WeBankBlockchain/WeIdentity1.8.1 等(共 3 个)
    $ }; A3 q: k/ W+ l) v. d$ W+ {log-protocol(io.shulie.pradar)https://github.com/shulieTech/Takin2.0.3 等(共 3 个)
    ' ?2 A2 y/ l$ Emicro-boot(com.oath.microservices)https://github.com/aol/micro-server1.2.6 等(共 38 个)
    ' Z+ G. D0 E9 ~7 ~3 _3 ?/ @; Ksparkling-water-package_2.11(ai.h2o)https://github.com/h2oai/sparkling-water2.4.10 等(共 36 个)
    * j4 ^* U. U  u: hscalatest_2.13(au.com.dius.pact.provider)https://github.com/pact-foundation/pact-jvm4.2.4 等(共 5 个)
    9 O4 F* q9 ]; @' f6 |mssql-jdbc(com.microsoft.sqlserver)https://github.com/microsoft/mssql-jdbc8.3.0.jre11-preview 等(共 100 个)# S+ V1 c8 [9 `: {; F- {
    elide-spring-boot-starter(com.yahoo.elide)https://github.com/yahoo/elide6.0.3 等(共 45 个)
    % s2 o, G* K9 P6 Lkafka-connect-elastic5(com.datamountaineer)https://github.com/lensesio/stream-reactor1.2.0 等(共 5 个)
    1 N$ s; ]6 U* L, l5 D* N0 w& Ckvision-server-spring-boot-jvm(io.kvision)https://github.com/rjaros/kvision5.4.3 等(共 9 个)
    6 \* L& j3 b; o  B4 q6 v' W8 Qr2dbc-postgresql(org.postgresql)https://github.com/pgjdbc/r2dbc-postgresql0.9.0.RC1 等(共 8 个)
      \8 q. m$ f1 \" |1 Jplay-slick-evolutions_2.13(com.typesafe.play)https://github.com/playframework/play-slick5.0.0-RC3 等(共 29 个)
    ) J) e. o. v9 ]9 h( f* i& {sbt-bloop-core(ch.epfl.scala)https://github.com/scalacenter/bloop1.4.8-43-c2d941d9 等(共 29 个)
    1 i9 h. [# @# ]- n% A  e4 M) y4 djcseg-elasticsearch(org.lionsoul)https://github.com/lionsoul2014/jcseg2.6.2 等(共 7 个)

    更多受影响组件查询,请点击以下链接查询:https://log4j2.huoxian.cn/

    漏洞排查

    代码排查:查看 pom.xml 是否引入 org.apache.logging.log4j、org.apache.logging.log4j2

    Linux:

    sudo find / -name "*log4j-*.jar"

    Windows:

    *log4j*.jar

    攻击排查

    日志排查:

    攻击者在利用前通常采用dnslog方式进行扫描、探测,对于常见利用方式可通过应用系统报错日志中的

    "javax.naming.CommunicationException"

    "javax.naming.NamingException: problem generating object using object factory"

    "Error looking up JNDI resource"关键字进行排查。

    流量排查:

    攻击者的数据包中可能存在:“${jndi:rmi”、“${jndi:ldap”字样,可根据此类关键字进行排查。

    漏洞复现

    Vulfocus 靶场环境

    目前 Vulfocus 已经集成 Log4j2 环境,可通过以下链接启动环境测试:

    http://vulfocus.fofa.so/#/dashboard?image_id=3b8f15eb-7bd9-49b2-a69e-541f89c4216c

    也可通过 docker pull vulfocus/log4j2-rce-2021-12-09:latest 拉取本地环境运行,本地启动命令:docker run -d -P vulfocus/log4j2-rce-2021-12-09:latest

    修复建议

    1、禁止使用 log4j 服务器外连,升级 idk 11.0.1 8u191 7u201 6u211 或更高版本。

    2、升级至 log4j-2.15.0-rc2:

         下载地址:https://github.com/apache/logging-log4j2/releases/tag/log4j-2.15.0-rc2

    3、紧急缓解措施:

    (1) 修改 jvm 参数 -Dlog4j2.formatMsgNoLookups=true

    (2) 修改配置 log4j2.formatMsgNoLookups=True

    (3) 将系统环境变量 FORMAT_MESSAGES_PATTERN_DISABLE_LOOKUPS 设置 为 true

    参考

    [1] https://github.com/apache/logging-log4j2/releases/tag/log4j-2.15.0-rc1

    [2] [LOG4J2-3201] Limit the protocols jNDI can use and restrict LDAP. - ASF JIRA (apache.org)

    [3] ASF Git Repos - logging-log4j2.git/blob - log4j-core/src/test/java/org/apache/logging/log4j/core/lookup/JndiRestrictedLookupTest.java

    [4] https://mp.weixin.qq.com/s/wC7mrK1Y4DYz9_yW4fLzbw

    [5] https://help.aliyun.com/noticelist/articleid/1060971232.html

    [6] https://mp.weixin.qq.com/s/C4zeXHKHDqPeRuLytO7Fzw


    ; L* W/ f: v- R% S

    via https://nosec.org/home/detail/4917.html


    ( z* H9 ~0 B1 q+ _
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏 分享分享 顶 踩 转发到微博

    本版积分规则

    关闭

    下沙大学生网推荐上一条 /1 下一条

    快速回复 返回顶部 返回列表