myaidev-method 0.2.19 → 0.2.22

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 (31) hide show
  1. package/.claude/mcp/sparc-orchestrator-server.js +0 -0
  2. package/.claude/mcp/wordpress-server.js +0 -0
  3. package/CHANGELOG.md +123 -5
  4. package/README.md +205 -13
  5. package/TECHNICAL_ARCHITECTURE.md +64 -2
  6. package/bin/cli.js +169 -2
  7. package/dist/mcp/mcp-config.json +138 -1
  8. package/dist/mcp/openstack-server.js +1607 -0
  9. package/package.json +2 -2
  10. package/src/config/workflows.js +532 -0
  11. package/src/lib/payloadcms-utils.js +206 -0
  12. package/src/lib/visual-generation-utils.js +445 -294
  13. package/src/lib/workflow-installer.js +512 -0
  14. package/src/libs/security/authorization-checker.js +606 -0
  15. package/src/mcp/openstack-server.js +1607 -0
  16. package/src/scripts/openstack-setup.sh +110 -0
  17. package/src/scripts/security/environment-detect.js +425 -0
  18. package/src/templates/claude/agents/openstack-vm-manager.md +281 -0
  19. package/src/templates/claude/agents/osint-researcher.md +1075 -0
  20. package/src/templates/claude/agents/penetration-tester.md +908 -0
  21. package/src/templates/claude/agents/security-auditor.md +244 -0
  22. package/src/templates/claude/agents/security-setup.md +1094 -0
  23. package/src/templates/claude/agents/webapp-security-tester.md +581 -0
  24. package/src/templates/claude/commands/myai-configure.md +84 -0
  25. package/src/templates/claude/commands/myai-openstack.md +229 -0
  26. package/src/templates/claude/commands/sc:security-exploit.md +464 -0
  27. package/src/templates/claude/commands/sc:security-recon.md +281 -0
  28. package/src/templates/claude/commands/sc:security-report.md +756 -0
  29. package/src/templates/claude/commands/sc:security-scan.md +441 -0
  30. package/src/templates/claude/commands/sc:security-setup.md +501 -0
  31. package/src/templates/claude/mcp_config.json +44 -0
@@ -0,0 +1,441 @@
1
+ ---
2
+ name: security-scan
3
+ description: Active network and service scanning with authorization enforcement
4
+ version: 1.0.0
5
+ category: security
6
+ agent: penetration-tester
7
+ ---
8
+
9
+ # Security Scanning Command
10
+
11
+ Execute active network and service scanning following professional security assessment methodologies.
12
+
13
+ ## Pre-Execution Requirements
14
+
15
+ **CRITICAL Authorization Check:**
16
+ ```javascript
17
+ import { requireAuthorization, AuthLevel } from '../../../src/libs/security/authorization-checker.js';
18
+
19
+ // User must provide target
20
+ const target = process.argv[2];
21
+ if (!target) {
22
+ console.error('Usage: /sc:security-scan <target>');
23
+ console.error('Example: /sc:security-scan 192.168.1.0/24');
24
+ process.exit(1);
25
+ }
26
+
27
+ // Verify authorization (active scanning requires ACTIVE level)
28
+ await requireAuthorization(target, AuthLevel.ACTIVE);
29
+ ```
30
+
31
+ ## Command Workflow
32
+
33
+ When user requests active scanning on a target:
34
+
35
+ ### Step 1: Activate penetration-tester Agent
36
+
37
+ ```
38
+ You are now in active scanning mode.
39
+
40
+ Target: [USER_PROVIDED_TARGET]
41
+ Authorization Level: ACTIVE (network interaction allowed)
42
+
43
+ Execute comprehensive active scanning following this workflow:
44
+
45
+ 1. Initial Host Discovery
46
+ 2. Port Scanning (TCP/UDP)
47
+ 3. Service Enumeration
48
+ 4. OS Detection
49
+ 5. Vulnerability Scanning
50
+ 6. SSL/TLS Analysis
51
+ 7. Generate Scan Report
52
+ ```
53
+
54
+ ### Step 2: Host Discovery
55
+
56
+ ```bash
57
+ # Ping sweep for live hosts
58
+ nmap -sn [TARGET_RANGE]
59
+
60
+ # ARP scan for local network
61
+ nmap -PR [LOCAL_NETWORK]
62
+
63
+ # TCP SYN ping (stealth)
64
+ nmap -PS22,80,443 [TARGET]
65
+
66
+ # ICMP echo request
67
+ ping -c 4 [TARGET]
68
+ ```
69
+
70
+ ### Step 3: Port Scanning
71
+
72
+ ```bash
73
+ # Quick scan (common ports)
74
+ nmap -F [TARGET]
75
+
76
+ # Full TCP scan
77
+ nmap -p- [TARGET]
78
+
79
+ # UDP scan (top ports)
80
+ nmap -sU --top-ports 100 [TARGET]
81
+
82
+ # SYN stealth scan
83
+ nmap -sS -p- [TARGET]
84
+
85
+ # Fast parallel scan with masscan
86
+ masscan -p1-65535 [TARGET] --rate=10000
87
+ ```
88
+
89
+ ### Step 4: Service Enumeration
90
+
91
+ ```bash
92
+ # Service version detection
93
+ nmap -sV -p [PORTS] [TARGET]
94
+
95
+ # Aggressive service detection
96
+ nmap -sV --version-intensity 9 -p [PORTS] [TARGET]
97
+
98
+ # NSE scripts for service enumeration
99
+ nmap -sC -sV -p [PORTS] [TARGET]
100
+
101
+ # Banner grabbing with netcat
102
+ nc -v [TARGET] [PORT]
103
+ ```
104
+
105
+ ### Step 5: OS Detection
106
+
107
+ ```bash
108
+ # OS detection
109
+ nmap -O [TARGET]
110
+
111
+ # Aggressive OS detection
112
+ nmap -A [TARGET]
113
+
114
+ # OS fingerprinting with p0f (passive)
115
+ p0f -i eth0
116
+ ```
117
+
118
+ ### Step 6: Vulnerability Scanning
119
+
120
+ ```bash
121
+ # Nmap vulnerability scripts
122
+ nmap --script vuln -p [PORTS] [TARGET]
123
+
124
+ # Specific vulnerability checks
125
+ nmap --script ssl-heartbleed,ssl-poodle -p 443 [TARGET]
126
+
127
+ # OpenVAS comprehensive scan
128
+ openvas --scan [TARGET]
129
+
130
+ # Nuclei template scanning
131
+ nuclei -u https://[TARGET] -t ~/nuclei-templates/
132
+ ```
133
+
134
+ ### Step 7: SSL/TLS Analysis
135
+
136
+ ```bash
137
+ # SSL/TLS configuration scan
138
+ nmap --script ssl-enum-ciphers -p 443 [TARGET]
139
+
140
+ # SSLScan
141
+ sslscan [TARGET]:443
142
+
143
+ # testssl.sh comprehensive
144
+ testssl.sh [TARGET]:443
145
+ ```
146
+
147
+ ### Step 8: Web Service Scanning
148
+
149
+ ```bash
150
+ # Web technology detection
151
+ whatweb -a 3 https://[TARGET]
152
+
153
+ # Nikto web scanner
154
+ nikto -h https://[TARGET]
155
+
156
+ # Directory brute force
157
+ gobuster dir -u https://[TARGET] -w /usr/share/wordlists/dirb/common.txt
158
+
159
+ # OWASP ZAP automated scan
160
+ zap-cli quick-scan https://[TARGET]
161
+ ```
162
+
163
+ ### Step 9: Generate Scan Report
164
+
165
+ Create comprehensive scan report:
166
+
167
+ ```markdown
168
+ # Network Scan Report: [TARGET]
169
+
170
+ **Date:** [CURRENT_DATE]
171
+ **Authorization:** Active scanning authorized (Level: ACTIVE)
172
+ **Scanner:** Security Team
173
+ **Duration:** [SCAN_DURATION]
174
+
175
+ ## Executive Summary
176
+
177
+ High-level overview of scan results, critical findings, and risk assessment.
178
+
179
+ ## Scope
180
+
181
+ **Target:** [TARGET]
182
+ **IP Range:** [RANGE]
183
+ **Scan Type:** Full TCP/UDP port scan with service enumeration
184
+ **Exclusions:** [OUT_OF_SCOPE]
185
+
186
+ ## Host Discovery
187
+
188
+ ### Live Hosts
189
+ - Total hosts scanned: [COUNT]
190
+ - Live hosts found: [COUNT]
191
+ - Responsive hosts: [LIST]
192
+
193
+ **Host Details:**
194
+ | IP Address | Hostname | MAC Address | OS Guess |
195
+ |------------|----------|-------------|----------|
196
+ | [IP] | [HOSTNAME] | [MAC] | [OS] |
197
+
198
+ ## Open Ports and Services
199
+
200
+ ### TCP Ports
201
+ | IP | Port | State | Service | Version |
202
+ |----|------|-------|---------|---------|
203
+ | [IP] | 22 | open | SSH | OpenSSH 8.2p1 |
204
+ | [IP] | 80 | open | HTTP | Apache 2.4.41 |
205
+ | [IP] | 443 | open | HTTPS | Apache 2.4.41 |
206
+
207
+ ### UDP Ports
208
+ | IP | Port | State | Service | Version |
209
+ |----|------|-------|---------|---------|
210
+ | [IP] | 53 | open | DNS | ISC BIND 9.16 |
211
+ | [IP] | 161 | open | SNMP | Net-SNMP 5.8 |
212
+
213
+ ## Service Analysis
214
+
215
+ ### HTTP/HTTPS Services
216
+ - **Count:** [NUMBER]
217
+ - **Technologies:** [Apache, Nginx, IIS, etc.]
218
+ - **Interesting Headers:** [SECURITY_HEADERS]
219
+ - **Missing Headers:** [CSP, HSTS, etc.]
220
+
221
+ ### SSH Services
222
+ - **Version:** [SSH_VERSION]
223
+ - **Algorithms:** [KEY_EXCHANGE]
224
+ - **Weak Ciphers:** [YES/NO]
225
+
226
+ ### Database Services
227
+ - **Type:** [MySQL, PostgreSQL, MongoDB, etc.]
228
+ - **Version:** [VERSION]
229
+ - **Anonymous Access:** [YES/NO]
230
+
231
+ ## Operating System Detection
232
+
233
+ ### OS Fingerprinting Results
234
+ | IP | OS Detection | Accuracy | Details |
235
+ |----|--------------|----------|---------|
236
+ | [IP] | Ubuntu Linux 20.04 | 95% | Kernel 5.4 |
237
+ | [IP] | Windows Server 2019 | 92% | Build 17763 |
238
+
239
+ ## Vulnerability Assessment
240
+
241
+ ### Critical Vulnerabilities (CVSS 9.0-10.0)
242
+ 1. **CVE-XXXX-XXXX** - [Vulnerability Name]
243
+ - Affected Service: [SERVICE:PORT]
244
+ - Impact: [RCE/Disclosure/DoS]
245
+ - Remediation: [UPDATE/PATCH]
246
+
247
+ ### High Risk Vulnerabilities (CVSS 7.0-8.9)
248
+ 1. **CVE-XXXX-XXXX** - [Vulnerability Name]
249
+ - Affected Service: [SERVICE:PORT]
250
+ - Impact: [IMPACT]
251
+ - Remediation: [FIX]
252
+
253
+ ### Medium Risk (CVSS 4.0-6.9)
254
+ - [LIST OF MEDIUM SEVERITY ISSUES]
255
+
256
+ ### Low Risk (CVSS 0.1-3.9)
257
+ - [LIST OF LOW SEVERITY ISSUES]
258
+
259
+ ## SSL/TLS Configuration
260
+
261
+ ### Certificate Analysis
262
+ - **Valid:** [YES/NO]
263
+ - **Issuer:** [CA]
264
+ - **Expiry:** [DATE]
265
+ - **Chain Valid:** [YES/NO]
266
+ - **Subject Alternative Names:** [SANS]
267
+
268
+ ### Cipher Suite Analysis
269
+ - **Weak Ciphers:** [RC4, DES, etc.]
270
+ - **Strong Ciphers:** [AES-GCM, ChaCha20, etc.]
271
+ - **Perfect Forward Secrecy:** [YES/NO]
272
+ - **TLS 1.3 Support:** [YES/NO]
273
+
274
+ ### Protocol Support
275
+ - SSL 2.0: [DISABLED/ENABLED]
276
+ - SSL 3.0: [DISABLED/ENABLED]
277
+ - TLS 1.0: [DISABLED/ENABLED]
278
+ - TLS 1.1: [DISABLED/ENABLED]
279
+ - TLS 1.2: [ENABLED]
280
+ - TLS 1.3: [ENABLED]
281
+
282
+ ## Attack Surface Summary
283
+
284
+ **Total Attack Surface:**
285
+ - Open TCP Ports: [COUNT]
286
+ - Open UDP Ports: [COUNT]
287
+ - Web Applications: [COUNT]
288
+ - Database Services: [COUNT]
289
+ - Admin Interfaces: [COUNT]
290
+ - Legacy Services: [COUNT]
291
+
292
+ **High-Risk Exposure:**
293
+ - Unencrypted Services: [COUNT]
294
+ - Default Credentials: [COUNT]
295
+ - Outdated Software: [COUNT]
296
+ - Missing Security Headers: [COUNT]
297
+
298
+ ## Security Recommendations
299
+
300
+ ### Immediate Actions (0-7 days)
301
+ 1. Patch critical vulnerabilities ([CVE-LIST])
302
+ 2. Disable unnecessary services
303
+ 3. Update outdated software versions
304
+ 4. Fix SSL/TLS configuration issues
305
+
306
+ ### Short-term (1-4 weeks)
307
+ 1. Implement network segmentation
308
+ 2. Deploy Web Application Firewall (WAF)
309
+ 3. Enable security headers on web services
310
+ 4. Conduct penetration testing
311
+
312
+ ### Long-term (1-3 months)
313
+ 1. Implement intrusion detection/prevention (IDS/IPS)
314
+ 2. Deploy security information and event management (SIEM)
315
+ 3. Establish vulnerability management program
316
+ 4. Conduct regular security assessments
317
+
318
+ ## Next Steps
319
+
320
+ **Recommended Follow-up:**
321
+ - Exploitation testing (requires EXPLOITATION authorization level)
322
+ - Web application security assessment
323
+ - Wireless network assessment
324
+ - Social engineering assessment
325
+ - Physical security assessment
326
+
327
+ ---
328
+
329
+ **Classification:** CONFIDENTIAL
330
+ **Distribution:** Authorized Personnel Only
331
+ **Engagement ID:** [ENGAGEMENT_ID]
332
+ ```
333
+
334
+ ## Usage Examples
335
+
336
+ **Basic Network Scan:**
337
+ ```
338
+ User: "/sc:security-scan 192.168.1.0/24"
339
+
340
+ Response:
341
+ 1. Check authorization for 192.168.1.0/24
342
+ 2. Activate penetration-tester agent
343
+ 3. Execute host discovery
344
+ 4. Perform port scanning
345
+ 5. Enumerate services
346
+ 6. Detect operating systems
347
+ 7. Run vulnerability scans
348
+ 8. Generate comprehensive report
349
+ 9. Save to: reports/scan-192.168.1.0-24-[DATE].md
350
+ ```
351
+
352
+ **Single Host Deep Scan:**
353
+ ```
354
+ User: "/sc:security-scan 192.168.1.10 --deep"
355
+
356
+ Response:
357
+ 1. Verify authorization
358
+ 2. Full TCP/UDP port scan
359
+ 3. Aggressive service version detection
360
+ 4. OS fingerprinting
361
+ 5. Vulnerability assessment with multiple tools
362
+ 6. SSL/TLS comprehensive analysis
363
+ 7. Generate detailed host report
364
+ ```
365
+
366
+ **Web Application Scan:**
367
+ ```
368
+ User: "/sc:security-scan https://app.example.com --web"
369
+
370
+ Response:
371
+ 1. Check authorization for app.example.com
372
+ 2. Technology stack detection
373
+ 3. Directory enumeration
374
+ 4. SSL/TLS configuration
375
+ 5. HTTP security headers
376
+ 6. OWASP ZAP automated scan
377
+ 7. Generate web-focused report
378
+ ```
379
+
380
+ ## Output
381
+
382
+ Save scan report to:
383
+ ```
384
+ reports/scan-[TARGET]-[TIMESTAMP].md
385
+ ```
386
+
387
+ Log operation:
388
+ ```javascript
389
+ await authChecker.logOperation({
390
+ type: 'active_scanning',
391
+ target: target,
392
+ result: 'completed',
393
+ findings_count: findings.length,
394
+ critical_count: criticalFindings.length,
395
+ user: process.env.USER
396
+ });
397
+ ```
398
+
399
+ ## Error Handling
400
+
401
+ **No Authorization:**
402
+ ```
403
+ ❌ Authorization Required
404
+
405
+ Target: 192.168.1.0/24 is NOT in authorized scope.
406
+
407
+ Authorized targets:
408
+ - 192.168.100.0/24
409
+ - *.example.com
410
+
411
+ This target requires authorization before scanning.
412
+ ```
413
+
414
+ **Insufficient Authorization Level:**
415
+ ```
416
+ ❌ Insufficient Authorization Level
417
+
418
+ Required: ACTIVE
419
+ Current: PASSIVE
420
+
421
+ Active scanning requires ACTIVE authorization level.
422
+ Passive reconnaissance only with PASSIVE level.
423
+ ```
424
+
425
+ **No Target Provided:**
426
+ ```
427
+ ❌ Target Required
428
+
429
+ Usage: /sc:security-scan <target>
430
+
431
+ Examples:
432
+ /sc:security-scan 192.168.1.0/24
433
+ /sc:security-scan 192.168.1.10
434
+ /sc:security-scan example.com
435
+ ```
436
+
437
+ ---
438
+
439
+ **Agent:** penetration-tester
440
+ **Authorization Level:** ACTIVE
441
+ **Version:** 1.0.0