Using Claude Desktop and Metasploit for Agentic Penetration Testing

Summary
A lab walkthrough connects Claude Desktop to Metasploit through MCP, demonstrating scans, exploitation of Linux and Windows lab hosts, post-exploitation and payload delivery, with human approval gates and mitigation guidance.
Key points
- The author connects Claude Desktop to Metasploit through an MCP bridge and runs the demonstration in an isolated lab network.
- On a Metasploitable 2 host, the walkthrough demonstrates exploitation of the vsftpd 2.3.4 and UnrealIRCd backdoors.
- On a Windows Server 2019 Domain Controller, the demonstration uses valid lab administrator credentials with psexec to obtain a SYSTEM session.
- The workflow generates and hosts a Windows reverse payload, then starts a listener; the article reports a callback from the lab Domain Controller.
- Human approval gates are required before offensive actions, and the article emphasizes authorization and isolation.
- Mitigations discussed include retiring vulnerable legacy services, network segmentation, limiting privileged credentials, securing SMB shares, monitoring outbound connections, and auditing MCP tool calls.
Article Details
- Topic
- Agentic penetration testing with Claude Desktop and Metasploit through MCP in an isolated lab
MITRE ATT&CK
T1021.002 · SMB/Windows Admin SharesThe test uses valid administrator credentials with Metasploit's psexec module to access the Windows Domain Controller over SMB.T1046 · Network Service DiscoveryThe workflow scans lab hosts and enumerates their open network services.T1105 · Ingress Tool TransferA generated Windows payload is hosted over HTTP on the Kali lab machine and downloaded by the Domain Controller.T1210 · Exploitation of Remote ServicesThe test exploits vulnerable remote services on the Metasploitable 2 host, including vsftpd and UnrealIRCd, to gain access.
CVE
Products
Claude DesktopThis article shows an end-to-end agentic penetration test where Claude Desktop, connected to Metasploit through MCP, scans targets, launches exploits, runs post-exploitation, and generates a payload across a lab network.Kali LinuxA Kali Linux machine serves as the attacker and hosts both Claude Desktop and the Metasploit Framework.Metasploitable 2It demonstrates compromise of a Metasploitable 2 Linux host and a Windows Server 2019 Domain Controller, while emphasizing human approval gates, isolated testing, and mitigation guidance.Windows Server 2019It demonstrates compromise of a Metasploitable 2 Linux host and a Windows Server 2019 Domain Controller, while emphasizing human approval gates, isolated testing, and mitigation guidance.
