Giter VIP home page Giter VIP logo

tpmgenie's Introduction

TPM Genie

TPM Genie is designed to aid in vulnerability research of Trusted Platform Modules. As a serial bus interposer, TPM Genie is capable of intercepting and modifying all traffic that is sent across the I2C channel between the host machine and a discrete TPM chip.

Outside of research, the threat model demonstrated by TPM Genie would require an attacker to have temporary physical access to the affected machine in order to implant the interposer device. Such an attack could be conducted in an "Evil Maid" scenario, by a rogue employee in a datacenter containing TPM enabled enterprise servers, or by a supply chain interdiction attack in the style of those found in the NSA ANT catalog of hardware implants.

Many discrete TPMs are broken out to a daughter card that is connected to the main board via a simple header or socket. Consequently, the process of implanting an interposer is fairly straight forward as it would not require the attacker to perform any circuit modification attacks. The implant could be installed in only a few seconds.

TPM Genie was tested extensively with the Infineon SLB9645 I2C TPM, which conforms to the TPM v1.2 protocol specification.

Key Features

This tool was primarily developed to manipulate TPM response packets in order to trigger parsing bugs in the host-side TPM drivers. These bugs can be found in the Linux kernel, as well as a variety of bootloaders such as Tboot and Tianocore EDKII. Leveraging these vulnerabilities, an attacker may be able to compromise a host machine after it had successfully booted up into a fully measured and attested state.

TPM Genie is also able to man-in-the-middle PCR Extend operations, yielding the ability to undermine most of the stated purposes of a TPM: measured boot, remote attestation, and sealed storage. Normally, attestation or unsealing should fail if an attacker modifies any component of the measured boot process. However, the interposer makes it is possible to spoof these measurements by replacing the the payload associated with the PCR Extend ordinal as it is transmitted across the bus.

Additionally, TPM Genie can weaken the Linux hardware random number generator. On some systems, /dev/hwrng is tied into the Trusted Platform Module such that all reads on the character device will actually result in the TPM chip providing the random bytes. In this way, the interposer can subtly alter the platform's RNG which may impair cryptographic operations on the host.

Finally, TPM Genie can be used to simply sniff the bus to capture secrets, such as session data associated with the OIAP and OSAP commands. And with nominal additional engineering effort, TPM Genie should be able to spoof the Endorsement Key, gain control of the AuthData and recalculate the Authorization Session HMAC. (More info on that in my whitepaper. I promise I'll implement that soon).

Further Information

tpmgenie's People

Contributors

jeremyncc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tpmgenie's Issues

i2c_t3 multi-wire issue

It seems that the current i2c_t3 version is causing problems.

nox771/i2c_t3#26
As you can see in this issue it is a known problem. If I got them right.

Maybe you could mention this somewhere and/or provide a working version of the library.
If I can get it running, I will update this issue and specify the latest working version here.

Attacks on pcr extension

Hi, I am wondering if the kernel and u-boot patches described in the paper will cover these kind of attacks?

LPC Based Genie

This isn't so much an issue as it is a suggestion, but github, /shrub.

On the LPC, I've considered taking this project as TPM Sniffer (https://github.com/lynxis/lpc_sniffer). The FPGA could be added to an Arduino Shield perhaps. But anyway, there's verilog changes that need to be made to inject LPC commands.

This was the closest starting point for LPC TPM hacking I could find, so maybe it triggers some other insight.

Attacks on bus encryption

It seems that in TPM 2.0 a call to TPM2_StartAuthSession() is able to start a decrypt/encrypt session. However, the caller forwards all the key generation material to the TPM in plaintext, and then uses the nonceTPM to generate an identical session key that is shared between the TPM and the caller.

What prevents a man in the middle (e.g. TPMGenie) from listening on the bus, creating an identical session key, and using it to decrypt encrypted traffic that is sent over the TPM bus? Ideally now they can also spoof HMACs because the key is also derived from the session key.

Am I missing something?

TPM in Arduino

Hello!

Do you have experience using TPM with Arduino (with SPI interface)? I have read something that you were running some tests.
Have you gotten it to work?

Thank you!

Raspberry Pi 3B i2c hardware bug

Regarding the i2c hardware bug.
I use a Raspberry Pi 3B in my setup and tried to solve the issue as described in the known issue section. Unfortunately, that didn't help.

I still had the problem that sometimes the ACK coming from the PI was not recognized by the Teensy.
grafik

I the end I solved it by using the i2c_gpio bitbang kernel module instead of the hardware implementation.

To do so, I replaced
dtparam=i2c_arm=on,i2c_arm_baudrate=100000
by
dtoverlay=i2c-gpio,i2c_gpio_sda=2,i2c_gpio_scl=3
in the config file '/boot/config.txt'.

No tpm_rng kernel module in current kernel versions.

The tpm_rng kernel module was removed raspberrypi/linux@6e592a0.

To still use the TPM as hwrng device you need to change the value of '/sys/class/misc/hw_random/rng_current' to the desired value.
To do so:

  1. Check if the TPM is available:
    # cat /sys/class/misc/hw_random/rng_available
    The output should look like this:
    3f104000.rng tpm-rng-0

  2. Write the desired value to rng_current
    # echo tpm-rng-0 > /sys/class/misc/hw_random/rng_current

For more information see https://github.com/raspberrypi/linux/blob/rpi-4.19.y/Documentation/hw_random.txt

PS: Sorry for spamming Issues. This will be the last one. :)

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.