SlideShare a Scribd company logo
Padding Oracle
On the Best server-side Bug
pwnie awards 2011
Padding Oracle
• 2002 – Vaudenay
– side-channel
– padding oracle
– CBC-mode
• Network encryption
• 2010 – Doung, Rizzo
– Web!
– Captchas
– JSF ViewStates
– ASP.NET
• ASP.NET
– O_O
2
Block Ciphers
3
E
P
C
D
P
P: Plaintext
C: Ciphertext
k: key
E: Encrypt
D: Decrypt
Block cipher: Fixed
block/plaintext/ciphertext
length
128 bit – 16 bytes
64 bit – 8 bytes
(key length and block
length are totally unrelated)
k
Electronic Code Book
4
E
P[0]
C[0]
E
P[1]
C[1]
E
P[2]
C[2]
5
EC
B
Other modesplaintext
This image is derived from File:Tux.jpg, and therefore requires attribution. All uses are permitted provided
that Larry Ewing, the owner of the original image, who requires that you mention him, his email address,
lewing@isc.tamu.edu, and The GIMP, according to http://www.isc.tamu.edu/~lewing/linux/.
Cipher Block Chaining
6
E
P[0]
C[0]
xor
IV
E
P[1]
C[1]
xor
E
P[2]
C[2]
xor
Cipher Block Chaining
7
xor
C[0]
P[0]
D
IV
xor
C[1]
P[1]
D
xor
C[2]
P[2]
D
8
CBC and XOR
9
xor
C
P
D
IV
intermediate
0 xor X = 0  X = 0
0 xor X = 1  X = 1
1 xor X = 1  X = 1
1 xor X = 0  X = 0
If only we had an oracle
telling us the plaintext!
Oracle: PKCS #5 Padding
10
? ? ? ? ? ? ? 01
? ? ? ? ? ? 02 02
? ? ? ? ? 03 03 03
? 07 07 07 07 07 07 07
08 08 08 08 08 08 08 08
….
Last ciphertext block is an oracle!
Padding: OK
Padding: Bad
11
Padding Oracle
12
xor
??????1
IV1
intermediate
xor
?????22
IV2
intermediate
xor
????333
IV3
intermediate
Padding Oracle
13
xor
C
P
D
IV
intermediate
C fixed => intermediate fixed
IV can be set by attacker
Padding Oracle yields P
IV xor P = intermediate
Search for P = ???????1
Search for P = ??????22
…
Search for P = 88888888
intermediate xor IV = P
DEMO
or if demo breaks, youtube 
http://youtu.be/B7UzYaTSeq8
14
CBC-R: CBC in reverse
15
xor
C
P
D
IV
intermediate
C = whatever
Padding Oracle  intermediate
P = whatever
IV = P xor intermediate
IV & C  valid ciphertext
C[2]  C[1]  C[0]  C[-1]
16
xor
C[0]
P[0]
D
C[-1]
xor
C[1]
P[1]
D
xor
C[2]
P[2]
D
Encrypt and Authenticate
17
E
P
C
D
P
HMAC
C + M
verify
C
c = encrypt( p )
m = hmac( c )
transmit( c, m )
recieve( c, m )
mm = hmac( c )
if ( m == mm ) {
p = decrypt( c )
}
else {
ninja kill sender
}
Developer challenges
• Encryption frameworks may not be secure
– 2010, most web frameworks were insecure
– some frameworks are still very broken
• Options
– OWASP, Microsoft – responds to security
– Validate your framework yourself
– Do not trust that web encryption works
18
Pwnie Awards
19
http://youtu.be/yghiC_U2RaM
Demonstration environment
• Encryption key in web.config
• Windows server
• ASP.NET
• DotNetNuke CMS
• Latest / fully patched versions at time of
video release.
20
ScriptResources.axd?d=
• Ciphertext in d= parameter
• Plaintext of d= supports grabbing files
• Vulnerable to Padding Oracle and CBC-R
• ?d= CBC-R ( ”R|~Web.config” )
• Attacker has encryption secrets!
21
Becomming DotNetNuke admin
• Web.config gives encryption keys
• Generate ASP.NET authentication cookie
– FormsAuthentication.SetAuthCookie(
Convert.ToString( LoggedOnUserName ), true
);
– Encrypt and MAC authcookie for ”SuperUser”
• Upload DotNetNuke extension backdoor
22
OS: Complete loss of control
• Start local command shell
– User: network service
• Privilege escalation exploit
– ”Token kidnaping revenge”
– User: SYSTEM
• Callback to netcat listener
23

More Related Content

PDF
JIT compilation in modern platforms – challenges and solutions
PPTX
Multi-threading your way out
ODP
GCC, GNU compiler collection
PDF
Go Lang Tutorial
ODP
C Under Linux
PPTX
PDF
Introduction to Go programming language
PPTX
Synchronization
JIT compilation in modern platforms – challenges and solutions
Multi-threading your way out
GCC, GNU compiler collection
Go Lang Tutorial
C Under Linux
Introduction to Go programming language
Synchronization

What's hot (20)

PDF
How it's made: C++ compilers (GCC)
PDF
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
PDF
Golang and Eco-System Introduction / Overview
PPT
GEM - GNU C Compiler Extensions Framework
PDF
Code gpu with cuda - CUDA introduction
PPTX
Go Programming Language (Golang)
PDF
Unmanaged Parallelization via P/Invoke
PPT
GCC compiler
PDF
Why my Go program is slow?
PPT
Static Code Analysis and AutoLint
PPTX
C++ via C#
ZIP
なぜ検索しなかったのか
PDF
Make A Shoot ‘Em Up Game with Amethyst Framework
PPTX
Hacking Go Compiler Internals / GoCon 2014 Autumn
PDF
Gameboy emulator in rust and web assembly
PPTX
Introduction to Rust language programming
PDF
Demystifying the Go Scheduler
PDF
DSL简介
PDF
Introduction to nand2 tetris
PDF
An introduction to Rust: the modern programming language to develop safe and ...
How it's made: C++ compilers (GCC)
Kernel Recipes 2019 - GNU poke, an extensible editor for structured binary data
Golang and Eco-System Introduction / Overview
GEM - GNU C Compiler Extensions Framework
Code gpu with cuda - CUDA introduction
Go Programming Language (Golang)
Unmanaged Parallelization via P/Invoke
GCC compiler
Why my Go program is slow?
Static Code Analysis and AutoLint
C++ via C#
なぜ検索しなかったのか
Make A Shoot ‘Em Up Game with Amethyst Framework
Hacking Go Compiler Internals / GoCon 2014 Autumn
Gameboy emulator in rust and web assembly
Introduction to Rust language programming
Demystifying the Go Scheduler
DSL简介
Introduction to nand2 tetris
An introduction to Rust: the modern programming language to develop safe and ...
Ad

Viewers also liked (14)

PDF
Vakblad Groen over Brainport regio Eindhoven - High Tech in het Groen.
PPTX
Webinar on benefits of incorprating of small business loans
PDF
Q2 bms business services sales index
PPTX
Deja vu usa overview
PDF
Meness Aptieka 05.08.13 - 04.09.13
DOCX
Blog modulo 6
PPTX
PPTX
PPTX
Mgod xu huong kinh doanh truc tuyen 2013
PPTX
就職活動開始時期を遅らせるべきか[1]
PDF
Daily mcx newsletter 12 aug 2013
PDF
Empathy map prezi
PDF
MSG_Resume_9-14-2016
Vakblad Groen over Brainport regio Eindhoven - High Tech in het Groen.
Webinar on benefits of incorprating of small business loans
Q2 bms business services sales index
Deja vu usa overview
Meness Aptieka 05.08.13 - 04.09.13
Blog modulo 6
Mgod xu huong kinh doanh truc tuyen 2013
就職活動開始時期を遅らせるべきか[1]
Daily mcx newsletter 12 aug 2013
Empathy map prezi
MSG_Resume_9-14-2016
Ad

Similar to Padding oracle [opkoko2011] (20)

PDF
Brief introduction into Padding Oracle attack vector
PPTX
Cracking the crypto
PPTX
SSL/POODLE: History repeats itself
PPTX
The Cryptography has YOU
PPT
padding oracle attack
PPTX
Daniel Crowley - Speaking with Cryptographic Oracles
PDF
Cryptography for Penetration Testers (PDF version)
PDF
CNIT 141: 4. Block Ciphers
PPTX
Block Cipher Modes Of Operation | Computer Networking and Security | Simplilearn
PDF
CNIT 141: 4. Block Ciphers
PPT
symet.crypto.hill.cipher.2023.ppt
PDF
CNIT 141: 4. Block Ciphers
PDF
CNIT 141: 1. Encryption
PPT
CISSP EXAM PREPARATION FOR A PASSED SCORE
PDF
CNIT 141: 4. Block Ciphers
PDF
4. Block Ciphers
PPTX
Introduction to encryption
PPT
Information Security
PDF
CNIT 141: 1. Encryption
PDF
CNIT 141: 1. Encryption
Brief introduction into Padding Oracle attack vector
Cracking the crypto
SSL/POODLE: History repeats itself
The Cryptography has YOU
padding oracle attack
Daniel Crowley - Speaking with Cryptographic Oracles
Cryptography for Penetration Testers (PDF version)
CNIT 141: 4. Block Ciphers
Block Cipher Modes Of Operation | Computer Networking and Security | Simplilearn
CNIT 141: 4. Block Ciphers
symet.crypto.hill.cipher.2023.ppt
CNIT 141: 4. Block Ciphers
CNIT 141: 1. Encryption
CISSP EXAM PREPARATION FOR A PASSED SCORE
CNIT 141: 4. Block Ciphers
4. Block Ciphers
Introduction to encryption
Information Security
CNIT 141: 1. Encryption
CNIT 141: 1. Encryption

Recently uploaded (20)

PPTX
sap open course for s4hana steps from ECC to s4
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
KodekX | Application Modernization Development
PDF
Electronic commerce courselecture one. Pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Approach and Philosophy of On baking technology
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Big Data Technologies - Introduction.pptx
PPT
Teaching material agriculture food technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
sap open course for s4hana steps from ECC to s4
The AUB Centre for AI in Media Proposal.docx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
KodekX | Application Modernization Development
Electronic commerce courselecture one. Pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Approach and Philosophy of On baking technology
Empathic Computing: Creating Shared Understanding
Big Data Technologies - Introduction.pptx
Teaching material agriculture food technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation
MYSQL Presentation for SQL database connectivity
20250228 LYD VKU AI Blended-Learning.pptx

Padding oracle [opkoko2011]