Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Padding Oracle Attack
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
zhouyunao
June 14, 2019
Technology
620
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Padding Oracle Attack
zhouyunao
June 14, 2019
More Decks by zhouyunao
See All by zhouyunao
knock
zhouyunao
0
47
Other Decks in Technology
See All in Technology
DevelopersIO 2026 知識の地図を描く ─ オントロジーとは何か?
ishikawa_satoru
1
1.7k
しろおびから始める!ログ活用の第一歩
shumei_ito
0
950
NDIでApple Vision Proにリアルタイム映像送信
jyouryuusui
0
120
ストレスなくAIと付き合いたい!こんなときどうしてる?
namiki64
3
530
オントロジーって 結局なにもの? AI エージェントに「意味」を渡す知識設計の話
greenmidori
0
200
Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
1
580
hackers_champloo_2026_tidb
makocchi
0
160
TinyGoでオブザーバビリティ?OpenTelemetryはTinyGoで使えるのか / Is OpenTelemetry available in TinyGo environment?
ymotongpoo
2
140
エンタメ企業のM&Aを支えるデータ基盤 ― 統合から店舗のリアルタイム分析まで / Data Engineering Summit 2026
genda
0
180
古い指輪から広がった JAVA コミュニティ とのつながり
yamad
0
100
初海外で注意すべきこと12選!!!安全快適なre:invent生活にするために
yuuuuuuu168
1
160
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
920
Featured
See All Featured
Side Projects
sachag
456
43k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
620
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Statistics for Hackers
jakevdp
799
230k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
520
Technical Leadership for Architectural Decision Making
baasie
3
600
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Docker and Python
trallard
47
4.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
Transcript
Padding Oracle with INSHACK 2019 jean bash picoctf2018 Magic padding
oracle 2019/6/14 m1z0r3 @Zhouyunao
⽬次 n Padding Oracle Attack l Encryption Attack l Decryption
Attack n 実践問題 2019/6/13 m1z0r3
n 概略 l 共通鍵ブロック暗号のCBCモードに対する攻撃⼿法 l 14年SSL3.0のPOODLEという脆弱性もこの⼿法 n CTFに置いての位置付け l ちょくちょく⾒る
l 初⾒としはうざい 2019/6/13 m1z0r3 Padding Oracle Attack
n 特徴 (あくまでも⾃分経験上の話) l CBCモード ←必須 l AES類のブロック暗号 ←必須 l
サーバーが復号化をやってくれる l サーバーコードは⼤概公開 l IVまでこっちから送られる ←場合によって 2019/6/13 m1z0r3 Padding Oracle Attack
n 何ができる︖ l Decryption Attack 難易度:⾼ 暗号⽂の復号ができる 平⽂はflagの場合 l Encryption
Attack 難易度:中 暗号⽂の改造による平⽂の改ざん 平⽂を特定なコマンド/データに改ざんし認証をバイパスできる 2019/6/13 m1z0r3 Padding Oracle Attack
n イメージ 2019/6/13 m1z0r3 Encryption Attack # a&…86 % +
+ + # ) user…
n イメージ 2019/6/13 m1z0r3 Encryption Attack # 01…8c % +
+ + # ) admin…
n 本来なら ) ⨁ 2 = ” … ” n
平⽂をすり替える為に差を計算 = “ … ”⨁” … ” n 差と⼀個前のブロックとxor )⨁⨁(%) = “ … ” 2019/6/13 m1z0r3 Encryption Attack
n それをサーバーに送ると 2019/6/13 m1z0r3 Encryption Attack # 01…8c % +
+ + # xxxxx admin… 最後のブロックを変える為に前のブロックを犠牲にする ※全ブロックを弄る⽅法もあります(後ほど説明)
n さらなる特徴(経験上) l PKCS7を使いがち l Padding errorの時のエラー⽂が特殊 n どうやる︖ 簡単にいうと
前のブロックをいじって、違うpaddingの形式に復号させ、 求めたいブロック平⽂⼀歩⼿前のDec(ct)を求めて、平⽂を取り 出す 2019/6/13 m1z0r3 Decryption Attack
2019/6/13 m1z0r3 Decryption Attack 1c a d m i n
u s e r 07 07 07 07 07 07 01 xx + + Dec Dec + xxxxx ) ブルートフォース ※適当に埋めた
2019/6/13 m1z0r3 Decryption Attack 2f 1c a d m i
n u s e r 07 07 07 07 07 02 02 yy xx 01 02 Dec + ) + Dec xxxxx + + + 01 ブルートフォース済み の部分を新しいpadding 形式に合わせる
2019/6/13 m1z0r3 Decryption Attack 3e 2f 1c a d m
i n u s e r 07 07 07 07 03 03 03 zz yy xx 02 01 03 03 + + + + Dec xxxxx Dec + )
2019/6/13 m1z0r3 Decryption Attack 4a 3e 2f 1c a d
m i n u s e r 07 07 07 04 04 04 04 aa zz yy xx 03 02 01 04 04 04 + + + + Dec xxxxx Dec + )
オ ラ ク ル 。 。 。 2019/6/13 m1z0r3 Decryption
Attack
2019/6/13 m1z0r3 Decryption Attack gy f1 ez dx cp bk
ag 9l 8i 7u 6n 5b 4a 3e 2f 1c 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 qq zz cc vv ee nn ll hh gg bb ee ff aa zz yy xx 0f 0e 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 + + + + Dec xxxxx Dec + ) 全部¥x10になる為既知明⽂か らDec(ct1)を計算して最後ct0と xor取り最後のブロックを算出
2019/6/13 m1z0r3 Decryption Attack gy f1 ez dx cp bk
ag 9l 8i 7u 6n 5b 4a 3e 2f 1c 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 qq zz cc vv ee nn ll hh gg bb ee ff aa zz yy xx 0f 0e 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 + + + + Dec xxxxx Dec + ) ′# ′) ′# ′) が10(padding)に埋め 尽くされた時: ′# ⨁ 1010. . = () ) () )⨁ # = )
2019/6/13 m1z0r3 全ブロックのEncryption Attack # 01…8c % + + +
# xxxxx user… + # admin… n Step 1 最後の2ブロックから差分を計算
n Step 2 前の2ブロックに移動 2019/6/13 m1z0r3 全ブロックのEncryption Attack xxxx 01…8c
% + + + # xxxxx user… + # admin… + ) I am…
n Step 3 2019/6/13 m1z0r3 全ブロックのEncryption Attack xxxx 01…8c %
+ + + # xxxxx user… + # admin… + ) I am… + % Yes… 最後は1ブロック⽬を すりかえられるよう に差分を計算
n picoctf 2018 magic padding oracle l De+Encryption Attack l
https://kusuwada.hatenablog.com/entry/2019/04/17/052525 n INS’hack 2019 Jean-Sébastien Bash l Encryption Attack l https://www.hackademint.org/Jean-Sebastien_Bash 2019/6/13 m1z0r3 実践問題
n http://rintaro.hateblo.jp/entry/2017/12/31/174327 2019/6/13 m1z0r3 レファレンス