Joeri de Ruiter Sicco Verwer



Similar documents
Formal models of bank cards for free

Formal analysis of EMV

Software security specification and verification

The SmartLogic Tool: Analysing and Testing Smart Card Protocols

Rapid Security Framework (RSF) Taxonomie, Bewertungsparameter und Marktanalyse zur Auswahl von Fuzzing-Tools

Securing Card-Not-Present Transactions through EMV Authentication. Matthew Carter and Brienne Douglas December 18, 2015

Keep Out of My Passport: Access Control Mechanisms in E-passports

A Guide to EMV. Version 1.0 May Copyright 2011 EMVCo, LLC. All rights reserved.

Reverse engineering Internet Banking

Implementation of Botcatch for Identifying Bot Infected Hosts

Blind Security Testing

Designed to Fail: A USB-Connected Reader for Online Banking

Electronic Passports in a Nutshell

Generating Models of Infinite-State Communication Protocols using Regular Inference with Abstraction

CONTACTLESS PAYMENTS. Joeri de Ruiter. University of Birmingham. (some slides borrowed from Tom Chothia)

Analysis of Secure Key Storage Solutions on Android

Application Intrusion Detection

Intrusion detection for web applications

Computer Security. Draft Exam with Answers

ERNW Newsletter 29 / November 2009

Adversary Modelling 1

Peach Fuzzer Platform

The Case For Secure

Bypassing Memory Protections: The Future of Exploitation

Product Library 2.5 EUR. DVD Contents. Release Notes January 31st, Windows 2000 Windows Server Windows. Windows Vista. Windows.

CPA SECURITY CHARACTERISTIC SECURE VOIP CLIENT

Smart Card Application Standard Draft

SafeNet Authentication Client (Windows)

Malicious Code on Java Card Smartcards: Attacks and Countermeasures

RF-Enabled Applications and Technology: Comparing and Contrasting RFID and RF-Enabled Smart Cards

Improving Active Mealy Machine Learning for Protocol Conformance Testing

How to hack VMware vcenter server in 60 seconds

Achilles Assurance Platform. Dr. Nate Kube Founder / CTO Wurldtech

Right-to-Left Language Support in EMu

Turning your managed Anti-Virus

CIS 551 / TCOM 401 Computer and Network Security. Spring 2007 Lecture 6

Using SNMP to Obtain Port Counter Statistics During Live Migration of a Virtual Machine. Ronny L. Bull Project Writeup For: CS644 Clarkson University

Using etoken for SSL Web Authentication. SSL V3.0 Overview

A small leak will sink a great ship: An Empirical Study of DLP solutions

CS 356 Lecture 28 Internet Authentication. Spring 2013

Security of Cloud Storage: - Deduplication vs. Privacy

EMV (Chip-and-PIN) Protocol

SecureDoc Disk Encryption Cryptographic Engine

Threat Modeling. Frank Piessens ) KATHOLIEKE UNIVERSITEIT LEUVEN

Plain English Guide To Common Criteria Requirements In The. Field Device Protection Profile Version 0.75

E- Encryption in Unix

Java Card. Smartcards. Demos. . p.1/30

Levels of Software Testing. Functional Testing

CS Final Exam

Product Library v.2.0eur Release Notes. DVD Contents. October 8th, Windows Server 2008 Server 2008 R2. Windows 2000 Windows

USB PORT NETWORK HUB. User Manual DA DA

The Feasibility and Application of using a Zero-knowledge Protocol Authentication Systems

Security of mobile TAN on smartphones

CPA SECURITY CHARACTERISTIC MIKEY-SAKKE SECURE VOIP GATEWAY

Memcom Emergency Telephone

SECURITY B-SIDES: ATLANTA STRATEGIC PENETRATION TESTING. Presented by: Dave Kennedy Eric Smith

Aegis Padlock for business

Encryption, Data Integrity, Digital Certificates, and SSL. Developed by. Jerry Scott. SSL Primer-1-1

Caught in the Maze of Security Standards

Information & Communication Security (SS 15)

Disk encryption... (not only) in Linux. Milan Brož

Smart Card Technology Capabilities

FAQs Electronic residence permit

Attestation and Authentication Protocols Using the TPM

Penetration Testing with Kali Linux

ThreatSpike Dome: A New Approach To Security Monitoring

Application-Specific Biometric Templates

Hacking the NFC credit cards for fun and debit ;) Renaud Lifchitz BT Hackito Ergo Sum 2012 April 12,13,14 Paris, France

The Advantages of Block-Based Protocol Analysis for Security Testing

Relay attacks on card payment: vulnerabilities and defences

SL-8800 HDCP 2.2 and HDCP 1.x Protocol Analyzer for HDMI User Guide

Security A to Z the most important terms

HIGHSEC eid App Administration User Manual

SECURITY IMPLICATIONS OF NFC IN AUTHENTICATION AND IDENTITY MANAGEMENT

Horst Görtz Institute for IT-Security

TheGreenBow IPSec VPN Client Release Note 4.5

UNCLASSIFIED Version 1.0 May 2012

Product Library v.1.1 EUR Release Notes. DVD Contents. January 10th, Windows. Windows. Windows 8. Server 2008 Server 2008 R2.

Using EMV Cards to Protect E-commerce Transactions

Efficient Program Exploration by Input Fuzzing

Accellion Secure File Transfer Cryptographic Module Security Policy Document Version 1.0. Accellion, Inc.

Coverability for Parallel Programs

544 Computer and Network Security

Telecom Equipment Assurance Testing

CPA SECURITY CHARACTERISTIC TLS VPN FOR REMOTE WORKING SOFTWARE CLIENT

A Note on the Relay Attacks on e-passports

Karsten Nohl University of Virginia. Henryk Plötz HU Berlin

BMM CERTIFICATION TEST REPORT

Chip & PIN is definitely broken. Credit Card skimming and PIN harvesting in an EMV world

Introduction to Formal Methods. Các Phương Pháp Hình Thức Cho Phát Triển Phần Mềm

WildFire Cloud File Analysis

Entrust IdentityGuard

2-FACTOR AUTHENTICATION WITH OPENLDAP, OATH-HOTP AND YUBIKEY. Axel Hoffmann

Enova X-Wall LX Frequently Asked Questions

EMV-TT. Now available on Android. White Paper by

Detecting SQL Injection Vulnerabilities in Web Services

AccuRead OCR. Administrator's Guide

Forward proxy server vs reverse proxy server

Site Monitor. Version 5.3

Transcription:

Automated reverse engineering of security protocols Learning to fuzz, fuzzing to learn Fides Aarts Erik Poll Joeri de Ruiter Sicco Verwer Radboud University Nijmegen

Fuzzing 1. Plain fuzzing, with long inputs to trigger seg-faults and find hence find buffer overflows 2. Protocol fuzzing based on known protocol format, fuzzing interesting fields [eg SNOOZE] 3. State-based fuzzing to reach interesting states in the protocol statemachine, and then fuzz there essentially model-based testing [eg Peach, jtor] 2

Example: protocol fuzzing to crash things GSM is a very rich protocol Fuzzing protocol fields quickly reveals weird behaviour using USRP as GSM cell tower no SMS-of-death found, but lots of but lots of phones crashing in weird ways 3

Example: protocol fuzzing for information leakage e-passport implements protocol to prevent skimming correct protocols runs don t leak info to an eavesdropper But fuzzing incorrect instructions leaks a fingerprint, unique per implementation and hence (almost) unique per country for Australian, Belgian, Dutch, French, German, Greek, Italian, Polish, Spanish, Swedish passports 4

In the other direction: Instead of using protocol knowledge when testing, we can also use testing to gain protocol knowledge or to gain knowledge about protocol implementation In order to analyse your own code and hunt for bugs, or to reverse-engineer someone else s unknown protocol, eg a botnet, to fingerprint or analyse (and attack) it 5

What to reverse engineer? Different aspects that can be learned: timing/traffic analyis protocol formats [eg Discoverer, Dispatcher, Tupni,... ] protocol state-machine [eg LearnLib] or both protocol format & state-machine [eg Prospex] 6

passive vs active learning How to reverse engineer? ie passive observing or active testing active learning involves a form of fuzzing active learning is harder, as it requires more software in test harness that produces meaningful data these approach learns different things; passive learning uses & produces statistics black box vs white box ie only observing in/output or also looking inside running code white-box analysis for eg encypted traffic, by looking at handling of data after decryption [eg ReFormat, TaintScope] 7

Passive learning eg (timed) state machine

Learning malware models

Passive learning positive data: aa, b, bba negative data: a, aaa, aabb in a prefix tree 10

Passive learning select two states combine and iterate positive data: aa, b, bba negative data: a, aaa, aabb in a prefix tree 11

Active learning with Angluin s L* algorithm Basic idea: compare a deterministic system s response to a b ; a If response is different, then a? b a?? a otherwise?? b 12

Active learning with L* Implemented in LearnLib library Learner H reset input output equivalence: M = H? Teacher M yes or a counterexample Equivalence can only be approximated in a black box setting 13

Learning set-up for banking cards Learner H abstract instructions and response instruction INS 2 byte status word SW test harness concrete instructions and response Teacher INS + args data + SW M 14

Test harness for EMV Our test harness implements standard EMV instructions SELECT (to select application) INTERNAL AUTHENTICATE (for a challenge-response) VERIFY (to check the PIN code) READ RECORD GENERATE AC (to generate application cryptogram) LearnLib then tries to learn all possible combinations Most commands with fixed parameters, but some with different options 15

Maestro application on Volksbank bank card raw result 16

Maestro application on Volksbank bank card merging arrows with identical outputs 17

Maestro application on Volksbank card merging all arrows with same start & end state 18

Formal models for free! Experiments with Dutch, German and Swedish banking and credit cards Learning takes between 9 and 26 minutes Editing by hand to merge arrows and choose sensible names for states could be automated Limitations We do not try to learn response to incorrect PIN as cards would quickly block... We cannot learn about one protocol step which requires knowledge of card s secret 3DES key No security problems found, but interesting insight in implementations 19

SecureCode application on Rabobank card used for internet banking, hence entering PIN with VERIFY obligatory 20

understanding & comparing implementations Volksbank Maestro implementation Rabobank Maestro implementation Are both implementations correct & secure? And compatible? 21

Using these state-diagrams Analysing the models by hand, or with model checker, for flaws to see if all paths are correct & secure Fuzzing or model-based testing using the diagram as basis for automated fuzz testing fuzzing the order and/or the parameters of commands Program verification proving that there is no functionality beyond that in the diagram Using it when doing a manual code review 22

Case study: analysis of internet banking devices Just in case you think that of course there won t be security flaws in banking soft/hardware that could be found using these techniques... We analysed a USB-connected smartcard reader for internet banking that provides a trusted display for What-You-Sign-Is-What-You-See Reverse engineering reveal a major security protocol flaw This was done manually but could have been found by fuzzing USB instructions [Blom et al., Designed to fail, NORDSEC 2012] 23

Conclusions Fuzzing (model-based testing) and active learning are closely related State machines are a great specification formalism easy to draw on white boards, typically omitted in official specs and you can extract them for free from implementations using very standard, off-the-shelf, tools like LearnLib Useful for security analysis of protocol implementations for reverse engineering, fuzz testing, or formal verification Future work: learning extended finite state machines with variables (eg the internal transaction counter in EMV cards) 24

Questions? 25