{"id":111,"date":"2025-11-29T15:52:13","date_gmt":"2025-11-29T15:52:13","guid":{"rendered":"https:\/\/jasveermaan.com\/?p=111"},"modified":"2026-03-13T10:07:03","modified_gmt":"2026-03-13T10:07:03","slug":"ai-driven-ad-enumeration","status":"publish","type":"post","link":"https:\/\/jasveermaan.com\/index.php\/2025\/11\/29\/ai-driven-ad-enumeration\/","title":{"rendered":"AI-driven AD enumeration"},"content":{"rendered":"\n<p>Hi Readers,<\/p>\n\n\n\n<p>In this post, I want to share something interesting I explored recently after a <a href=\"https:\/\/github.com\/RamadhanAmizudin\" data-type=\"link\" data-id=\"https:\/\/github.com\/RamadhanAmizudin\">friend<\/a> recommended that I try PowerView.py with its MCP integration. I\u2019ve been using <a href=\"https:\/\/github.com\/aniqfakhrul\/powerview.py\" data-type=\"link\" data-id=\"https:\/\/github.com\/aniqfakhrul\/powerview.py\">PowerView.py<\/a> for Active Directory enumeration in my homelab, and discovering that it has supports the Model Context Protocol (MCP) means you can integrate it directly with an AI model to perform AD tasks through natural language.<\/p>\n\n\n\n<p>This opens up a new way of interacting with enumeration tools: instead of typing commands manually, you can talk to an AI assistant and have it execute PowerView functions for you \u2014 as long as you understand the risks and use it in a controlled, authorised environment.<\/p>\n\n\n\n<p>I tested this inside my GOAD lab (Game of Active Directory) and wanted to document the setup for anyone who wants to experiment with it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Is MCP (Model Context Protocol)?<\/h2>\n\n\n\n<p>Model Context Protocol (MCP) is a local, open protocol that allows applications and tools to expose structured capabilities to AI models. Instead of relying on prompt-guessing or plugins, MCP lets tools communicate with the AI in a clean, safe, and reliable way.<\/p>\n\n\n\n<p>In simpler terms:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Your tool exposes commands<\/li>\n\n\n\n<li>MCP acts as the bridge<\/li>\n\n\n\n<li>The AI can call those commands safely<\/li>\n\n\n\n<li>Everything stays local and private<\/li>\n<\/ul>\n\n\n\n<p>This makes AI far more accurate and useful when interacting with local tools.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why PowerView.py?<\/h2>\n\n\n\n<p>PowerView.py is the Python-based reimplementation of the original PowerView PowerShell tool from PowerSploit. It offers:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Cross-platform support (Linux\/macOS\/Windows)<\/li>\n\n\n\n<li>No PowerShell dependency<\/li>\n\n\n\n<li>Great for red teaming from non-Windows attacker machines<\/li>\n\n\n\n<li>Potentially lower detection surface compared to PowerShell scripts<\/li>\n\n\n\n<li>Supports MCP, enabling full AI-assisted enumeration<\/li>\n\n\n\n<li>This makes it perfect for hybrid \u201cAI + AD Enumeration\u201d workflows.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Installation &amp; Setup<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Install Dependencies<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\"><br>sudo apt install libkrb5-dev<br>pip3 install powerview<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Install Claude Desktop (Linux Build)<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">git clone https:\/\/github.com\/aaddrick\/claude-desktop-debian.git<br>cd claude-desktop-debian<br>.\/build.sh<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Install MCP Proxy<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">pipx install mcp-proxy<\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Configuring Claude Desktop<\/li>\n<\/ol>\n\n\n\n<p>Edit the configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">~\/.config\/Claude\/claude_desktop_config.json<\/pre>\n\n\n\n<p>Add the PowerView MCP integration:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{\"mcpServers\":{\"Powerview\":{\"command\":\"\/home\/kali\/.local\/bin\/mcp-proxy\",\"args\":[\"http:\/\/127.0.0.1:5000\/powerview\",\"--transport=streamablehttp\"]}}}<\/pre>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li>Running PowerView.py in MCP Mode<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">powerview north.sevenkingdoms.local\/hodor:hodor@10.8.10.11 --mcp --mcp-host 0.0.0.0 --mcp-port 5000 --mcp-path powerview<\/pre>\n\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li>Start the proxy<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">mcp-proxy http:\/\/127.0.0.1:5000\/powerview --transport=streamablehttp<\/pre>\n\n\n\n<ol start=\"7\" class=\"wp-block-list\">\n<li>Launch Claude Desktop:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">claude-desktop<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">AI in Action: Conversational AD Enumeration<\/h2>\n\n\n\n<p>Once everything is configured, you can interact with PowerView.py simply by talking to your AI assistant. Here are some examples from my GOAD lab.<\/p>\n\n\n\n<p>Example: Listing Domain Admins Using AI<\/p>\n\n\n\n<p>The figure below shows Claude using PowerView.py through MCP to enumerate and return all the domain admin users:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"758\" height=\"828\" src=\"https:\/\/jasveermaan.com\/wp-content\/uploads\/2025\/11\/Claude_DA.png\" alt=\"\" class=\"wp-image-121\"\/><\/figure>\n\n\n\n<p>Example: AI Uncovers Exposed Credentials While Processing a Custom Prompt<\/p>\n\n\n\n<p>While performing enumeration, Claude automatically identified that a password was exposed in one of the PowerView.py outputs, even though the original prompt was only asking for privilege analysis:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"767\" height=\"974\" src=\"https:\/\/jasveermaan.com\/wp-content\/uploads\/2025\/11\/Claude_hodor.png\" alt=\"\" class=\"wp-image-117\"\/><\/figure>\n\n\n\n<p>You can expand each response box to view the full details. Within the same prompt, Claude also recognised several potential pivoting paths, including:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Accessible SMB shares available to the user Hodor<\/li>\n\n\n\n<li>Possible RDP access paths through group membership<\/li>\n\n\n\n<li>And a critical finding \u2014 the plaintext password for Samwell Tarly<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"751\" height=\"982\" src=\"https:\/\/jasveermaan.com\/wp-content\/uploads\/2025\/11\/Claude_hodor2.png\" alt=\"\" class=\"wp-image-118\"\/><\/figure>\n\n\n\n<p>The figure below confirms that the exposed password can indeed be used to authenticate to a machine within the environment, as verified using NetExec:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1348\" height=\"187\" src=\"https:\/\/jasveermaan.com\/wp-content\/uploads\/2025\/11\/NXC_Samwell.png\" alt=\"\" class=\"wp-image-123\"\/><\/figure>\n\n\n\n<p>Based on the information gathered from Claude, we can also perform an RDP login using the identified credentials. The screenshot below demonstrates a successful login to a target machine as the user Samwell:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1770\" height=\"879\" src=\"https:\/\/jasveermaan.com\/wp-content\/uploads\/2025\/11\/RDP_Samwell.png\" alt=\"\" class=\"wp-image-125\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>PowerView.py + MCP introduces a new way of interacting with common red-team tools.<br>Instead of running commands manually, you can simply speak naturally to an AI assistant and let it handle the enumeration through structured, safe MCP calls.<\/p>\n\n\n\n<p>This setup is still new, and I plan to explore more advanced ideas:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>AI-generated AD attack path mapping<\/li>\n\n\n\n<li>Automating privilege escalation discovery<\/li>\n\n\n\n<li>AI-assisted cleanup after engagements<\/li>\n\n\n\n<li>Integration with BloodHound data<\/li>\n\n\n\n<li>More MCP-enabled red-team tools<\/li>\n<\/ul>\n\n\n\n<p>If you\u2019re experimenting with MCP in red-team workflows, I\u2019d love to hear your experience.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Disclaimer<\/h2>\n\n\n\n<p><strong><em>If you connect PowerView to cloud-hosted AI models, be aware that any query you submit, including directory output, credentials, or enumeration results, may pass through the provider\u2019s infrastructure. Your Active Directory data could be stored, logged, or reviewed depending on the platform\u2019s data handling policies.<\/em><\/strong><\/p>\n\n\n\n<p><strong><em>Use this setup only in non-sensitive, fully authorised lab environments unless you are working with a local or self-hosted model.<\/em><\/strong><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi Readers, In this post, I want to share something interesting I explored recently after a friend recommended that I try PowerView.py with its MCP integration. I\u2019ve been using PowerView.py for Active Directory enumeration in my homelab, and discovering that it has supports the Model Context Protocol (MCP) means you can integrate it directly with &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jasveermaan.com\/index.php\/2025\/11\/29\/ai-driven-ad-enumeration\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;AI-driven AD enumeration&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":17,"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":218,"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/posts\/111\/revisions\/218"}],"wp:attachment":[{"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jasveermaan.com\/index.php\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}