Claude and MCP Kali Server Automate a Lab Penetration Test

· Original article ↗

Summary

A hands-on lab walkthrough connects Claude Desktop to Kali tools through MCP, demonstrating reconnaissance, exploitation, credential recovery and domain access across vulnerable hosts, then outlining defenses including patching, stronger authentication and network hard.

Key points

  • Claude Desktop used the MCP Kali Server to run Kali security tools through natural-language requests, with consent prompts for high-impact actions.
  • In the authorized lab, enumeration found anonymous SMB access and weak credentials; the walkthrough reports successful SSH login attempts and SQL injection against test hosts.
  • The article demonstrates obtaining root on a Metasploitable host through Samba CVE-2007-2447 and cracking six of seven recovered password hashes.
  • Vulnerable Reflex Gallery and Mail-Masta plugins were used to gain WordPress access; the walkthrough also reports recovering domain administrator credentials on a Windows Server 2019 lab controller.
  • Recommended defenses include retiring unsupported software, patching WordPress and plugins, disabling anonymous access, enforcing strong passwords and MFA, and segmenting networks.
  • Additional mitigations include parameterized queries, restricting upload execution, using modern password hashing, and monitoring for scanning, brute-force and exploitation activity.

Article Details

Topic
Natural-language orchestration of an authorized lab penetration test using Claude Desktop and the MCP Kali Server, including vulnerability exploitation and credential recovery across multiple hosts.

MITRE ATT&CK

T1003.008 · /etc/passwd and /etc/shadowAfter gaining root access, the assessment dumped the shadow file and retrieved password hashes.T1021.002 · SMB/Windows Admin SharesThe recovered administrator credentials provided access to the domain controller over SMB.T1021.006 · Windows Remote ManagementThe article reports that the recovered administrator credentials granted access to the domain controller over WinRM.T1046 · Network Service DiscoveryNmap and Metasploit scans enumerated services and open ports on lab hosts.T1078.002 · Domain AccountsRecovered domain administrator credentials were used to obtain administrative access to the Windows domain controller.T1087.001 · Local AccountSMB null-session enumeration exposed local user accounts on the Metasploitable host.T1110.001 · Password GuessingHydra tested username and password combinations against SSH and recovered a credential pair.T1110.002 · Password CrackingJohn the Ripper cracked hashes obtained from the host's shadow file.T1110.003 · Password SprayingNetExec tested combinations from local wordlists against SMB authentication on the domain controller.T1190 · Exploit Public-Facing ApplicationSQL injection and vulnerable WordPress plugins were exploited on lab web applications.T1210 · Exploitation of Remote ServicesThe Samba usermap_script vulnerability was exploited to obtain a root shell on the Metasploitable host.T1552.001 · Credentials In FilesA PHP filter wrapper was used to read wp-config.php and retrieve database credentials.

CVE

Products

Tools

Related Articles