SlideShare a Scribd company logo
1 of 29
Timing attacks against web applications:
Are they still practical? 09.11.2018
Ivan Petrov
Penetration tester
Timing attacks against web applications:
Are they still practical?
- What is a timing attack?
- What was our plan?
- What did we do differently?
- What did we achieve?
- How practical are timing attacks (over the internet)?
- Who are subjects to an attack?
- What is an acceptable solution?
2/29
What is a timing attack?
Basic string comparison in PHP
3/29
What is a timing attack?
is_identical_function()
4/29
What is a timing attack?
memcmp()
5/29
What is a timing attack?
2 5 6 c d
21 ns 16 ns 19 ns
2 5 6 e
18 ns 20 ns
Key:
256c27ad3cd09366e9884a8c93747900
ā€¦
Total execution time: 95 ns
Total execution time: 80 ns
17 ns
22 ns
22 ns
ā€¦
20 ns
6/29
2 5 6 c d
21 ns 16 ns 19 ns
Key:
256c27ad3cd09366e9884a8c93747900
Total execution time: 95 ns
17 ns 22 ns
ā€¦
What is a timing attack?
2 5 6 c 8
16 ns 14 ns 24 ns 18 ns 19 ns
ā€¦
2 5 6 c 2
18 ns 21 ns 16 ns 21 ns 17 ns
?
22 ns
Total execution time: 91 ns
Total execution time: 115
ns
7/29
General scenario:
Attacker Hop 1 Hop .. Hop N
Web
server
Application
Our plan
8/29
Prerequisite
- We had access to the source code
- A pass-the-hash vulnerability was present
- A weak hash function was used (and without a salt)
- There was no WAF/IDS/IPS in place
- There was no reverse proxy, CDN, caching
9/29
Our plan
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Study the applicationā€™s source code in details
Pinpoint a particular function to exploit
Conduct basic data collection (timing)
Work to improve noise filtration
Reduce the search space for the timing attack
10/29
Our plan
What worked:
- Application profiling using a profiler (xdebug, xhprof etc)
- Measuring RTT via TCP timestamps
- Making observations from user-space
What didnā€™t work:
- Timing different PHP functions used by the application
- Average out web serverā€™s performance (per version)
11/29
Calculating the RTT
- Must NOT be done in user-space
- Packet capturing yields reliable results (SYN,ACK)
- TCP timestampsā€™ granularity ā€“ 1 ms-100 seconds
- Tracing system calls (e.g. strace(1)) can be tricky
- Different protocols can be routed differently
12/29
Calculating the RTT
13/29
Calculating the RTT
14/29
Calculating server response time
0.000978360
X.X.X.X ā†’ Y.Y.Y.Y HTTP 146 GET / HTTP/1.1
0.001722918
Y.Y.Y.Y ā†’ X.X.X.X TCP 66 80 ā†’ 33930 [ACK] Seq=1 Ack=81 Win=29056 Len=0
TSval=1737072019 TSecr=3816704019
0.004035262
Y.Y.Y.Y ā†’ X.X.X.X HTTP 481 HTTP/1.1 301 Moved Permanently (text/html)
Packet capturing with tshark(1)
15/29
What else? Spikes.
- Mirroring the target environment
- Application profiling (function timing)
- Execution timing per different environments
- Calculating median absolute deviation (MAD)
What do we use to identify them?
16/29
The target? More specifically.
17/29
Timing different functions
18/29
Timing different functions
19/29
Attack
resources
- On average: 14 000 requests per character
- The hash is hexadecimal - utilizes a character set of 16 elements: a-f0-
9
- Hash length is 40 characters
Rough statistics for the attack:
~ 224 000 per each position
ā€¦ or ~ 8 960 000 requests for full hash recovery
20/29
Difference to brute-forcing?
Works for any user-supplied password no matter the complexity
Itā€™s simple.
Howeverā€¦
Brute-forcing would be preferable if the user has used a predictable password
21/29
Reducing the search space
- Itā€™s not necessary to go for a full hash (in some cases)
- We can use rainbow tables to lookup partial hashes
Some more basic statistics
Estimation:
elements to pick from * number of requests per element * length
- First 10 characters are expected to be recovered with 2 240 000 requests
- First 13 characters are expected to be recovered with 2 912 000 requests
- First 20 characters are expected to be recovered with 4 480 000 requests
22/29
Demo
Is this practical?
Advantages
- Timing attacks can be more efficient than brute-forcing
- A lot of developers are not paying attention to them
Disadvantages
- In most cases are easy to detect
- Hard to execute and easy to fail
- Require a MASSIVE amount of requests
- Can be hindered by any standard WAF/IDS
- A reverse proxy will almost completely render them useless
24/29
Who is vulnerable?
- Applications that are not using timing-safe comparisons (constant-time algorithms)
- Applications that have no rate limiting and/or monitoring in place
- Shared hosting environments and virtualization can aid a timing attack
25/29
What can the consequences be?
- Ranging from useless traffic to a complete server takeover
depending on the timing differences
- Resource exhaustion if costly operations are performed on the back-end
and continuously abused over a period of time
26/29
Solution to timing attacks?
- Do not solely rely on network jitter
- Use constant-time algorithms for critical operations (auth, crypto)
- Enforce a rate limiting policy
27/29
Opportunities and Limits of Remote Timing Attacks (2009)
SCOTT A. CROSBY, DAN S. WALLACH and RUDOLF H. RIEDI
Rice University
Some astonishing researches
Nanosecond Scale Remote Timing Attacks On PHP
Applications: Time To Take Them Seriously? (2010)
Padraic Brady
28/29
Questions & Feedback
Thank you
Bibliography available upon request
www.tadgroup.com
info@tadgroup.com

More Related Content

Similar to Timing attacks against web applications: Are they still practical?

Network time protocol
Network time protocolNetwork time protocol
Network time protocolMohd Amir
Ā 
HHM-2833: Where is My Message?: Using IBM MQ Tools to Work Out What Applicati...
HHM-2833: Where is My Message?: Using IBM MQ Tools to Work Out What Applicati...HHM-2833: Where is My Message?: Using IBM MQ Tools to Work Out What Applicati...
HHM-2833: Where is My Message?: Using IBM MQ Tools to Work Out What Applicati...Matt Leming
Ā 
Uber mobility - High Performance Networking
Uber mobility - High Performance NetworkingUber mobility - High Performance Networking
Uber mobility - High Performance NetworkingDhaval Patel
Ā 
Reconsider TCPdump for Modern Troubleshooting
Reconsider TCPdump for Modern TroubleshootingReconsider TCPdump for Modern Troubleshooting
Reconsider TCPdump for Modern TroubleshootingAvi Networks
Ā 
SFMap (TMA 2015)
SFMap (TMA 2015)SFMap (TMA 2015)
SFMap (TMA 2015)mori_tatsuya
Ā 
Cloud network management model a novel approach to manage cloud traffic
Cloud network management model   a novel approach to manage cloud trafficCloud network management model   a novel approach to manage cloud traffic
Cloud network management model a novel approach to manage cloud trafficijccsa
Ā 
Pre-Con Education: Recognizing Your Network's Key Performance Indicators Th...
Pre-Con Education: Recognizing Your Network's Key Performance Indicators Th...Pre-Con Education: Recognizing Your Network's Key Performance Indicators Th...
Pre-Con Education: Recognizing Your Network's Key Performance Indicators Th...CA Technologies
Ā 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesAlexander Penev
Ā 
NON-INTRUSIVE REMOTE MONITORING OF SERVICES IN A DATA CENTRE
NON-INTRUSIVE REMOTE MONITORING OF SERVICES IN A DATA CENTRENON-INTRUSIVE REMOTE MONITORING OF SERVICES IN A DATA CENTRE
NON-INTRUSIVE REMOTE MONITORING OF SERVICES IN A DATA CENTREcscpconf
Ā 
Code Crime Scene
Code Crime SceneCode Crime Scene
Code Crime ScenePawel Klimczyk
Ā 
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic AnalyticsSAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic AnalyticsQin Liu
Ā 
Network visibility and control using industry standard sFlow telemetry
Network visibility and control using industry standard sFlow telemetryNetwork visibility and control using industry standard sFlow telemetry
Network visibility and control using industry standard sFlow telemetrypphaal
Ā 
Banv
BanvBanv
Banvnetvis
Ā 
network-management Web base.ppt
network-management Web base.pptnetwork-management Web base.ppt
network-management Web base.pptAssadLeo1
Ā 
Using redmine as a sla ticketing system, helpdesk or service desk software
Using redmine as a sla ticketing system, helpdesk or service desk softwareUsing redmine as a sla ticketing system, helpdesk or service desk software
Using redmine as a sla ticketing system, helpdesk or service desk softwareAleksandar Pavic
Ā 
9Tuts.Com New CCNA 200-120 New CCNA New Questions 2
9Tuts.Com New CCNA 200-120 New CCNA   New Questions 29Tuts.Com New CCNA 200-120 New CCNA   New Questions 2
9Tuts.Com New CCNA 200-120 New CCNA New Questions 2Lori Head
Ā 
CCNA 200-120 Exam Questions
CCNA 200-120 Exam QuestionsCCNA 200-120 Exam Questions
CCNA 200-120 Exam QuestionsEng. Emad Al-Atoum
Ā 
A Modern Approach to Performance Monitoring
A Modern Approach to Performance MonitoringA Modern Approach to Performance Monitoring
A Modern Approach to Performance MonitoringCliff Crocker
Ā 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance TestingC4Media
Ā 

Similar to Timing attacks against web applications: Are they still practical? (20)

Network time protocol
Network time protocolNetwork time protocol
Network time protocol
Ā 
Cerita
CeritaCerita
Cerita
Ā 
HHM-2833: Where is My Message?: Using IBM MQ Tools to Work Out What Applicati...
HHM-2833: Where is My Message?: Using IBM MQ Tools to Work Out What Applicati...HHM-2833: Where is My Message?: Using IBM MQ Tools to Work Out What Applicati...
HHM-2833: Where is My Message?: Using IBM MQ Tools to Work Out What Applicati...
Ā 
Uber mobility - High Performance Networking
Uber mobility - High Performance NetworkingUber mobility - High Performance Networking
Uber mobility - High Performance Networking
Ā 
Reconsider TCPdump for Modern Troubleshooting
Reconsider TCPdump for Modern TroubleshootingReconsider TCPdump for Modern Troubleshooting
Reconsider TCPdump for Modern Troubleshooting
Ā 
SFMap (TMA 2015)
SFMap (TMA 2015)SFMap (TMA 2015)
SFMap (TMA 2015)
Ā 
Cloud network management model a novel approach to manage cloud traffic
Cloud network management model   a novel approach to manage cloud trafficCloud network management model   a novel approach to manage cloud traffic
Cloud network management model a novel approach to manage cloud traffic
Ā 
Pre-Con Education: Recognizing Your Network's Key Performance Indicators Th...
Pre-Con Education: Recognizing Your Network's Key Performance Indicators Th...Pre-Con Education: Recognizing Your Network's Key Performance Indicators Th...
Pre-Con Education: Recognizing Your Network's Key Performance Indicators Th...
Ā 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE Architectures
Ā 
NON-INTRUSIVE REMOTE MONITORING OF SERVICES IN A DATA CENTRE
NON-INTRUSIVE REMOTE MONITORING OF SERVICES IN A DATA CENTRENON-INTRUSIVE REMOTE MONITORING OF SERVICES IN A DATA CENTRE
NON-INTRUSIVE REMOTE MONITORING OF SERVICES IN A DATA CENTRE
Ā 
Code Crime Scene
Code Crime SceneCode Crime Scene
Code Crime Scene
Ā 
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic AnalyticsSAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
SAND: A Fault-Tolerant Streaming Architecture for Network Traffic Analytics
Ā 
Network visibility and control using industry standard sFlow telemetry
Network visibility and control using industry standard sFlow telemetryNetwork visibility and control using industry standard sFlow telemetry
Network visibility and control using industry standard sFlow telemetry
Ā 
Banv
BanvBanv
Banv
Ā 
network-management Web base.ppt
network-management Web base.pptnetwork-management Web base.ppt
network-management Web base.ppt
Ā 
Using redmine as a sla ticketing system, helpdesk or service desk software
Using redmine as a sla ticketing system, helpdesk or service desk softwareUsing redmine as a sla ticketing system, helpdesk or service desk software
Using redmine as a sla ticketing system, helpdesk or service desk software
Ā 
9Tuts.Com New CCNA 200-120 New CCNA New Questions 2
9Tuts.Com New CCNA 200-120 New CCNA   New Questions 29Tuts.Com New CCNA 200-120 New CCNA   New Questions 2
9Tuts.Com New CCNA 200-120 New CCNA New Questions 2
Ā 
CCNA 200-120 Exam Questions
CCNA 200-120 Exam QuestionsCCNA 200-120 Exam Questions
CCNA 200-120 Exam Questions
Ā 
A Modern Approach to Performance Monitoring
A Modern Approach to Performance MonitoringA Modern Approach to Performance Monitoring
A Modern Approach to Performance Monitoring
Ā 
Continuous Performance Testing
Continuous Performance TestingContinuous Performance Testing
Continuous Performance Testing
Ā 

More from DefCamp

Remote Yacht Hacking
Remote Yacht HackingRemote Yacht Hacking
Remote Yacht HackingDefCamp
Ā 
Mobile, IoT, Cloudsā€¦ Itā€™s time to hire your own risk manager!
Mobile, IoT, Cloudsā€¦ Itā€™s time to hire your own risk manager!Mobile, IoT, Cloudsā€¦ Itā€™s time to hire your own risk manager!
Mobile, IoT, Cloudsā€¦ Itā€™s time to hire your own risk manager!DefCamp
Ā 
The Charter of Trust
The Charter of TrustThe Charter of Trust
The Charter of TrustDefCamp
Ā 
Internet Balkanization: Why Are We Raising Borders Online?
Internet Balkanization: Why Are We Raising Borders Online?Internet Balkanization: Why Are We Raising Borders Online?
Internet Balkanization: Why Are We Raising Borders Online?DefCamp
Ā 
Bridging the gap between CyberSecurity R&D and UX
Bridging the gap between CyberSecurity R&D and UXBridging the gap between CyberSecurity R&D and UX
Bridging the gap between CyberSecurity R&D and UXDefCamp
Ā 
Secure and privacy-preserving data transmission and processing using homomorp...
Secure and privacy-preserving data transmission and processing using homomorp...Secure and privacy-preserving data transmission and processing using homomorp...
Secure and privacy-preserving data transmission and processing using homomorp...DefCamp
Ā 
Drupalgeddon 2 ā€“ Yet Another Weapon for the Attacker
Drupalgeddon 2 ā€“ Yet Another Weapon for the AttackerDrupalgeddon 2 ā€“ Yet Another Weapon for the Attacker
Drupalgeddon 2 ā€“ Yet Another Weapon for the AttackerDefCamp
Ā 
Economical Denial of Sustainability in the Cloud (EDOS)
Economical Denial of Sustainability in the Cloud (EDOS)Economical Denial of Sustainability in the Cloud (EDOS)
Economical Denial of Sustainability in the Cloud (EDOS)DefCamp
Ā 
Trust, but verify ā€“ Bypassing MFA
Trust, but verify ā€“ Bypassing MFATrust, but verify ā€“ Bypassing MFA
Trust, but verify ā€“ Bypassing MFADefCamp
Ā 
Threat Hunting: From Platitudes to Practical Application
Threat Hunting: From Platitudes to Practical ApplicationThreat Hunting: From Platitudes to Practical Application
Threat Hunting: From Platitudes to Practical ApplicationDefCamp
Ā 
Building application security with 0 money down
Building application security with 0 money downBuilding application security with 0 money down
Building application security with 0 money downDefCamp
Ā 
Implementation of information security techniques on modern android based Kio...
Implementation of information security techniques on modern android based Kio...Implementation of information security techniques on modern android based Kio...
Implementation of information security techniques on modern android based Kio...DefCamp
Ā 
Lattice based Merkle for post-quantum epoch
Lattice based Merkle for post-quantum epochLattice based Merkle for post-quantum epoch
Lattice based Merkle for post-quantum epochDefCamp
Ā 
The challenge of building a secure and safe digital environment in healthcare
The challenge of building a secure and safe digital environment in healthcareThe challenge of building a secure and safe digital environment in healthcare
The challenge of building a secure and safe digital environment in healthcareDefCamp
Ā 
Tor .onions: The Good, The Rotten and The Misconfigured
Tor .onions: The Good, The Rotten and The Misconfigured Tor .onions: The Good, The Rotten and The Misconfigured
Tor .onions: The Good, The Rotten and The Misconfigured DefCamp
Ā 
Needles, Haystacks and Algorithms: Using Machine Learning to detect complex t...
Needles, Haystacks and Algorithms: Using Machine Learning to detect complex t...Needles, Haystacks and Algorithms: Using Machine Learning to detect complex t...
Needles, Haystacks and Algorithms: Using Machine Learning to detect complex t...DefCamp
Ā 
We will charge you. How to [b]reach vendorā€™s network using EV charging station.
We will charge you. How to [b]reach vendorā€™s network using EV charging station.We will charge you. How to [b]reach vendorā€™s network using EV charging station.
We will charge you. How to [b]reach vendorā€™s network using EV charging station.DefCamp
Ā 
Connect & Inspire Cyber Security
Connect & Inspire Cyber SecurityConnect & Inspire Cyber Security
Connect & Inspire Cyber SecurityDefCamp
Ā 
The lions and the watering hole
The lions and the watering holeThe lions and the watering hole
The lions and the watering holeDefCamp
Ā 
Catch Me If You Can - Finding APTs in your network
Catch Me If You Can - Finding APTs in your networkCatch Me If You Can - Finding APTs in your network
Catch Me If You Can - Finding APTs in your networkDefCamp
Ā 

More from DefCamp (20)

Remote Yacht Hacking
Remote Yacht HackingRemote Yacht Hacking
Remote Yacht Hacking
Ā 
Mobile, IoT, Cloudsā€¦ Itā€™s time to hire your own risk manager!
Mobile, IoT, Cloudsā€¦ Itā€™s time to hire your own risk manager!Mobile, IoT, Cloudsā€¦ Itā€™s time to hire your own risk manager!
Mobile, IoT, Cloudsā€¦ Itā€™s time to hire your own risk manager!
Ā 
The Charter of Trust
The Charter of TrustThe Charter of Trust
The Charter of Trust
Ā 
Internet Balkanization: Why Are We Raising Borders Online?
Internet Balkanization: Why Are We Raising Borders Online?Internet Balkanization: Why Are We Raising Borders Online?
Internet Balkanization: Why Are We Raising Borders Online?
Ā 
Bridging the gap between CyberSecurity R&D and UX
Bridging the gap between CyberSecurity R&D and UXBridging the gap between CyberSecurity R&D and UX
Bridging the gap between CyberSecurity R&D and UX
Ā 
Secure and privacy-preserving data transmission and processing using homomorp...
Secure and privacy-preserving data transmission and processing using homomorp...Secure and privacy-preserving data transmission and processing using homomorp...
Secure and privacy-preserving data transmission and processing using homomorp...
Ā 
Drupalgeddon 2 ā€“ Yet Another Weapon for the Attacker
Drupalgeddon 2 ā€“ Yet Another Weapon for the AttackerDrupalgeddon 2 ā€“ Yet Another Weapon for the Attacker
Drupalgeddon 2 ā€“ Yet Another Weapon for the Attacker
Ā 
Economical Denial of Sustainability in the Cloud (EDOS)
Economical Denial of Sustainability in the Cloud (EDOS)Economical Denial of Sustainability in the Cloud (EDOS)
Economical Denial of Sustainability in the Cloud (EDOS)
Ā 
Trust, but verify ā€“ Bypassing MFA
Trust, but verify ā€“ Bypassing MFATrust, but verify ā€“ Bypassing MFA
Trust, but verify ā€“ Bypassing MFA
Ā 
Threat Hunting: From Platitudes to Practical Application
Threat Hunting: From Platitudes to Practical ApplicationThreat Hunting: From Platitudes to Practical Application
Threat Hunting: From Platitudes to Practical Application
Ā 
Building application security with 0 money down
Building application security with 0 money downBuilding application security with 0 money down
Building application security with 0 money down
Ā 
Implementation of information security techniques on modern android based Kio...
Implementation of information security techniques on modern android based Kio...Implementation of information security techniques on modern android based Kio...
Implementation of information security techniques on modern android based Kio...
Ā 
Lattice based Merkle for post-quantum epoch
Lattice based Merkle for post-quantum epochLattice based Merkle for post-quantum epoch
Lattice based Merkle for post-quantum epoch
Ā 
The challenge of building a secure and safe digital environment in healthcare
The challenge of building a secure and safe digital environment in healthcareThe challenge of building a secure and safe digital environment in healthcare
The challenge of building a secure and safe digital environment in healthcare
Ā 
Tor .onions: The Good, The Rotten and The Misconfigured
Tor .onions: The Good, The Rotten and The Misconfigured Tor .onions: The Good, The Rotten and The Misconfigured
Tor .onions: The Good, The Rotten and The Misconfigured
Ā 
Needles, Haystacks and Algorithms: Using Machine Learning to detect complex t...
Needles, Haystacks and Algorithms: Using Machine Learning to detect complex t...Needles, Haystacks and Algorithms: Using Machine Learning to detect complex t...
Needles, Haystacks and Algorithms: Using Machine Learning to detect complex t...
Ā 
We will charge you. How to [b]reach vendorā€™s network using EV charging station.
We will charge you. How to [b]reach vendorā€™s network using EV charging station.We will charge you. How to [b]reach vendorā€™s network using EV charging station.
We will charge you. How to [b]reach vendorā€™s network using EV charging station.
Ā 
Connect & Inspire Cyber Security
Connect & Inspire Cyber SecurityConnect & Inspire Cyber Security
Connect & Inspire Cyber Security
Ā 
The lions and the watering hole
The lions and the watering holeThe lions and the watering hole
The lions and the watering hole
Ā 
Catch Me If You Can - Finding APTs in your network
Catch Me If You Can - Finding APTs in your networkCatch Me If You Can - Finding APTs in your network
Catch Me If You Can - Finding APTs in your network
Ā 

Recently uploaded

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĆŗjo
Ā 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
Ā 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
Ā 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
Ā 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
Ā 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
Ā 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
Ā 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
Ā 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
Ā 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜RTylerCroy
Ā 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024The Digital Insurer
Ā 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
Ā 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Ā 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
Ā 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
Ā 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Ā 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Ā 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
Ā 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Ā 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Ā 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Ā 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
Ā 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜
Ā 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024
Ā 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Ā 

Timing attacks against web applications: Are they still practical?

  • 1. Timing attacks against web applications: Are they still practical? 09.11.2018 Ivan Petrov Penetration tester
  • 2. Timing attacks against web applications: Are they still practical? - What is a timing attack? - What was our plan? - What did we do differently? - What did we achieve? - How practical are timing attacks (over the internet)? - Who are subjects to an attack? - What is an acceptable solution? 2/29
  • 3. What is a timing attack? Basic string comparison in PHP 3/29
  • 4. What is a timing attack? is_identical_function() 4/29
  • 5. What is a timing attack? memcmp() 5/29
  • 6. What is a timing attack? 2 5 6 c d 21 ns 16 ns 19 ns 2 5 6 e 18 ns 20 ns Key: 256c27ad3cd09366e9884a8c93747900 ā€¦ Total execution time: 95 ns Total execution time: 80 ns 17 ns 22 ns 22 ns ā€¦ 20 ns 6/29
  • 7. 2 5 6 c d 21 ns 16 ns 19 ns Key: 256c27ad3cd09366e9884a8c93747900 Total execution time: 95 ns 17 ns 22 ns ā€¦ What is a timing attack? 2 5 6 c 8 16 ns 14 ns 24 ns 18 ns 19 ns ā€¦ 2 5 6 c 2 18 ns 21 ns 16 ns 21 ns 17 ns ? 22 ns Total execution time: 91 ns Total execution time: 115 ns 7/29
  • 8. General scenario: Attacker Hop 1 Hop .. Hop N Web server Application Our plan 8/29
  • 9. Prerequisite - We had access to the source code - A pass-the-hash vulnerability was present - A weak hash function was used (and without a salt) - There was no WAF/IDS/IPS in place - There was no reverse proxy, CDN, caching 9/29
  • 10. Our plan Step 1: Step 2: Step 3: Step 4: Step 5: Study the applicationā€™s source code in details Pinpoint a particular function to exploit Conduct basic data collection (timing) Work to improve noise filtration Reduce the search space for the timing attack 10/29
  • 11. Our plan What worked: - Application profiling using a profiler (xdebug, xhprof etc) - Measuring RTT via TCP timestamps - Making observations from user-space What didnā€™t work: - Timing different PHP functions used by the application - Average out web serverā€™s performance (per version) 11/29
  • 12. Calculating the RTT - Must NOT be done in user-space - Packet capturing yields reliable results (SYN,ACK) - TCP timestampsā€™ granularity ā€“ 1 ms-100 seconds - Tracing system calls (e.g. strace(1)) can be tricky - Different protocols can be routed differently 12/29
  • 15. Calculating server response time 0.000978360 X.X.X.X ā†’ Y.Y.Y.Y HTTP 146 GET / HTTP/1.1 0.001722918 Y.Y.Y.Y ā†’ X.X.X.X TCP 66 80 ā†’ 33930 [ACK] Seq=1 Ack=81 Win=29056 Len=0 TSval=1737072019 TSecr=3816704019 0.004035262 Y.Y.Y.Y ā†’ X.X.X.X HTTP 481 HTTP/1.1 301 Moved Permanently (text/html) Packet capturing with tshark(1) 15/29
  • 16. What else? Spikes. - Mirroring the target environment - Application profiling (function timing) - Execution timing per different environments - Calculating median absolute deviation (MAD) What do we use to identify them? 16/29
  • 17. The target? More specifically. 17/29
  • 20. Attack resources - On average: 14 000 requests per character - The hash is hexadecimal - utilizes a character set of 16 elements: a-f0- 9 - Hash length is 40 characters Rough statistics for the attack: ~ 224 000 per each position ā€¦ or ~ 8 960 000 requests for full hash recovery 20/29
  • 21. Difference to brute-forcing? Works for any user-supplied password no matter the complexity Itā€™s simple. Howeverā€¦ Brute-forcing would be preferable if the user has used a predictable password 21/29
  • 22. Reducing the search space - Itā€™s not necessary to go for a full hash (in some cases) - We can use rainbow tables to lookup partial hashes Some more basic statistics Estimation: elements to pick from * number of requests per element * length - First 10 characters are expected to be recovered with 2 240 000 requests - First 13 characters are expected to be recovered with 2 912 000 requests - First 20 characters are expected to be recovered with 4 480 000 requests 22/29
  • 23. Demo
  • 24. Is this practical? Advantages - Timing attacks can be more efficient than brute-forcing - A lot of developers are not paying attention to them Disadvantages - In most cases are easy to detect - Hard to execute and easy to fail - Require a MASSIVE amount of requests - Can be hindered by any standard WAF/IDS - A reverse proxy will almost completely render them useless 24/29
  • 25. Who is vulnerable? - Applications that are not using timing-safe comparisons (constant-time algorithms) - Applications that have no rate limiting and/or monitoring in place - Shared hosting environments and virtualization can aid a timing attack 25/29
  • 26. What can the consequences be? - Ranging from useless traffic to a complete server takeover depending on the timing differences - Resource exhaustion if costly operations are performed on the back-end and continuously abused over a period of time 26/29
  • 27. Solution to timing attacks? - Do not solely rely on network jitter - Use constant-time algorithms for critical operations (auth, crypto) - Enforce a rate limiting policy 27/29
  • 28. Opportunities and Limits of Remote Timing Attacks (2009) SCOTT A. CROSBY, DAN S. WALLACH and RUDOLF H. RIEDI Rice University Some astonishing researches Nanosecond Scale Remote Timing Attacks On PHP Applications: Time To Take Them Seriously? (2010) Padraic Brady 28/29
  • 29. Questions & Feedback Thank you Bibliography available upon request www.tadgroup.com info@tadgroup.com