Skip to main content
CTFWorld
Misc & ChainDifficulty: Beginner -> Elite

Misc, Scripting & Smart Contracts

The Misc category rewards creativity, scripting fluency, and cross-domain problem solving. It encompasses Python/Bash jail escapes, custom network protocols, algorithmic puzzles, and increasingly Web3/Smart Contract auditing (reentrancy, flash loans, storage slot manipulation).

Core Attack Classes & Concepts

Pyjails & Restricted Shell Escapes

Breaking out of sandboxed Python eval environments or restricted rbash shells.

Key Techniques: Python MRO/subclasses traversal, Unicode NFKC identifier normalization, audit-hook bypasses, and GTFOBins.

Protocol & Automation Scripting

Solving 1,000 timed socket rounds, maze games, or custom binary protocols faster than humanly possible.

Key Techniques: pwntools remote tubes, asyncio concurrency, and resilient state-machine parsers.

Smart Contract & EVM Auditing

Exploiting reentrancy, integer/precision bugs, delegatecall storage collisions, and oracle manipulation.

Key Techniques: Foundry (forge/cast/anvil) local forks, invariant testing, and reading raw contract storage slots.

Competition Methodology Checklist

  1. 1

    Read jail filter rules carefully: distinguish AST checks, character blocklists, builtin removals, and OS-level sandboxes.

  2. 2

    For timed socket challenges, log raw bytes with repr() first so hidden newlines or ANSI codes do not break your parser.

  3. 3

    For Solidity targets, reproduce the exact chain state locally in Foundry Anvil and write a deterministic exploit test.

Reference Pattern

Why Character Blocklists Fail in Python Jails
python
# Python normalizes Unicode identifiers (NFKC) during parsing:
# Even if ASCII "open" is blocked, fullwidth characters may normalize!
# Defense: never pass untrusted strings to eval() or exec() at all.
import unicodedata
print(unicodedata.normalize('NFKC', 'open'))  # -> 'open'

Understanding parser edge cases explains why denylist sandboxes consistently break.

Recommended Practice Progression

Challenge / TrackPlatformLevelFocus
Bandit Wargame (Levels 0-33)OverTheWireBeginnerEssential Linux CLI, permissions, SSH, and shell escapes
Ethernaut Smart Contract WargameOpenZeppelinIntermediateHands-on EVM and Solidity vulnerability labs
Pyjail & Misc ArchivesCTFtime / picoCTFIntermediateCreative scripting and sandbox bypasses

Defensive Engineering Takeaway

Never use application-level blocklists or Python eval() as a security sandbox—isolate untrusted code with OS containers or microVMs, and apply checks-effects-interactions plus formal audits to smart contracts.