Skip to content
yaklang avatar

Type Juggling

Loose PHP comparisons and magic-hash tricks for bypassing weak authentication, HMAC, and token checks.

CCM score
68 of 100
skills.sh installs
4K
GitHub stars
2.7K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers PHP == type juggling, magic hashes matching 0e digits, HMAC loose checks, NULL juggling, and CTF-style strcmp/intval bypasses
  • Includes a truth table of loose-comparison results, a PHP 5/7 versus PHP 8 behavior comparison, and reference magic-hash inputs for MD5 and SHA-1
  • Provides hash_equals and === as the strict-comparison replacements for secret and token checks
  • Designed for auditing legacy PHP authentication and CTF-style code paths that compare secrets with loose equality

Install

$ npx -y skills add yaklang/hack-skills --skill type-juggling -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

SKILL: PHP Type Juggling — Weak Comparison & Magic Hash Bypass

AI LOAD INSTRUCTION: PHP == coercion, magic hashes (0e…), HMAC/hash loose checks, NULL from bad types, and CTF-style strcmp / json_decode / intval tricks. Use strict routing: map the sink (== vs hash_equals), PHP major version, and whether both operands are attacker-controlled. Routing note: when you encounter PHP login/signature logic or code like md5($_GET['x'])==md5($_GET['y']), start with this skill; if hash_equals/=== is already used, this path usually does not apply.

0. QUICK START

First-pass goal: prove the server branch treats unequal secrets/tokens as equal via coercion, not guess the real password.

First-pass payloads (auth / token shape)

password[]=x
password=
0
0e12345
240610708
QNKCDZO
true
[]
{"password":true}
admin%00

Minimal PHP probes (local or php -r in lab)

<?php
// Loose compare probes — run in target PHP major version if possible
var_dump('0e123' == '0e999');
var_dump('123a' == 123);
var_dump(md5('240610708') == md5('QNKCDZO'));

Routing hints

Details

Repository
github.com/yaklang/hack-skills
Categories
Security, PHP & Laravel
First seen
Jun 3, 2026

More from yaklang/hack-skills

All 102

Similar to Type Juggling

More Security