Writeups/HackTheBox/Blockchain
HackTheBox

Blockchain Writeups

Smart contract exploitation, EVM internals, and Web3 security. Each challenge is documented as a complete security research article — explaining not just the exploit, but why it works and how the underlying Solidity or EVM behaviour makes it possible.

5

Challenges Solved

Medium

All Difficulties

EVM

Focus Area

01
MediumBlockchain

Rivals

On-Chain Storage Transparency

Ethereum's `private` keyword does not prevent on-chain storage reads. By using `eth_getStorageAt` to retrieve the `encryptedFlag` stored in slot 0, and then scanning historical bot transactions to find the XOR key that produces a value matching `hashedFlag` in slot 1, the `talk()` function can be called with the correct key to set `solver = msg.sender`.

SolidityStorage Slotseth_getStorageAtFoundrycast
Read
02
MediumBlockchain

Token to Wonderland

delegatecall Storage Collision + Deterministic Contract Deployment

The `createPortal` function in `PortalStation` performs a `delegatecall` to a hardcoded destination address. Because contract deployment addresses are deterministic (`keccak256(RLP([deployer, nonce]))`), burning nonces 0–129 with dummy contracts causes the 130th deployment to land exactly at the `orcKingdom` destination address. The attacker-controlled contract's `connect()` function then writes `true` to `isPortalActive["orcKingdom"]` through the delegatecall, entirely within `PortalStation`'s storage.

SoliditydelegatecallStorage CollisionNonce PredictionFoundryCREATE
Read
03
MediumBlockchain

Magic Vault

Bit Manipulation & Blockhash Dependency

A multi-condition unlock function relies on byte truncation and a blockhash-dependent password. Understanding how Solidity handles bytes vs uint endianness reveals how to satisfy all conditions simultaneously with one crafted value.

Soliditybytes16uint64 truncationblockhashprivate storage
Read
04
MediumBlockchain

Locked and Loaded

Reentrancy via ETH Transfer Before State Update

An ETH transfer fires before the sale item is deleted from state. A malicious receive() function re-enters the purchase function while the item still exists, triggering a second payout and draining the contract balance.

SolidityReentrancychecks-effects-interactionsreceive()calldata recon
Read
05
HardBlockchain

Portal Noncense

delegatecall Storage Collision + Deterministic Contract Deployment

The createPortal function performs a delegatecall to a hardcoded destination address. Because CREATE deployment addresses are deterministic (keccak256(RLP([deployer, nonce]))), burning nonces 0-129 causes the 130th deployment to land exactly at the target address, letting an attacker-controlled contract write through delegatecall into the caller's storage.

SoliditydelegatecallCREATENonce PredictionStorage Collision
Read