Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Dangerous usage of JNDI
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
okuken
December 21, 2021
Technology
500
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Dangerous usage of JNDI
okuken
December 21, 2021
More Decks by okuken
See All by okuken
全集中Burp extension ISTE勉強会 第1回 / Burp ISTE study 01
okuken
0
520
全集中Burp extension ISTE v0.5.0 ー Request chain の躍進 / Burp extension ISTE v050
okuken
0
470
DOM Invader - prototype pollution対応の衝撃 - / DOM Invader - prototype pollution
okuken
0
880
npm Security ー サプライチェーン攻撃の観点から ー
okuken
1
710
全集中 Burp extension ISTE リリース1周年記念 - 振り返り - / Burp extension ISTE 1st Anniversary
okuken
0
590
全集中 Burp extension ISTE v0.4リリース / Burp extension ISTE v0.4
okuken
0
510
Web Messaging のセキュリティ - DOM Invaderを添えて - / Web Messaging Security
okuken
0
2.9k
DOM Invader - Burp Suiteの新機能でJavaScriptに立ち向かう - / DOM Invader
okuken
0
1.7k
#BurpISTEで!SECCON Beginners CTF 2021 Web問に全集中した話 / ctf4b 2021 with ISTE
okuken
1
610
Other Decks in Technology
See All in Technology
[DroidKaigi 2026] Making UI specifications visible: Android UI development in the AI agent era supported by Compose Screenshot Testing and galleries
syarihu
0
600
Amazon Quick on DesktopがIAM Identity Centerで動かない理由
yukiogawa
0
100
PfEingのアプローチで働こう
rindrics
0
200
Beyond the Hype: Practical AI for Your Oracle Database with MCP
thatjeffsmith
1
280
Bet AI Day 2026丨Agentは、「金融」という巨大産業の何を変えられるのか
layerx
PRO
0
1.2k
Kiro Crewしか勝たん!?
miu_crescent
PRO
0
190
OpenTelemetry eBPF Instrumentationの舞台裏 / Behind the Scenes of OpenTelemetry eBPF Instrumentation
ymotongpoo
1
160
【視聴者参加型!】AWSセキュリティアンチパターンクイズ
syoshie
0
450
module Synths; end
asonas
1
120
多摩川(.dev)ランニング入門 / Tamagawa.dev#3
fujiwara3
3
400
全員がプロダクトへ向き合う組織を持続成長させるために——組織づくりのフライホイールと4象限 / The Flywheel Model and Four Quadrants for Organizational Design
hiro_torii
4
900
AIで開発は速くなったのに、なぜ現場は楽にならないのか 〜あなたの組織のボトルネックを突き止めるワークショップ〜
jacopen
1
270
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Practical Orchestrator
shlominoach
191
12k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
510
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
470
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Building AI with AI
inesmontani
PRO
1
1.2k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
How STYLIGHT went responsive
nonsquared
100
6.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Transcript
Dangerous usage of JNDI @okuken3 2021.12.21 第14回 初心者のためのセキュリティ勉強会
== CAUTION (Disclaimer) == ▪本資料の内容は、ローカル環境で個人的に行った検証の結果です JNDIの危険な使い方、具体的には、信頼できない値をJNDI Lookupに渡す実装が行われた場合に、どのような内部処理を経て RCEが成立するのかを把握し、チェックや対策に役立てることを目的として、自身のローカル環境で個人的に検証を行いまし た。本内容を共有する目的も同様であり、悪用を助長するような意図は一切ないことをあらかじめご認識おきください。な お、悪用の意図がない場合であっても、自身の管理下にないシステムに対して管理者の許可なく検証行為を行うことは法令違
反に当たる可能性もあり、行わないようにご注意ください。 ▪網羅的な内容ではありません 本資料で記載した攻撃手法を全て防いだ場合でも、記載以外の既知の手法はもちろん、少し捻られたり、新たな手法が発見さ れる可能性も大いにあるため、万全な対策とは言えません。信頼できない値をJNDI Lookupに渡さない、これが対策の原則に なるかと思います。また、昨今話題の、ライブラリ経由で意図せずJNDIの危険な使い方を行っているケースでは、然るべき発 行元からの情報を元に、バージョンアップ等の適切な対策を実施いただければと思います。 ▪敢えて既知の脆弱性が存在するバージョンを使用しています 本資料と同様の検証をご自身で実施される場合は、自身の管理下のサンドボックス環境で実施するなど細心の注意を払った上 で、自己責任で行ってください。脆弱なシステムを動かすことで思わぬ攻撃の被害にあう可能性があります。 ▪個人の見解です 記載の内容はあくまで個人の検証内容および見解であり、所属組織とは一切関係ありません。
Test Environment Vulnerable Server: https://github.com/okuken/sectest_java - Spring Boot 2.6.1 *use
spring-boot-starter-web - Log4j 2.14.1 *CVE-2021-44228 - Java - 8u112 *https://www.oracle.com/java/technologies/javase/8u121-relnotes.html#notes-8u121 - 8u181 *CVE-2018-3149 - 8u191 Attacker Server (PoC): https://github.com/pimps/JNDI-Exploit-Kit
※ It’s for illustration purpose. (not actual code) Flow Vulnearable
Server 127.0.0.1:8080 Attacker Server (PoC) [RMI] 127.0.0.1:10990 [LDAP] 127.0.0.1:13890 [HTTP] 127.0.0.1:8180 Attacker ①HTTP Request ②LDAP Lookup ③Response (javaCodeBase is URL of Attacker HTTP Server) ④HTTP Request ⑤Response(.class) ⑥
Java 8u112 - RMI [Attacker Server (PoC)] [Vulnerable Server] ...
Java 8u112 - LDAP [Attacker Server (PoC)] [Vulnerable Server] ...
...
Java 8u181 - RMI [Attacker Server (PoC)] [Vulnerable Server] ...
NO calc
Java 8u181 - LDAP [Attacker Server (PoC)] [Vulnerable Server] ...
Java 8u191 - LDAP [Attacker Server (PoC)] [Vulnerable Server] NO
calc
Flow -bypass with EL- Vulnearable Server 127.0.0.1:8080 Attacker Server (PoC)
[RMI] 127.0.0.1:10990 Attacker ①HTTP Request ②RMI Lookup ③Response (crafted ResourceRef *use javax.el.ELProcessor ) ④
Java 8u191 – RMI(bypass with EL) [Attacker Server (PoC)] [Vulnerable
Server]
Flow -serialized payload- Vulnearable Server 127.0.0.1:8080 Attacker Server (PoC) [LDAP]
127.0.0.1:13890 Attacker ①HTTP Request ②LDAP Lookup ③Response (serialized payload *generated by ysoserial ) ④
Java 8u191 - LDAP(serialized payload) *add Apache Commons Collections 4.0
to classpath [Attacker Server (PoC)] [Vulnerable Server] ...
Demo
Reference ▪ Log4j, CVE-2021-44228 - https://logging.apache.org/log4j/2.x/security.html#CVE-2021-44228 - https://logging.apache.org/log4j/2.x/security.html#Older_.28discredited.29_mitigation_measures - https://www.lunasec.io/docs/blog/log4j-zero-day/
- https://mbechler.github.io/2021/12/10/PSA_Log4Shell_JNDI_Injection/ ▪ JNDI, Deserialization - https://www.veracode.com/blog/research/exploiting-jndi-injections-java - https://www.blackhat.com/docs/us-16/materials/us-16-Munoz-A-Journey-From-JNDI-LDAP- Manipulation-To-RCE.pdf - https://cheatsheetseries.owasp.org/assets/Deserialization_Cheat_Sheet_GOD16Deserialization.pdf ▪ PoC - https://github.com/okuken/sectest_java - https://github.com/pimps/JNDI-Exploit-Kit - https://github.com/frohoff/ysoserial