Giter Club home page Giter Club logo

apdu-intercept's Introduction

APDU interception

This repository provides code for interception of smartcard application protocol data unit (APDU) commands by listening and responding to messages received by a virtual smartcard driver. It shows the hexadecimal traces in a hexdump format, logs them, colour-codes the APDU fields, prints the descriptions for the detected inter-industry commands and responses, and provides a hook to manipulate them.

It depends on the Virtual Smart Card library.

To collect APDU traces make sure the smartcard is inserted, pcscd is running, smartcard can be found in pcsc_scan. Then execute intercept.py using Python interpreter and use OpenSC, GnuPG, or your vendor's smartcard tools to perform operations on the smartcard.

To perform MITM attack, the method respond_to_message in a class inherited from InterceptAttack is the point where the attacker can issue commands and manipulate responses.

Virtual smartcard OS'es available using parameter --os:

  • RelayOS that relays messages to another smartcard reader specified by --reader.
  • GemaltoOS providing valid responses to authentication commands issued by Gemalto libgclib.so/libgck2015x.so Cryptoki libraries emulating Gemalto IDClassic 340.

Attack logic available using parameter --attack:

  • InterceptAttack that just prints the sniffed APDU traces to stdout and logs/date-time.log.
  • GemaltoMITMAttack that calculates parameters of secure messaging agreed between library and card.
  • YubikeyMITMAttack that intercepts GENERATE ASYMMETRIC KEY PAIR, puts the attackers private key on card, and returns corresponding public key.

The ISO inter-industry command/response descriptions are taken from the apdu-parser project.

apdu-intercept's People

Contributors

julijonas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.