@aegis-scan/skills 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/ATTRIBUTION.md +75 -0
  2. package/CHANGELOG.md +129 -0
  3. package/LICENSE +21 -0
  4. package/README.md +123 -0
  5. package/dist/bin.d.ts +3 -0
  6. package/dist/bin.d.ts.map +1 -0
  7. package/dist/bin.js +122 -0
  8. package/dist/bin.js.map +1 -0
  9. package/dist/commands/info.d.ts +5 -0
  10. package/dist/commands/info.d.ts.map +1 -0
  11. package/dist/commands/info.js +75 -0
  12. package/dist/commands/info.js.map +1 -0
  13. package/dist/commands/install.d.ts +7 -0
  14. package/dist/commands/install.d.ts.map +1 -0
  15. package/dist/commands/install.js +87 -0
  16. package/dist/commands/install.js.map +1 -0
  17. package/dist/commands/list.d.ts +7 -0
  18. package/dist/commands/list.d.ts.map +1 -0
  19. package/dist/commands/list.js +82 -0
  20. package/dist/commands/list.js.map +1 -0
  21. package/dist/index.d.ts +13 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +13 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/skills-loader.d.ts +23 -0
  26. package/dist/skills-loader.d.ts.map +1 -0
  27. package/dist/skills-loader.js +213 -0
  28. package/dist/skills-loader.js.map +1 -0
  29. package/package.json +63 -0
  30. package/skills/defensive/README.md +9 -0
  31. package/skills/mitre-mapped/README.md +10 -0
  32. package/skills/offensive/snailsploit-fork/advanced-redteam/SKILL.md +148 -0
  33. package/skills/offensive/snailsploit-fork/ai-security/SKILL.md +592 -0
  34. package/skills/offensive/snailsploit-fork/basic-exploitation/SKILL.md +10783 -0
  35. package/skills/offensive/snailsploit-fork/bug-identification/SKILL.md +1256 -0
  36. package/skills/offensive/snailsploit-fork/crash-analysis/SKILL.md +12466 -0
  37. package/skills/offensive/snailsploit-fork/deserialization/SKILL.md +185 -0
  38. package/skills/offensive/snailsploit-fork/edr-evasion/SKILL.md +1806 -0
  39. package/skills/offensive/snailsploit-fork/exploit-dev-course/SKILL.md +428 -0
  40. package/skills/offensive/snailsploit-fork/exploit-development/SKILL.md +699 -0
  41. package/skills/offensive/snailsploit-fork/fast-checking/SKILL.md +487 -0
  42. package/skills/offensive/snailsploit-fork/file-upload/SKILL.md +822 -0
  43. package/skills/offensive/snailsploit-fork/fuzzing/SKILL.md +340 -0
  44. package/skills/offensive/snailsploit-fork/fuzzing-course/SKILL.md +2105 -0
  45. package/skills/offensive/snailsploit-fork/graphql/SKILL.md +209 -0
  46. package/skills/offensive/snailsploit-fork/idor/SKILL.md +608 -0
  47. package/skills/offensive/snailsploit-fork/initial-access/SKILL.md +1528 -0
  48. package/skills/offensive/snailsploit-fork/jwt/SKILL.md +276 -0
  49. package/skills/offensive/snailsploit-fork/keylogger-arch/SKILL.md +197 -0
  50. package/skills/offensive/snailsploit-fork/mitigations/SKILL.md +1351 -0
  51. package/skills/offensive/snailsploit-fork/oauth/SKILL.md +366 -0
  52. package/skills/offensive/snailsploit-fork/open-redirect/SKILL.md +487 -0
  53. package/skills/offensive/snailsploit-fork/osint/SKILL.md +399 -0
  54. package/skills/offensive/snailsploit-fork/osint-methodology/SKILL.md +434 -0
  55. package/skills/offensive/snailsploit-fork/parameter-pollution/SKILL.md +595 -0
  56. package/skills/offensive/snailsploit-fork/race-condition/SKILL.md +881 -0
  57. package/skills/offensive/snailsploit-fork/rce/SKILL.md +1069 -0
  58. package/skills/offensive/snailsploit-fork/request-smuggling/SKILL.md +773 -0
  59. package/skills/offensive/snailsploit-fork/shellcode/SKILL.md +477 -0
  60. package/skills/offensive/snailsploit-fork/sqli/SKILL.md +372 -0
  61. package/skills/offensive/snailsploit-fork/ssrf/SKILL.md +830 -0
  62. package/skills/offensive/snailsploit-fork/ssti/SKILL.md +349 -0
  63. package/skills/offensive/snailsploit-fork/vuln-classes/SKILL.md +1229 -0
  64. package/skills/offensive/snailsploit-fork/waf-bypass/SKILL.md +820 -0
  65. package/skills/offensive/snailsploit-fork/windows-boundaries/SKILL.md +15153 -0
  66. package/skills/offensive/snailsploit-fork/windows-mitigations/SKILL.md +14546 -0
  67. package/skills/offensive/snailsploit-fork/xss/SKILL.md +784 -0
  68. package/skills/offensive/snailsploit-fork/xxe/SKILL.md +996 -0
  69. package/skills/ops/README.md +6 -0
@@ -0,0 +1,185 @@
1
+ <!-- aegis-local: forked 2026-04-23 from SnailSploit/Claude-Red@c74d53e2938b59f111572e0819265a1e73029393; attribution preserved, see ATTRIBUTION.md -->
2
+
3
+ # SKILL: Insecure Deserialization
4
+
5
+ ## Metadata
6
+ - **Skill Name**: insecure-deserialization
7
+ - **Folder**: offensive-deserialization
8
+ - **Source**: https://github.com/SnailSploit/offensive-checklist/blob/main/insecure-deserialization.md
9
+
10
+ ## Description
11
+ Insecure deserialization attack checklist: identifying deserialization sinks, Java/PHP/.NET/Python deserialization exploitation, ysoserial gadget chains, magic method abuse, and detection evasion. Use when testing deserialization endpoints or developing deserialization exploits.
12
+
13
+ ## Trigger Phrases
14
+ Use this skill when the conversation involves any of:
15
+ `deserialization, insecure deserialization, ysoserial, Java deserialization, PHP deserialization, .NET deserialization, pickle, gadget chain, magic method, ObjectInputStream`
16
+
17
+ ## Instructions for Claude
18
+
19
+ When this skill is active:
20
+ 1. Load and apply the full methodology below as your operational checklist
21
+ 2. Follow steps in order unless the user specifies otherwise
22
+ 3. For each technique, consider applicability to the current target/context
23
+ 4. Track which checklist items have been completed
24
+ 5. Suggest next steps based on findings
25
+
26
+ ---
27
+
28
+ ## Full Methodology
29
+
30
+ # Insecure Deserialization
31
+
32
+ Happens when applications deserialize program objects without proper precaution. An attacker can then manipulate serialized objects to change program behavior and even execute code.
33
+
34
+ ## Shortcut
35
+
36
+ 1. Search source for deserialization that touches user input.
37
+ 2. If black-box, look for large, opaque blobs (cookies, headers, bodies) and unusual content-types.
38
+ 3. Identify features that must deserialize user-supplied data (session, jobs/queues, file metadata, tokens).
39
+ 4. If identity is embedded, tamper to attempt auth bypass.
40
+ 5. Try to escalate to RCE/logic abuse carefully and non-destructively.
41
+
42
+ ## Mechanisms
43
+
44
+ - Occurs when user-controlled data is deserialized without strict allowlists and integrity checks. Exploits often occur during deserialization (magic methods, constructors), before app logic runs.
45
+ - Prefer data formats that don’t instantiate code (JSON), and disable polymorphic typing.
46
+
47
+ ## Hunt
48
+
49
+ 1. **Identify Potential Inputs:**
50
+ - HTTP parameters/headers/cookies, file uploads, message queues, caches, DB‑stored user content
51
+ 2. **Recognize Serialized Data:**
52
+ - **PHP:** `O:<len>:"Class":...` (often Base64), PHAR archives (`phar://`)
53
+ - **Java:** hex `ac ed 00 05` or Base64 `rO0`; XMLDecoder/XStream flows
54
+ - **.NET:** legacy `BinaryFormatter`/`SoapFormatter` (unsafe/deprecated); Base64 `AAEAAAD/////`
55
+ - **Python:** `pickle` opcodes; unsafe `yaml.load` without `SafeLoader`
56
+ - **Ruby:** `YAML.load` unsafe; use `safe_load`
57
+ 3. **Source Review (if available):**
58
+ - **Java:** `ObjectInputStream.readObject`; enable `ObjectInputFilter`, disable Jackson default typing; use allowlists
59
+ - **PHP:** `unserialize()`; file operations that dereference `phar://`
60
+ - **.NET:** avoid `BinaryFormatter`; use `System.Text.Json`
61
+ - **Python:** avoid `pickle` for untrusted data; `yaml.safe_load`
62
+ - **Node.js:** `node-serialize`, `serialize-javascript`, `funcster` with unsafe eval()
63
+ - **Golang:** `encoding/gob` with interface{} type confusion
64
+ - **Ruby:** `Marshal.load()`, `YAML.load()` without `safe_load`
65
+ - **Rust:** `serde` with YAML/bincode, `ron` (Rusty Object Notation)
66
+ 4. **Dynamic Analysis:** Intercept and mutate; watch for error stack traces, class names, and timing anomalies.
67
+
68
+ ## Bypass Techniques
69
+
70
+ 1. **Alternate Gadgets/Classes:** Switch payload chains if blocklists are present.
71
+ 2. **Type Confusion:** Change expected types to bypass weak validation.
72
+ 3. **Indirect Paths:** Sink data into storage that a different component later deserializes.
73
+ 4. **Format Specific:** PHAR wrappers, XML entity tricks, language‑specific unserialize quirks.
74
+ 5. **Post‑deserialization Impact:** Abuse magic methods that run before validation.
75
+
76
+ ## Language-Specific Details
77
+
78
+ ### Node.js
79
+
80
+ - **node-serialize**: RCE via `_$$ND_FUNC$$_` IIFE pattern
81
+ ```javascript
82
+ {"rce":"_$$ND_FUNC$$_function(){require('child_process').exec('whoami', function(error, stdout){console.log(stdout)});}()"}
83
+ ```
84
+ - **serialize-javascript**: Unsafe eval() when not properly escaped
85
+ - **funcster**: Arbitrary function serialization leads to code execution
86
+ - **Detection**: Look for `{"_$$ND_FUNC$$_` or serialized function strings in cookies/tokens
87
+
88
+ ### Golang
89
+
90
+ - **encoding/gob**: Type confusion attacks when using `interface{}` types
91
+ ```go
92
+ // Vulnerable: accepts any type
93
+ var data interface{}
94
+ dec := gob.NewDecoder(buffer)
95
+ dec.Decode(&data)
96
+ ```
97
+ - **encoding/json**: Generally safe but Unmarshal into `interface{}` allows unexpected types
98
+ - **MessagePack**: Unsafe reflection in `github.com/vmihailenco/msgpack` with custom decoders
99
+ - **Mitigation**: Use concrete types, avoid `interface{}` for untrusted data
100
+
101
+ ### Rust
102
+
103
+ - **serde**: Generally memory-safe but logic bugs possible with custom `Deserialize` implementations
104
+ - **bincode**: Binary serialization - ensure versioning and size limits
105
+ - **ron** (Rusty Object Notation): Can deserialize into arbitrary types if schema not restricted
106
+ - **YAML**: `serde_yaml` with untrusted input can cause DoS via deeply nested structures
107
+ - **Best Practice**: Use `#[serde(deny_unknown_fields)]` and explicit type constraints
108
+
109
+ ### Additional Languages
110
+
111
+ - **Ruby**:
112
+ - `Marshal.load()`: Gadget chains exist (e.g., `Gem::Requirement`, `Gem::RequestSet`)
113
+ - Tools: `Ruby Marshal RCE` (exploit scripts)
114
+ - **Python**:
115
+ - `pickle`: Extensive gadget chains, `__reduce__` magic method exploitation
116
+ - `yaml.load()`: Use `yaml.safe_load()` or `yaml.load(data, Loader=yaml.SafeLoader)`
117
+ - **Java**:
118
+ - Apache Commons Collections (InvokerTransformer chain)
119
+ - Spring Framework (PropertyPathFactoryBean)
120
+ - Tool: `ysoserial` - generates payloads for 30+ gadget chains
121
+
122
+ ## Modern Attack Vectors
123
+
124
+ ### Container & Kubernetes
125
+
126
+ - **ConfigMaps/Secrets**: Applications deserializing YAML/JSON from ConfigMaps without validation
127
+ - **Admission Webhooks**: Kubernetes admission controllers deserializing `AdmissionReview` objects
128
+ - Test by submitting pods with malicious annotations or labels containing serialized payloads
129
+ - **CRD Controllers**: Custom Resource Definitions with unsafe deserialization in reconciliation loops
130
+ - **Attack**: Submit malicious Custom Resource → controller deserializes → RCE in cluster
131
+
132
+ ### Message Queues
133
+
134
+ - **Kafka/RabbitMQ/Redis**: Consumers blindly deserializing messages from queues
135
+ ```python
136
+ # Vulnerable consumer
137
+ msg = consumer.receive()
138
+ data = pickle.loads(msg) # Attacker controls msg
139
+ ```
140
+ - **Testing**: Publish crafted serialized objects to queues if you have producer access
141
+ - **Impact**: Compromise all consumers processing the poisoned queue
142
+
143
+ ### Serverless Functions
144
+
145
+ - **AWS Lambda**: Event payloads deserialized from S3 triggers, SNS, SQS
146
+ - **Google Cloud Functions**: HTTP request bodies automatically deserialized
147
+ - **Azure Functions**: Blob triggers with automatic deserialization
148
+ - **Attack Vector**: Upload malicious serialized object to S3 → Lambda deserializes → RCE in serverless context
149
+
150
+ ### CI/CD Pipelines
151
+
152
+ - **Jenkins**: Java deserialization in remoting protocol (multiple CVEs)
153
+ - **GitLab Runners**: YAML deserialization in `.gitlab-ci.yml` with unsafe anchors/aliases
154
+ - **GitHub Actions**: Workflow files with embedded serialized data in custom actions
155
+ - **Build Artifacts**: Deserializing cached build objects from untrusted sources
156
+
157
+ ### GraphQL / API Gateways
158
+
159
+ - **Custom Scalars**: GraphQL custom scalar types deserializing complex objects
160
+ - **Input Coercion**: API gateways converting JSON to language objects without validation
161
+ - **Batch Operations**: Bulk import/export features deserializing uploaded files
162
+
163
+ ## Vulnerabilities / Impacts
164
+
165
+ - **RCE via gadget chains**: Execute arbitrary code through chained object instantiation
166
+ - **Arbitrary file access**: Read/write files via path traversal in deserialization
167
+ - **DoS via resource bombs**: Billion laughs-style attacks with nested objects (zip bombs, XML bombs)
168
+ - **Auth bypass via object field tampering**: Modify `is_admin`, `role`, `user_id` fields in session objects
169
+ - **Downstream SQLi with tainted fields**: Deserialized objects used in SQL queries without sanitization
170
+ - **Memory exhaustion**: Allocate large data structures during deserialization
171
+ - **Type juggling attacks**: Language-specific type coercion vulnerabilities
172
+
173
+ ## Methodologies
174
+
175
+ - Identify → Format → Mutate/Fuzz → Exploit chain → Verify impact safely
176
+ - Tools: `ysoserial`, `phpggc`, `ysoserial.net`, Burp Deserialization Scanner, Semgrep rules for dangerous sinks, `marshalsec`, gadget inspectors.
177
+
178
+ ## Remediation Recommendations
179
+
180
+ 1. Avoid deserializing untrusted input; use JSON with schemas.
181
+ 2. Verify integrity first (HMAC/signature) and only then deserialize; reject on mismatch.
182
+ 3. Use safe, specific serializers without polymorphic typing; implement allowlists.
183
+ 4. Isolate deserialization code under least privilege and sandboxing; timeouts/memory limits.
184
+ 5. Keep libraries updated; monitor for anomalies.
185
+