It's Oops PM
It's Oops PM
Platform: HackTheBox | Category: Hardware | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2026-02-16 | Status: Solved Techniques: backdoor_trigger, code_analysis
Summary
Task: Analyze VHDL source code for a TPM chip to find a backdoor. Solution: Identified a pattern comparator that bypasses encryption when input matches 0xFFE9, revealing the hardcoded secret key.
It's Oops PM — HackTheBox
Description
This challenge presents VHDL source code for a Trusted Platform Module (TPM) chip. The goal is to analyze the hardware description, find the backdoor, and understand how to extract the secret key.
Analysis
tpm.vhdl
This is the main entity that combines the following components:
ckey: Component that provides the secret key.encryption: Data encryption module.backdoor: Module that checks input data for a backdoor trigger.
The tpm.vhdl architecture implements a process that controls the Output signal:
vhdl read-only • copy allowedprocess(Key, Encrypted, B) begin case B is when '1' => for i in 0 to 15 loop Output(i) <= Key(i); end loop; when others => for i in 0 to 15 loop Output(i) <= Encrypted(i); end loop; end case; end process;
If signal B (output of the backdoor module) equals '1', the device outputs the raw secret key Key. Otherwise, it outputs encrypted data.
backdoor.vhdl
This module is responsible for activating signal B. It defines a constant pattern:
vhdl read-only • copy allowedconstant pattern : STD_LOGIC_VECTOR(15 downto 0) := "1111111111101001";
The activation logic is simple:
vhdl read-only • copy allowedif D = pattern then B <= '1'; else B <= '0'; end if;
The backdoor triggers when input data D exactly matches the pattern 1111111111101001 (in hexadecimal: 0xFFE9).
key.vhdl
This file contains the hardcoded secret key that the TPM is supposed to protect:
vhdl read-only • copy allowedconstant key : STD_LOGIC_VECTOR(15 downto 0) := "0110001111100001";
Key value in HEX: 0x63E1.
encryption.vhdl
The encryption module performs XOR between input data and the key, but contains intentional errors:
- Bits 0, 6, and 13 are forcibly set to
NOT K(i), ignoring input dataD. This makes encryption irreversible for some bits, but doesn't interfere with the backdoor operation.
Backdoor Trigger Logic
The trigger is implemented as a comparator of the input data bus with a predefined 16-bit value. When matched, the control signal switches the multiplexer, routing the internal key register directly to the device's output port, bypassing the encryption block.
Solution
- Structure analysis: Examine
tpm.vhdland notice the suspiciousbackdoorcomponent whose output controls the multiplexer at the device output. - Pattern search: Navigate to
backdoor.vhdland find the trigger value:1111111111101001. - Secret extraction: Understand that when this value is sent to the input, the device will reveal its key.
- Key retrieval: In
key.vhdl, find the key itself:0110001111100001.
In the CTF context, after discovering this logic, you need to send the magic number to the emulated device or server to obtain the flag.