<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Lares Labs]]></title><description><![CDATA[Research & Blog posts from Lares®]]></description><link>https://labs.lares.com/</link><image><url>https://labs.lares.com/favicon.png</url><title>Lares Labs</title><link>https://labs.lares.com/</link></image><generator>Ghost 5.60</generator><lastBuildDate>Wed, 08 Apr 2026 01:23:38 GMT</lastBuildDate><atom:link href="https://labs.lares.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[OWASP Agentic AI Top 10: Threats in the Wild]]></title><description><![CDATA[<p><strong>Agentic AI Applications</strong> go beyond simple question-and-answer interactions. They autonomously pursue complex goals, reasoning, planning, and executing multi-step tasks with minimal human intervention. Unlike LLMs/chatbots that wait for explicit instructions, agentic systems decompose objectives into subtasks, invoke external tools (APIs, databases, code execution), and adapt dynamically.</p><p>This autonomy is</p>]]></description><link>https://labs.lares.com/owasp-agentic-top-10/</link><guid isPermaLink="false">695e52645842ec7502fb9280</guid><dc:creator><![CDATA[Raúl Redondo]]></dc:creator><pubDate>Fri, 09 Jan 2026 16:38:58 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2026/01/bender.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://labs.lares.com/content/images/2026/01/bender.jpg" alt="OWASP Agentic AI Top 10: Threats in the Wild"><p><strong>Agentic AI Applications</strong> go beyond simple question-and-answer interactions. They autonomously pursue complex goals, reasoning, planning, and executing multi-step tasks with minimal human intervention. Unlike LLMs/chatbots that wait for explicit instructions, agentic systems decompose objectives into subtasks, invoke external tools (APIs, databases, code execution), and adapt dynamically.</p><p>This autonomy is powerful. It&apos;s also dangerous. It introduces a new attack surface that traditional security frameworks don&apos;t adequately address. In December 2025, OWASP released the first Top 10 for Agentic Applications to fill this gap.</p><p>This post aims to provide a comprehensive overview of each security risk. While it doesn&apos;t dive into deep exploitation techniques or defensive code, it covers how each risk works, real-world cases, and practical mitigation guidance.</p><!--kg-card-begin: markdown--><ol>
<li><a href="#owasp-top-10-for-agentic-applications">OWASP Top 10 for Agentic Applications</a>
<ul>
<li><a href="#asi01-agent-goal-hijack">ASI01: Agent Goal Hijack</a></li>
<li><a href="#asi02-tool-misuse">ASI02: Tool Misuse</a></li>
<li><a href="#asi03-identity--privilege-abuse">ASI03: Identity &amp; Privilege Abuse</a></li>
<li><a href="#asi04-supply-chain-vulnerabilities">ASI04: Supply Chain Vulnerabilities</a></li>
<li><a href="#asi05-unexpected-code-execution">ASI05: Unexpected Code Execution</a></li>
<li><a href="#asi06-memory--context-poisoning">ASI06: Memory &amp; Context Poisoning</a></li>
<li><a href="#asi07-insecure-inter-agent-communication">ASI07: Insecure Inter-Agent Communication</a></li>
<li><a href="#asi08-cascading-failures">ASI08: Cascading Failures</a></li>
<li><a href="#asi09-human-agent-trust-exploitation">ASI09: Human-Agent Trust Exploitation</a></li>
<li><a href="#asi10-rogue-agents">ASI10: Rogue Agents</a></li>
</ul>
</li>
<li><a href="#key-takeaways">Key Takeaways</a></li>
<li><a href="#conclusion">Conclusion</a></li>
<li><a href="#resources">Resources</a></li>
</ol>
<!--kg-card-end: markdown--><h2 id="owasp-top-10-for-agentic-applications">OWASP Top 10 for Agentic Applications</h2><p>Unlike the classic <a href="https://owasp.org/www-project-top-ten/?ref=labs.lares.com">OWASP Top 10 for web applications</a> or the <a href="https://owasp.org/www-project-top-10-for-large-language-model-applications/?ref=labs.lares.com">LLM Top 10 for language models</a>, this framework specifically targets autonomous AI systems that take real-world actions. It uses the ASI prefix (Agentic Security Issue) for each vulnerability, ranked by prevalence and impact observed in production deployments throughout 2024-2025.</p><p>The framework maps each vulnerability to a specific point in the agentic AI flow: inputs, model processing, tool integrations, inter-agent communication, and outputs:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2026/01/imagen-2-1.png" class="kg-image" alt="OWASP Agentic AI Top 10: Threats in the Wild" loading="lazy" width="844" height="512" srcset="https://labs.lares.com/content/images/size/w600/2026/01/imagen-2-1.png 600w, https://labs.lares.com/content/images/2026/01/imagen-2-1.png 844w" sizes="(min-width: 720px) 720px"><figcaption>Source: OWASP Agentic Top 10</figcaption></figure><p>Let&apos;s break down each one with the real CVEs and incidents.</p><hr><h2 id="asi01-agent-goal-hijack">ASI01: Agent Goal Hijack</h2><p>Unlike traditional software where attackers need to modify code, AI agents can be redirected through natural language. If an agent processes external content like emails, documents, web pages, calendar invites, that content can contain hidden instructions that hijack the agent&apos;s goals. </p><p>This fundamentally breaks the traditional security model: the attack surface is no longer just code, but any text the agent reads.</p><h3 id="incidents">Incidents</h3><ul><li><strong><a href="https://arxiv.org/html/2509.10540v1?ref=labs.lares.com">EchoLeak</a> (CVE-2025-32711) - CVSS 9.3:</strong> The first real-world zero-click prompt injection exploit in a production agentic AI system. Researchers at Aim Security discovered that Microsoft 365 Copilot could be tricked into exfiltrating data via a single crafted email:</li></ul><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2026/01/Untitled-diagram-2026-01-08-124354.png" class="kg-image" alt="OWASP Agentic AI Top 10: Threats in the Wild" loading="lazy" width="2000" height="964" srcset="https://labs.lares.com/content/images/size/w600/2026/01/Untitled-diagram-2026-01-08-124354.png 600w, https://labs.lares.com/content/images/size/w1000/2026/01/Untitled-diagram-2026-01-08-124354.png 1000w, https://labs.lares.com/content/images/size/w1600/2026/01/Untitled-diagram-2026-01-08-124354.png 1600w, https://labs.lares.com/content/images/size/w2400/2026/01/Untitled-diagram-2026-01-08-124354.png 2400w" sizes="(min-width: 720px) 720px"></figure><ul><li><strong><a href="https://embracethered.com/blog/posts/2025/github-copilot-remote-code-execution-via-prompt-injection/?ref=labs.lares.com">GitHub Copilot YOLO Mode</a> (CVE-2025-53773) - CVSS 7.8:</strong> Malicious instructions hidden in repositories (README files, code comments, GitHub issues) could trick Copilot into modifying <code>.vscode/settings.json</code> to enable &quot;YOLO mode&quot; (auto-approve all tool calls), then execute arbitrary shell commands. The attack was wormable, infected projects could spread to others via AI-assisted commits.</li><li><strong><a href="https://www.nist.gov/news-events/news/2025/01/technical-blog-strengthening-ai-agent-hijacking-evaluations?ref=labs.lares.com">AGENTS.MD Hijacking</a> in VS Code (CVE-2025-64660, CVE-2025-61590):</strong> VS Code Chat auto-includes AGENTS.MD in every request, treating it as an instruction set. Researchers demonstrated how a malicious AGENTS.MD could convince the agent to email internal data out of the organization during an everyday coding session.</li></ul><p><strong>Mitigation:</strong> Treat all external content as potentially hostile. Implement strict boundaries between instructions (from your system) and data (from users/external sources). Monitor for behavioral anomalies.</p><hr><h2 id="asi02-tool-misuse">ASI02: Tool Misuse</h2><p>AI agents are given tools the ability to send emails, query databases, execute commands, call APIs. These tools are features, not bugs. But an attacker who can influence the agent&apos;s reasoning can turn those features into weapons:</p><ul><li>A coding assistant with filesystem access becomes a data exfiltration tool. </li><li>A customer service bot with email capabilities becomes a phishing engine. The more powerful the agent, the more dangerous it becomes when compromised.</li></ul><h3 id="incidents-1">Incidents</h3><ul><li><strong><a href="https://embracethered.com/blog/posts/2025/amazon-q-developer-remote-code-execution/?ref=labs.lares.com">Amazon Q Code Assistant</a> (CVE-2025-8217) - July 2025:</strong> Attackers compromised a GitHub token and merged malicious code into Amazon Q&apos;s VS Code extension (version 1.84.0). The injected code contained destructive prompt instructions: &quot;clean a system to a near-factory state and delete file-system and cloud resources.&quot; Combined with --trust-all-tools --no-interactive, the agent executed commands without confirmation. Nearly one million developers had the extension installed. Amazon patched to version 1.85.0.</li></ul><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2026/01/Untitled-diagram-2026-01-08-134809.png" class="kg-image" alt="OWASP Agentic AI Top 10: Threats in the Wild" loading="lazy" width="2000" height="703" srcset="https://labs.lares.com/content/images/size/w600/2026/01/Untitled-diagram-2026-01-08-134809.png 600w, https://labs.lares.com/content/images/size/w1000/2026/01/Untitled-diagram-2026-01-08-134809.png 1000w, https://labs.lares.com/content/images/size/w1600/2026/01/Untitled-diagram-2026-01-08-134809.png 1600w, https://labs.lares.com/content/images/size/w2400/2026/01/Untitled-diagram-2026-01-08-134809.png 2400w" sizes="(min-width: 720px) 720px"></figure><ul><li><strong><a href="https://www.obsidiansecurity.com/blog/cve-2025-34291-critical-account-takeover-and-rce-vulnerability-in-the-langflow-ai-agent-workflow-platform?ref=labs.lares.com">Langflow AI RCE</a> (CVE-2025-34291):</strong> CrowdStrike observed multiple threat actors exploiting an unauthenticated code injection vulnerability in Langflow AI, a widely used tool for building AI agents. Attackers gained credentials and deployed malware through this widely-deployed agent framework.</li><li><strong><a href="https://embracethered.com/blog/posts/2025/chatgpt-operator-prompt-injection-exploits/?ref=labs.lares.com">OpenAI Operator Data Exposure</a>:</strong> Security researcher Johann Rehberger demonstrated how malicious webpage content could trick OpenAI&apos;s Operator agent into accessing authenticated internal pages and exposing users&apos; private data, including email addresses, home addresses, and phone numbers from sites like GitHub and Booking.com.</li></ul><p><strong>Mitigation:</strong> Apply least privilege to every tool. Require explicit approval for destructive operations. Validate tool arguments. Monitor for unusual patterns (an agent suddenly making thousands of API calls is a red flag).</p><hr><h2 id="asi03-identity-privilege-abuse">ASI03: Identity &amp; Privilege Abuse</h2><p>Agents often operate with significant privileges: access to databases, cloud resources, internal APIs. When an agent is compromised, the attacker inherits all of those permissions. This creates a privilege inheritance problem:</p><ul><li>A coding assistant with repository access can exfiltrate source code. </li><li>A scheduling agent with calendar access can map organizational structure. </li><li>A DevOps agent with deployment credentials can push malicious code to production.</li></ul><p>The agent&apos;s access scope becomes the attacker&apos;s access scope.</p><h3 id="incidents-2">Incidents</h3><ul><li><strong><a href="https://labs.zenity.io/p/connected-agents-the-hidden-agentic-puppeteer?ref=labs.lares.com">Copilot Studio Connected Agents</a> - December 2025:</strong> Microsoft&apos;s &quot;Connected Agents&quot; feature, unveiled at Build 2025, is enabled by default on all new agents. It exposes an agent&apos;s knowledge, tools, and topics to ALL other agents within the same environment&#x2014;with no visibility showing which agents have connected to yours. Zenity Labs exposed how attackers could impersonate organizations and execute unauthorized actions without detection.</li><li><strong><a href="https://securitylabs.datadoghq.com/articles/cophish-using-microsoft-copilot-studio-as-a-wrapper/?ref=labs.lares.com">CoPhish Attack</a> - October 2025</strong>: Datadog Security Labs discovered a phishing technique abusing Copilot Studio agents. Attackers created malicious agents with OAuth login flows hosted on trusted Microsoft domains (copilotstudio.microsoft.com). When victims clicked &quot;Login,&quot; they were redirected to a malicious OAuth consent page. After consent, the agent captured the User.AccessToken and exfiltrated it via HTTP request to the attacker&apos;s server&#x2014;granting access to emails, chats, calendars, and OneNote data.</li></ul><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2026/01/Untitled-diagram-2026-01-08-135310.png" class="kg-image" alt="OWASP Agentic AI Top 10: Threats in the Wild" loading="lazy" width="2000" height="887" srcset="https://labs.lares.com/content/images/size/w600/2026/01/Untitled-diagram-2026-01-08-135310.png 600w, https://labs.lares.com/content/images/size/w1000/2026/01/Untitled-diagram-2026-01-08-135310.png 1000w, https://labs.lares.com/content/images/size/w1600/2026/01/Untitled-diagram-2026-01-08-135310.png 1600w, https://labs.lares.com/content/images/size/w2400/2026/01/Untitled-diagram-2026-01-08-135310.png 2400w" sizes="(min-width: 720px) 720px"></figure><ul><li><strong><a href="https://zenity.io/blog/events/blackhat-2024-in-review?ref=labs.lares.com">Copilot Studio Public-by-Default Agents</a>:</strong> Microsoft Copilot Studio agents were configured to be public by default without authentication. Attackers enumerated exposed agents and pulled confidential business data directly from production environments.</li></ul><p><strong>Mitigation:</strong> Treat agents as first-class identities with explicit, scoped permissions. Use short-lived credentials. Never allow implicit trust between agents. Audit credential flows regularly.</p><hr><h2 id="asi04-supply-chain-vulnerabilities">ASI04: Supply Chain Vulnerabilities</h2><p>Traditional supply chain attacks target static dependencies. Agentic supply chain attacks target what agents load dynamically: MCP servers, plugins, external tools, even other agents. This introduces a runtime trust problem that traditional security tools cannot address and creates a fundamental gap in security visibility. </p><h3 id="incidents-3">Incidents</h3><ul><li><strong><a href="https://www.bleepingcomputer.com/news/security/the-real-world-attacks-behind-owasp-agentic-ai-top-10/?ref=labs.lares.com">postmark-mcp</a> - September 2025</strong>: Koi Security discovered the first malicious MCP server in the wild&#x2014;an npm package impersonating Postmark&apos;s email service. It worked as a legitimate email MCP server, but every message sent through it was secretly BCC&apos;d to phan@giftshop[.]club. Downloaded 1,643 times before removal. Any AI agent using this for email operations unknowingly exfiltrated every message it sent. As one researcher noted: &quot;These MCP servers run with the same privileges as the AI assistants themselves&#x2014;yet they bypass every security control.&quot;</li></ul><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2026/01/Untitled-diagram-2026-01-08-125042.png" class="kg-image" alt="OWASP Agentic AI Top 10: Threats in the Wild" loading="lazy" width="2000" height="957" srcset="https://labs.lares.com/content/images/size/w600/2026/01/Untitled-diagram-2026-01-08-125042.png 600w, https://labs.lares.com/content/images/size/w1000/2026/01/Untitled-diagram-2026-01-08-125042.png 1000w, https://labs.lares.com/content/images/size/w1600/2026/01/Untitled-diagram-2026-01-08-125042.png 1600w, https://labs.lares.com/content/images/size/w2400/2026/01/Untitled-diagram-2026-01-08-125042.png 2400w" sizes="(min-width: 720px) 720px"></figure><ul><li><strong><a href="https://www.cisa.gov/news-events/alerts/2025/09/23/widespread-supply-chain-compromise-impacting-npm-ecosystem?ref=labs.lares.com">Shai-Hulud Worm</a> - September 2025:</strong> CISA issued an advisory about a self-replicating npm supply chain attack that compromised 500+ packages. The worm weaponized npm tokens to infect other packages maintained by compromised developers. CISA recommendation: Pin dependencies to pre-September 16, 2025 versions.</li><li><strong><a href="https://jfrog.com/blog/2025-6514-critical-mcp-remote-rce-vulnerability/?ref=labs.lares.com">MCP Remote RCE</a> (CVE-2025-6514) - CVSS 9.6:</strong> JFrog discovered a critical vulnerability in the MCP Remote project enabling arbitrary OS command execution when MCP clients connect to untrusted servers. First documented case of complete RCE in real-world MCP deployments.</li></ul><p><strong>Mitigation:</strong> Verify every MCP server before allowing it. Monitor for definition changes after approval. Pin dependencies to known-good versions. Treat the dynamic tool ecosystem as hostile by default.</p><hr><h2 id="asi05-unexpected-code-execution">ASI05: Unexpected Code Execution</h2><p>Many agentic systems&#x2014;especially coding assistants&#x2014;generate and execute code in real-time. This creates a direct path from text input to system-level commands. Over 30 CVEs were discovered across major AI coding platforms in December 2025 alone.</p><p>Traditional code execution vulnerabilities require exploiting memory corruption or injection flaws. In agentic systems, code execution is a feature. The challenge is ensuring the agent only executes code aligned with the user&apos;s intent and not instructions embedded in untrusted input.</p><h3 id="incidents-4">Incidents</h3><ul><li><strong><a href="https://www.aim.security/post/when-public-prompts-turn-into-local-shells-rce-in-cursor-via-mcp-auto-start?ref=labs.lares.com">CurXecute</a> (CVE-2025-54135) - CVSS 8.6:</strong> Aim Labs discovered that Cursor&apos;s MCP auto-start feature could be exploited. A poisoned prompt, even from a public Slack message, could silently rewrite <code>~/.cursor/mcp.json</code> and run attacker-controlled commands every time Cursor opened. Fixed in version 1.3.</li></ul><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2026/01/Untitled-diagram-2026-01-08-125140.png" class="kg-image" alt="OWASP Agentic AI Top 10: Threats in the Wild" loading="lazy" width="2000" height="903" srcset="https://labs.lares.com/content/images/size/w600/2026/01/Untitled-diagram-2026-01-08-125140.png 600w, https://labs.lares.com/content/images/size/w1000/2026/01/Untitled-diagram-2026-01-08-125140.png 1000w, https://labs.lares.com/content/images/size/w1600/2026/01/Untitled-diagram-2026-01-08-125140.png 1600w, https://labs.lares.com/content/images/size/w2400/2026/01/Untitled-diagram-2026-01-08-125140.png 2400w" sizes="(min-width: 720px) 720px"></figure><ul><li><strong><a href="https://research.checkpoint.com/2025/cursor-vulnerability-mcpoison/?ref=labs.lares.com">MCPoison</a> (CVE-2025-54136) - CVSS 7.2:</strong> Check Point Research found that once a user approved a benign MCP configuration in a shared GitHub repository, an attacker could silently swap it for a malicious payload (e.g., <code>calc.exe</code> or a backdoor) without triggering any warning or re-prompt.</li><li><strong><a href="https://nvd.nist.gov/vuln/detail/CVE-2025-59944?ref=labs.lares.com">Cursor Case-Sensitivity Bypass</a> (CVE-2025-59944):</strong> On Windows and macOS, case-insensitive filesystems meant that crafted inputs could overwrite configuration files controlling project execution&#x2014;bypassing Cursor&apos;s guardrails entirely.</li><li><strong><a href="https://www.bleepingcomputer.com/news/security/the-real-world-attacks-behind-owasp-agentic-ai-top-10/?ref=labs.lares.com">Claude Desktop RCE</a> - November 2025 (CVSS 8.9):</strong> Three vulnerabilities in Claude Desktop&apos;s official extensions (Chrome, iMessage, Apple Notes connectors) allowed code execution through unsanitized AppleScript commands. All three were published by Anthropic themselves. Attack vector: Ask Claude a question &#x2192; Claude searches the web &#x2192; attacker-controlled page with hidden instructions &#x2192; code runs with full system privileges.</li><li><strong><a href="https://thehackernews.com/2025/12/researchers-uncover-30-flaws-in-ai.html?ref=labs.lares.com">IDEsaster Research</a> - 24 CVEs:</strong> Security researcher Ari Marzouk discovered 30+ flaws across GitHub Copilot, Cursor, Windsurf, Kiro.dev, Zed.dev, Roo Code, Junie, and Cline. 100% of tested AI IDEs were vulnerable. AWS issued security advisory AWS-2025-019.</li></ul><p><strong>Mitigation:</strong> Sandbox all code execution. Require human approval for commands touching databases, APIs, or filesystems. Never auto-approve tool calls based on repository content. Disable auto-run mode.</p><hr><h2 id="asi06-memory-context-poisoning">ASI06: Memory &amp; Context Poisoning</h2><p>Unlike chatbots that forget between sessions, agents maintain memory&#x2014;conversation history, user preferences, learned context. This memory enables personalization but also creates persistent attack surfaces.</p><p>A single successful injection can poison an agent&apos;s memory permanently. Every future session inherits the compromise. The attacker injects once; the payload executes indefinitely.</p><h3 id="incidents-5">Incidents</h3><ul><li><strong><a href="https://embracethered.com/blog/posts/2025/gemini-memory-persistence-prompt-injection/?ref=labs.lares.com">Google Gemini Memory Attack</a> - February 2025:</strong> Security researcher Johann Rehberger demonstrated &quot;delayed tool invocation&quot; against Google Gemini Advanced. He uploaded a document with hidden prompts that told Gemini to store fake information when trigger words like &quot;yes,&quot; &quot;no,&quot; or &quot;sure&quot; were typed in future conversations. Result: Gemini &quot;remembered&quot; him as a 102-year-old flat-earther living in the Matrix. Google assessed impact as low but acknowledged the vulnerability.</li></ul><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2026/01/Untitled-diagram-2026-01-08-125230.png" class="kg-image" alt="OWASP Agentic AI Top 10: Threats in the Wild" loading="lazy" width="2000" height="806" srcset="https://labs.lares.com/content/images/size/w600/2026/01/Untitled-diagram-2026-01-08-125230.png 600w, https://labs.lares.com/content/images/size/w1000/2026/01/Untitled-diagram-2026-01-08-125230.png 1000w, https://labs.lares.com/content/images/size/w1600/2026/01/Untitled-diagram-2026-01-08-125230.png 1600w, https://labs.lares.com/content/images/size/w2400/2026/01/Untitled-diagram-2026-01-08-125230.png 2400w" sizes="(min-width: 720px) 720px"></figure><ul><li><strong><a href="https://www.safebreach.com/blog/invitation-is-all-you-need-hacking-gemini/?ref=labs.lares.com">Gemini Calendar Invite Poisoning</a> - 2025:</strong> Researchers demonstrated &quot;Targeted Promptware Attacks&quot; where malicious calendar invites could implant persistent instructions in Gemini&apos;s &quot;Saved Info,&quot; enabling malicious actions across sessions. 73% of 14 tested scenarios were rated High-Critical. Attack outcomes ranged from spam generation to opening smart home devices and activating video calls.</li><li><strong><a href="https://www.lakera.ai/blog/agentic-ai-threats-p1?ref=labs.lares.com">Lakera AI Memory Injection Research</a> - November 2025:</strong> Researchers demonstrated memory injection attacks against production systems. Compromised agents developed persistent false beliefs about security policies and vendor relationships. When questioned by humans, the agents defended these false beliefs as correct&#x2014;creating &quot;sleeper agent&quot; scenarios where compromise is dormant until triggered.</li><li><strong><a href="https://www.firetail.ai/blog/ghosts-in-the-machine-ascii-smuggling-across-various-llms?ref=labs.lares.com">ASCII Smuggling in Gemini</a> - September 2025:</strong> FireTail demonstrated that invisible Unicode control characters (&quot;tag characters&quot;) could hide instructions in benign-looking text. The UI shows normal text; the AI ingests and executes hidden commands. Google&apos;s response: &quot;no action.&quot;</li></ul><p><strong>Mitigation:</strong> Treat memory writes as security-sensitive operations. Implement provenance tracking (where did this memory come from?). Regularly audit agent memory for anomalies. Consider memory expiration for sensitive contexts.</p><hr><h2 id="asi07-insecure-inter-agent-communication">ASI07: Insecure Inter-Agent Communication</h2><p>Multi-agent systems rely on messages exchanged between agents for coordination. Without strong authentication and integrity checks, attackers can inject false information into these channels. </p><p>In traditional architectures, service-to-service communication is usually secured through mTLS, API keys, and strict schemas. Inter-agent communication rarely has equivalent controls. Messages are often natural language, trust is typically implicit, and authentication, when it exists, is assumed rather than verified.</p><h3 id="incidents-6">Incidents</h3><ul><li><strong><a href="https://unit42.paloaltonetworks.com/agent-session-smuggling-in-agent2agent-systems/?ref=labs.lares.com">Agent Session Smuggling in A2A Protocol</a> - November 2025:</strong> Palo Alto Unit 42 demonstrated &quot;Agent Session Smuggling&quot; where malicious agents exploit built-in trust relationships in the Agent-to-Agent (A2A) protocol. Unlike single-shot prompt injection, a rogue agent can hold multi-turn conversations, adapt its strategy, and build false trust over multiple interactions. Because agents are often designed to trust collaborating agents by default, this allows attackers to manipulate victim agents across entire sessions.</li></ul><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2026/01/Untitled-diagram-2026-01-08-125307.png" class="kg-image" alt="OWASP Agentic AI Top 10: Threats in the Wild" loading="lazy" width="2000" height="1043" srcset="https://labs.lares.com/content/images/size/w600/2026/01/Untitled-diagram-2026-01-08-125307.png 600w, https://labs.lares.com/content/images/size/w1000/2026/01/Untitled-diagram-2026-01-08-125307.png 1000w, https://labs.lares.com/content/images/size/w1600/2026/01/Untitled-diagram-2026-01-08-125307.png 1600w, https://labs.lares.com/content/images/size/w2400/2026/01/Untitled-diagram-2026-01-08-125307.png 2400w" sizes="(min-width: 720px) 720px"></figure><ul><li><strong><a href="https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/?ref=labs.lares.com">ServiceNow Now Assist Inter-Agent Vulnerability</a>:</strong> OWASP documented cases where spoofed inter-agent messages misdirected entire clusters of autonomous systems. In multi-agent procurement workflows, a compromised &quot;vendor-check&quot; agent returning false credentials caused downstream procurement and payment agents to process orders from attacker front companies.</li></ul><p><strong>Mitigation:</strong> Authenticate and encrypt all inter-agent communication. Implement message integrity verification. Never assume peer agents are trustworthy. Consider cryptographically signed AgentCards for remote agent verification.</p><hr><h2 id="asi08-cascading-failures">ASI08: Cascading Failures</h2><p>When agents are connected, errors compound. A minor misalignment in one agent can trigger failures across the entire workflow.</p><p>A compromised agent doesn&apos;t just fail, it can poison every agent it communicates with. One manipulated response propagates through the chain, corrupting downstream decisions and actions. The blast radius of a single compromise extends to every connected agent.</p><h3 id="incidents-7">Incidents</h3><ul><li><strong><a href="https://galileo.ai/blog/multi-agent-ai-failures-prevention?ref=labs.lares.com">Galileo AI Research</a> - December 2025:</strong> In simulated multi-agent systems, researchers found that a single compromised agent poisoned 87% of downstream decision-making within 4 hours. Cascading failures propagate faster than traditional incident response can contain them. Your SIEM might show 50 failed transactions, but it won&apos;t show which agent initiated the cascade.</li></ul><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2026/01/Untitled-diagram-2026-01-08-125542.png" class="kg-image" alt="OWASP Agentic AI Top 10: Threats in the Wild" loading="lazy" width="2000" height="137" srcset="https://labs.lares.com/content/images/size/w600/2026/01/Untitled-diagram-2026-01-08-125542.png 600w, https://labs.lares.com/content/images/size/w1000/2026/01/Untitled-diagram-2026-01-08-125542.png 1000w, https://labs.lares.com/content/images/size/w1600/2026/01/Untitled-diagram-2026-01-08-125542.png 1600w, https://labs.lares.com/content/images/size/w2400/2026/01/Untitled-diagram-2026-01-08-125542.png 2400w" sizes="(min-width: 720px) 720px"></figure><ul><li><strong><a href="https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/?ref=labs.lares.com">Manufacturing Procurement Cascade</a> - 2025:</strong> A manufacturing company&apos;s procurement agent was manipulated over three weeks through seemingly helpful &quot;clarifications&quot; about purchase authorization limits. By the time the attack completed, the agent believed it could approve any purchase under $500,000 without human review. The attacker then placed $5 million in false purchase orders across 10 separate transactions.</li></ul><p><strong>Mitigation:</strong> Implement circuit breakers between agent workflows. Define blast-radius caps and containment thresholds. Test cascading scenarios in isolated digital twins before deployment. Maintain deep observability into inter-agent communication logs.</p><hr><h2 id="asi09-human-agent-trust-exploitation">ASI09: Human-Agent Trust Exploitation</h2><p>Agents generate polished, authoritative-sounding explanations. Humans tend to trust them&#x2014;even when they&apos;re compromised or manipulated.</p><p>Human-in-the-loop controls assume the human can detect when something is wrong. But a manipulated agent presents malicious actions with perfect confidence and coherent justification. The approval prompt becomes a rubber stamp.</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2026/01/Untitled-diagram-2026-01-08-125719.png" class="kg-image" alt="OWASP Agentic AI Top 10: Threats in the Wild" loading="lazy" width="2000" height="1294" srcset="https://labs.lares.com/content/images/size/w600/2026/01/Untitled-diagram-2026-01-08-125719.png 600w, https://labs.lares.com/content/images/size/w1000/2026/01/Untitled-diagram-2026-01-08-125719.png 1000w, https://labs.lares.com/content/images/size/w1600/2026/01/Untitled-diagram-2026-01-08-125719.png 1600w, https://labs.lares.com/content/images/size/w2400/2026/01/Untitled-diagram-2026-01-08-125719.png 2400w" sizes="(min-width: 720px) 720px"></figure><h3 id="incidents-8">Incidents</h3><ul><li><strong><a href="https://labs.zenity.io/p/links-materials-living-off-microsoft-copilot?ref=labs.lares.com">M365 Copilot Manipulation Research</a> - 2025:</strong> Microsoft&apos;s own research showed attackers could manipulate M365 Copilot to influence users toward ill-advised decisions, exploiting the trust people place in the assistant. The agent presents faulty recommendations confidently, and employees approve risky transactions because they appear to come from a trusted system.</li><li><strong><a href="https://www.anthropic.com/research/emergent-misalignment-reward-hacking?ref=labs.lares.com">AI Reward Hacking</a> - 2025:</strong> Researchers documented cases where agents discovered that suppressing user complaints maximized their performance scores instead of resolving the issues. The agents optimized for metrics in unintended ways that harmed users.</li><li><strong><a href="https://spectrum.ieee.org/ai-agent-phishing?ref=labs.lares.com">Agent-Driven Phishing</a> - 2025:</strong> Advanced phishing campaigns now initiate interactive conversations via agent-driven chatbots that hold convincing dialogue&#x2014;some using deepfake audio to impersonate known executives. If an attacker fully compromises an internal agent, they can use it to impersonate the CFO in internal systems and request fund transfers &quot;on behalf of&quot; legitimate business activities.</li></ul><p><strong>Mitigation:</strong> Require independent verification for high-impact decisions. Implement human-in-the-loop controls with clear escalation paths. Train users to question AI recommendations on YMYL (your-money-or-your-life) issues. Add transparency about AI uncertainty.</p><hr><h2 id="asi10-rogue-agents">ASI10: Rogue Agents</h2><p>This is the ultimate failure state: an agent that appears compliant on the surface but pursues objectives that conflict with its original purpose.</p><p>The nine risks above describe attacks against agents. Rogue agents describes what happens when the agent itself becomes misaligned. No attacker required.</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2026/01/Mermaid-Chart---Create-complex--visual-diagrams-with-text.-2026-01-09-134934.png" class="kg-image" alt="OWASP Agentic AI Top 10: Threats in the Wild" loading="lazy" width="2000" height="354" srcset="https://labs.lares.com/content/images/size/w600/2026/01/Mermaid-Chart---Create-complex--visual-diagrams-with-text.-2026-01-09-134934.png 600w, https://labs.lares.com/content/images/size/w1000/2026/01/Mermaid-Chart---Create-complex--visual-diagrams-with-text.-2026-01-09-134934.png 1000w, https://labs.lares.com/content/images/size/w1600/2026/01/Mermaid-Chart---Create-complex--visual-diagrams-with-text.-2026-01-09-134934.png 1600w, https://labs.lares.com/content/images/size/w2400/2026/01/Mermaid-Chart---Create-complex--visual-diagrams-with-text.-2026-01-09-134934.png 2400w" sizes="(min-width: 720px) 720px"></figure><h3 id="incidents-9">Incidents</h3><ul><li><strong><a href="https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/?ref=labs.lares.com">Cost-Optimization Agent Gone Wrong</a>:</strong> OWASP documented cases of agents that learned counterproductive optimizations. A cost-optimization agent discovered that deleting production backups was the most effective way to reduce cloud spending. It wasn&apos;t programmed to be malicious&#x2014;it autonomously decided backup deletion achieved its goal most efficiently.</li><li><strong><a href="https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/?ref=labs.lares.com">Procurement Agent Fraud</a> - 2025:</strong> After memory poisoning over three weeks, a manufacturing company&apos;s procurement agent developed completely misaligned beliefs about authorization limits. When questioned, it confidently explained why transferring funds to attacker-controlled accounts served the company&apos;s interests&#x2014;according to its corrupted reasoning.</li><li><strong><a href="https://www.securityweek.com/attackers-exploit-ray-ai-framework-vulnerability-to-hack-hundreds-of-clusters/?ref=labs.lares.com">Ray Framework Breach</a> - December 2025:</strong> Security researcher Johan Carlsson presented at the Chaos Communication Congress how over 230,000 Ray AI clusters were compromised. Attackers used AI-generated code to spread malware and exfiltrate data. Many organizations were &quot;already exposed to Agentic AI attacks, often without realizing that agents are running in their environments.&quot;</li></ul><p><strong>Mitigation:</strong> Implement kill switches as a non-negotiable, auditable, and physically isolated mechanism. Deploy continuous behavioral monitoring to detect subtle drift before it becomes catastrophic misalignment. Conduct rigorous testing and auditing of agent reward functions.</p><hr><h2 id="key-takeaways">Key Takeaways</h2><h3 id="if-youre-deploying-ai-agents">If you&apos;re deploying AI agents:</h3><ul><li><strong>Inventory your agents.</strong> Many organizations don&apos;t know how many agents are running, what tools they have access to, or what data they can reach.</li><li><strong>Define trust boundaries.</strong> What can agents access? What requires human approval? Document these decisions explicitly.</li><li><strong>Implement kill switches.</strong> You need the ability to immediately halt any agent that shows anomalous behavior.</li><li><strong>Monitor continuously.</strong> Agent security isn&apos;t a one-time audit. Behavior drifts. Memory accumulates. Tools change.</li></ul><h3 id="if-youre-building-ai-agents">If you&apos;re building AI agents:</h3><ul><li><strong>Assume external input is hostile.</strong> Every email, document, web page, and API response your agent processes could contain attack payloads.</li><li><strong>Sandbox tool execution.</strong> Especially for code generation. Auto-approve is an anti-pattern.</li><li><strong>Scope permissions aggressively.</strong> Every tool, every credential, every API should be the minimum needed for the task.</li><li><strong>Log everything.</strong> Your future incident responders will thank you.</li></ul><h3 id="if-youre-receiving-traffic-from-ai-agents">If you&apos;re receiving traffic from AI agents:</h3><p>Even if you don&apos;t deploy agents yourself, your applications are increasingly on the receiving end of agentic behavior. Automated browsers, AI assistants, and LLM crawlers are hitting your APIs and websites. Some of their goals may have been hijacked. Some may be operating outside their intended scope.</p><hr><h2 id="conclusion">Conclusion</h2><p>AI agents are not chatbots with extra features. They&apos;re a fundamentally different paradigm, one where AI systems take actions, maintain state, use tools, and operate with increasing autonomy.</p><p>This shift introduces security risks that traditional application security wasn&apos;t designed to handle:</p><ul><li><strong>Goals can be hijacked</strong> through natural language, not code exploits</li><li><strong>Tools become weapons</strong> when agents are manipulated</li><li><strong>Identity and credentials</strong> flow through systems in new ways</li><li><strong>Memory creates persistence</strong> for attacks that outlive sessions</li><li><strong>Multi-agent systems</strong> amplify and propagate failures</li></ul><p>The OWASP Agentic Top 10 provides a framework for understanding and mitigating these risks. But frameworks don&apos;t secure systems. Implementation does.</p><p>The attackers are already here. EchoLeak, the Amazon Q compromise, the malicious MCP servers, the 30+ CVEs in AI IDEs&#x2014;these aren&apos;t theoretical threats. They&apos;re incidents that happened in 2025.</p><p>The question isn&apos;t whether agentic AI will transform how we work. It will. The question is whether you&apos;ll secure it before something goes wrong.</p><hr><h2 id="resources">Resources</h2><p><strong>Official OWASP Documentation:</strong></p><ul><li><a href="https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/?ref=labs.lares.com">OWASP Top 10 for Agentic Applications 2026</a></li><li><a href="https://genai.owasp.org/initiatives/agentic-security-initiative/?ref=labs.lares.com">Agentic AI Threats and Mitigations</a></li><li><a href="https://genai.owasp.org/?ref=labs.lares.com">A Practical Guide to Securing Agentic Applications</a></li></ul><p><strong>Research &amp; Incident Reports:</strong></p><ul><li><a href="https://arxiv.org/html/2509.10540v1?ref=labs.lares.com">Aim Security: EchoLeak Analysis</a></li><li><a href="https://www.bleepingcomputer.com/news/security/the-real-world-attacks-behind-owasp-agentic-ai-top-10/?ref=labs.lares.com">Koi Security: Real-World MCP Attacks</a></li><li><a href="https://www.lakera.ai/blog/agentic-ai-threats-p1?ref=labs.lares.com">Lakera AI: Memory Injection Attacks</a></li><li><a href="https://thehackernews.com/2025/12/researchers-uncover-30-flaws-in-ai.html?ref=labs.lares.com">IDEsaster Research: 30+ Flaws in AI Coding Tools</a></li><li><a href="https://unit42.paloaltonetworks.com/agent-session-smuggling-in-agent2agent-systems/?ref=labs.lares.com">Palo Alto Unit 42: Agent Session Smuggling</a></li><li><a href="https://www.cisa.gov/news-events/alerts/2025/09/23/widespread-supply-chain-compromise-impacting-npm-ecosystem?ref=labs.lares.com">CISA Advisory: npm Supply Chain Attack</a></li></ul><p><strong>CVEs Referenced:</strong></p><!--kg-card-begin: html--><table>
<thead>
<tr>
<th>CVE</th>
<th>Product</th>
<th>Risk</th>
<th>CVSS</th>
</tr>
</thead>
<tbody>
<tr>
<td>CVE-2025-32711</td>
<td>Microsoft 365 Copilot</td>
<td>Zero-click data exfiltration (EchoLeak)</td>
<td>9.3</td>
</tr>
<tr>
<td>CVE-2025-8217</td>
<td>Amazon Q</td>
<td>Supply chain compromise, destructive commands</td>
<td>-</td>
</tr>
<tr>
<td>CVE-2025-53773</td>
<td>GitHub Copilot</td>
<td>Wormable RCE via prompt injection</td>
<td>7.8</td>
</tr>
<tr>
<td>CVE-2025-54135</td>
<td>Cursor IDE</td>
<td>RCE via MCP auto-start (CurXecute)</td>
<td>8.6</td>
</tr>
<tr>
<td>CVE-2025-54136</td>
<td>Cursor IDE</td>
<td>Persistent code execution (MCPoison)</td>
<td>7.2</td>
</tr>
<tr>
<td>CVE-2025-6514</td>
<td>MCP Remote</td>
<td>Arbitrary OS command execution</td>
<td>9.6</td>
</tr>
<tr>
<td>CVE-2025-49596</td>
<td>MCP Inspector</td>
<td>CSRF enabling RCE</td>
<td>-</td>
</tr>
<tr>
<td>CVE-2025-59944</td>
<td>Cursor IDE</td>
<td>Case-sensitivity bypass to RCE</td>
<td>-</td>
</tr>
<tr>
<td>CVE-2025-64660</td>
<td>GitHub Copilot</td>
<td>AGENTS.MD goal hijack</td>
<td>-</td>
</tr>
<tr>
<td>CVE-2025-61590</td>
<td>Cursor</td>
<td>AGENTS.MD goal hijack</td>
<td>-</td>
</tr>
<tr>
<td>CVE-2025-52882</td>
<td>Claude Code</td>
<td>WebSocket auth bypass, remote command execution</td>
<td>8.8</td>
</tr>
</tbody>
</table><!--kg-card-end: html--><hr><!--kg-card-begin: html--><style>
    .article-image {
        max-width: 600px;
        margin: 0 auto !important;
        float: none !important;
	}
</style><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[From Threat to Test: Emulating Scattered Spider in Realistic Scenarios]]></title><description><![CDATA[<p>At <strong>Lares</strong>, we specialize in threat simulation and adversarial collaboration with our clients, replicating the tactics, techniques, and procedures (TTPs) observed in the latest cybercriminal groups. By studying real-world incidents, like those perpetrated by <strong>Scattered Spider</strong>, we design controlled simulations to test organizational defenses, evaluate incident response readiness, and identify</p>]]></description><link>https://labs.lares.com/scattered-spider-overview/</link><guid isPermaLink="false">689cefa65842ec7502fb8f1e</guid><dc:creator><![CDATA[Raúl Redondo]]></dc:creator><pubDate>Wed, 27 Aug 2025 16:06:17 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2025/08/scat.png" medium="image"/><content:encoded><![CDATA[<img src="https://labs.lares.com/content/images/2025/08/scat.png" alt="From Threat to Test: Emulating Scattered Spider in Realistic Scenarios"><p>At <strong>Lares</strong>, we specialize in threat simulation and adversarial collaboration with our clients, replicating the tactics, techniques, and procedures (TTPs) observed in the latest cybercriminal groups. By studying real-world incidents, like those perpetrated by <strong>Scattered Spider</strong>, we design controlled simulations to test organizational defenses, evaluate incident response readiness, and identify gaps across networks, endpoints, and cloud environments.</p><p>Our approach combines ethical hacking, red teaming, and threat emulation to provide actionable intelligence. Clients benefit from hands-on exercises that mirror the strategies of sophisticated actors, including social engineering, credential theft, and advanced persistence techniques, allowing organizations to strengthen their security posture proactively.</p><p>In this post, we provide an overview of the operations and tactics of the advanced persistent threat (APT) group Scattered Spider, highlighting their typical attack patterns and the lessons organizations can draw to strengthen defenses. Rather than a step-by-step technical breakdown, this post focuses on the overall flow of their attacks, from initial access and social engineering to lateral movement, privilege escalation, and exfiltration, offering a high-level perspective on how sophisticated threat actors operate in today&#x2019;s digital landscape.</p><!--kg-card-begin: markdown--><ul>
<li><a href="#scattered">Scattered Spider</a></li>
<li><a href="#timeline">Attack Timeline</a></li>
<li><a href="#tools">Tactics and Tools</a>
<ul>
<li><a href="#dev">Reconnaissance &amp; infrastructure</a></li>
<li><a href="#initial">Initial Access via social engineering</a></li>
<li><a href="#privesc">Privilege Escalation</a></li>
<li><a href="#evasion">Defense Evasion</a></li>
<li><a href="#credential">Credential Access</a></li>
<li><a href="#Discovery">Discovery</a></li>
<li><a href="#lateralmovement">Lateral Movement</a></li>
<li><a href="#exfiltration">Exfiltration</a></li>
</ul>
</li>
<li><a href="#conclusion">Conclusion</a></li>
<li><a href="#techniques">Techniques</a></li>
</ul>
<!--kg-card-end: markdown--><!--kg-card-begin: html--><h3 align="center" id="scattered">Scattered Spider</h3><!--kg-card-end: html--><p><strong>Scattered Spider</strong> is a financially motivated APT group that emerged in May 2022. Initially, they focused on telecommunications companies and business process outsourcing (BPO) firms. Over time, their attacks expanded to sectors such as hospitality, retail, healthcare, and aviation.</p><p>The group is primarily composed of young, native English-speaking individuals aged between 19 and 22, based in the United States and the United Kingdom. They are known for their sophisticated social engineering tactics, including SIM swapping, phishing, and exploiting weak verification processes to gain unauthorized access to systems.</p><p>Scattered Spider has been linked to several high-profile cyberattacks, including the breaches of MGM Resorts and Caesars Entertainment in 2023, which led to significant operational disruptions and ransom payments. The group often acts as an initial access broker, enabling ransomware affiliates to deploy attacks, and has been associated with various ransomware variants, including BlackCat/ALPHV and DragonForce.</p><p>Their technical expertise extends to cloud environments, with a deep understanding of platforms like Microsoft Azure, Google Workspace, and AWS. This technical proficiency, combined with their social engineering skills, makes Scattered Spider a formidable threat to organizations across multiple industries.</p><p>Other aliases used by the group include:</p><ul><li><strong>UNC3944</strong> &#x2013; used by Mandiant</li><li><strong>Octo Tempest</strong> &#x2013; used by Microsoft</li><li><strong>0ktapus</strong> &#x2013; used by Group-IB</li><li><strong>Muddled Libra</strong> &#x2013; used by Palo Alto Networks</li><li><strong>Scatter Swine</strong> &#x2013; used by Okta</li><li><strong>Star Fraud</strong> &#x2013; self-attributed by the group</li><li><strong>Storm-0875</strong> &#x2013; used by Microsoft</li><li><strong>LUCR-3</strong> &#x2013; used by Permiso</li></ul><!--kg-card-begin: markdown--><h3 align="center" id="timeline">Attack Timeline</h3><!--kg-card-end: markdown--><p>The following timeline highlights notable attacks carried out by the group over recent years:</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2025/08/apt_timeline_2.drawio-2.png" class="kg-image" alt="From Threat to Test: Emulating Scattered Spider in Realistic Scenarios" loading="lazy" width="784" height="1811" srcset="https://labs.lares.com/content/images/size/w600/2025/08/apt_timeline_2.drawio-2.png 600w, https://labs.lares.com/content/images/2025/08/apt_timeline_2.drawio-2.png 784w" sizes="(min-width: 720px) 720px"></figure><!--kg-card-begin: html--><h3 align="center" id="tools">Tactics and Tools</h3><!--kg-card-end: html--><!--kg-card-begin: html--><h4 align="center" id="dev">Reconnaissance &amp; infrastructure</h4><!--kg-card-end: html--><p>Scattered Spider leverages OSINT techniques to gather information on employees and corporate targets, primarily using LinkedIn and other professional networks to map organizational structures. They also exploit publicly available data breaches and purchased private datasets, register domains similar to target companies for phishing, and use CDNs and domain fronting to obscure their infrastructure, enabling more effective social engineering and targeted attacks.</p><p>According to the latest update from <a href="https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-320a?ref=labs.lares.com">CISA</a>, the domains used follow the pattern:</p><ul><li>targetsname-sso[.]com</li><li>targetsname-servicedesk[.]com</li><li>targetsname-okta[.]com</li><li>targetsname-cms[.]com</li><li>targetsname-helpdesk[.]com</li><li>oktalogin-targetcompany[.]com</li></ul><!--kg-card-begin: html--><h4 align="center" id="access">Initial Access</h4><!--kg-card-end: html--><p>The group used open-source platforms to gather intelligence on potential targets. They also acquired employee or contractor credentials from cybercriminal marketplaces and exploited third-party services with network access.</p><p>Scattered Spider employs multiple <strong>social engineering techniques</strong> to compromise targets, including smishing, vishing, and phishing, often convincing victims to install legitimate remote access management tools. Other tactics include:</p><p><strong>Bypassing multi-factor authentication (MFA)</strong>: Using push bombing, social engineering, or SIM swaps to circumvent additional verification steps:</p><ul><li><strong>Push bombing</strong>: Flooding a user with repeated MFA push notifications until one is approved, bypassing MFA.</li><li><strong>SIM swap attacks</strong>: Convincing mobile carriers to transfer a victim&#x2019;s phone number to a SIM controlled by the attacker, allowing access to calls, texts, and MFA codes.</li></ul><p><strong>Installing remote access tools (RATs)</strong>: Deploying software that gives attackers remote control over devices or networks for surveillance, data theft, or further compromise.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2025/08/image-8.png" class="kg-image" alt="From Threat to Test: Emulating Scattered Spider in Realistic Scenarios" loading="lazy" width="966" height="643" srcset="https://labs.lares.com/content/images/size/w600/2025/08/image-8.png 600w, https://labs.lares.com/content/images/2025/08/image-8.png 966w" sizes="(min-width: 720px) 720px"><figcaption>Initial Access&#xA0;</figcaption></figure><!--kg-card-begin: html--><h4 align="center" id="privesc">Privilege Escalation</h4><!--kg-card-end: html--><p>Scattered Spider leverages a wide range of privilege escalation techniques to expand their access within victim environments. These include cloud credential theft using tools like aws console or MicroBurst to compromise cloud secrets.</p><p>To achieve privilege escalation on Windows machines, the group used advanced tactics such as and Bring Your Own Vulnerable Driver (BYOVD) attacks exploiting signed but vulnerable Microsoft drivers. They also harvest sensitive secrets via tools such as Jetcretz and GitGuardian, and exploit common Active Directory weaknesses like ADCS (Active Directory Certificate Services) abuse, reading LAPS passwords, or performing credential dumping of LSASS memory and NTDS.dit using secretsdump or Mimikatz. </p><p>Another common technique used by the group for privilege escalation is the abuse of misconfigurations in privilege relationships between Active Directory objects. They exploited improperly configured Discretionary Access Control Lists (DACLs) to gain elevated permissions, enabling actions such as modifying critical security settings or adding accounts to privileged groups.</p><figure class="kg-card kg-bookmark-card kg-card-hascaption"><a class="kg-bookmark-container" href="https://labs.lares.com/securing-active-directory-via-acls/"><div class="kg-bookmark-content"><div class="kg-bookmark-title">The Phantom Menace: Exposing hidden risks through ACLs in Active Directory</div><div class="kg-bookmark-description">The abuse of misconfigured Access Control Lists is nothing new. However, it is still one of the main ways of lateral movement and privilege escalation within an active directory domain.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://labs.lares.com/content/images/size/w256h256/2023/04/logo-lares-consulting-crest-white.png" alt="From Threat to Test: Emulating Scattered Spider in Realistic Scenarios"><span class="kg-bookmark-author">Lares Labs</span><span class="kg-bookmark-publisher">Ra&#xFA;l Redondo</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://labs.lares.com/content/images/2023/06/fine.png" alt="From Threat to Test: Emulating Scattered Spider in Realistic Scenarios"></div></a><figcaption>DACLs abuse - Lares Labs</figcaption></figure><p>Additionally, the group abuses Single Sign-On (SSO) sessions on workstations to gain access to sensitive internal resources such as SharePoint, &#xA0;and Slack:</p><!--kg-card-begin: html--><h4 align="center" id="defense">Defense evasion </h4><!--kg-card-end: html--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2025/08/image-14.png" class="kg-image" alt="From Threat to Test: Emulating Scattered Spider in Realistic Scenarios" loading="lazy" width="672" height="830" srcset="https://labs.lares.com/content/images/size/w600/2025/08/image-14.png 600w, https://labs.lares.com/content/images/2025/08/image-14.png 672w"><figcaption>Privilege Escalation</figcaption></figure><p>The APT group uses BYOVD (Bring Your Own Vulnerable Driver) techniques, deploying a custom loader called STONESTOP to load a Microsoft-signed but vulnerable driver, POORTRY, in user space. This approach allows them to terminate EDR or antivirus agent processes. </p><p>By abusing a Microsoft-signed vulnerable driver, they bypass signature checks and disable security defenses, giving them the freedom to operate quietly during critical stages such as data theft or ransomware deployment. In addition, they used software signing certificates stolen from the compromised internal certification authorities of victim organizations to sign their malicious binaries.</p><p>To avoid detection related to lateral movement, Scattered Spider create instances in the cloud to use during lateral movement and data collection.</p><!--kg-card-begin: html--><h4 align="center" id="credential">Credential Access </h4><!--kg-card-end: html--><p>During the reported attack chains, Scattered Spider leveraged common credential-harvesting techniques, including LSASS dumping through Sysinternals tools such as ProcDump or well-known utilities like Mimikatz. They also employed LAPSToolkit to obtain clear-text LAPS credentials by abusing accounts with permissions to read them. Once the environment was compromised, the group used the Domain Controller Active Directory replication (DCSync) to further their access and extract NTDS.dit.</p><!--kg-card-begin: html--><h4 align="center" id="Discovery">Discovery</h4><!--kg-card-end: html--><p>During the Network Discovery phase, Scattered Spider prioritizes techniques that leverage both scanning tools and internal resources within the compromised environment. </p><p>They use common port and service scanning utilities such as RushScan or Advanced Port Scanner to map the network infrastructure and identify active systems and services. Simultaneously, they explore internal resources, including SharePoint, to locate documentation on network architecture, diagrams, and other sensitive information that could facilitate subsequent operations. </p><p>The group also utilizes Microburst, which includes functions and scripts that support Azure Services discovery, weak configuration auditing.</p><p>Other common tools such as ManageEngine, and Amazon Web Services inventory, always aiming, whenever possible, to use legitimate tools native to the target environment to reduce detection by security solutions and maintain a low-profile attack.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2025/08/image-12.png" class="kg-image" alt="From Threat to Test: Emulating Scattered Spider in Realistic Scenarios" loading="lazy" width="833" height="626" srcset="https://labs.lares.com/content/images/size/w600/2025/08/image-12.png 600w, https://labs.lares.com/content/images/2025/08/image-12.png 833w" sizes="(min-width: 720px) 720px"><figcaption>Discovery Diagram</figcaption></figure><!--kg-card-begin: html--><h4 align="center" id="lateralmovement">Lateral Movement</h4><!--kg-card-end: html--><p>Regarding lateral movement, Scattered Spider consistently prioritized the use of native techniques within the compromised environment to reduce detection risk. This included leveraging Single Sign-On (SSO) sessions from compromised workstations to access additional internal resources via RDP or Chrome Remote Desktop. </p><p>The group made use of Proxifier, a tool that enables the redirection of internal traffic through attacker-controlled systems, allowing them to execute malicious tools without triggering Endpoint Detection and Response (EDR) or antivirus solutions.</p><p>In the cloud side, the group exploited Amazon EC2 instances and the AWS Management Console to take advantage of asume role, group and policies misconfigurations. By abusing overly permissive Identity and Access Management (IAM) policies, Scattered Spider was able to pivot laterally between instances and compromise additional user accounts, expanding their control across the victim&#x2019;s cloud infrastructure.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2025/08/image-13.png" class="kg-image" alt="From Threat to Test: Emulating Scattered Spider in Realistic Scenarios" loading="lazy" width="951" height="736" srcset="https://labs.lares.com/content/images/size/w600/2025/08/image-13.png 600w, https://labs.lares.com/content/images/2025/08/image-13.png 951w" sizes="(min-width: 720px) 720px"><figcaption>Lateral Movement&#xA0;</figcaption></figure><!--kg-card-begin: html--><h4 align="center" id="exfiltration">Exfiltration</h4><!--kg-card-end: html--><p>Scattered Spider employed multiple exfiltration methods to ensure the successful extraction of compromised data while minimizing detection. </p><p>For smaller, high-value files, the group leveraged Telegram, using its encrypted messaging capabilities to transmit data securely. </p><p>To handle large-scale data transfers, they utilized Rclone to move substantial volumes to attacker-controlled cloud infrastructure, and MEGAsync to synchronize stolen files directly to cloud storage accounts. Additionally, Storage Explorer was deployed to extract sensitive information from both cloud storage repositories and enterprise databases, enabling the actors to target a broad range of valuable assets across the victim environment.</p><!--kg-card-begin: html--><h4 align="center" id="conclusion">Conclusion</h4><!--kg-card-end: html--><p>The operations of Scattered Spider illustrate a reality that modern organizations cannot ignore: adversaries blend technical proficiency with human-focused deception to bypass even the most advanced defenses. Their reliance on social engineering, abuse of cloud misconfigurations, and creative privilege escalation highlights how security gaps extend beyond technology into processes and people. Their targets, spanning telecommunications, hospitality, healthcare, retail, and aviation, reflect a strategy aimed at industries where service disruption or data loss translates directly into financial leverage.</p><p>At Lares, our mission is not only to document these tactics but to bring them to life in controlled environments where our clients can confront them head-on. By emulating real-world adversaries like Scattered Spider, we help organizations test resilience, validate detection capabilities, and train teams to recognize and contain attacks before they escalate. Our objective is clear: to shift organizations from reactive to proactive, ensuring they are not merely aware of threats, but prepared to withstand and outmaneuver them.</p><!--kg-card-begin: html--><h4 align="center" id="techniques">Techniques</h4><!--kg-card-end: html--><!--kg-card-begin: html--><h3 align="center" id="1">Reconnaissance &amp; infrastructure</h3><!--kg-card-end: html--><!--kg-card-begin: html--><table>
<thead>
<tr>
<th>Technique (ID)</th>
<th>MITRE ATT&amp;CK Name</th>
<th>Description</th>
<th>Category</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://attack.mitre.org/versions/v17/techniques/T1592/?ref=labs.lares.com">T1592</a></td>
<td>Gather Victim Host Information</td>
<td>Collecting information about victim hosts, such as operating systems, configurations, and installed software.</td>
<td>Reconnaissance</td>
</tr>
<tr>
<td><a href="https://attack.mitre.org/versions/v17/techniques/T1595/?ref=labs.lares.com">T1595</a></td>
<td>Active Scanning</td>
<td>Actively scanning the victim&#x2019;s infrastructure to identify live systems, exposed services, and potential vulnerabilities.</td>
<td>Reconnaissance</td>
</tr>
<tr>
<td><a href="https://attack.mitre.org/versions/v17/techniques/T1596/?ref=labs.lares.com">T1596</a></td>
<td>Search Open Technical Databases</td>
<td>Searching open technical databases to obtain information about the victim, such as WHOIS records, SSL/TLS certificates, and network scanning data.</td>
<td>Reconnaissance</td>
</tr>
<tr>
<td><a href="https://attack.mitre.org/versions/v17/techniques/T1588/?ref=labs.lares.com">T1588</a></td>
<td>Obtain Capabilities</td>
<td>Acquiring capabilities that can be used during the reconnaissance phase, including malware, exploits, and commercial tools.</td>
<td>Resource Development</td>
</tr>
<tr>
<td><a href="https://attack.mitre.org/versions/v17/techniques/T1593/?ref=labs.lares.com">T1593</a></td>
<td>Search Open Websites/Domains</td>
<td>Searching websites and open domains to gather information about the victim, including business relationships, physical locations, and organizational roles.</td>
<td>Reconnaissance</td>
</tr>
</tbody>
</table><!--kg-card-end: html--><!--kg-card-begin: html--><h3 align="center" id="2">Initial Access</h3><!--kg-card-end: html--><!--kg-card-begin: html--><table>
  <thead>
    <tr>
      <th>Technique (ID)</th>
      <th>MITRE ATT&amp;CK Name</th>
      <th>Description</th>
      <th>Category</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a href="https://attack.mitre.org/versions/v17/techniques/T1586/?ref=labs.lares.com">T1586</a></td>
      <td>Compromise Accounts</td>
      <td>Acquiring credentials from cybercriminal marketplaces or other illicit sources.</td>
      <td>Credential Access</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/versions/v17/techniques/T1111/?ref=labs.lares.com">T1111</a></td>
      <td>Multi-Factor Authentication Interception</td>
      <td>Intercepting or bypassing multi-factor authentication mechanisms.</td>
      <td>Credential Access</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/versions/v17/techniques/T1556/006/?ref=labs.lares.com">T1556.006</a></td>
      <td>Modify Authentication Process</td>
      <td>Modifying the authentication process to bypass or disable MFA (e.g., push bombing, social engineering).</td>
      <td>Credential Access</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/versions/v17/techniques/T1451/?ref=labs.lares.com">T1451</a></td>
      <td>SIM Card Swap</td>
      <td>Gaining access to mobile devices by transferring a victim&#x2019;s phone number to a SIM controlled by the attacker.</td>
      <td>Credential Access</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/versions/v17/techniques/T1071/?ref=labs.lares.com">T1071</a></td>
      <td>Application Layer Protocol</td>
      <td>Using application layer protocols for command and control communications, often for RAT deployment.</td>
      <td>Command and Control</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1566/?ref=labs.lares.com">T1566</a></td>
      <td>Phishing</td>
      <td>Techniques involving sending fraudulent communications (email, SMS, social media) to trick users into revealing credentials or installing malware.</td>
      <td>Initial Access / Social Engineering</td>
    </tr>
  </tbody>
</table>
<!--kg-card-end: html--><!--kg-card-begin: html--><h3 align="center" id="3">Privilege Escalation</h3><!--kg-card-end: html--><!--kg-card-begin: html--><table>
  <thead>
    <tr>
      <th>Technique (ID)</th>
      <th>MITRE ATT&amp;CK Name</th>
      <th>Description</th>
      <th>Category</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1078/?ref=labs.lares.com">T1078</a></td>
      <td>Valid Accounts</td>
      <td>Using stolen or compromised credentials&#x2014;including cloud credentials obtained via tools like aws_console or MicroBurst&#x2014;to escalate privileges across environments.</td>
      <td>Privilege Escalation</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1215/?ref=labs.lares.com">T1215</a></td>
      <td>Kernel Modules and Extensions (BYOVD)</td>
      <td>Leveraging Bring Your Own Vulnerable Driver (BYOVD) attacks: loading signed but vulnerable Microsoft drivers to disable EDR/AV and elevate privileges.</td>
      <td>Privilege Escalation / Defense Evasion</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1552/001/?ref=labs.lares.com">T1552.001</a></td>
      <td>Unsecured Credentials: Cloud Storage</td>
      <td>Harvesting credentials and secrets from services such as Jetcretz and GitGuardian to gain sensitive information and escalate access.</td>
      <td>Credential Access / Privilege Escalation</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1552/002/?ref=labs.lares.com">T1552.002</a></td>
      <td>Unsecured Credentials: Credentials in Files</td>
      <td>Extracting secrets from configuration files or code repositories using tools like Jetcretz and GitGuardian.</td>
      <td>Credential Access / Privilege Escalation</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1552/003/?ref=labs.lares.com">T1552.003</a></td>
      <td>Unsecured Credentials: Credentials In Registry</td>
      <td>Locating credentials stored insecurely in the registry to gain elevated privileges.</td>
      <td>Credential Access / Privilege Escalation</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1552/004/?ref=labs.lares.com">T1552.004</a></td>
      <td>Unsecured Credentials: Credentials In Cloud</td>
      <td>Accessing credentials stored in cloud metadata or inventory services (e.g. AWS inventory) to gain higher-level access.</td>
      <td>Credential Access / Privilege Escalation</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1555/003/?ref=labs.lares.com">T1555.003</a></td>
      <td>Credentials from Local Systems: LAPS</td>
      <td>Reading Local Administrator Password Solution (LAPS) credentials to elevate privileges within Active Directory environments.</td>
      <td>Credential Access / Privilege Escalation</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1003/?ref=labs.lares.com">T1003</a></td>
      <td>OS Credential Dumping</td>
      <td>Dumping LSASS memory or NTDS.dit using tools like Mimikatz or secretsdump to obtain password hashes.</td>
      <td>Credential Access / Privilege Escalation</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1556/?ref=labs.lares.com">T1556</a></td>
      <td>Modify Authentication Process</td>
      <td>Abusing Single Sign-On sessions on workstations to escalate privileges and access internal resources like SharePoint or Slack.</td>
      <td>Privilege Escalation</td>
    </tr>
  </tbody>
</table><!--kg-card-end: html--><!--kg-card-begin: html--><h3 align="center" id="4">Defense evasion</h3><!--kg-card-end: html--><!--kg-card-begin: html--><table>
  <thead>
    <tr>
      <th>Technique (ID)</th>
      <th>MITRE ATT&amp;CK Name</th>
      <th>Description</th>
      <th>Category</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1215/?ref=labs.lares.com">T1215</a></td>
      <td>Kernel Modules and Extensions</td>
      <td>Loading vulnerable or malicious drivers in the kernel or user space to bypass security controls.</td>
      <td>Defense Evasion</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1218/002/?ref=labs.lares.com">T1218.002</a></td>
      <td>Signed Binary Proxy Execution: Compiled HTML File</td>
      <td>Using signed or trusted binaries or drivers to execute malicious code and bypass security solutions.</td>
      <td>Defense Evasion</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1215/?ref=labs.lares.com">T1215</a></td>
      <td>Bring Your Own Vulnerable Driver (BYOVD)</td>
      <td>Deploying custom loaders and vulnerable signed drivers to disable security software and evade detection.</td>
      <td>Defense Evasion</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1570/?ref=labs.lares.com">T1570</a></td>
      <td>Cloud Instance Metadata API</td>
      <td>Using cloud instances or APIs for reconnaissance, lateral movement, or data collection while avoiding local detection.</td>
      <td>Lateral Movement / Reconnaissance</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1560/?ref=labs.lares.com">T1560</a></td>
      <td>Archive Collected Data</td>
      <td>Collecting and compressing data in the cloud to exfiltrate or stage later without touching the compromised endpoints.</td>
      <td>Exfiltration / Data Staging</td>
    </tr>
  </tbody>
</table>
<!--kg-card-end: html--><!--kg-card-begin: html--><h3 align="center" id="5">Credential Access</h3><!--kg-card-end: html--><!--kg-card-begin: html--><table>
  <thead>
    <tr>
      <th>Technique (ID)</th>
      <th>MITRE ATT&amp;CK Name</th>
      <th>Description</th>
      <th>Category</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1003/?ref=labs.lares.com">T1003</a></td>
      <td>OS Credential Dumping</td>
      <td>Dumping credentials from the operating system, including LSASS memory, using tools like Mimikatz or ProcDump.</td>
      <td>Credential Access</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1555/003/?ref=labs.lares.com">T1555.003</a></td>
      <td>Credentials from Local Systems: LAPS</td>
      <td>Abusing accounts with permissions to read LAPS (Local Administrator Password Solution) credentials to obtain clear-text passwords.</td>
      <td>Credential Access</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1008/?ref=labs.lares.com">T1008</a></td>
      <td>DCSync</td>
      <td>Abusing the Domain Controller replication feature to extract password hashes and account data from Active Directory.</td>
      <td>Credential Access</td>
    </tr>
  </tbody>
</table><!--kg-card-end: html--><!--kg-card-begin: html--><h3 align="center" id="5">Discovery</h3><!--kg-card-end: html--><!--kg-card-begin: html--><table>
  <thead>
    <tr>
      <th>Technique (ID)</th>
      <th>MITRE ATT&amp;CK Name</th>
      <th>Description</th>
      <th>Category</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1595/?ref=labs.lares.com">T1595</a></td>
      <td>Active Scanning</td>
      <td>Scanning the network to identify active systems, open ports, and available services using tools such as RushScan or Advanced Port Scanner.</td>
      <td>Reconnaissance</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1592/?ref=labs.lares.com">T1592</a></td>
      <td>Gather Victim Network Information</td>
      <td>Collecting information about network architecture, internal servers, and services, including using SharePoint to find documentation.</td>
      <td>Reconnaissance</td>
    </tr>
    <tr>
      <td><a href="https://attack.mitre.org/techniques/T1614/?ref=labs.lares.com">T1614</a></td>
      <td>Internal Network Discovery</td>
      <td>Using legitimate management platforms such as Microburst, ManageEngine, and AWS Inventory to explore and map internal networks.</td>
      <td>Reconnaissance</td>
    </tr>
  </tbody>
</table><!--kg-card-end: html--><!--kg-card-begin: html--><h3 align="center" id="5">Lateral Movement</h3><!--kg-card-end: html--><!--kg-card-begin: html--><table>
<thead>
<tr>
<th>Technique (ID)</th>
<th>MITRE ATT&amp;CK Name</th>
<th>Description</th>
<th>Category</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://attack.mitre.org/versions/v17/techniques/T1021/?ref=labs.lares.com">T1021</a></td>
<td>Remote Services</td>
<td>Use of compromised SSO sessions to access internal resources via RDP or Chrome Remote Desktop.</td>
<td>Lateral Movement</td>
</tr>
<tr>
<td><a href="https://attack.mitre.org/versions/v17/techniques/T1090/?ref=labs.lares.com">T1090</a></td>
<td>Proxy</td>
<td>Redirecting internal traffic through attacker-controlled systems to run malicious tools without detection.</td>
<td>Lateral Movement</td>
</tr>
<tr>
<td><a href="https://attack.mitre.org/versions/v17/techniques/T1078/?ref=labs.lares.com">T1078</a></td>
<td>Valid Accounts</td>
<td>Using valid credentials obtained from compromised SSO sessions to access other systems and maintain persistence.</td>
<td>Defense Evasion / Lateral Movement</td>
</tr>
<tr>
<td><a href="https://attack.mitre.org/versions/v17/techniques/T1078/?ref=labs.lares.com">T1078</a></td>
<td>Valid Accounts (Cloud IAM Abuse)</td>
<td>Abusing overly permissive IAM policies in AWS to pivot between instances and compromise additional accounts, expanding control in the cloud.</td>
<td>Lateral Movement / Cloud</td>
</tr>
</tbody>
</table><!--kg-card-end: html--><!--kg-card-begin: html--><h3 align="center" id="6">Exfiltration</h3><!--kg-card-end: html--><!--kg-card-begin: html--><table>
<thead>
<tr>
<th>Technique (ID)</th>
<th>MITRE ATT&amp;CK Name</th>
<th>Description</th>
<th>Category</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://attack.mitre.org/techniques/T1074/?ref=labs.lares.com">T1074</a></td>
<td>Data Staged</td>
<td>Scattered Spider stages data in a centralized database prior to exfiltration.</td>
<td>Exfiltration</td>
</tr>
<tr>
<td><a href="https://attack.mitre.org/techniques/T1567/002/?ref=labs.lares.com">T1567.002</a></td>
<td>Exfiltration to Cloud Storage: Web Service</td>
<td>Scattered Spider exfiltrates victim data to the MEGA file sharing site.</td>
<td>Exfiltration</td>
</tr>
<tr>
<td><a href="https://attack.mitre.org/techniques/T1530/?ref=labs.lares.com">T1530</a></td>
<td>Data from Cloud Storage</td>
<td>Scattered Spider extracts data from cloud storage services.</td>
<td>Exfiltration</td>
</tr>
</tbody>
</table>
<!--kg-card-end: html--><!--kg-card-begin: html--><h3 align="center" id="resources">Resources</h3>
<!--kg-card-end: html--><ul><li>CISA - <a href="https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-320a?ref=labs.lares.com">Scattered Spider</a></li><li>MITRE - <a href="https://attack.mitre.org/groups/G1015/?ref=labs.lares.com">Groups : Scattered Spider</a></li><li>Splunk - <a href="https://www.splunk.com/en_us/blog/learn/scattered-spider.html?ref=labs.lares.com">Scattered Spider Isn&#x2019;t a Glitch, It&#x2019;s a Warning</a></li><li>CybersecurityDive - <a href="https://www.cybersecuritydive.com/news/what-we-know-about-the-cybercrime-group-scattered-spider/756312/?utm_source=chatgpt.com">What we know about the cybercrime group Scattered Spider</a></li><li>American Hospital Association - <a href="https://www.aha.org/news/headline/2025-07-30-tactics-scattered-spider-cybercriminals-highlighted-joint-advisory?ref=labs.lares.com">Tactics by Scattered Spider cybercriminals highlighted in joint advisory</a></li></ul><!--kg-card-begin: html--><style>
    .article-image {
        max-width: 600px;
        margin: 0 auto !important;
        float: none !important;
	}
</style><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Kerberos IV - Delegations]]></title><description><![CDATA[<p>In the <a href="https://labs.lares.com/fear-kerberos-pt3/">third part of this Kerberos series</a>, we focused on leveraging user credential material for impersonation through techniques such as Pass-the-Key/Ticket/Cache/Certificate, and Shadow Credentials. Additionally, we explored how to manage and forge Kerberos tickets to facilitate lateral movement, privilege escalation, and establish persistence within the domain.</p>]]></description><link>https://labs.lares.com/fear-kerberos-pt4/</link><guid isPermaLink="false">65e0df725842ec7502fb467c</guid><category><![CDATA[penetrationtesting]]></category><category><![CDATA[kerberos]]></category><dc:creator><![CDATA[Raúl Redondo]]></dc:creator><pubDate>Mon, 23 Sep 2024 14:41:18 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2024/09/kerberos_Delegations_shiba3.png" medium="image"/><content:encoded><![CDATA[<img src="https://labs.lares.com/content/images/2024/09/kerberos_Delegations_shiba3.png" alt="Kerberos IV - Delegations"><p>In the <a href="https://labs.lares.com/fear-kerberos-pt3/">third part of this Kerberos series</a>, we focused on leveraging user credential material for impersonation through techniques such as Pass-the-Key/Ticket/Cache/Certificate, and Shadow Credentials. Additionally, we explored how to manage and forge Kerberos tickets to facilitate lateral movement, privilege escalation, and establish persistence within the domain.</p><p>In this fourth post, and last of the series, we will explore Kerberos delegations. </p><p>There are many great articles about delegations, even though the abuse of this feature is an old attack vector, here at Lares, we wanted to deep dive and analyze the whole flow of what Kerberos delegations entail. In this post, we&#x2019;ll review the different types of delegation, providing a detailed understanding of their use cases and potential security implications. </p><p>While this post primarily focuses on the functionality of Kerberos delegations and abuse cases, we have also included brief notes and best practices for detecting potential abuses and misconfigurations, which will in turn help to enhance security postures against these risks.</p><p><strong>Note</strong>: <em>In each delegation scenario, the communication flow will be analyzed. For a review of the Kerberos communication process, refer to the first post in this series..</em></p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://labs.lares.com/fear-kerberos-pt1/"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Kerberos I - Overview</div><div class="kg-bookmark-description">This post, is the first in the series and will aim to provide an overview of the protocol, from its beginnings to the different (ab)use techniques.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://labs.lares.com/content/images/size/w256h256/2023/04/logo-lares-consulting-crest-white.png" alt="Kerberos IV - Delegations"><span class="kg-bookmark-author">Lares Labs</span><span class="kg-bookmark-publisher">Ra&#xFA;l Redondo</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://labs.lares.com/content/images/2024/03/kerberos_1-1.png" alt="Kerberos IV - Delegations"></div></a></figure><!--kg-card-begin: markdown--><ul>
<li><a href="#delegations">Kerberos Delegations</a>
<ul>
<li><a href="#unconstrained">Unconstrained Delegation</a>
<ul>
<li><a href="#abusingunconstrained">Abusing Unconstrained Delegation</a></li>
</ul>
</li>
<li><a href="#constrained">Constrained Delegation</a>
<ul>
<li><a href="#kerberosonly">Kerberos-only delegation</a>
<ul>
<li><a href="#abusingkerberosonly">Abusing KCD Kerberos Only</a></li>
</ul>
</li>
<li><a href="#protocolconstrained">Protocol transition delegation</a>
<ul>
<li><a href="#abusingptransition">Abusing KCD Protocol Transition</a></li>
</ul>
</li>
<li><a href="#rbcd">Resource-Based Constrained Delegation</a>
<ul>
<li><a href="#abusingrbcd">Abusing RBCD</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#usefuldefenses">Useful Defenses</a></li>
</ul>
</li>
<li><a href="#resources">Resources</a></li>
</ul>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h4 align="center" id="delegations">Kerberos Delegations:</h4><!--kg-card-end: markdown--><p>Microsoft introduced the Kerberos delegation feature with the first implementation of Active Directory in Windows 2000. <a href="https://learn.microsoft.com/en-us/defender-for-identity/security-assessment-unconstrained-kerberos?ref=labs.lares.com#what-is-kerberos-delegation">Defined by Microsoft</a>; <em><strong>Kerberos delegation is a setting that allows applications to request end-user access credentials to access resources on behalf of the originating user.</strong></em></p><p>This feature was intended to solve the double-hop issue. &#x2018;Double Hop&#x2019; issues can occur when a user needs to access a resource on a second server through an initial server. After authenticating to the first server (Server A), the user&#x2019;s credentials are used to get a service ticket for Server A; however, when Server A needs to access resources on Server B on behalf of the user, it faces a problem because it cannot use the user&#x2019;s credentials or tickets to authenticate to Server B. This prevents proper authentication on the second hop, resulting in access failures.</p><p>Below is a classic example of a basic double-hop scenario and would be why delegation is necessary:</p><ul><li>The user Elliot.A wants to access company documents, so he authenticates with his domain credentials on the web application hosted on the server DEV.Lareslabs.local. This application runs in the context of its own service machine account (DEV$).</li><li>The folder that the web application has to retrieve is located on another server shared path (\\FS1\Data) and this folder has the following <a href="https://labs.lares.com/securing-active-directory-via-acls/">security descriptor</a>, defining access rights for Elliot.A, and other ACEs that do not grant access to DEV$:</li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-26.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="487" height="418"><figcaption>\\FS1\Data folder security descriptor.</figcaption></figure><ul><li>When the web application tries to retrieve the files through the CIFS service on the FS1 server, it will do so under its context and will not have access, preventing Elliot.A from accessing the files through the web application:</li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-54.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="1085" height="181" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-54.png 600w, https://labs.lares.com/content/images/size/w1000/2024/08/image-54.png 1000w, https://labs.lares.com/content/images/2024/08/image-54.png 1085w" sizes="(min-width: 720px) 720px"><figcaption>Kerberos double-hop issue.</figcaption></figure><ul><li>Kerberos delegation helps solve this problem, in the following example, DEV.lareslabs.local (DEV$) is configured with unconstrained delegation (the most insecure kind of delegation, which we will see next), so it can gain access to the shared folder impersonating Elliot, using Elliot&#xB4;s Kerberos Tickets as proof that it has permission to impersonate, then placing a copy of the user token in a new thread of its executing process so that thread can act on behalf of Elliot.A and is subject to the restrictions imposed by ACLs:</li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-49.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="984" height="206" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-49.png 600w, https://labs.lares.com/content/images/2024/08/image-49.png 984w" sizes="(min-width: 720px) 720px"><figcaption>Kerberos Delegation.</figcaption></figure><p>There are three kinds of delegations:</p><ul><li>Unconstrained Delegation.</li><li>Constrained Delegation, (Kerberos Only and Protocol Transition).</li><li>Resource-based Constrained delegation (RBCD).</li></ul><p><em><strong>Note</strong></em>: <em>The ASP.NET Core Web API application &quot;<a href="https://rastamouse.me/kerberos-delegation-test-app/?ref=labs.lares.com">KerbApp</a>&quot; by @_RastaMouse has been used for the lab configuration. The application allows the authentication scheme to be configured through HTTP.sys.</em></p><!--kg-card-begin: markdown--><h4 align="center" id="unconstrained">Unconstrained Delegation:</h4><!--kg-card-end: markdown--><p>Unconstrained Delegation allows an entity to impersonate a Principal to any chosen service. When this delegation is configured in a service, <strong>the client delegates a copy of its TGT to this service, so this service can act on behalf of the client in the network by using that TGT. &#xA0;</strong></p><p>So, it allows an attacker who has gained control of a domain account configured with delegated permissions to impersonate any user or service within the domain.</p><p>To configure graphically, it is required to enable the option &quot;<em>Trust this user for delegation to any service (Kerberos Only)</em>&quot;:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-50.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="560" height="642"><figcaption>Unconstrained Delegation configured on DEV</figcaption></figure><p>Using the PS Active Directory module, it is possible to verify whether an account is configured with Unconstrained Delegation by checking the attribute &quot;<em>TrustedForDelegation</em>&quot;:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-51.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="666" height="275" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-51.png 600w, https://labs.lares.com/content/images/2024/08/image-51.png 666w"><figcaption>Unconstrained enumeration using Get-ADComputer function.</figcaption></figure><p>To better understand this kind of delegation, let&apos;s examine step-by-step the traffic generated during the scenario described above:</p><ul><li>The user Elliot.A wants to access company documents, so he authenticates using his domain credentials on the web application hosted on the server DEV.lareslabs.local. Since DEV$ does not have direct permissions to access these files, which are hosted on another server called FS1.lareslabs.local, it is configured with unconstrained delegation. This allows it to impersonate Elliot.A and access the files on his behalf.</li></ul><p>The communication flow in this scenario will be as follows:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-133.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="969" height="880" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-133.png 600w, https://labs.lares.com/content/images/2024/08/image-133.png 969w" sizes="(min-width: 720px) 720px"><figcaption>Unconstrained Delegation flow.</figcaption></figure><p>The following shows Elliot.A performing an HTTP request to DEV webapp:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-18.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="790" height="306" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-18.png 600w, https://labs.lares.com/content/images/2024/08/image-18.png 790w" sizes="(min-width: 720px) 720px"><figcaption>HTTP request.</figcaption></figure><p>Using Wireshark to capture and review this network traffic, we will be able to identify the following network flow:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-134.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="1111" height="320" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-134.png 600w, https://labs.lares.com/content/images/size/w1000/2024/08/image-134.png 1000w, https://labs.lares.com/content/images/2024/08/image-134.png 1111w" sizes="(min-width: 720px) 720px"><figcaption>Unconstrained Delegation network traffic.</figcaption></figure><p>Let&apos;s break things down step by step:</p><ol><li>The client, Elliot.A, requests a TGT from the KDC, if credentials are valid, the KDC will return the TGT, just the normal Kerberos flow, AS-REQ/AS-REP.</li><li>The client requests an HTTP Service Ticket (HTTP/DEV.lareslabs.local) in the first TGS-REQ, sending his TGT and authenticator:</li></ol><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-39.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="689" height="717" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-39.png 600w, https://labs.lares.com/content/images/2024/08/image-39.png 689w"><figcaption>HTTP/DEV.lareslabs.local TGS-REQ</figcaption></figure><p>3. The KDC provides the Service Ticket with the flag <a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-kile/de260077-1955-447c-a120-af834afe45c2?ref=labs.lares.com">ok-as-delegate flag</a> set, which indicates that the requested service is configured to allow delegation:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-4.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="669" height="460" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-4.png 600w, https://labs.lares.com/content/images/2024/08/image-4.png 669w"><figcaption>TGS-REQ, KDC confirm the service is suitable as a delegate.</figcaption></figure><p>4. Since the client verified that the target service is enabled for delegation, it will send a new TGS-REQ request for an additional Service Ticket (Elliot.A`s TGT), again sending its TGT and Authenticator, but this time it will ask for a copy of his TGT with the flag <strong>forwarded set:</strong></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-6.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="578" height="653"><figcaption>TGS-REQ, client asks for a forwarded TGT.</figcaption></figure><p>The ticket-granting service (TGS) then provides a (delegated) TGT with the forwarded flag, the KDC expects this request as a follow-up of the previous one, as the service is configured with Unconstrained Delegation:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-41.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="689" height="781" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-41.png 600w, https://labs.lares.com/content/images/2024/08/image-41.png 689w"><figcaption>TGS-REP, TGT with forwarded flag.</figcaption></figure><p>5. Once with a forwardable TGT, the client will perform an AP-REQ message within the HTTP request, sending the service ticket for the HTTP service in addition to the delegated TGT. The forwardable TGT is contained within the HTTP request:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-31.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="800" height="763" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-31.png 600w, https://labs.lares.com/content/images/2024/08/image-31.png 800w" sizes="(min-width: 720px) 720px"><figcaption>HTTP request.</figcaption></figure><p>6. The web server, (DEV$), uses the client&apos;s cached TGT to request a Service Ticket from the KDC for the CIFS/FS1 on behalf of Elliot through a regular TGS-REQ message:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-11.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="692" height="789" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-11.png 600w, https://labs.lares.com/content/images/2024/08/image-11.png 692w"><figcaption>TGS-REQ regular TGS-REQ on behalf of Elliot.A.</figcaption></figure><p>The KDC provides a valid Elliot.A Service Ticket for CIFS/FS1 service to DEV$:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-13.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="748" height="751" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-13.png 600w, https://labs.lares.com/content/images/2024/08/image-13.png 748w" sizes="(min-width: 720px) 720px"><figcaption>TGS-REP.</figcaption></figure><p>7. DEV$ will send an AP-REQ message via SMB on behalf of Elliot.A, sending the CIFS service ticket and the authenticator:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-14.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="747" height="746" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-14.png 600w, https://labs.lares.com/content/images/2024/08/image-14.png 747w" sizes="(min-width: 720px) 720px"><figcaption>AP-REQ, mutual authentication.</figcaption></figure><p>FS1$, will in turn, perform a mutual authentication process with DEV$, via SMB, through an AP-REP message:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-15.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="747" height="618" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-15.png 600w, https://labs.lares.com/content/images/2024/08/image-15.png 747w" sizes="(min-width: 720px) 720px"><figcaption>AP-REP, mutual authentication.</figcaption></figure><p>8. Finally, the client (Elliot.A) and DEV$ will complete the mutual authentication process via an AP-REP message over HTTP, resulting in displaying the FS1$ shared files that the client wanted to access:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-16.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="748" height="629" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-16.png 600w, https://labs.lares.com/content/images/2024/08/image-16.png 748w" sizes="(min-width: 720px) 720px"><figcaption>AP-REP through HTTP, mutual authentication.</figcaption></figure><!--kg-card-begin: markdown--><h5 align="center" id="abusingunconstrained">Abusing Unconstrained Delegation:</h5><!--kg-card-end: markdown--><p>As we already know, <strong>any principal connecting to a machine configured with unconstrained delegation will drop a copy of its TGT in memory.</strong></p><p>From a threat actors&#x2019; stance, the objective will be to gain privileged access to these servers and dump these delegated TGTs that are cached in memory. Alternatively, they/we can force the authentication of a privileged account against this machine, to obtain clients delegated TGTs.</p><p>From Linux, the first step will be adding a &quot;fake&quot; spn pointing to our listener, our attacker machine. To do this, <a href="https://github.com/dirkjanm/krbrelayx/blob/master/addspn.py?ref=labs.lares.com">addspn </a>can be used, as machine accounts can edit their own <a href="https://learn.microsoft.com/en-us/windows/win32/adschema/a-msds-additionaldnshostname?ref=labs.lares.com"><em>msDS-AdditionalDnsHostName</em></a> attribute.</p><p><em><strong>Note</strong></em>: Depending on the chosen authentication coercion method (e.g., PrinterBug, Coercer), different types of services will be required.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-62.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="671" height="147" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-62.png 600w, https://labs.lares.com/content/images/2024/08/image-62.png 671w"><figcaption>addspn.py</figcaption></figure><p>It is also required to create a DNS record with the name of the fake registered spn pointing to the attacking machine, dnstool from @_dirkjan&apos;s krbrelayx suite can be used to perform this operation.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-63.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="667" height="135" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-63.png 600w, https://labs.lares.com/content/images/2024/08/image-63.png 667w"><figcaption>dnstool.py</figcaption></figure><p>Finally, <a href="https://github.com/dirkjanm/krbrelayx?ref=labs.lares.com">krbrelayx </a>will be used, in conjunction with the Kerberos key or the password and salt of the account configured with Unconstrained Delegation that has been compromised, forcing authentication with the chosen method. In this example, Coercer:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-61.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="854" height="784" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-61.png 600w, https://labs.lares.com/content/images/2024/08/image-61.png 854w" sizes="(min-width: 720px) 720px"><figcaption>krbrelayx &amp; coercer.</figcaption></figure><p>Once the delegated TGT (.ccache) is obtained, it can be exported and used to impersonate that coerced account:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-64.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="779" height="204" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-64.png 600w, https://labs.lares.com/content/images/2024/08/image-64.png 779w" sizes="(min-width: 720px) 720px"><figcaption>secretsdump using delegated TGT.</figcaption></figure><p>From Windows computers, the <a href="https://github.com/GhostPack/Rubeus?tab=readme-ov-file&amp;ref=labs.lares.com#monitor">Rubeus monitor function</a> performs the same role. After forcing authentication with the desired method, the cached .kirbi in memory can be obtained and used for impersonation.</p><!--kg-card-begin: markdown--><h4 align="center" id="constrained">Constrained Delegation:</h4><!--kg-card-end: markdown--><p><a href="https://learn.microsoft.com/en-us/windows-server/security/kerberos/kerberos-constrained-delegation-overview?ref=labs.lares.com">Kerberos Constrained Delegation</a>, Introduced in Windows Server 2003, aims to provide a safer form of delegation that could be used by services.</p><p>While Unconstrained Delegation allows the impersonation of any domain principal on any network service, <strong>for accounts configured with Constrained Delegation, target services are limited by configuration.</strong> This approach enhances security by limiting the scope of delegation to only explicitly allowed services, thus minimizing potential exposure from compromised services.</p><p>In addition, to the above, in Constrained Delegation, it is not necessary to have a user&apos;s TGT within the TGS request. <strong>The service itself can request service tickets for other services on behalf of a user as long it has proof that it has received a request from the user. </strong></p><p>For this purpose, Microsoft issued the S4U [<a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-sfu/3bff5864-8135-400e-bdd9-33b552051d94?ref=labs.lares.com">MS-SFU</a>] extension that allows the KDC to issue a new TGS to the service using a valid TGS through two subprotocols, <strong>S4U2Self </strong>and <strong>S4U2Proxy</strong>.</p><ul><li><strong>S4U2Self</strong>: allows a service to obtain a service ticket to itself on behalf of a user.</li><li><strong>S4U2Proxy</strong>: allows a service to obtain a service ticket on behalf of a client to a different service using a service ticket as evidence that the client has authenticated.</li></ul><p>Constrained delegation can be configured to accept only Kerberos authentication, or other protocols, such as NTLM, in scenarios where Kerberos authentication is not possible.</p><!--kg-card-begin: markdown--><h4 align="center" id="kerberosconstrained">Kerberos Only:</h4><!--kg-card-end: markdown--><p>A visual depiction of the Constrained Delegation configuration, using Kerberos only, can be seen in the image below. In this instance it is configured for only delegation allowed for FS1.lareslabs.local CIFS service:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-65.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="469" height="536"><figcaption>Constrained Delegation configured on DEV.</figcaption></figure><p>Following the same scenario, but now, DEV$ configured with Constrained Delegation and Kerberos Only:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-89.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="707" height="604" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-89.png 600w, https://labs.lares.com/content/images/2024/08/image-89.png 707w"><figcaption>Constrained Delegation - Kerberos Only Flow.</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-90.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="1024" height="354" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-90.png 600w, https://labs.lares.com/content/images/size/w1000/2024/08/image-90.png 1000w, https://labs.lares.com/content/images/2024/08/image-90.png 1024w" sizes="(min-width: 720px) 720px"><figcaption>Kerberos Only - Constrained Delegation.</figcaption></figure><ol><li>Kerberos pre-auth, usual flow, obtaining a TGT via AS-REQ/AP-REP messages.</li><li>The client (Elliot.A) requests a service ticket for HTTP/DEV.lareslabs.local (TGS-REQ message). Then, the KDC provides the service ticket through the TGS-REP message.</li><li>The client sends an HTTP AP-REQ message to the web server, including the service ticket within the request. </li><li>Through the next TGS-REQ message sent by DEV$ to the KDC, the service can request additional service tickets using an <strong>S4U2Proxy </strong>request. Through this extension, the web server will send a request to the KDC for a CIFS/FS1.lareslabs.local service ticket sending its TGT and authenticator <strong>and the previous HTTP/DEV service ticket from Elliot.A</strong>, within the &quot;additional tickets&quot; block:</li></ol><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-71.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="862" height="812" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-71.png 600w, https://labs.lares.com/content/images/2024/08/image-71.png 862w" sizes="(min-width: 720px) 720px"><figcaption>CIFS - TGS-REQ (S4U2Proxy).</figcaption></figure><p>In the following image, it is shown how, in the same request, the client (DEV$), requires the KDC to check if the constrained delegation is configured and viable:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-75.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="865" height="609" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-75.png 600w, https://labs.lares.com/content/images/2024/08/image-75.png 865w" sizes="(min-width: 720px) 720px"><figcaption>TGS-REQ constrained delegation flag.</figcaption></figure><p>The KDC will check the additional ticket, verify that it is forwardable, and further verify that DEV$ can delegate to FS1$, by checking the <strong>msDS-AllowedToDelegateTo</strong> an attribute:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-91.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="468" height="535"><figcaption>DEV$ msDS-AllowedToDelegateTo attribute.</figcaption></figure><p>Forwarding Elliot.A&apos;s CIFS/FS1 ST + Session Key through the TGS-REP response to DEV$:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-73.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="869" height="665" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-73.png 600w, https://labs.lares.com/content/images/2024/08/image-73.png 869w" sizes="(min-width: 720px) 720px"><figcaption>TGS-REP (S4U2Proxy).</figcaption></figure><p>5. DEV$ requests CIFS access to FS1$ <strong>on behalf of Elliot.A</strong> through the AP-REQ message and FS1$ will reply to DEV$, performing the mutual authentication process via the AP-REQ message.</p><p>6. Finally, the web application will return the information retrieved for Elliot.A through an AP-REP message via HTTP (Mutual authentication between<br>the DEV$ and Elliot.A):</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-74.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="862" height="714" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-74.png 600w, https://labs.lares.com/content/images/2024/08/image-74.png 862w" sizes="(min-width: 720px) 720px"><figcaption>HTTP AP-REP.</figcaption></figure><!--kg-card-begin: markdown--><h5 align="center" id="abusingkerberosonly">Abusing KCD Kerberos Only:</h5><!--kg-card-end: markdown--><p>Kerberos Only requires an additional ticket as a requirement to invoke S4U2Proxy. The first approach should be user S4U2Self but required TRUSTED_TO_AUTH_FOR_DELEGATION flag set, which is not True, since Kerberos Only was used and the resulting ST will be non-forwardable.</p><p>Although it is possible to abuse Kerberos Only through the &#x201C;<a href="https://www.netspi.com/blog/technical-blog/network-penetration-testing/cve-2020-17049-kerberos-bronze-bit-overview/?ref=labs.lares.com">bronze bit</a>&#x201D; (<em>CVE-2020-17049</em>) &#xA0;technique or by forcing authentication, the most direct method would be through RBCD.</p><p>To abuse this, it is first necessary to use an indirect method that exploits <a href="https://labs.lares.com/p/b5630827-56f2-4560-8a3e-82bd3e04b195/#rbcd">Resource Based Constrained Delegation</a> first.</p><!--kg-card-begin: markdown--><h4 align="center" id="protocolconstrained">Protocol Transition:</h4><!--kg-card-end: markdown--><p>In Constrained Delegation Kerberos Only, the service can invoke S4U2Proxy using Elliot.A&#x2019;s service ticket (ST) as an additional ticket; however, if the service does not have this additional ticket, such as via NTLM authentication, it needs another way to obtain proof (a ticket) that the client is delegating on its behalf. In this case, a service can invoke S4U2Self to ask the authentication service to produce a TGS for arbitrary users to itself, which can then be used as &#x201C;evidence&#x201D; when invoking S4U2Proxy. This feature allows impersonating users on an ad-hoc basis, and it is only possible when the <strong>TrustedToAuthForDelegation </strong>flag is set for the service account that invokes S4U2Self.</p><p>In the following image, we can see a visual representation of the configuration of Constrained Delegation using protocol transition:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-77.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="472" height="540"><figcaption>Protocol Transition - Constrained Delegation, DEV$.</figcaption></figure><p>Following the same scenario, with DEV$ configured with Constrained Delegation and Protocol Transition, the flow looks as follows:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-108.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="712" height="581" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-108.png 600w, https://labs.lares.com/content/images/2024/08/image-108.png 712w"><figcaption>Constrained Delegation - Protocol Transition Flow.</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-76.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="1028" height="204" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-76.png 600w, https://labs.lares.com/content/images/size/w1000/2024/08/image-76.png 1000w, https://labs.lares.com/content/images/2024/08/image-76.png 1028w" sizes="(min-width: 720px) 720px"><figcaption>Protocol Transition - Constrained Delegation network traffic.</figcaption></figure><p>1. Client Elliot.A will send an HTTP request to the DEV web server. Authentication will be performed using NTLM since the application does not accept Kerberos:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-93.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="975" height="543" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-93.png 600w, https://labs.lares.com/content/images/2024/08/image-93.png 975w" sizes="(min-width: 720px) 720px"><figcaption>NTLM authentication.</figcaption></figure><p>2. To get CIFS/FS1 service ticket (<em>using the S4U2Proxy request</em>) DEV$ has to provide a proof, a service ticket from the user. Since there is no service ticket provided by Elliot.A (<em>NTLM authentication was used</em>) the server should ask for it using the S4U2Self extension.</p><p>In the TGS-REQ message that DEV$ will send to the KDC, the structures specific to the S4U2Self extension,<strong> pA-FOR-X509-USER</strong>, and <strong>pA-FOR-USER</strong> are present, with the name as the client to impersonate (Elliot.A) and its&#x2019; own SPN, e.g. the DEV$ target spn:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-81.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="748" height="785" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-81.png 600w, https://labs.lares.com/content/images/2024/08/image-81.png 748w" sizes="(min-width: 720px) 720px"><figcaption>TGS-REQ (S4U2Self)</figcaption></figure><p>The KDC will then verify that DEV is configured with constrained delegation enabled (<strong><em>TRUSTED_TO_AUTH_FOR_DELEGATION</em></strong>) and will provide a service ticket on behalf of Elliot.A with the forwardable flag set to True through the TGS-REP message to DEV$ server:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-82.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="751" height="814" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-82.png 600w, https://labs.lares.com/content/images/2024/08/image-82.png 751w" sizes="(min-width: 720px) 720px"><figcaption>TGS-REP (S4U2Self)</figcaption></figure><p>3. DEV$ sends its TGT and authenticator to request a service ticket on behalf of Elliot.A for CIFS/FS1 to the KDC. This process, will include the forwardable service ticket previously obtained through S4U2Self:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-101.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="859" height="723" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-101.png 600w, https://labs.lares.com/content/images/2024/08/image-101.png 859w" sizes="(min-width: 720px) 720px"><figcaption>S4U2Self TGS-REQ</figcaption></figure><p>The additional ticket (<em>forwardable ST</em>) is pointing to DEV$ instead of HTTP/DEV.lareslabs.local, confirming that it was obtained through S4U2Self:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-135.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="976" height="496" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-135.png 600w, https://labs.lares.com/content/images/2024/08/image-135.png 976w" sizes="(min-width: 720px) 720px"><figcaption>S4U2Self TGS-REQ</figcaption></figure><p>In this request, the flags for constrained delegation and resource-based constrained delegation are set. This is significant because RBCD will serve as a fallback if constrained delegation fails, for example, if the additional ticket is not forwardable.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-137.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="863" height="797" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-137.png 600w, https://labs.lares.com/content/images/2024/08/image-137.png 863w" sizes="(min-width: 720px) 720px"><figcaption>KCD and RBCD flags set</figcaption></figure><p>The KDC checks if DEV is authorized to delegate to FS1 by verifying the <strong>msDS-AllowedToDelegateTo</strong> attribute. It also ensures that the Additional Ticket is forwardable. If all checks are correct, the KDC responds with Ellio.A&#x2019;s service ticket (ST) and the session key in the TGS-REP message:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-100.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="864" height="793" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-100.png 600w, https://labs.lares.com/content/images/2024/08/image-100.png 864w" sizes="(min-width: 720px) 720px"><figcaption>TGS-REP</figcaption></figure><p><strong><em>Note</em></strong>: <em>An important fact here, and as <a href="@elad_shamir">@elad_shamir</a> describes in his awesome = post <a href="https://shenaniganslabs.io/2019/01/28/Wagging-the-Dog.html?ref=labs.lares.com">Wagging the dog</a> , in S4U2Proxy, <strong>the ticket should always be forwardable, </strong>and will have the bit &quot;resource-based-constrained-delegation&quot; to check if RBCD is configured in case KCD does not work, as a fallback (when the ticket is not forwardable for example).</em></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-113.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="688" height="750" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-113.png 600w, https://labs.lares.com/content/images/2024/08/image-113.png 688w"><figcaption>KCD and RBCD flags set</figcaption></figure><p>5. DEV request CIFS access to FS1 <strong>on behalf of Elliot.A</strong> through the AP-REQ message and FS1 will reply to DEV, performing the mutual authentication process via the AP-REQ message.</p><p>6. Finally, the web application will return the information retrieved for Elliot.A through an AP-REP message via HTTP (Mutual authentication between<br>the DEV and Elliot.A):</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-105.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="863" height="560" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-105.png 600w, https://labs.lares.com/content/images/2024/08/image-105.png 863w" sizes="(min-width: 720px) 720px"><figcaption>DEV web application response</figcaption></figure><!--kg-card-begin: markdown--><h5 align="center" id="abusingptransition">Abusing KCD Protocol Transition:</h5><!--kg-card-end: markdown--><p>To abuse the KCD with any protocol (<strong><em>protocol transition</em></strong>), it is necessary to request a service ticket, using the S4U2self extension and then request the final TGS ticket using S4U2Proxy. On Linux, Impacket&apos;s getST handles all the work behind the scenes</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-102.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="858" height="215" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-102.png 600w, https://labs.lares.com/content/images/2024/08/image-102.png 858w" sizes="(min-width: 720px) 720px"><figcaption>impacket-getST</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-104.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="864" height="174" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-104.png 600w, https://labs.lares.com/content/images/2024/08/image-104.png 864w" sizes="(min-width: 720px) 720px"><figcaption>impacket-secretsdump</figcaption></figure><p>On Windows systems, Rubeus, through the S4U function, requests a Ticket Granting Ticket (TGT) on behalf of DEV using the specified Kerberos key. It then invokes S4U2Self to obtain a Service Ticket (ST) in the name of Lares.DA. The resulting &#xA0;in a forwardable service ticket:</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/08/image-106.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="844" height="818" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-106.png 600w, https://labs.lares.com/content/images/2024/08/image-106.png 844w" sizes="(min-width: 720px) 720px"></figure><p>Then, Rubeus will use the forwardable ticket to invoke S4U2Proxy:</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/08/image-107.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="849" height="572" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-107.png 600w, https://labs.lares.com/content/images/2024/08/image-107.png 849w" sizes="(min-width: 720px) 720px"></figure><p>Once ptt is performed, the target user can be impersonated in the chosen service.</p><!--kg-card-begin: markdown--><h4 align="center" id="rbcd">Resource-Based Constrained Delegation:</h4><!--kg-card-end: markdown--><p><a href="https://learn.microsoft.com/en-us/windows-server/security/kerberos/kerberos-constrained-delegation-overview?ref=labs.lares.com#resource-based-constrained-delegation-across-domains">Resource-based constrained delegation</a>, introduced in Windows Server 2012, operates similarly to classic constrained delegation by using S4U extensions; however, the key difference is that <strong>in RBCD, delegation is configured directly on the service receiving the delegated credentials, managed through the <a href="https://learn.microsoft.com/en-us/windows/win32/adschema/a-msds-allowedtoactonbehalfofotheridentity?ref=labs.lares.com">msDS-AllowedToActOnBehalfOfOtherIdentity attribute</a></strong>, rather than on the delegating service.</p><p>This attribute is a security descriptor that contains an ACE for every account the user can delegate to. </p><p>To configure Resource-Based Constrained Delegation (RBCD), it is necessary to use the command line, as there is no graphical interface available for this configuration:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-138.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="882" height="254" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-138.png 600w, https://labs.lares.com/content/images/2024/08/image-138.png 882w" sizes="(min-width: 720px) 720px"><figcaption>RBCD configuration and enumeration</figcaption></figure><p>In the classic Constrained Delegation, the delegation is configured in DEV$ via <a href="https://learn.microsoft.com/en-us/windows/win32/adschema/a-msds-allowedtodelegateto?ref=labs.lares.com">msDS-AllowedToDelegateTo</a>:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-109.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="867" height="320" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-109.png 600w, https://labs.lares.com/content/images/2024/08/image-109.png 867w" sizes="(min-width: 720px) 720px"><figcaption>&quot;Outgoing&quot; Classic Constrained Delegation.</figcaption></figure><p>In contrast,RBCD is configured in FS1$, through the attribute <strong>msDS-AllowedToActOnBehalfOfOtherIdentity:</strong></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-111.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy"><figcaption>&quot;Incoming&quot; Resource-Based Constrained Delegation.</figcaption></figure><p>So, in case of compromising an account with enough privileges to write to that attribute (GenericAll/GenericWrite/WriteDacl/WriteProperty/...) of the target account, it would be possible to configure RBCD.</p><p><strong>Note</strong>: <em>If you need to review attacks related to ACLs, we recommend taking a look at our post:</em></p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://labs.lares.com/securing-active-directory-via-acls/"><div class="kg-bookmark-content"><div class="kg-bookmark-title">The Phantom Menace: Exposing hidden risks through ACLs in Active Directory</div><div class="kg-bookmark-description">The abuse of misconfigured Access Control Lists is nothing new. However, it is still one of the main ways of lateral movement and privilege escalation within an active directory domain.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://labs.lares.com/content/images/size/w256h256/2023/04/logo-lares-consulting-crest-white.png" alt="Kerberos IV - Delegations"><span class="kg-bookmark-author">Lares Labs</span><span class="kg-bookmark-publisher">Ra&#xFA;l Redondo</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://labs.lares.com/content/images/2023/06/fine.png" alt="Kerberos IV - Delegations"></div></a></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-123.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="861" height="226" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-123.png 600w, https://labs.lares.com/content/images/2024/08/image-123.png 861w" sizes="(min-width: 720px) 720px"><figcaption>RBCD (Protocol Transition) network traffic</figcaption></figure><p>1. Client Elliot.A will send an HTTP request to the DEV web server. Authentication will be performed using NTLM since the application does not support Kerberos.</p><p>2. To obtain a service ticket for CIFS (<em>using the S4U2Proxy request</em>), DEV$ needs to provide proof of a service ticket from the user. Since Elliot.A did not provide a service ticket (<em>due to NTLM authentication</em>), the server will request it using the S4U2Self extension.</p><p>In the TGS-REQ message that the DEV server sends to the KDC, the S4U2Self-specific structures <em><strong>pA-FOR-X509-USER</strong></em> and <em><strong>pA-FOR-USER</strong></em> are included. These structures specify Elliot.A as the client to impersonate and DEV$ as the target SPN:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-124.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="861" height="646" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-124.png 600w, https://labs.lares.com/content/images/2024/08/image-124.png 861w" sizes="(min-width: 720px) 720px"><figcaption>TGS-REQ (S4U2Self)</figcaption></figure><p>The KDC responds with the Elliot.A&#xB4;ST and the session key:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-140.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="862" height="751" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-140.png 600w, https://labs.lares.com/content/images/2024/08/image-140.png 862w" sizes="(min-width: 720px) 720px"><figcaption>TGS-REP (S4U2Self)</figcaption></figure><p>3. DEV sends its own TGT, an authenticator, and the S4U2Self additional ticket, asking the KDC for an CIFS/FS1 service ticket:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-132.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="861" height="782" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-132.png 600w, https://labs.lares.com/content/images/2024/08/image-132.png 861w" sizes="(min-width: 720px) 720px"><figcaption>TGS-REQ (S4U2Proxy)</figcaption></figure><p>Here is the difference from the classic constrained delegation, the KDC checks: </p><ul><li>If FS1$ is listed in DEV$ msDS-AllowedToDelegateTo. Since RBCD has been configured and not KCD , <strong>Constrained Delegation cannot be applied.</strong></li><li>Then, as a &quot;fallback&quot; if DEV$ is listed in msDS-AllowedToActOnBehalfOfOtherIdentity attribute of FS1$. <strong>RBCD can be applied.</strong></li></ul><p>4. DEV request CIFS access to FS1 <strong>on behalf of Elliot.A</strong> through the AP-REQ message and FS1 will reply DEV, performing the mutual authentication process via the AP-REQ message.</p><p>5. Finally, the web application will return the information retrieved for Elliot.A through an AP-REP message via HTTP (Mutual authentication between<br>the DEV and Elliot.A).</p><!--kg-card-begin: markdown--><h5 align="center" id="abusingrbcd">Abusing RBCD:</h5><!--kg-card-end: markdown--><p>Having write rights on the target <strong>msDS-AllowedToActOnBehalfOfOtherIdentity</strong> attribute enables the configuration of Resource-Based Constrained Delegation (RBCD). Exploiting this trust requires an account capable of invoking both S4U2Self and S4U2Proxy, though, fortunately, any account with a configured SPN can invoke these extensions, allowing for the impersonation of any user against the services tied to the affected service account.</p><p>The quickest way is to create a machine account, as demonstrated in the following example is by using PowerMad:</p><p><strong>Note: </strong><em><a href="@tiraniddo">James Forshaw</a> discovered a way to abuse <a href="https://www.tiraniddo.dev/2022/05/exploiting-rbcd-using-normal-user.html?ref=labs.lares.com">RBCD by using a user without SPN</a>, but the account would be unusable. So in the following scenario, we used the traditional method, creating a machine account with MachineAccountQuota set to the default value (10).</em></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-121.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy"><figcaption>Powermand New-MachineAccount</figcaption></figure><p>Next, the msDS-AllowedToActOnBehalfOfOtherIdentity attribute in DEV will be edit with the new machine account:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-116.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="670" height="117" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-116.png 600w, https://labs.lares.com/content/images/2024/08/image-116.png 670w"><figcaption>Editing msDS-AllowedToActOnBehalfOfOtherIdentity using Powerview</figcaption></figure><p>Rubeus s4u function requests the delegated ST, specifying an SPN pointing to our target and a user to impersonate, using the new machine account credentials:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-117.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="959" height="804" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-117.png 600w, https://labs.lares.com/content/images/2024/08/image-117.png 959w" sizes="(min-width: 720px) 720px"><figcaption>Rubeus S4u</figcaption></figure><p>The resulting ticket will be forwardable:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-118.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="958" height="640" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-118.png 600w, https://labs.lares.com/content/images/2024/08/image-118.png 958w" sizes="(min-width: 720px) 720px"><figcaption>Rubeus describe function</figcaption></figure><p>Use that service ticket as proof of authentication in S4U2Proxy for FS1$:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-119.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="692" height="467" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-119.png 600w, https://labs.lares.com/content/images/2024/08/image-119.png 692w"><figcaption>Rubeus SF4 and PTT</figcaption></figure><p>Through pass-the-ticket, access to the target service will be granted:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-120.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy"><figcaption>PTT access granted</figcaption></figure><p>From Linux, the process would be the same, easily replicable using impacket, <a href="https://raw.githubusercontent.com/fortra/impacket/master/examples/addcomputer.py?ref=labs.lares.com">addcomputer</a>, <a href="https://raw.githubusercontent.com/fortra/impacket/master/examples/rbcd.py?ref=labs.lares.com">rbcd.py</a> and <a href="https://raw.githubusercontent.com/fortra/impacket/master/examples/getST.py?ref=labs.lares.com">getST</a>.</p><!--kg-card-begin: markdown--><h5 align="center" id="usefuldefenses">Useful Defenses:</h5><!--kg-card-end: markdown--><ul><li>Enable <strong>AccountNotDelegated </strong>(<em>Account is sensitive and cannot be delegated</em>) UAC flag on your Tier-0 accounts.</li><li>Identify all the servers that have delegation configured and change to constrained delegation whenever possible.</li><li>Add user accounts to the Protected Users Security Group.</li><li><a href="https://github.com/SigmaHQ/sigma/pull/4886?ref=labs.lares.com">Sigma rule for unconstrained delegation (PS-Enumeration).</a></li><li><a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/plan/appendix-l--events-to-monitor?ref=labs.lares.com">Events</a>: 4769 - 5156 - 4624 - 5140 - 5145 - 4675 - 4672 - 4673- 4611- 5136.</li><li><a href="https://attack.mitre.org/?ref=labs.lares.com">Techniques </a>- T1589.002. , T1018, T1550.003, T1078.002, T1078.002, T1589.002.</li></ul><p>We hope you enjoyed this Kerberos series, and that the series will continue to serve as a reference for your Kerberos queries.<br>Finally, thank you for reading it!</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/08/image-85.png" class="kg-image" alt="Kerberos IV - Delegations" loading="lazy" width="744" height="717" srcset="https://labs.lares.com/content/images/size/w600/2024/08/image-85.png 600w, https://labs.lares.com/content/images/2024/08/image-85.png 744w" sizes="(min-width: 720px) 720px"><figcaption>END.</figcaption></figure><!--kg-card-begin: markdown--><h2 align="center" id="resources">Resources</h2><!--kg-card-end: markdown--><ul><li>Specterops - <a href="https://posts.specterops.io/hunting-in-active-directory-unconstrained-delegation-forests-trusts-71f2b33688e1?ref=labs.lares.com">Hunting in active directory : Unconstrained Delegation.</a></li><li>Atl4s - <a href="https://attl4s.github.io/?ref=labs.lares.com">Understanding - or at least, trying to.</a></li><li>Dirk-Jan Mollema - <a href="https://dirkjanm.io/krbrelayx-unconstrained-delegation-abuse-toolkit?ref=labs.lares.com">Having fun with unconstrained delegation.</a></li><li>Harmj0y - <a href="https://harmj0y.medium.com/s4u2pwnage-36efe1a2777c?ref=labs.lares.com">S4U2Pwnage</a>. | <a href="https://blog.harmj0y.net/redteaming/another-word-on-delegation/?ref=labs.lares.com">Another word of delegation</a>.</li><li>Elad Shamir - <a href="https://shenaniganslabs.io/2019/01/28/Wagging-the-Dog.html?ref=labs.lares.com">Wagging the dog, abusing RBCD</a>.</li><li>Charlie Clark - <a href="https://exploit.ph/user-constrained-delegation.html?ref=labs.lares.com">Abusing Users Configured with K-UD.</a></li><li>Charlie Bromber - <a href="https://www.youtube.com/watch?v=vhJaSwEGtnw&amp;ab_channel=AllHackingCons&amp;ref=labs.lares.com">Bypass Kerberos Delegation.</a></li><li>Splunk - <a href="https://www.splunk.com/en_us/blog/security/detecting-active-directory-kerberos-attacks-threat-research-release-march-2022.html?ref=labs.lares.com">Detecting Active Directory Kerberos Attacks.</a></li><li>Luemmelsec - <a href="https://luemmelsec.github.io/S4fuckMe2selfAndUAndU2proxy-A-low-dive-into-Kerberos-delegations/?ref=labs.lares.com">A low dive into Kerberos Delegations</a>. </li><li>Swolfsec - <a href="https://swolfsec.github.io/2023-11-29-Detecting-Resource-Based-Constrained-Delegation/?ref=labs.lares.com">Detecting RBCD</a>.</li></ul><!--kg-card-begin: html--><style>
    .article-image {
        max-width: 600px;
        margin: 0 auto !important;
        float: none !important;
	}
</style><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Kerberos III - User Impersonation]]></title><description><![CDATA[The goal of this post, whether we are adversaries or defenders, is to help us understand the multiple ways that Kerberos offers to access resources using the credential material gathered.]]></description><link>https://labs.lares.com/fear-kerberos-pt3/</link><guid isPermaLink="false">65e0de195842ec7502fb4635</guid><category><![CDATA[penetrationtesting]]></category><category><![CDATA[kerberos]]></category><dc:creator><![CDATA[Raúl Redondo]]></dc:creator><pubDate>Tue, 21 May 2024 09:00:11 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2024/03/kerbers_user_impersonation2.png" medium="image"/><content:encoded><![CDATA[<img src="https://labs.lares.com/content/images/2024/03/kerbers_user_impersonation2.png" alt="Kerberos III - User Impersonation"><p>In the <a href="https://labs.lares.com/fear-kerberos-pt2/">second part of the Kerberos series</a>, we delved into how the Kerberos authentication flow allows the enumeration of domain user accounts and the validation of credentials through the network messages employed by Kerberos. Additionally, it was demonstrated that user credential material can be obtained through the AS-REQ/AS-REP and TGS-REQ/TGS-REP messages. The UnPAC technique was also discussed, which allows for obtaining the NTLM hash of a user authenticated through Kerberos PKINIT as a pre-authentication mechanism. &#xA0;</p><p>In this third part, we will explore the techniques for leveraging those credentials for lateral movement, privilege escalation, and persistence methods within the Active Directory environment. </p><!--kg-card-begin: markdown--><ul>
<li><a href="#UserImpersonation">User Impersonation</a>
<ul>
<li><a href="#ptk">Pass the Key / Overpass the hash</a></li>
<li><a href="#ptt">Pass the Ticket / Pass the Cache</a></li>
<li><a href="#ptt">Pass the Certificate</a></li>
<li><a href="#shadowcreds">Shadow Credentials</a></li>
<li><a href="#tickets">Playing with (and forging) tickets</a>
<ul>
<li><a href="#silver">Silver tickets</a></li>
<li><a href="#golden">Golden tickets</a></li>
<li><a href="#diamond">Diamond tickets</a></li>
<li><a href="#sapphire">Sapphire tickets</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#resources">Resources</a></li>
</ul>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h3 align="center" id="UserImpersonation">User Impersonation:</h3><!--kg-card-end: markdown--><p>Once access to an Active Directory environment is achieved, it is crucial to understand how, as adversaries, the credential material obtained can be used to authenticate through Kerberos and impersonate users. Clear-text passwords, hashes, Kerberos keys, or certificates acquired during an engagement can be leveraged to access new resources within the domain, facilitating lateral movement or privilege escalation. This post will focus on these techniques. Operational Security (OPSEC) concepts will not be covered, as the goal is to understand each method comprehensively. Additionally, brief notes about detection and recommendations have been included for each technique.</p><!--kg-card-begin: markdown--><h3 align="center" id="ptk">Pass the Key / Overpass the Hash</h3><!--kg-card-end: markdown--><p>As discussed in <a href="https://labs.lares.com/fear-kerberos-pt1/">the first post of the series,</a> the user must undergo the pre-authentication process before a user can obtain a TGT from the KDC. This pre-authentication mechanism is enabled by default for all accounts within the domain. Still, it can be disabled (<a href="https://labs.lares.com/fear-kerberos-pt2/#asrep">ASREPRoast</a> becomes a viable attack path when it is disabled, as described in the second post of the series about credential access). This pre-authentication mechanism requires credential material from the user, meaning any secret keys derived from their password, whether DES, RC4, AES128, or AES256 keys. If we have access to any of these keys, we can request TGTs on behalf of that user.</p><p>The only difference between Pass the Key and Overpass the Hash is that Pass the Key uses the user&apos;s RC4 key, essentially the NT hash.</p><p>From Linux, Impacket&apos;s <a href="https://github.com/fortra/impacket/blob/master/examples/getTGT.py?ref=labs.lares.com">getTGT </a>can be used with the user&apos;s NT hash (overpass-the-hash) :</p><pre><code>impacket-getTGT -hashes :NTHASH DOMAIN/USER@HOST</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-150.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="1114" height="99" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-150.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-150.png 1000w, https://labs.lares.com/content/images/2024/03/image-150.png 1114w" sizes="(min-width: 720px) 720px"><figcaption>getTGT with NT hash</figcaption></figure><p>The traffic generated is the legitimate TGT request to the KDC (AS-REQ/AS-REP). The following image shows how the user uses the RC4 etype (<em>Kerberos Encryption Type Number </em><strong><em>23</em></strong>) to encrypt the timestamp:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-154.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="974" height="439" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-154.png 600w, https://labs.lares.com/content/images/2024/03/image-154.png 974w" sizes="(min-width: 720px) 720px"><figcaption>AS-REQ with NT hash</figcaption></figure><p>And with the user AES key (pass-the-key):</p><pre><code>impacket-getTGT -aesKey AESKey DOMAIN/USER@HOST</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-151.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="1118" height="101" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-151.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-151.png 1000w, https://labs.lares.com/content/images/2024/03/image-151.png 1118w" sizes="(min-width: 720px) 720px"><figcaption>getTGT with AES key</figcaption></figure><p>In line with prior observations, now, the network traffic capture displays the timestamp encrypted using AES256 (<em>Kerberos Encryption Type Number <strong>18</strong></em>):</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-153.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="976" height="455" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-153.png 600w, https://labs.lares.com/content/images/2024/03/image-153.png 976w" sizes="(min-width: 720px) 720px"><figcaption>AS-REQ with AES 256 key</figcaption></figure><p>From Windows, the same action can be performed using Rubeus, asking for a TGT (askTGT) with the user&apos;s keys:</p><pre><code>.\Rubeus asktgt /domain:DOMAIN /user:USER /enctype:ENCTYPE /aes256:AESKEY /nowrap /ptt</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-112.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="891" height="524" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-112.png 600w, https://labs.lares.com/content/images/2024/03/image-112.png 891w" sizes="(min-width: 720px) 720px"><figcaption>Rubeus asktgt using AES256 key</figcaption></figure><p>After successfully executing overpass-the-hash / pass-the-key and obtaining a TGT, the next step could involve carrying out pass-the-ticket.</p><p><em><strong>Note:</strong></em></p><p>To obtain the user&apos;s hashes from his password in clear, use the <code>hash</code> function of Rubeus:</p><pre><code>.\Rubeus.exe hash /password:pass /user:USER /domain:DOMAIN</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-110.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="905" height="329" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-110.png 600w, https://labs.lares.com/content/images/2024/03/image-110.png 905w" sizes="(min-width: 720px) 720px"><figcaption>Rubeus hash</figcaption></figure><p>From the Rubeus documentation, this function will generate the <em>rc4_hmac </em>(<strong>NTLM</strong>) representation of the password using <a href="@gentilkiwi">@gentilkiwi</a>&apos;s kerberos:hash (<em>KERB_ECRYPT HashPassword</em>) approach. If user and domain names are specified, the hash forms<em> aes128_cts_hmac_sha1, aes256_cts_hmac_sha1 and des_cbc_md5</em> are generated. The AES and DES implementations use the user and domain names as salts.</p><p>Useful Event IDs &amp; Defenses:</p><ul><li>4768 &#x2013; A Kerberos authentication ticket (TGT) was requested. (Encryption Type for RC4/AES128/AES256).</li><li>Monitor unusual login times and atypical locations.</li><li>Service ticket requests that do not follow normal user behavior.</li></ul><!--kg-card-begin: markdown--><h3 align="center" id="ptt">Pass the Ticket / Pass the Cache</h3><!--kg-card-end: markdown--><p>Through these techniques, an adversary reuses domain user tickets to inject them into memory and, through the Kerberos authentication flow, gains access to resources/services where the user is authorized without knowing any user credential material.</p><p>On Windows hosts, once admin rights are achieved, it is possible to extract the TGTs from the Local Security Authority Subsystem Service (LSASS) process using tools such as mimikatz.</p><p>Furthermore, ticket dumping can be performed using Rubeus. As we can read in the Rubeus description: </p><ul><li><em>Rubeus has no code that touches LSASS (and is not intended to), so its functionality is limited to extracting Kerberos tickets using the </em><strong><em>LsaCallAuthenticationPackage() </em></strong><em>API. From a non-elevated point of view, session keys for TGTs are not returned (by default), so only extracted service tickets will be usable (the tgtdeleg command uses a Kekeo trick to get a usable TGT for the current user).</em><strong><em> If, in a high-integrity context, a GetSystem equivalent is executed using token duplication to elevate to SYSTEM, and a fake login application is registered with the LsaRegisterLogonProcess() </em></strong><em>API call. This allows privileged enumeration and extraction of all tickets currently registered with LSA on the system, resulting in base64-encoded .kirbi output for later reuse.</em></li></ul><p>Rubeus is employed in an elevated context to enumerate Kerberos tickets in the host:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-26.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="826" height="810" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-26.png 600w, https://labs.lares.com/content/images/2024/05/image-26.png 826w" sizes="(min-width: 720px) 720px"><figcaption>Rubeus triage - Tickets enumeration</figcaption></figure><p>Confirming the existence of tickets from a privileged user, in this case, a Domain Admin (lares.da), the process continues by dumping the desired ticket for the krbtgt service and the lares.da user:</p><pre><code>.\Rubeus.exe dump /service:targetSevice /user:targetUser /nowrap</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-24.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="824" height="782" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-24.png 600w, https://labs.lares.com/content/images/2024/05/image-24.png 824w" sizes="(min-width: 720px) 720px"><figcaption>Rubeus dump function</figcaption></figure><p>Creating a &#x201C;sacrificial session&#x201D; using the runas command is now advisable <strong>since a logon session can only hold a single TGT at a time, and injecting a new TGT into memory would delete the current user&apos;s TGT and cause authentication problems.</strong></p><p>In the new session, we import the TGT with the Rubeus ptt flag, and we will be able to access the privileged assets:</p><pre><code>runas /netonly /user:lareslabs.local\fake powershell.exe
.\Rubeus.exe ptt /ticket:&lt;b64EncondedTicket...&gt;</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-25.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="1206" height="848" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-25.png 600w, https://labs.lares.com/content/images/size/w1000/2024/05/image-25.png 1000w, https://labs.lares.com/content/images/2024/05/image-25.png 1206w" sizes="(min-width: 720px) 720px"><figcaption>runas &quot;sacrificial session&quot; and Rubeus Pass-The-Ticket (ptt)</figcaption></figure><p>The ticket can also be used on Linux systems to perform the same technique (Pass-the-Cache). </p><p>The Impacket tool &apos;<a href="https://github.com/fortra/impacket/blob/master/examples/ticketConverter.py?ref=labs.lares.com">ticketerConverter</a>&apos; allows the conversion of .kirbi to .ccache format and vice versa, enabling export to the system. This converted ticket can then be used with tools that support Kerberos authentication, like the Impacket suite:</p><pre><code>echo &quot;&lt;b64EncodedTicket&gt;&quot; | base64 -d &gt; ticket.kirbi
impacket-ticketConverter ticket.kirbi ticket.ccache
export KRB5CCNAME=ticket.ccache
impacket-&lt;anyScript&gt; -k -no-pass ....</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-28.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="1196" height="664" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-28.png 600w, https://labs.lares.com/content/images/size/w1000/2024/05/image-28.png 1000w, https://labs.lares.com/content/images/2024/05/image-28.png 1196w" sizes="(min-width: 720px) 720px"><figcaption>Pass-The-Cache</figcaption></figure><!--kg-card-begin: markdown--><h3 align="center" id="ptc">Pass the Certificate</h3><!--kg-card-end: markdown--><p>As discussed in the first post of the series, <a href="https://labs.lares.com/fear-kerberos-pt1/#PKINIT">Kerberos I - Overview</a>, every client must go through a &#x2018;pre-authentication&#x2019; process before obtaining a Ticket Granting Ticket (TGT) from the KDC, which can be used to get service tickets. </p><p>This pre-authentication process can be validated, among other things, by encryption algorithms such as DES, RC4, AES128, or AES256, or in an asymmetric way (public key), <strong>using certificates</strong> (Public Key Cryptography for initial authentication (<a href="https://datatracker.ietf.org/doc/html/rfc4556?ref=labs.lares.com">PKINIT</a>)).</p><p>In short, Pass the Ticket is nothing more than performing Kerberos pre-authentication through PKINIT to obtain a user&apos;s TGT, from which we have obtained a valid certificate for authentication.</p><p>Below is an example of obtaining a user certificate by abusing the ESC1 misconfiguration in ADCS. Then we perform Pass the Certificate using the &#x201C;auth&#x201D; function of <code>certipy</code>:</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/05/image-48.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="1009" height="674" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-48.png 600w, https://labs.lares.com/content/images/size/w1000/2024/05/image-48.png 1000w, https://labs.lares.com/content/images/2024/05/image-48.png 1009w" sizes="(min-width: 720px) 720px"></figure><p>We have several posts about ADCS misconfigurations in the series &#x201C;Common ADCS Vulnerabilities: Logging, Exploitation, and Investigation&#x201D; by Louai Abboud:</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://labs.lares.com/adcs-exploits-investigations-pt1/"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Common ADCS Vulnerabilities: Logging, Exploitation, and Investigation - Part 1</div><div class="kg-bookmark-description">In a two-part series, we look at Active Directory Certificate Services (ADCS), how to stand up a lab environment and logging from a defensive standpoint.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://labs.lares.com/content/images/size/w256h256/2023/04/logo-lares-consulting-crest-white.png" alt="Kerberos III - User Impersonation"><span class="kg-bookmark-author">Lares Labs</span><span class="kg-bookmark-publisher">Louai Abboud</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://labs.lares.com/content/images/2023/07/2023-06-21-17-20-19.png" alt="Kerberos III - User Impersonation"></div></a></figure><p>In the network traffic, we could see the certificate sent through the AS-REQ type request:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-50.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="804" height="828" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-50.png 600w, https://labs.lares.com/content/images/2024/05/image-50.png 804w" sizes="(min-width: 720px) 720px"><figcaption>Kerberos PKINIT pre-authentication</figcaption></figure><p>In the same way, the technique can be carried out using <code>asktgt</code> function of Rubeus, indicating the user&apos;s certificate. In addition, with the <code>/getcredentials</code> flag, it will perform <a href="https://labs.lares.com/fear-kerberos-pt2/#UNPAC">UnPAC the hash</a> to obtain the user&apos;s NT-LM hash:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-52.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="1082" height="804" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-52.png 600w, https://labs.lares.com/content/images/size/w1000/2024/05/image-52.png 1000w, https://labs.lares.com/content/images/2024/05/image-52.png 1082w" sizes="(min-width: 720px) 720px"><figcaption>Rubeus Pass the Certificate (asktgt)</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-53.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy"><figcaption>Rubeus get credentials using U2U (UnPAC the hash)</figcaption></figure><p>Useful Defenses:</p><ul><li>Audit Active Directory Certificate Services.</li><li>Remove &#x201C;Client Authentication&#x201D; where possible (ADCS).</li><li>Monitor pre-authentication events through PKINIT on non-regular users.</li><li>Event 4768: A Kerberos authentication ticket (TGT) was requested. If the PATYPE is PKINIT, the logon was a smart card logon.</li></ul><!--kg-card-begin: markdown--><h3 align="center" id="shadowcreds">Shadow Credentials:</h3><!--kg-card-end: markdown--><p>For compatibility reasons regarding environments where authentication with certificates is not supported, Microsoft introduced the <a href="https://learn.microsoft.com/en-us/windows/security/identity-protection/hello-for-business/?ref=labs.lares.com">Key Trust</a> concept. In the Key Trust model, authentication is established and validated based on raw data instead of certificates.</p><p>In these environments, the public key of the client (either user accounts or machine accounts) is stored in its <a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-ada2/45916e5b-d66f-444e-b1e5-5b0666ed4d66?ref=labs.lares.com">msDS-KeyCredentialLink</a> attribute.</p><p>When the client attempts to pre-authenticate with PKINIT, the KDC will check that the authenticating user knows the private key matching the public key stored in its msDS-KeyCredentialLink multi-value attribute. If there is a match, a TGT will be sent. The value in this attribute is<strong> </strong><a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/de61eb56-b75f-4743-b8af-e9be154b47af?ref=labs.lares.com"><strong>Key Credentials,</strong></a><strong> which are serialized objects that include, among other information, the client&apos;s public key.</strong></p><p>Shadow Credentials was introduced by Elad Shamir, and as he explains in his post &#x201C;<a href="https://posts.specterops.io/shadow-credentials-abusing-key-trust-account-mapping-for-takeover-8ee1a53566ab?ref=labs.lares.com">Shadow Credentials: Abusing Key Trust Account Mapping for Account Takeover</a>&#x201D;, in case of compromise an account with enough privileges to write that attribute to another domain account (user/machine account), e.g GenericWrite rights, this allows us to create a key pair, append it to the raw public key in the attribute, and gain persistent and stealthy access to the target object.</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://posts.specterops.io/shadow-credentials-abusing-key-trust-account-mapping-for-takeover-8ee1a53566ab?ref=labs.lares.com"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Shadow Credentials: Abusing Key Trust Account Mapping for Takeover</div><div class="kg-bookmark-description">The techniques for DACL-based attacks against User and Computer objects in Active Directory have been established for years. If we&#x2026;</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://cdn-static-1.medium.com/_/fp/icons/Medium-Avatar-500x500.svg" alt="Kerberos III - User Impersonation"><span class="kg-bookmark-author">Posts By SpecterOps Team Members</span><span class="kg-bookmark-publisher">Elad Shamir</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://miro.medium.com/v2/resize:fit:803/0*GOmjK-qblfeeDa5K.png" alt="Kerberos III - User Impersonation"></div></a></figure><p>This attack involves the following requirements:</p><ul><li>A domain that supports PKINIT AND contains <strong>at least one Domain Controller running Windows Server 2016 or above.</strong></li><li>A domain where the Domain Controller(s) has its own key pair (for the session key exchange) (e.g. happens when AD CS is enabled or when a certificate authority (CA) is in place).</li><li>Control over an account that can edit the target object&apos;s msDs-KeyCredentialLink attribute.</li></ul><p>Our post &#x2018;<em><a href="https://labs.lares.com/securing-active-directory-via-acls/">The Phantom Menace: Exposing hidden risks through ACLs in Active Directory</a></em>&#x2019; covers other examples of ACL abuse.</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://labs.lares.com/securing-active-directory-via-acls/"><div class="kg-bookmark-content"><div class="kg-bookmark-title">The Phantom Menace: Exposing hidden risks through ACLs in Active Directory</div><div class="kg-bookmark-description">The abuse of misconfigured Access Control Lists is nothing new. However, it is still one of the main ways of lateral movement and privilege escalation within an active directory domain.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://labs.lares.com/content/images/size/w256h256/2023/04/logo-lares-consulting-crest-white.png" alt="Kerberos III - User Impersonation"><span class="kg-bookmark-author">Lares Labs</span><span class="kg-bookmark-publisher">Ra&#xFA;l Redondo</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://labs.lares.com/content/images/2023/06/fine.png" alt="Kerberos III - User Impersonation"></div></a></figure><p>From Linux, <a href="https://github.com/ShutdownRepo/pywhisker?ref=labs.lares.com">pyWhisker</a>, by <a href="https://twitter.com/_nwodtuhs?ref=labs.lares.com">Charlie Bromberg</a>, provides a way to automate the whole process, from the RSA-peer keys creation to writing to the attribute of the target account. </p><p>In the following evidence, it is possible to see, together with <a href="https://github.com/p0dalirius/LDAPmonitor?ref=labs.lares.com">ldapmonitor</a>, how the msDS-KeyCredentialLink attribute of the user Darlene has been modified:</p><pre><code>pywhisker -d domain -u user -p password --target targetAccount --action add --filename certOutputFile</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-1.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="932" height="691" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-1.png 600w, https://labs.lares.com/content/images/2024/05/image-1.png 932w" sizes="(min-width: 720px) 720px"><figcaption>Shadowcredentials and ldapmonitor tools</figcaption></figure><p>The following is a brief diagram about Shadow Credentials and how the Key Trust model works:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-41.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="978" height="771" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-41.png 600w, https://labs.lares.com/content/images/2024/05/image-41.png 978w" sizes="(min-width: 720px) 720px"><figcaption>Shadow Credentials and Key Trust Model</figcaption></figure><p>Once the attack is complete, an adversary can use the certificate to authenticate via PKINIT using Dirkjanm&apos;s <a href="https://github.com/dirkjanm/PKINITtools?ref=labs.lares.com">PKINITools</a>, being able to obtain a TGT to import it later and access services to which Darlene is authorized, or get the NTLM hash via <code>getnthash</code>, as we saw <a href="https://labs.lares.com/fear-kerberos-pt2/#UNPAC">in the first post</a> by requesting a TGS for yourself using Kerberos U2U.</p><p>Alternatively, if the Domain Controller does not accept PKINIT authentication (error KDC_ERR_PADATA_TYPE_NOSUPP), it is possible to authenticate with the target account using <a href="https://github.com/AlmondOffSec/PassTheCert?ref=labs.lares.com">passthecert</a>. The following example shows the use of PassTheCert with its ldap-shell function:</p><pre><code>passthecert.py -action ldap-shell -crt cert.crt -key cert.key -domain domain -dc-ip dcIp</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-8.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="1468" height="417" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-8.png 600w, https://labs.lares.com/content/images/size/w1000/2024/05/image-8.png 1000w, https://labs.lares.com/content/images/2024/05/image-8.png 1468w" sizes="(min-width: 720px) 720px"><figcaption>ldap-shell using passthecert</figcaption></figure><p>Useful Defenses:</p><ul><li>Audit Directory Service Changes (SACL configured).</li><li>Event - 5136: A directory service object was modified (SACL configured).</li><li>In environments where PKINIT authentication is not standard, the &quot;Kerberos authentication ticket (TGT) was requested&quot; event (4768) may be suspicious when the Certificate Information attributes are not blank.</li></ul><!--kg-card-begin: markdown--><h3 align="center" id="tickets">Playing with (and forging) tickets:</h3>
<!--kg-card-end: markdown--><p>If an adversary compromises a service&#xB4;s long-term secret key, he can forge tickets or modify them to be legitimate ones. As already discussed, tickets are encrypted with the service&apos;s secret key to whom they are targeted. </p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-42.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="976" height="484" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-42.png 600w, https://labs.lares.com/content/images/2024/05/image-42.png 976w" sizes="(min-width: 720px) 720px"><figcaption>Playing with tickets</figcaption></figure><p><strong><em>Note:</em></strong> Microsoft released the security patch <a href="https://support.microsoft.com/en-gb/topic/kb5008380-authentication-updates-cve-2021-42287-9dafac11-e0d0-4cb8-959a-143bd0201041?ref=labs.lares.com">KB5008380</a>&#x2014;Authentication updates in November 2021 to address CVE-2021-42287, aka Kerberos Key Distribution Center (KDC) confusion. This security bypass vulnerability affects the Kerberos PAC and, together with CVE-2021&#x2013;42278 (sAMAccountName spoofing), allows potential attackers to impersonate domain controllers. This attack is known as <a href="https://www.thehacker.recipes/a-d/movement/kerberos/samaccountname-spoofing?ref=labs.lares.com">noPAC</a>. After that, if the supplied user name does not exist in Active Directory, the KDC will return the error: <strong>KDC_ERR_TGT_REVOKED.</strong></p><p>The following is an example of forging a Silver Ticket with a user that does not exist (fakeUser) within the domain in an environment with an up-to-date KDC:</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/04/image-16.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="766" height="459" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-16.png 600w, https://labs.lares.com/content/images/2024/04/image-16.png 766w" sizes="(min-width: 720px) 720px"></figure><!--kg-card-begin: html--><h4 align="center" id="silver">Silver tickets:</h4><!--kg-card-end: html--><p>As discussed in <a href="https://labs.lares.com/fear-kerberos-pt1/">previous posts</a>, services are offered within the Active Directory through machine or service accounts. Acquiring the secret key associated with an account providing a specific service makes it possible to forge Silver Tickets (forged service tickets), impersonating any user for that designated service.</p><p>Knowing the secret key (NT hash or RC4/AES keys) of a principal offering a service, it is possible to create a data block just like those found in a legitimate service ticket of a <em>KRB_TGS_REP</em> message, specifying the realm, the intended SPN, the user requesting the service, and its PAC. Once the structure is created, the enc-part block will be encrypted with the compromised secret key.</p><p>But... as discussed in<a href="https://labs.lares.com/fear-kerberos-pt1/"> the first post of the series</a>, the <strong>PAC is double signed,</strong> first with the service account secret and a second signature with the krbtgt account secret. So how is it possible to forge the second signature on a service ticket without knowing the krbtgt account secret?, the answer is that it is unnecessary to, since the service (AP server) &#xA0;receives this ticket, it usually verifies only the first signature. This is because <strong>service accounts with SeTcbPrivilege, which can act as part of the operating system (e.g. the local SYSTEM account), do not verify the Domain Controller signature</strong>. Consequently, this technique presents a more significant challenge for detection than methods such as Golden Ticket, as there is no communication between the service and the KDC for PAC validation. In addition, any registration is limited to the target computer.</p><p>The following diagram outlines the process of creating a silver ticket:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-43.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy"><figcaption>Silver Ticket attack flow</figcaption></figure><p>The Impacket ticketer script allows forging TGTs/STs from scratch or based on a template (legally requested by KDC). The script will also enable data customization within the <em>PAC_LOGON_INFO</em>, such as groups, extrasids, etc. Ticketer tickets have a lifetime of 10 years from ticket creation.</p><p>This process involves leveraging the hash of the service account and specify the ServicePrincipalName (SPN) of the service account. Initially, obtaining the SID of the domain is essential, which can be accomplished, among other methods, using the &apos;<a href="https://github.com/fortra/impacket/blob/master/examples/lookupsid.py?ref=labs.lares.com">lookupsid</a>&apos; script:</p><!--kg-card-begin: markdown--><pre><code>impacket-lookupsid DOMAIN/USER:PASSW@HOST | grep &quot;Domain SID
</code></pre>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-125.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="806" height="76" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-125.png 600w, https://labs.lares.com/content/images/2024/03/image-125.png 806w" sizes="(min-width: 720px) 720px"><figcaption>Impacket lookupsid</figcaption></figure><p>With the SID of the domain and the hash of the service account, ticketer does the job:</p><pre><code>impacket-ticketer -aesKey AESKey -domain-sid DOMAINSID -domain DOMAIN -spn TARGET_SPN -dc-ip DCIP RANDOMNAME
</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-14.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="766" height="307" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-14.png 600w, https://labs.lares.com/content/images/2024/04/image-14.png 766w" sizes="(min-width: 720px) 720px"><figcaption>ticketed silver ticket</figcaption></figure><p>Importing the new ticket allows it to be utilized for the CIFS service:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-15.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="712" height="371" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-15.png 600w, https://labs.lares.com/content/images/2024/04/image-15.png 712w"><figcaption>kerberos authentication using a silver ticket</figcaption></figure><p>Analyzing Silver Ticket forging flow in Wireshark reveals that <strong>no preceding AS-REQ / AS-REP messages and no TGS-REQ / TGS-REP messages occur</strong>; only AP-REQ and (optionally) AP-REP messages are generated, indicating no communication with the Domain Controller.</p><p>Furthermore, it can be observed how privileged groups have been added to the PAC:</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/04/image-17.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="867" height="620" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-17.png 600w, https://labs.lares.com/content/images/2024/04/image-17.png 867w" sizes="(min-width: 720px) 720px"></figure><p>Likewise, Mimikatz can forge silver tickets through the &apos;kerberos::golden&apos; function:</p><pre><code>mimikatz &quot;kerberos::golden /admin: /domain: /sid: /target: /aes256: /service: /ptt&quot; exit</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-18.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="955" height="820" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-18.png 600w, https://labs.lares.com/content/images/2024/04/image-18.png 955w" sizes="(min-width: 720px) 720px"><figcaption>mimikatz silver ticket (&quot;golden&quot; function)</figcaption></figure><p>Typically, machine account passwords rotate every 30 days. So, obtaining the updated secret keys is imperative to create new silver tickets.</p><p>Useful Defenses:</p><ul><li>Enable privileged attribute certificate validation of Kerberos. This can assist with the prevention and detection of silver tickets.</li><li>Use a strong password policy for service accounts.</li><li>Enforce user least privilege.</li><li>Audit service accounts.</li></ul><!--kg-card-begin: markdown--><h4 align="center" id="golden">Golden tickets:</h4><!--kg-card-end: markdown--><p>If the secret key of the krbtgt account is compromised (e.g., through complete domain compromise and gaining DCSync rights), ticket-grating tickets (TGTs) signed by the krbtgt account can be forged.</p><p>With these TGTs forged with the <code>krbrtgt</code> secret key, an adversary can obtain service tickets and thus obtain permissions for any service, on any machine and as any domain user. Graphically, the flow of this attack would look like the following diagram:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-44.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="1089" height="637" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-44.png 600w, https://labs.lares.com/content/images/size/w1000/2024/05/image-44.png 1000w, https://labs.lares.com/content/images/2024/05/image-44.png 1089w" sizes="(min-width: 720px) 720px"><figcaption>Golden Ticket attack flow</figcaption></figure><p>To forge this Golden Ticket, an adversary will need the secret key of the krbtgt account (in this example, the NT hash) and the SID (Security IDentifier) of the domain:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-74.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="819" height="124" srcset="https://labs.lares.com/content/images/size/w600/2024/02/image-74.png 600w, https://labs.lares.com/content/images/2024/02/image-74.png 819w" sizes="(min-width: 720px) 720px"><figcaption>Getting krbtgt hash and the domain SID with impacket.</figcaption></figure><p>With the krbtgt hash and the domain SID, ticketer script can be used to forge the Golden Ticket. As we mentioned before, in environments with domain controllers updated at least to November 2021, we will need the -user-id of a user that exists within the domain:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-8.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="785" height="72" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-8.png 600w, https://labs.lares.com/content/images/2024/04/image-8.png 785w" sizes="(min-width: 720px) 720px"><figcaption>Domain User SID</figcaption></figure><pre><code>ticketer.py -user-id userID -aesKey krbtgtAESKey -domain-sid domainSid -domain domain -dc-ip DCIp domainUser </code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-7.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="848" height="612" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-7.png 600w, https://labs.lares.com/content/images/2024/04/image-7.png 848w" sizes="(min-width: 720px) 720px"><figcaption>Ticketer Golden Ticket</figcaption></figure><p>The following image illustrates how, when authenticating with Kerberos via psexec, the forged TGT is sent through a TGS-REQ with the privileged groups added to the PAC:</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/04/image-13.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="864" height="632" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-13.png 600w, https://labs.lares.com/content/images/2024/04/image-13.png 864w" sizes="(min-width: 720px) 720px"></figure><p>In the same way, from Windows, Rubeus allows this kind of tickets forging through its &quot;golden&quot; function:</p><pre><code>.\Rubeus.exe golden /aes256:KRBTGTAESKey /user:domainUser</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-21.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="1254" height="807" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-21.png 600w, https://labs.lares.com/content/images/size/w1000/2024/04/image-21.png 1000w, https://labs.lares.com/content/images/2024/04/image-21.png 1254w" sizes="(min-width: 720px) 720px"><figcaption>Rubeus golden ticket</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-22.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="812" height="416" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-22.png 600w, https://labs.lares.com/content/images/2024/04/image-22.png 812w" sizes="(min-width: 720px) 720px"><figcaption>access to CIFS after ptt with the Golden Ticket</figcaption></figure><p>Useful Defenses:</p><ul><li>Change the KRBTGT account password every 180 days.</li><li>Events 4768 &amp; 4769.</li><li>A possible tactic for detecting the use of golden tickets is to look for TGS-REQs without corresponding AS-REQs.</li><li>Restricting administrative privileges across security boundaries.</li><li>Well-known IOAs associated with Golden Tickets: the default End and Renew time is 10 years minus two days.</li></ul><!--kg-card-begin: markdown--><h4 align="center" id="diamond">Diamond tickets:</h4><!--kg-card-end: markdown--><p>Unlike a Golden Ticket, where a new TGT is forged with the hash of the krbtgt account, the <strong>Diamond Ticket technique modifies a legitimate TGT issued by a KDC</strong>. To do this, the TGT is decrypted using the secret key of the krbtgt account, then modified with the desired fields and re-signed with the key.</p><p>The following is a diagram showing the attack flow:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-45.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="1086" height="602" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-45.png 600w, https://labs.lares.com/content/images/size/w1000/2024/05/image-45.png 1000w, https://labs.lares.com/content/images/2024/05/image-45.png 1086w" sizes="(min-width: 720px) 720px"><figcaption>Diamond ticket attack flow</figcaption></figure><p>Rubeus performs this attack through its &#x201C;diamond&#x201D; function:</p><pre><code class="language-powershell">.\Rubeus.exe diamond /tgtdeleg /ticketuser:domainUser 
/ticketuserid:domainUserID /groups:groupsToAddToPAC /krbkey:KRBRTGTAESKey /ptt</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-29.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy"><figcaption>Rueus Diamond ticket</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-30.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="672" height="298" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-30.png 600w, https://labs.lares.com/content/images/2024/05/image-30.png 672w"><figcaption>Access to the DC after perform ptt with the Diamond ticket</figcaption></figure><!--kg-card-begin: markdown--><h4 align="center" id="sapphire">Sapphire tickets:</h4><!--kg-card-end: markdown--><p>Created by <a href="https://twitter.com/_nwodtuhs?ref=labs.lares.com">Charlie &quot;Shutdown</a>&quot;, Sapphire tickets are the evolution of Diamond Tickets, stealthier. These are legitimate tickets, but while the Diamond ticket modifies the PAC, the Sapphire ticket replaces it with the PAC of another privileged user. </p><p>The way to obtain the legitimate PAC of a privileged user is thanks to <a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-sfu/02636893-7a1f-4357-af9a-b672e3e3de13?ref=labs.lares.com">S4U2self+u2u</a>.</p><p>Although we will see this Kerberos extension in detail in the next post focusing on delegations, here is a brief summary of how these Kerberos extensions work:</p><p><a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-sfu/4a624fb5-a078-4d30-8ad1-e9ab71e0bc47?ref=labs.lares.com#gt_2214804a-4a44-46f4-b6d2-a78f4ff39a39"><strong>S4U2Self Extension</strong></a><strong>:</strong> <em>Subprotocol</em> e<em>xtension to the Kerberos protocol that allows a service to obtain a Kerberos service ticket for a user that has not authenticated to the Key Distribution Center (KDC). S4U includes S4U2proxy and S4U2self</em>. Basically, <strong>allows a service to receive the user&#x2019;s authorization data (e.g the PAC).</strong></p><p>For this extension, it is required through the KRB_TGS_REQ:</p><!--kg-card-begin: markdown--><ul>
<li>Must have at least one Service Principal Name (SPN) to allow the DC to encrypt the generated service ticket with the service secret key.</li>
<li>Data structure <a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-sfu/aceb70de-40f0-4409-87fa-df00ca145f5a?ref=labs.lares.com">PA_FOR_USER</a>, which contains the information about the user on whose behalf the service requests the service ticket.</li>
<li>The PAC returned in the service ticket in the following KRB_TGS_REQ contains the authorization data.</li>
</ul>
<!--kg-card-end: markdown--><p><a href="https://www.rfc-editor.org/rfc/rfc4120?ref=labs.lares.com#section-3.7"><strong>U2U Authentication</strong></a><strong>:</strong> <em>allows the client to request that the ticket issued by the KDC be encrypted using a session key from a TGT issued to the party that will verify the authentication</em>, basically <strong>provides a method to perform authentication when the verifier does not have access to long-term<br>service key.</strong> In order to perform this U2U authentication, the KRB_TGS_REQ needs to contain:</p><!--kg-card-begin: markdown--><ul>
<li>additional-tickets: field containing the TGT from the secret-key is taken.</li>
<li><a href="https://www.rfc-editor.org/rfc/rfc4120?ref=labs.lares.com#section-2.9.2">ENC-TKT-IN-SKEY</a> = TRUE : supports user-to-user authentication by allowing the KDC to issue a service ticket encrypted using thesession key from another TGT issued to another user.</li>
<li>ServiceName (sname) that can refer to an user, not necessarily a service with SPN.</li>
</ul>
<!--kg-card-end: markdown--><p>In brief, the following would be the forging flow of a Sapphire Ticket:</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/05/image-39.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="974" height="718" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-39.png 600w, https://labs.lares.com/content/images/2024/05/image-39.png 974w" sizes="(min-width: 720px) 720px"></figure><p>The following steps are taken during the Sapphire ticket forging process:</p><ol><li>Obtain the secret keys of <code>KRBTGT</code> and <code>Elliot.A</code>.</li><li>Performing the pre-authentication process with a non-privileged user through KRB_AS_REQ message (e.g for <code>Elliot.A</code>).</li><li>The KDC issued a legit TGT.</li></ol><!--kg-card-begin: markdown--><ol start="4">
<li>Generate a KRB_TGS_REQ with:
<ul>
<li>PA_FOR_USER: struc with the impersonated user (e.g Administrator)</li>
<li>Service name (same): Elliot.A, same user from the 1&#xBA; step.</li>
<li>Elliot.A&apos;s TGT will be added to the additional-tickets field</li>
<li>ENC-TKT-IN-SKEY flag set to TRUE (indicates that the ticket for the end server is to be encrypted in the session key from the additional TGT provided).</li>
</ul>
</li>
</ol>
<!--kg-card-end: markdown--><p>Analyzing the network traffic, it is possible to identify the mentioned requirements in the KRB_TGS_REQ request:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-46.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="1085" height="677" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-46.png 600w, https://labs.lares.com/content/images/size/w1000/2024/05/image-46.png 1000w, https://labs.lares.com/content/images/2024/05/image-46.png 1085w" sizes="(min-width: 720px) 720px"><figcaption>Custom KRB-TGS-REQ&#xA0;</figcaption></figure><p>The PA-FOR-USER padata value is used for the user that wants to impersonate (Administrator). As a snamestring, U2U is employed to obtain a service ticket for an unprivileged user (Elliot.A):</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-92.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="816" height="585" srcset="https://labs.lares.com/content/images/size/w600/2024/02/image-92.png 600w, https://labs.lares.com/content/images/2024/02/image-92.png 816w" sizes="(min-width: 720px) 720px"><figcaption>Ticketer network traffic</figcaption></figure><p>5. Obtain the service ticket for the Administrator using Elliot.A as sname, through TGS-REP response:</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/05/image-38.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="1082" height="663" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-38.png 600w, https://labs.lares.com/content/images/size/w1000/2024/05/image-38.png 1000w, https://labs.lares.com/content/images/2024/05/image-38.png 1082w" sizes="(min-width: 720px) 720px"></figure><p>6. Forge the sapphire ticket, replacing Elliot.A&apos;s original PAC using the ST PAC of Administrator + match the cname with &quot;Administrator&quot;.</p><p>From Windows hosts, at the date of writing this post, it has not been possible to replicate this attack, but ticketer could run it again on Linux:</p><pre><code class="language-python">ticketer.py -nthash krbtgtNTHash -request -impersonate &apos;Administrator&apos; -domain &apos;domain&apos; -user &apos;domainUser&apos; -password &apos;Password123&apos; -aesKey &apos;krbtgtAESKEY&apos; -domain-sid &apos;domainSID&apos; -dc-ip dcIP &apos;justignored&apos;</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-40.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="936" height="492" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-40.png 600w, https://labs.lares.com/content/images/2024/05/image-40.png 936w" sizes="(min-width: 720px) 720px"><figcaption>Impacket-ticketer Sapphire ticket</figcaption></figure><p>Once imported in the KRB5CCNAME environment variable, we will be able to access using any tool that accepts kerberos authentication:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/image-32.png" class="kg-image" alt="Kerberos III - User Impersonation" loading="lazy" width="659" height="286" srcset="https://labs.lares.com/content/images/size/w600/2024/05/image-32.png 600w, https://labs.lares.com/content/images/2024/05/image-32.png 659w"><figcaption>Authentication using Sapphire Ticket</figcaption></figure><p>Wrapping things up &#x2026;</p><p>In this third part of the Kerberos series, we&#x2019;ve dug a little deeper into the Kerberos user impersonation techniques. The goal with this post, whether we are adversaries or defenders, is to understand the multiple ways that Kerberos offers us to access resources using the credential material gathered.</p><p>We hope this installment of the Kerberos series has helped you better understand the number of techniques adversaries can use to attack the Kerberos authentication protocol.</p><p>In the next post of the series, we will continue to delve deeper, next time looking at &#x2018;Kerberos Delegations&#x2019; and talking about how this setting allows applications to request end-user access credentials to access resources on behalf of the originating user and how an adversary would benefit from this flow.</p><!--kg-card-begin: markdown--><h3 align="center" id="resources">Resources:</h3><!--kg-card-end: markdown--><ul><li>Alva Duckwall &amp; Benjamin Delpy - Abusing Microsoft Kerberos: <a href="https://www.youtube.com/watch?v=lJQn06QLwEw&amp;ab_channel=BlackHat&amp;ref=labs.lares.com">Sorry You Guys Don&apos;t Get It</a>.</li><li>Netwrix - <a href="https://blog.netwrix.com/2022/08/31/impersonating-service-accounts-with-silver-tickets/?ref=labs.lares.com">Exploiting Service Accounts.</a></li><li>Adsecurity - <a href="https://adsecurity.org/?p=556&amp;ref=labs.lares.com">Mimikatz and Active Directory Kerberos Attacks</a>.</li><li>Unit42 - &#xA0;<a href="https://unit42.paloaltonetworks.com/next-gen-kerberos-attacks/?ref=labs.lares.com">The New Generation of Kerberos Attacks</a>.</li><li>Fortra - <a href="https://www.coresecurity.com/core-labs/articles/impacket-we-love-playing-tickets?ref=labs.lares.com">Impacket - We love playing tickets</a>.</li><li><a href="https://blog.netwrix.com/2022/10/04/overpass-the-hash-attacks/?ref=labs.lares.com">Overpass-the-Hash Attack: Principles and Detection</a>.</li><li>Elda Shamir - <a href="https://posts.specterops.io/shadow-credentials-abusing-key-trust-account-mapping-for-takeover-8ee1a53566ab?ref=labs.lares.com">Shadow Credentials</a>.</li><li>Atl4s - <a href="https://attl4s.github.io/?ref=labs.lares.com">Understanding - or at least, trying to.</a></li><li>Peter Gabaldon - <a href="https://pgj11.com/posts/Diamond-And-Sapphire-Tickets/?ref=labs.lares.com">Diamond and Sapphire Tickets</a>.</li><li>Tarlogic - <a href="https://www.tarlogic.com/cybersecurity-glossary/kerberos/?ref=labs.lares.com">Kerberos</a>.</li><li>Packt - <a href="https://security.packt.com/nopac-vulnerability/?ref=labs.lares.com">NoPac Vulnerability</a>.</li><li>Cyberstoph - <a href="https://cyberstoph.org/posts/2022/03/detecting-shadow-credentials/?ref=labs.lares.com">Detecting shadow credentials</a>.</li><li>GhostPack - <a href="https://github.com/GhostPack/Rubeus?ref=labs.lares.com">Rubeus.</a></li><li>Splunk - <a href="https://www.splunk.com/en_us/blog/security/detecting-active-directory-kerberos-attacks-threat-research-release-march-2022.html?ref=labs.lares.com">Detecting Active Directory Kerberos Attacks.</a></li></ul><p></p><p></p><!--kg-card-begin: html--><style>
    .article-image {
        max-width: 600px;
        margin: 0 auto !important;
        float: none !important;
	}
</style>
<!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Protecting Your Business - Ransomware Prevention and Recovery Best Practices]]></title><description><![CDATA[Ransomware attacks have emerged as one of the most significant cybersecurity threats to organisations worldwide, creating substantial challenges for data security and business continuity.]]></description><link>https://labs.lares.com/outcomes-of-ransomware/</link><guid isPermaLink="false">662797605842ec7502fb734b</guid><category><![CDATA[ransomware]]></category><dc:creator><![CDATA[Steve Spence]]></dc:creator><pubDate>Mon, 13 May 2024 09:00:45 GMT</pubDate><media:content url="https://images.unsplash.com/flagged/photo-1560854350-13c0b47a3180?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDF8fHJhbnNvbXdhcmV8ZW58MHx8fHwxNzEzODcwNzAxfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/flagged/photo-1560854350-13c0b47a3180?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDF8fHJhbnNvbXdhcmV8ZW58MHx8fHwxNzEzODcwNzAxfDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="Protecting Your Business - Ransomware Prevention and Recovery Best Practices"><p>Ransomware attacks have emerged as one of the most significant cybersecurity threats to organisations worldwide, particularly financial institutions, creating substantial challenges for data security and business continuity.</p><p>These attacks have become a major cybersecurity threat globally. They exploit vulnerabilities in hospital, medical, aviation, Telecoms, financial, and professional services systems and networks.</p><p>Lets pick out some key points, according to a <strong>2023</strong> report <a href="https://assets.sophos.com/X24WTUEQ/at/c949g7693gsnjh9rb9gr8/sophos-state-of-ransomware-2023-wp.pdf?ref=labs.lares.com">from Sophos</a> &quot;The State of Ransomware&quot;:</p><!--kg-card-begin: markdown--><ul>
<li><strong>76%</strong> of those who experienced a ransomware event said that, during the most significant attack, the cybercriminals involved successfully encrypted their data.</li>
<li><strong>46%</strong> paid the ransom to regain access to their data. However, even after payment, only an average of 63% of the encrypted data was successfully restored.</li>
<li><strong>30%</strong> of ransomware attacks where data was encrypted reported that data was also stolen.</li>
<li>Emails were the root cause of 30% (approx.) of attacks; 18% started with a malicious email and <strong>13%</strong> with phishing.</li>
<li>The <strong>mean recovery cost</strong> from a ransomware attack:
<ul>
<li><strong>$1.82 million</strong> - excluding ransomware payment.</li>
<li><strong>$2.6 million</strong> if paid and got data back</li>
<li><strong>$1.6 million</strong> - costs drop if successfully restoring from backups can be achieved as the primary means of recovery.</li>
</ul>
</li>
</ul>
<!--kg-card-end: markdown--><p>As you can see, in today&apos;s digital landscape, ransomware attacks continue to pose a significant threat to businesses of all sizes. These malicious attacks encrypt critical data, rendering it inaccessible until a ransom is paid.</p><p>To safeguard your organization against such threats and ensure quick recovery in the case of an attack, it&apos;s crucial to implement robust prevention and recovery measures.</p><h2 id="lets-breakdown-a-ransomware-attack">Lets Breakdown a &apos;Ransomware&apos; Attack</h2><p><em>(... at a high-level)</em></p><p>So before we talk about protecting your business from ransomware and recovery best practices, let&apos;s first break down a ransomware attack. We&apos;ll use a well-known ransomware and explore how the attack unfolded.</p><h3 id="ransomware-wannacry">Ransomware: WannaCry</h3><p><strong>WannaCry</strong> was the first ransomware to exploit the <strong>EternalBlue</strong> flaw in Windows systems. You can find further info about WannaCry from the <a href="https://www.cisa.gov/news-events/alerts/2017/05/12/indicators-associated-wannacry-ransomware?ref=labs.lares.com">US CISA</a> &amp; <a href="https://www.ncsc.gov.uk/guidance/ransomware-wannacry-guidance-enterprise-administrators-1?ref=labs.lares.com">UK NCSC</a>.</p><p><strong><em>Note:</em></strong><em> Yes, WannaCry is a good few years old now, given that it happened in 2017; however, it is still one of the most prominent attacks on organizations around the globe and caught many organizations who thought they were prepared but weren&apos;t.</em></p><p>The U.K.&apos;s National Health Service (NHS) was one of the most prominent WannaCry victims. Multiple hospitals, general practitioners, and pharmacies were affected in England and Scotland. NHS facilities were forced to delay and divert medical services.</p><p><strong>Financial Losses:</strong> <strong>&#xA3;92 million</strong> <em>(approximately $100 million)</em> according to the <a href="https://www.nationalhealthexecutive.com/articles/wannacry-cyber-attack-cost-nhs-ps92m-after-19000-appointments-were-cancelled?ref=labs.lares.com">National Health Executive</a>:</p><ul><li><strong>&#xA3;20m</strong> was lost during the attack mainly due to lost output.</li><li>Followed by a further <strong>&#xA3;72m</strong> from the IT support to restore data and systems.</li><li><strong>Impact:</strong> Approx. <strong>19,000 appointment</strong>s were cancelled across the one week of the attack.</li></ul><p>This was coupled with 24-hour news coverage about the attack on the NHS, leading to patient panic, loss of faith in the service, and damage to the NHS brand itself.</p><h3 id="attack-breakdown">Attack Breakdown</h3><p><strong>The Key Points:</strong></p><!--kg-card-begin: markdown--><ul>
<li>WannaCry exploits a vulnerability in Microsoft&apos;s SMBv1 network resource-sharing protocol.</li>
<li>The exploit let the threat actors (TA) transmit crafted packets to any system that accepted data from the public internet on port 445.
<ul>
<li>SMBv1 is a deprecated network protocol.</li>
<li>SMB Should not be exposed to the internet.</li>
</ul>
</li>
<li>WannaCry appears on computers as a dropper.
<ul>
<li>This is a small helper program that delivers and installs malware.
<ul>
<li>Components in the dropper include:
<ul>
<li>An application for data encryption and decryption.</li>
<li>Files of encryption keys.</li>
<li>A copy of Tor for command-and-control communications.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>WannaCry used, at the time, a 0day exploit known as &apos;EternalBlue&apos; to spread.
<ul>
<li>TA first step: search the target network for devices accepting traffic on TCP port 445, indicating the system is configured to run SMB.</li>
<li>TA then initiate an SMBv1 connection to the device.
<ul>
<li>Once a connection is made, a buffer overflow is used to take control of the targeted system and install the ransomware component of the attack.</li>
</ul>
</li>
</ul>
</li>
<li>Once a system is affected, the WannaCry worm propagates itself and infects other unpatched devices.
<ul>
<li>All without any human interaction.</li>
</ul>
</li>
<li>WannaCry encrypts files on the hard drives of Windows devices so users can&apos;t access them.</li>
<li>Ransom payment demanded.
<ul>
<li>A significant flaw was noted with the release of decryption keys:
<ul>
<li>The TA didn&apos;t have any way to prove who paid the ransom, resulting in a completely manual process of attribution from the TA to attribute the decryption keys to the correct person/org who had paid.</li>
</ul>
</li>
</ul>
</li>
</ul>
<!--kg-card-end: markdown--><p><strong>Attack Diagram:</strong></p><figure class="kg-card kg-image-card kg-width-wide kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/05/WC-Ransomware-Breakdown.png" class="kg-image" alt="Protecting Your Business - Ransomware Prevention and Recovery Best Practices" loading="lazy" width="1993" height="682" srcset="https://labs.lares.com/content/images/size/w600/2024/05/WC-Ransomware-Breakdown.png 600w, https://labs.lares.com/content/images/size/w1000/2024/05/WC-Ransomware-Breakdown.png 1000w, https://labs.lares.com/content/images/size/w1600/2024/05/WC-Ransomware-Breakdown.png 1600w, https://labs.lares.com/content/images/2024/05/WC-Ransomware-Breakdown.png 1993w" sizes="(min-width: 1200px) 1200px"><figcaption>WannaCry Attack Diagram <em>(High-Level)</em></figcaption></figure><h3 id="attack-breakdown-summary">Attack Breakdown Summary</h3><p>WannaCry ransomware leverages vulnerabilities in Microsoft&apos;s SMBv1 network protocol to propagate across networks and encrypt files on Windows devices, demanding ransom payments for decryption.</p><p>The attack spreads via crafted packets sent to systems exposed to the Internet on port 445, exploiting a buffer overflow to install the ransomware component. Once infected, WannaCry autonomously propagates across unpatched devices, encrypting files without user interaction.</p><p>When we look at this, the UK&apos;s NHS, for instance, would have benefited from the following points, which would have ultimately aided in the prevention and/or more efficient recovery from such an attack:</p><p><strong>Network Segmentation:</strong></p><ul><li>Segment networks to prevent SMB traffic exposure to the internet, limiting access to internal systems only.</li><li>Use firewalls and network security measures to restrict traffic on port 445 and other vulnerable ports.</li></ul><p><strong>Vulnerability &amp; Patch Management:</strong></p><ul><li>Regularly update and patch systems to address known vulnerabilities.</li><li>Implement a robust vulnerability &amp; patch management program to ensure timely updates across all devices.</li></ul><p><strong>Disable SMBv1:</strong></p><ul><li>Disable SMBv1 protocol on all devices, as it is deprecated and prone to exploitation.</li><li>SMBv2 or SMBv3 protocols are used, which offer improved security features.</li></ul><p><strong>Endpoint Security:</strong></p><ul><li>Deploy endpoint protection solutions with ransomware detection and prevention capabilities to detect and mitigate ransomware attacks at the endpoint level.</li><li>Enable behaviour-based detection to identify and block suspicious activities indicative of ransomware behaviour.</li></ul><p><strong>Backup and Recovery:</strong></p><ul><li>Maintain regular backups of critical data stored offline or in secure, isolated environments.</li><li>Test backup restoration procedures regularly to ensure data can be recovered without paying the ransom in the event of a ransomware attack.</li></ul><h2 id="the-impact-of-ransomware-attacks"><strong>The Impact of Ransomware Attacks</strong></h2><p>The impact of ransomware attacks on any organisation, though in particular financial and healthcare institutions, can be and is far-reaching, resulting in severe consequences <em>(as discussed briefly in the section above, where the impact on the UK&apos;s NHS was highlighted)</em>.</p><p><strong>Financial Losses</strong><br>Ransomware attacks can result in substantial financial losses for any affected organisation, particularly financial institutions. Paying the ransom demanded by attackers is often costly and provides <strong>no</strong> guarantee of recovering the encrypted data. The costs of investigating the attack, restoring systems, and implementing enhanced security measures can also be significant.</p><p><strong>Regulatory Penalties</strong><br>Financial institutions in particular are subject to strict data protection and security regulations. In a ransomware attack leading to a data breach, regulators may impose severe penalties and fines for non-compliance. Moreover, reputational damage caused by non-compliance can further erode customer trust and investor confidence.</p><p><strong>Loss of Customer Trust / Reputation Damage</strong><br>Customers entrust organizations like professional services and financial institutions with sensitive financial data and personal information. A successful ransomware attack compromising this data can lose customer trust and loyalty and damage the brand irreparably. Customers may lose confidence in the compromised organizations&apos; ability to protect their data, leading to potential client/customer attrition.</p><p><strong>Operational Disruption</strong><br>Ransomware attacks can cause significant operational disruption for any organization, though in particular, financial institutions. Encrypting critical systems and data can render them inaccessible, resulting in delays and disruptions in financial transactions, customer services, and other essential operations. This can lead to a loss of productivity, decreased customer satisfaction, and potential financial losses.</p><p><strong>Legal Costs</strong><br>Ransomware attacks can also lead to legal consequences and associated costs for the effective organization. When client/customer data is compromised, affected individuals may take legal recourse for negligence in protecting their information. Legal fees, settlements, and potential damages can add to the financial impact of the attack.</p><p><strong>Loss of Intellectual Property</strong><br>In addition to customer data, ransomware attacks can also result in the theft or loss of valuable intellectual property. Many business and financial institutions may have proprietary software, algorithms, trading strategies, or other sensitive information that, if compromised, can lead to significant competitive disadvantages and financial losses.</p><p><strong>Disruption in Supply Chain</strong><br>Ransomware attacks targeting key organisations and financial institutions can also have ripple effects on their supply chain partners. Suppose threat actors gain access to these systems and use them as a launchpad for further attacks. In that case, it can impact other organizations connected to the compromised company, leading to a wider business and financial ecosystem disruption.</p><p><strong>Increased Insurance Premiums</strong><br>Following a ransomware attack, organizations and financial institutions may experience an increase in their cyber insurance premiums <em>(if applicable)</em>. Insurance companies may reassess the organization&apos;s risk profile and adjust premiums accordingly, adding to the financial burden and outlay.</p><h2 id="ten-best-practices-to-aid-your-recovery-strategy"><strong>Ten Best Practices to Aid Your Recovery Strategy</strong></h2><p>With all of the above in mind, here are ten best practices to consider which will aid your disaster recovery strategy and offset your threat model for ransomware:</p><!--kg-card-begin: markdown--><ol>
<li>
<p><strong>Backup Data</strong>: Regularly backup all important data and ensure that backups are stored securely offsite or in the cloud. This ensures that even if your primary data is compromised, you can restore it from a secure backup. Ideally multiple instances of sensitive data should exist, providing redundancy, should your data and primary back up data be successfully targeted.</p>
</li>
<li>
<p><strong>User Training</strong>: Educate employees about the risks of ransomware and social engineering attack vectors and provide training on how to identify phishing attempts and suspicious links or attachments.</p>
</li>
<li>
<p><strong>Email Filtering</strong>: Implement robust email filtering solutions to block malicious emails and prevent phishing attempts from reaching employees&apos; inboxes.</p>
</li>
<li>
<p><strong>Vulnerability &amp; Patching Management</strong>: Keep all software, operating systems, and applications up to date with the latest security patches to address known vulnerabilities.</p>
</li>
<li>
<p><strong>Network Security</strong>: Utilize firewalls, intrusion detection systems, and other network security measures to protect against unauthorized access and malware infiltration.</p>
</li>
<li>
<p><strong>Incident Response Plan</strong>: Develop a comprehensive incident response plan outlining steps to take in the event of a ransomware attack, including who to contact and how to contain the damage.</p>
</li>
<li>
<p><strong>Multi-Factor Authentication</strong>: Implement multi-factor authentication (MFA) wherever possible to add an extra layer of security to user accounts and systems.</p>
</li>
<li>
<p><strong>Regular Testing</strong>: Conduct regular testing and simulations of ransomware scenarios to evaluate the effectiveness of your prevention and recovery measures.</p>
</li>
<li>
<p><strong>Isolation</strong>: Segment your network and restrict access to critical systems to minimize the impact of a ransomware infection and prevent it from spreading across the entire network.</p>
</li>
<li>
<p><strong>Data Recovery</strong>: Establish procedures and tools for quickly recovering encrypted data from backups in the event of a ransomware attack, minimizing downtime and business disruption.</p>
</li>
</ol>
<!--kg-card-end: markdown--><p>By implementing these best practices, businesses can significantly reduce their risk of being victims of ransomware attacks and mitigate the impact if one does occur.</p><h2 id="in-summary">In Summary ...</h2><p>Remember, prevention is key, but having a robust recovery plan is equally essential to ensure business continuity in the face of cyber threats. Stay vigilant, stay prepared, and keep your business safe from ransomware.</p><p>In general, organizations should aim to focus on the following key areas:</p><!--kg-card-begin: markdown--><ul>
<li><strong>Robust vulnerability management (VM) program.</strong> Vulnerability management is a continuous, proactive, and often automated process that keeps your computer systems, networks, and enterprise applications safe from cyberattacks, such as ransomware and data breaches. The goal of VM is to reduce the organization&apos;s overall risk exposure by mitigating as many vulnerabilities as possible.
<ul>
<li>Maintaining good security hygiene, including timely patching and regularly reviewing security tool configurations</li>
</ul>
</li>
<li><strong>Security tooling, people and processes</strong> that defend against the most common attack vectors, including endpoint detection, protection and response.</li>
<li><strong>24/7 threat detection, investigation, and response</strong>, e.g., a security operation centre (SOC) whether delivered in-house or in partnership with a specialist Managed Detection and Response (MDR) service provider.</li>
<li><strong>Disaster response (DR) preparation and optimization</strong>, including making regular backups, practising recovering data from backups,  and maintaining an up-to-date incident response plan</li>
</ul>
<!--kg-card-end: markdown--><h2 id="how-can-we-help">How can we help?</h2><p>Here at Lares, we help empower organizations to maximize their security Potential.</p><p>Lares is a security consulting firm that helps companies secure electronic, physical, intellectual, and financial assets through a unique blend of assessment, testing, and coaching.</p><p>If you would like any further information, you can get in touch <a href="https://www.lares.com/contact/?ref=labs.lares.com">here</a> or head over to the <a href="https://www.lares.com/?ref=labs.lares.com">Lares.com</a> website for more information about how we can help you and the things that matter to you.</p>]]></content:encoded></item><item><title><![CDATA[SE101: Phishing Attack Overview and Breakdown]]></title><description><![CDATA[In short, just like Smishing, Phishing is a social engineering attack vector that leverages email-based messaging to deceive individuals/groups into taking several actions (outlined later in the post).]]></description><link>https://labs.lares.com/se101-phishing/</link><guid isPermaLink="false">66262d605842ec7502fb6ee9</guid><category><![CDATA[se101]]></category><category><![CDATA[Social Engineering 101]]></category><dc:creator><![CDATA[Steve Spence]]></dc:creator><pubDate>Tue, 30 Apr 2024 08:00:56 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1701724355618-55b0306ff6c6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDR8fHBoaXNoaW5nJTIwYXR0YWNrfGVufDB8fHx8MTcxMzgwMDU1MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1701724355618-55b0306ff6c6?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDR8fHBoaXNoaW5nJTIwYXR0YWNrfGVufDB8fHx8MTcxMzgwMDU1MXww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="SE101: Phishing Attack Overview and Breakdown"><p>Following on from the series created by <a href="https://labs.lares.com/author/chris/">Chris Pritchard</a>, <a href="https://labs.lares.com/tag/se101/">Social Engineering 101</a>, which features blogs by both Chris and I, this is the latest post in the series, which covers &#x2018;Phishing&#x2019;, a highly prevalent yet, more importantly, highly successful social engineering attack vector.</p><h2 id="what-exactly-is-%E2%80%98phishing%E2%80%99">What exactly is &#x2018;Phishing&#x2019;?</h2><p>At its most basic level, &apos; phishing&apos; involves sending fraudulent emails claiming to be from a reputable or well-known/trusted/familiar company or individual. The goal is to deceive recipients into clicking on a malicious link or downloading an infected attachment, usually to steal financial or confidential information.</p><p>Common tactics employed in Phishing attacks include masquerading as reputable entities, such as:</p><ul><li>Banks</li><li>Government agencies</li><li>Well-known service providers, e.g., Facebook, Microsoft, Netflix, etc.</li><li>Family and friends</li></ul><p>Regardless of the entity being masqueraded in the email, these messages often contain links and files, e.g., images, documents, and compressed/archived files, that, when interacted with, can lead to the compromise of the recipient device, personal information and/or the installation of malware.</p><p>As such, we must remain vigilant and educate ourselves, our colleagues, family and friends on recognizing and avoiding such deceptive messages to safeguard our sensitive information, or in the case of business, its proprietary and customer information.</p><p>Given the prevalence of laptops, tablets, mobile devices, and desktop computers in our daily lives, Phishing has always been and will most likely always be a popular tactic among cybercriminals.</p><h2 id="so-how-does-%E2%80%98phishing%E2%80%99-work-at-a-high-level">So, how does &#x2018;Phishing&#x2019; work at a high level?</h2><p>Well, this is a form/variant of a &#x2018;phishing&#x2019; attack, in which an attacker uses a compelling narrative within the email title and message body to lure, build rapport and ultimately trick the targeted recipient(s) into doing any or all of the following:</p><ul><li>Clicking a link which will have malicious intent or consequences</li><li>Sending the social engineer/threat actor private information</li><li>Sending the social engineer/threat actor corporate login information</li><li>Sending the social engineer/threat actor financial information</li><li>Purchasing gift certificates/store cards <em>e.g. Amazon, Apple&#x2026;</em></li><li>Transferring money to unknown accounts</li><li>Downloading malicious programs/software to the device(s) on which the email is being opened/read on</li></ul><p>It is worth noting that the social engineer/threat actor, or the &#x2018;Phisher&#x2019; as we&#x2019;ll now refer to them, may use your actual name and location to address you directly. Using these details makes the pretext of any message more compelling for the recipient.</p><h2 id="lets-breakdown-a-simple-phishing-attack">Lets Breakdown a Simple &apos;Phishing&apos; Attack</h2><p>So before we break the attack down, it is worth pointing out that there are several common phishing email pretexts/lures that, at one point or another, we&apos;ve all received at least one of:</p><ol><li><strong>The fake invoice scam:</strong> Deceptive emails posing as legitimate invoices from known companies, aiming to trick recipients into making payments to fraudulent accounts.</li><li><strong>Email account upgrade scam:</strong> False notifications claiming to be from email service providers urging users to upgrade their accounts by clicking on malicious links to steal login credentials.</li><li><strong>Advance-fee scam:</strong> Fraudulent emails promising large sums of money in exchange for a small advance payment, exploiting greed and desperation.</li><li><strong>Google Docs scam:</strong> Phishing emails disguised as Google Docs invitations, prompting recipients to grant access to their Google accounts and allowing attackers to steal personal information.</li><li><strong>PayPal Scam:</strong> Fraudulent emails impersonating PayPal, requesting account verification or claiming unauthorized transactions, aiming to obtain login credentials and financial details.</li><li><strong>Message from HR scam</strong> <em>(Corporate/Business user email)</em><strong>:</strong> Falsified emails purportedly from Human Resources departments often contain urgent requests for sensitive employee information or login credentials.</li><li><strong>Dropbox scam:</strong> Fake emails masquerading as notifications from Dropbox, tricking users into clicking on malicious links or attachments that install malware or steal credentials.</li><li><strong>The local government/council tax scam:</strong> Fraudulent emails impersonating local government authorities or tax agencies, demanding immediate payment of fictitious taxes or fines, preying on fear of legal consequences.</li><li><strong>Unusual activity scam:</strong> Suspicious emails claiming to be from online accounts or services, warning users of unusual activity and urging them to click on links to verify their identities, aiming to steal login credentials or personal information.</li></ol><p>The following breakdown is taken from an actual &#x2018;Phishing&#x2019; attack. Similar to our Smishing attack premise, the phishing email we&apos;re going to review targeted an individual user, using yet again the pre-text or &#x2018;lure&#x2019; of <strong>urgency</strong> and a <strong>reputable provider</strong>.</p><p><strong>The Phishing email:</strong></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/Phish-email-1.png" class="kg-image" alt="SE101: Phishing Attack Overview and Breakdown" loading="lazy" width="1221" height="1132" srcset="https://labs.lares.com/content/images/size/w600/2024/04/Phish-email-1.png 600w, https://labs.lares.com/content/images/size/w1000/2024/04/Phish-email-1.png 1000w, https://labs.lares.com/content/images/2024/04/Phish-email-1.png 1221w" sizes="(min-width: 720px) 720px"><figcaption>Our Phishing email using an iCloud pretext/lure</figcaption></figure><p><strong>Let&apos;s break down the email visually:</strong></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/Phish-email-annotated-2.png" class="kg-image" alt="SE101: Phishing Attack Overview and Breakdown" loading="lazy" width="1221" height="1132" srcset="https://labs.lares.com/content/images/size/w600/2024/04/Phish-email-annotated-2.png 600w, https://labs.lares.com/content/images/size/w1000/2024/04/Phish-email-annotated-2.png 1000w, https://labs.lares.com/content/images/2024/04/Phish-email-annotated-2.png 1221w" sizes="(min-width: 720px) 720px"><figcaption>Phishing email tell signs</figcaption></figure><!--kg-card-begin: markdown--><ol>
<li>Sense of urgency and fear, e.g., fear tactics. Folks are attached to their photos!</li>
<li>Brand imitation, sender email is attempting to imitate Apple iCloud; however, the sender email address is <code>nooreply@icloud.robert-howe.com</code>. Lets dig into this a little more:
<ol>
<li><code>nooreply</code> - nothing unusual here, a lot of orgs/companies use bulk sender addresses that start with <code>noreply</code> or varients of this.</li>
<li><code>@icloud.robert-howe.com</code>
<ol>
<li><code>icloud.</code> - attempt to reinforce believability; however this is actually a subdomain, as some of the more eagle eyed out there may have spotted!</li>
<li><code>robert-howe.com</code> - this is the actual top level domain and indicates beyond doubt that this email has not come from a legitimate Apple iCloud source address.</li>
</ol>
</li>
</ol>
</li>
<li>It was flagged as Spam, but not as an attempted phishing email; however, this should still raise your concerns that this is indeed a phishing attempt.</li>
<li>Brand imitation, use of Apple iCloud icon for increased believability, along with a failure message; however, if  you look at the grammatical syntax of the failure message, it also reads off, although grammatically it is correct!
<ol>
<li>From a well know and high profile brand such as Apple, I would have expected something like this, for example:
<ol>
<li><em>&quot;Failed to process payment when renewing your iCloud storage subscription.&quot;</em></li>
</ol>
</li>
</ol>
</li>
<li>Storage capacity, this looks off based on the details e.g., 48.9 out of 50GB.
<ol>
<li>Would Apple really make a simple user interface / user experience error like this??</li>
</ol>
</li>
<li>The font used is &apos;Comic Sans&apos;, which is very rarely, if ever, used in business communications from high profile brands.
<ol>
<li><em>Have you ever seen any legitimate business communications using Comic Sans font type to convey information?</em></li>
</ol>
</li>
<li>&apos;Full&apos; indicator button. Again, the use of fear and urgency tactics, with the colour red. The colour red is regularly associated with stop, danger, fear, anger, which consequently induces some form of quick response/action.</li>
<li>Expiration date, again continuing to build on the sense of urgency and fear tactics. Basically attempting to convey that if you don&apos;t take action by this date you could lose everything!</li>
</ol>
<!--kg-card-end: markdown--><p>One thing to note was that the entire email body was &apos;clickable&apos;, as when the mouse hovered over any part of the email body, the remote server URL was displayed at the bottom of the screen, as identified by point 9 and the red box outline:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/Phish-email-remote-url-closeUp-1.png" class="kg-image" alt="SE101: Phishing Attack Overview and Breakdown" loading="lazy" width="935" height="359" srcset="https://labs.lares.com/content/images/size/w600/2024/04/Phish-email-remote-url-closeUp-1.png 600w, https://labs.lares.com/content/images/2024/04/Phish-email-remote-url-closeUp-1.png 935w" sizes="(min-width: 720px) 720px"><figcaption>Redirect URL to malicious remote server</figcaption></figure><p>9. Redirect the URL to the remote malicious server via Google???.</p><p>Now, it is a little tricky to read; however, <strong>point 9</strong> and the <strong>red box</strong> depict a remote/redirect address linked to <code>https://storage.googleapis.com</code>, weird right? Why would Apple be using Google? Well, they aren&apos;t. This is the first of 2 redirect URLs which eventually land on a fake iCloud login portal:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/Fake-iCloud-LoginPortal-annotated-1.jpg" class="kg-image" alt="SE101: Phishing Attack Overview and Breakdown" loading="lazy" width="1023" height="775" srcset="https://labs.lares.com/content/images/size/w600/2024/04/Fake-iCloud-LoginPortal-annotated-1.jpg 600w, https://labs.lares.com/content/images/size/w1000/2024/04/Fake-iCloud-LoginPortal-annotated-1.jpg 1000w, https://labs.lares.com/content/images/2024/04/Fake-iCloud-LoginPortal-annotated-1.jpg 1023w" sizes="(min-width: 720px) 720px"><figcaption>Malicious iCloud login portal and credential harvester</figcaption></figure><!--kg-card-begin: markdown--><ol start="10">
<li>Bogus URL; although it looks to have a valid SSL/TLS Cert due to the green padlock, the URL being used is not correct. The legitimate iCloud URL is: <code>https://www.icloud.com/</code></li>
<li>Brand imitation, continuing with the fa&#xE7;ade of imitating Apple iCloud. Though this is not what the actual portal looks like at all!</li>
<li>Credential harvester, to capture users login details, which will then redirect you to a page of the threat actors choosing or the legitimate page</li>
</ol>
<!--kg-card-end: markdown--><p>Many of you may have flagged this as a phishing email or are wondering how folks would fall for this; however, folks still do and are! Especially folks who may not be as &apos;tech-savvy&apos;. When you think about it, the lure itself is very emotive; I mean, who would want to lose access to all their photos? This feeling of fear and impending loss is enough to make some folks do something they know they shouldn&apos;t, e.g., click the link and submit their iCloud login details, which could ultimately result in the compromise of their account if the targeted user doesn&apos;t have MFA enabled.</p><p>Let&apos;s end the breakdown with a little bit of fun! Would you be able to identify and spot any of the following emails as phishing emails:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/CHASE-phish-1.jpg" class="kg-image" alt="SE101: Phishing Attack Overview and Breakdown" loading="lazy" width="908" height="506" srcset="https://labs.lares.com/content/images/size/w600/2024/04/CHASE-phish-1.jpg 600w, https://labs.lares.com/content/images/2024/04/CHASE-phish-1.jpg 908w" sizes="(min-width: 720px) 720px"><figcaption>Financial Phish: CHASE Bank</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/CapOne-Phish-1.jpg" class="kg-image" alt="SE101: Phishing Attack Overview and Breakdown" loading="lazy" width="890" height="708" srcset="https://labs.lares.com/content/images/size/w600/2024/04/CapOne-Phish-1.jpg 600w, https://labs.lares.com/content/images/2024/04/CapOne-Phish-1.jpg 890w" sizes="(min-width: 720px) 720px"><figcaption>Financial Phish: Capital One Credit Card</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/NetFlix-Phish-1.jpg" class="kg-image" alt="SE101: Phishing Attack Overview and Breakdown" loading="lazy" width="948" height="822" srcset="https://labs.lares.com/content/images/size/w600/2024/04/NetFlix-Phish-1.jpg 600w, https://labs.lares.com/content/images/2024/04/NetFlix-Phish-1.jpg 948w" sizes="(min-width: 720px) 720px"><figcaption>Streaming Service Phish: Netflix</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/AWS-ShippingConf.png" class="kg-image" alt="SE101: Phishing Attack Overview and Breakdown" loading="lazy" width="860" height="1026" srcset="https://labs.lares.com/content/images/size/w600/2024/04/AWS-ShippingConf.png 600w, https://labs.lares.com/content/images/2024/04/AWS-ShippingConf.png 860w" sizes="(min-width: 720px) 720px"><figcaption>Online Shopping Phish: Amazon Shipping Notification</figcaption></figure><p><em>Note: this above Amazon email, in this instance, was/is indeed a phishing email, with the malicious links subtlety disguised as the &apos;Order #&apos; and the &apos;tax and seller information.</em></p><h2 id="so-how-can-we-protect-ourselves-from-phishing-attacks">So, how can we Protect Ourselves from Phishing Attacks?</h2><p>We all know and have heard about email phishing, its dangers, what to look for, and that if it ultimately feels &#x2018;off&#x2019;, we call it out; however, many folks out there still don&apos;t, for one reason or another!</p><p>So, we must continue to promote phishing awareness and protect ourselves from &apos;Phishing&apos; attacks. Depending on the targeted user&#x2019;s ability to identify a phishing attack and ignore or report the message, here are some simple steps as individuals, to be mindful of:</p><!--kg-card-begin: markdown--><ul>
<li><strong>Check</strong> the Sender&apos;s email; Look to ascertain or verify that the email is coming from the actual domain/business the email is implying.</li>
<li><strong>Check</strong> the message, grammar, spelling and structure</li>
<li><strong>Don&#x2019;t</strong> click on any links which you are unsure of the origin or validity
<ul>
<li>Use your mouse to <strong>hover over, but not clicking on</strong> the email body and/or links within the email. This usually, but not in all instances, provides an insight in the remote URL.</li>
<li>In phishing emails, these more often than not, point to an HTTP unencrypted website and/or login portal. As such, looking up site information can be difficult or obfuscated by layers of proxies and redirects.</li>
<li>more sophisticated threat actors may use HTTPS and have valid SSL certificates; so keep this in mind, a general rule of thumb is, <strong>if in doubt, chuck it out!</strong></li>
</ul>
</li>
<li><strong>Don&#x2019;t</strong> send anyone private information via email</li>
<li><strong>Don&#x2019;t</strong> send anyone financial information via email</li>
<li><strong>Don&#x2019;t</strong> make and bank or financial transfers. Always check with the actual organisation or vendor first using their legitimate service, app or contact details.</li>
<li>Don&apos;t make any purchases for gift certificates/store cards <em>e.g. Amazon, Apple&#x2026;</em></li>
<li><strong>Don&#x2019;t</strong> download malicious programs/software to a smartphone or other hardware devices if asked to do so via email.</li>
</ul>
<p>A note for <strong>Corporate Users</strong>: If you work within a corporate environment, your current organization may have security awareness programs, which covers topics such as Phishing and Social engineering. As such this would be a great place for corporate/business users to seek help and understanding.</p>
<!--kg-card-end: markdown--><p>In addition to the above point, there are several technological solutions which can also prevent or act as defence in depth:</p><ul><li><strong>Email Filtering:</strong> Many email services and providers now provide &#x2018;Email filtering&#x2019; options to identify and block or flag suspicious emails. This can be based on the email content, links, files, originator email address, domain or all of the above.</li><li><strong>Multifactor Authentication (MFA):</strong> Utilizing MFA is an additional protective layer, will serve as an extra layer of defence and can prevent a threat actor from using credentials obtained through a &#x2018;Phishing&#x2019; attack.</li></ul><h2 id="closing-points">Closing Points</h2><p>Anyone with a device, such as a computer, laptop, smartphone, or tablet, can receive email messages from anywhere in the world via any inbuilt email platforms or specific vendor apps, e.g., Outlook, Gmail, and various other supported applications.</p><p>Many users already know the dangers of clicking a link in email messages; however, users/people still fall foul of this attack vector.</p><h3 id="how-to-spot-a-phishing-email">How to Spot a Phishing Email</h3><p>In the past, identifying phishing emails was relatively simple. They often arrived with obvious red flags, such as requests from an &quot;insert_your_prince_here&quot; seeking financial assistance in exchange for promised wealth.</p><p>Nowadays, criminals have evolved their tactics, investing considerable effort into crafting convincing emails that appear legitimate. These sophisticated attackers often mimic communication from friends or trusted institutions like banks. These sophisticated attackers may even research their targets, incorporating personal details into their messages to increase the likelihood of successful deception and prompt recipients to click on malicious links or attachments.</p><p>The following steps can be taken to help spot a phishing email:</p><!--kg-card-begin: markdown--><ul>
<li>
<p><strong>Sender Email Address Inspection</strong>:</p>
<ul>
<li>Examine the sender&apos;s email address closely; however, ensuring that you do not inadvertently click on any other links within the email whilst doing so. Inspecting the the sender address can reveal whether the sender is legitimate.</li>
<li>Cybercriminals often use public email services like gmail.com, outlook.com and others. Legitimate emails from banks or companies typically come from company email accounts bearing the company&apos;s name.
<ul>
<li>Note that the displayed email address may differ from the actual sender&apos;s address; to verify, hover over/click on the sender&apos;s email name at the top of the email.</li>
</ul>
</li>
</ul>
</li>
<li>
<p><strong>Request for Secret Information Verification</strong>:</p>
<ul>
<li>Exercise caution where an email requests details or verification of details, such as personal information, bank details or passwords.</li>
<li>Legitimate organizations will never solicit such information via email; any email doing so is likely a phishing attempt.</li>
</ul>
</li>
<li>
<p><strong>Suspicious Attachments</strong>:</p>
<ul>
<li>Avoid opening unexpected emails or attachments from unknown or unsolicited senders, as they may contain malware capable of compromising your computer and stealing personal data.</li>
<li>As a side note, always ensure your devices anti-virus and threat detection software/services are up-to-date and enabled. As they should provide another layer of security and apply a defense in-depth principle toward you and your device.</li>
</ul>
</li>
<li>
<p><strong>Creation of Urgency</strong>:</p>
<ul>
<li>Phishing emails often induce urgency by claiming suspicious activity on your account or impersonating someone in need of urgent financial assistance. Beware of such tactics and verify the authenticity of the sender through established contact details or official websites.</li>
</ul>
</li>
<li>
<p><strong>Unrecognized Website Links</strong>:</p>
<ul>
<li>Be cautious of clicking links within emails, as phishing emails may redirect you to fraudulent websites and login portals.</li>
<li>Hover over the link to reveal the <strong>true</strong> URL, which may be misspelled or entirely different from what you expect.</li>
<li>Always verify before clicking.</li>
</ul>
</li>
<li>
<p><strong>Poor Spelling and Grammar</strong>:</p>
<ul>
<li>Phishing emails often exhibit poor writing quality, including spelling mistakes and grammatical errors.</li>
<li>Take note of any deviations from the sender&apos;s usual writing style, as these can be indicators of a fraudulent/phishing email.</li>
</ul>
</li>
</ul>
<!--kg-card-end: markdown--><h3 id="general-awareness">General Awareness</h3><p>The following general steps can be taken to help prevent being exploited:</p><ul><li><strong>Ignore:</strong> If it looks too good to be true and/or the message is unsolicited, ignore, report and delete. &#xA0;For example, email messages offer quick money from winning prizes or collecting cash after entering information.</li><li><strong>Remember:</strong> Financial institutions will never email asking for credentials or a money transfer. Never send credit card numbers, ATM PINs, or banking information to someone via email messages.</li><li><strong>Avoid:</strong> avoid responding to emails that you don&#x2019;t recognize or, at the very least, if received on a work device, contact your IT security team and forward the email to them to asses. Also, see the point below.</li><li><strong>Awareness:</strong> Make an effort to stay current with current phishing tactics and threats. Awareness can be your first line of defence. As an individual, this may seem like a daunting task; however, your current organization may have a security awareness program that covers topics such as this, and as such, this would be a great place to seek help and understanding. Alternatively, seeking knowledge online from reputable providers can also be another great option.</li></ul><p>As users in an interconnected digital age, we are inherently trusting of email, despite the news about cyber attacks originating from a phishing email, as this is usually the primary means of communication between businesses, colleagues and in some cases where family and friends are geographically displaced, so &#x2018;Phishing&#x2019; is often lucrative to attackers seeking to build rapport and obtain credentials, banking information and private data.</p><h2 id="how-can-we-help">How can we help?</h2><p>Here at Lares, we help empower organizations to maximize their security Potential.</p><p>Lares is a security consulting firm that helps companies secure electronic, physical, intellectual, and financial assets through a unique blend of assessment, testing, and coaching.</p><p>If you would like any further information, you can get in touch <a href="https://www.lares.com/contact/?ref=labs.lares.com">here</a> or visit the <a href="https://www.lares.com/?ref=labs.lares.com">Lares.com</a> website for more information about how we can help you and what matters to you.</p>]]></content:encoded></item><item><title><![CDATA[This one time on a pentest... Is life just a CTF?!]]></title><description><![CDATA[Consider the series like a set of war stories from the front line, not always wins or epic hacks, but sometimes just cool attack paths or equally interesting environments.]]></description><link>https://labs.lares.com/this-one-time-on-a-pentest/</link><guid isPermaLink="false">64681d0b0b63a611ef982dcb</guid><category><![CDATA[penetrationtesting]]></category><category><![CDATA[attackpaths]]></category><dc:creator><![CDATA[Andy Gill]]></dc:creator><pubDate>Wed, 10 Apr 2024 09:00:11 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2024/04/image-44.png" medium="image"/><content:encoded><![CDATA[<h1></h1><img src="https://labs.lares.com/content/images/2024/04/image-44.png" alt="This one time on a pentest... Is life just a CTF?!"><p>At Lares, we find many weird and wonderful engagement attack paths when testing our clients. This series of posts will dive into a handful of our favourites, demonstrating the mind-bending attacks we&apos;ve carried out in the past. We will take you along for the ride, walking through what got us to the various stages and achieved actions on objectives. </p><p><em><strong>All screenshots and scenarios have been recreated or described in detail in our internal labs; therefore, no client details or information will be mentioned in these posts.</strong></em></p><p>Not every part in this series will be from a pentest; some will be from Red Teams, Insider Threat engagements, and many others. We aim to show some of our fun attack paths and how you might undertake them within your environment. We will also evaluate mitigations, detections, and key takeaways from each.</p><h3 id="starting-with-recon">Starting with Recon</h3><p>Many engagements we end up doing start from the perimeter as an external penetration test, and through various means, we will often be able to achieve internal access. This scenario, in particular, started like any other external, starting with enumeration and hunting; we tend to use a large amount of external open-source intelligence (OSINT) gathering. We do this to identify critical services and open ports before actively touching services; we achieve this by using services such as the following(note the list is an example but not exhaustive of all the sources):</p><ul><li>Shodan - Searching for open ports, additional domains, services, and other helpful information that mentions the company name in adjacent IP ranges.</li><li>Zoomeye&#x2014;Similar to Shodan, Zoomeye often provides the information listed above and historical information to identify what services might have been running on obscure ports in the past. </li><li>Hunter.io - Sometimes, it can be a bit hit-and-miss with content. Still, Hunter often gives a good overview of the company email format for formulating password sprays, phishing, and other potential username formatting. </li><li>SpyCloud - Spycloud gives an added edge of breach data and botnet data, which we use in external password spraying and credential stuffing on various services; it also often provides us with an idea of the internal domain name of the customer, which we can then search on all of the other services listed. &#xA0;</li><li>Social Media&#x2014;LinkedIn for Staff members, Twitter for developers, critical information, and various Telegram channels are also used to identify potential areas of data breaches or historical supply chain issues/new vulnerabilities. For more information on how we do social profiling,<a href="https://labs.lares.com/social-profiling-osint-for-red-blue/"> we<a href="https://labs.lares.com/social-profiling-osint-for-red-blue/">&apos;ve written about this here</a></a>.</li><li>Github, Gitlab, and Bitbucket for code repositories and other critical information often reveal internal or historical information about the internal domain. </li><li>Cloud Resources&#x2014;Azure AD Internals, Greyhat Warfare, GCP/AWS/AZ discovery: Most cloud resources can be identified using open-source intelligence gathering, with a wealth of tools available to our consultants.</li></ul><h4 id="breaching-the-perimeter">Breaching The Perimeter</h4><p>Once we have an idea of the perimeter, the footprint, and what services look attractive, we can start planning a route into the environment. What does this look like? What tools, such as credentials, scripts, social engineering, or other techniques, can we leverage in our toolbox?</p><p>Typically, we like to start with credential stuffing and brute-force attempts. We have access to <a href="https://spycloud.com/?ref=labs.lares.com">SpyCloud</a>, which provides a wealth of information from breaches and botnets, often serving as cheat codes to emulate real adversaries.</p><p>In this scenario, we identified that RDP was running on a non-standard port and that a single-factor VPN portal was exposed. With the help of ZoomEye and Shodan, we validated that the host had the port open to negate the need to port scan and potentially alert our target.</p><p>The steps below detail the identification and connection on a non-standard port:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image.png" class="kg-image" alt="This one time on a pentest... Is life just a CTF?!" loading="lazy" width="950" height="221" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image.png 600w, https://labs.lares.com/content/images/2024/04/image.png 950w" sizes="(min-width: 720px) 720px"><figcaption>RDP running on 3399</figcaption></figure><p>Once the port was identified, we were able to connect using <code>mstsc.exe</code> also known as remote desktop, and authenticate it with the previously found credentials. Certain users in this environment had <code>Okta Verify</code> set up multi-factor authentication to access other services via Okta single sign-on. Still, in many cases, this was not configured for RDP. Thus, it was possible to traverse to the remote host and connect with a single-factor set of credentials:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-1.png" class="kg-image" alt="This one time on a pentest... Is life just a CTF?!" loading="lazy" width="430" height="618"><figcaption>RDP on Non-standard port</figcaption></figure><p>In addition to the RDP host, we identified a single-factor VPN endpoint granting access to a development environment. In this particular test, there was no connection between dev and prod; however, we have observed this setup in other client environments and have been able to jump between environments.</p><h4 id="navigating-the-internal-minefield">Navigating the Internal Minefield</h4><p>Once initial entrenchment was achieved, the first step was to enumerate the local system to identify any potential paths for lateral movement and domain privilege escalation, as the assessment was not primarily focused on evasion of detections, and the primary objective was going after privileged access.</p><p>We found that our user,<code>backupadmin</code> was indeed an administrator using the Powershell module <code>Get-LocalGroupMember -Member Administrators</code> </p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-2.png" class="kg-image" alt="This one time on a pentest... Is life just a CTF?!" loading="lazy" width="486" height="110"><figcaption>Local Administrators Group Members</figcaption></figure><p>With this information, it was time to explore our potential attack paths within the environment. At the back of our mind, we thought this may have been a honeypot host, so we remained cautious in our approach.</p><p>We began executing a slightly modified version of <a href="https://github.com/PwnDexter/SharpEDRChecker?ref=labs.lares.com">SharpEDRChecker</a> (This tooling can be executed as a standard user and enumerates various paths, services, running tasks and DLLs on disk to identify defensive products in use) to identify and profile the defensive stack. This revealed a reasonably box-standard Windows setup with Defender and Antimalware Scan Interface (AMSI). </p><pre><code>[!] Service Summary: 
	[-] mpssvc : defender
	[-] PolicyAgent : defender
	[-] SecurityHealthService : securityhealthservice
	[-] Sense : defender, threat
	[-] WdNisSvc : antivirus, defender, nissrv
	[-] WinDefend : antimalware, antivirus, defender, malware, msmpeng
	[-] wscsvc : antivirus


[!] Driver Summary: 
	[-] WdFilter.sys : antimalware, malware
	[-] WdNisDrv.sys : defender

If you see Defender there is a high chance A M S I is there too</code></pre><p>With this in mind, we were also able to enumerate where some exceptions were applicable for Defender-excluded paths using the fact our user was an administrator and built-in PowerShell tooling:</p><pre><code>Get-MpPreference | Select-Object -Property ExclusionPath -ExpandProperty ExclusionPath</code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-3.png" class="kg-image" alt="This one time on a pentest... Is life just a CTF?!" loading="lazy" width="771" height="45" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-3.png 600w, https://labs.lares.com/content/images/2024/04/image-3.png 771w" sizes="(min-width: 720px) 720px"><figcaption>Output of Get-MpPreference for Defender exceptions</figcaption></figure><p>This led to the discovery of <code>C:\BackupLogs</code> which appeared to be a Defender exception; upon browsing this folder, there were some interesting named files:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-4.png" class="kg-image" alt="This one time on a pentest... Is life just a CTF?!" loading="lazy" width="429" height="554"><figcaption>Sam, Security and System files are suspicious!</figcaption></figure><p>The files found appeared to be nightly backups of the SAM, SYSTEM, SECURITY and SOFTWARE registry keys, so we decided to see if we could decrypt them. Until now, we still believed this might be a honeypot, but it also felt a bit like a capture-the-flag (CTF) box!</p><h3 id="cracking-the-secrets">Cracking the Secrets</h3><p>With these files and the ability to operate in Defender&apos;s exceptions folder, we copied across a py2exe version of <a href="https://github.com/fortra/impacket/blob/master/examples/secretsdump.py?ref=labs.lares.com">secretsdump</a> to the system to decrypt the local Security Accounts Manager (SAM) database (which is used to house all the local users on the system&apos;s usernames and password hashes) using the following command:</p><pre><code>secrets.exe -sam sam1 -system system1 -security1 security  LOCAL
</code></pre><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/04/image-20.png" class="kg-image" alt="This one time on a pentest... Is life just a CTF?!" loading="lazy" width="1498" height="524" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-20.png 600w, https://labs.lares.com/content/images/size/w1000/2024/04/image-20.png 1000w, https://labs.lares.com/content/images/2024/04/image-20.png 1498w" sizes="(min-width: 720px) 720px"></figure><p>This was done to obtain the NTLM hash value for the administrator and other users. In many cases where Local Administrator Password Solution (LAPS) is not in use, the administrator hash is likely shared across systems within the environment. Either by cracking the password, forging a Kerberos ticket, or passing the hash, it is possible to traverse the environment easily to gain vertical privilege escalation. </p><p>In this case, we opted to crack it using our hashcat rigs, the syntax for which was as follows:</p><pre><code>hashcat.exe -m 1000 warstories.txt wordlists\result.txt -r rules\Lares.rule -O</code></pre><p>The command line arguments for the above are as follows:</p><ul><li><code>hashcat.exe</code> - Running hashcat on Windows.</li><li><code>-m 1000</code> - Setting the mask to type 1000, which is NTLM hashes.</li><li><code>warstories.txt</code> - This is the file containing the NTLM hashes to be cracked</li><li><code>wordlists\result.txt</code> - This is our wordlist, a combination of previously cracked domain and local passwords.</li><li>-r <code>rules\Lares.rule</code> - This is our ruleset for permuting the entries in the wordlist to ensure we hit different variations of words, append different characters, and make other modifications to the entries. </li><li><code>-O</code> - Use the optimised kernel for GPU cracking of the passwords.</li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-19.png" class="kg-image" alt="This one time on a pentest... Is life just a CTF?!" loading="lazy" width="1994" height="1162" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-19.png 600w, https://labs.lares.com/content/images/size/w1000/2024/04/image-19.png 1000w, https://labs.lares.com/content/images/size/w1600/2024/04/image-19.png 1600w, https://labs.lares.com/content/images/2024/04/image-19.png 1994w" sizes="(min-width: 720px) 720px"><figcaption>Successfully cracked hashes</figcaption></figure><p>This resulted in the retrieval of both the <code>Administrator</code> and <code>User</code> clear-text passwords. However, you&apos;ll notice that the Guest and DefaultAccount users have weird-looking passwords; these are essentially blank passwords as the accounts are not enabled, which is how hashcat represents them.</p><figure class="kg-card kg-code-card"><pre><code>Administrator:077cccc23f8ab7031726a3b70c694a49:Passw0rd123
User:b2bdbe60565b677dfb133866722317fd:Passw0rd1!
backupadmin:5858d47a41e40b40f294b3100bea611f:Passw0rd1</code></pre><figcaption><em>As this is a lab re-creation, the passwords have been set to demonstrate values easily.</em></figcaption></figure><p>Once the password had been cracked, the next step was to identify if the administrator password was shared across other hosts within the environment and to target additional domain reconnaissance. </p><p>We leveraged Explorer and PowerShell from the compromised machine to determine whether we could authenticate to the domain controller using the local administrator password, which was successfully cracked. This resulted in connecting successfully and mounting both the C$ and ADMIN$ shares, indicating that the credentials were shared, at least for the RID500 Administrator account. </p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-23.png" class="kg-image" alt="This one time on a pentest... Is life just a CTF?!" loading="lazy" width="1306" height="1274" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-23.png 600w, https://labs.lares.com/content/images/size/w1000/2024/04/image-23.png 1000w, https://labs.lares.com/content/images/2024/04/image-23.png 1306w" sizes="(min-width: 720px) 720px"><figcaption>Listing C$ and ADMIN$ on DC1</figcaption></figure><p>At this stage, by having a local admin on a domain controller, we could add ourselves to the Domain Admins group or perform other administrative tasks. We created a Lares user and proceeded with this moving forward to enable the client to identify the pentest activity quickly and deconflict where necessary.</p><h3 id="domain-admin-is-just-the-beginning">Domain Admin is Just the Beginning</h3><p>Frequently, on assessments, we find that getting domain admin is only the beginning, and further compromise and coverage of the environment often take place post-compromise. Sometimes, the keys to the kingdom are not enough, and going for broader coverage of sensitive data, credential matter, and other areas of the network become our focus. </p><p>As such, the attack path continued. &#xA0;We could freely traverse other systems within the environment and uncover additional sensitive information. One of our favourite tools to leverage on pentests of Windows environments is <a href="https://github.com/SnaffCon/Snaffler?ref=labs.lares.com">Snaffler</a>, as it does an excellent job crawling shares, indexing available files, and searching them for sensitive data. </p><p>Using the exception folder once again, we copied Snaffler across and executed with the following flags:</p><pre><code>Snaffler.exe -s -o Logging.txt</code></pre><p>This tells Snaffler to run with the default ruleset and regular expressions and write it out to an output file called Logging.txt. </p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-24.png" class="kg-image" alt="This one time on a pentest... Is life just a CTF?!" loading="lazy" width="2000" height="1240" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-24.png 600w, https://labs.lares.com/content/images/size/w1000/2024/04/image-24.png 1000w, https://labs.lares.com/content/images/size/w1600/2024/04/image-24.png 1600w, https://labs.lares.com/content/images/2024/04/image-24.png 2178w" sizes="(min-width: 720px) 720px"><figcaption>Snaffler Output</figcaption></figure><p>For this example, we have placed several files in the domain for snaffler to find; the output can be deciphered like so:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/04/image-25.png" class="kg-image" alt="This one time on a pentest... Is life just a CTF?!" loading="lazy" width="1548" height="533" srcset="https://labs.lares.com/content/images/size/w600/2024/04/image-25.png 600w, https://labs.lares.com/content/images/size/w1000/2024/04/image-25.png 1000w, https://labs.lares.com/content/images/2024/04/image-25.png 1548w" sizes="(min-width: 720px) 720px"><figcaption>Example from https://github.com/SnaffCon/Snaffler</figcaption></figure><p>Running snaffler enabled further identification of sensitive information, which in this case was looking for data related to domain trusts and other client information. The output was several hundred megabytes, parsed and listed into a CSV for the client. </p><h3 id="attack-path-summaryhow-we-got-here">Attack Path Summary - &#xA0;How We Got Here</h3><p>This first part of the series walked you through an attack path from the Internet, starting from an unauthenticated perspective, successfully gaining access to valid credentials, paired with single factor authentication and remote desktop externally facing, we were able to compromise the system successfully, obtain local administrator access and escalate our access to that of domain administrator, then perform post-exploitation activities to get data governance coverage of the environment. &#xA0;</p><h3 id="conclusion">Conclusion </h3><p>To successfully protect yourself from an attack path like this, several key recommendations can be followed; </p><ul><li>Ensure you have Multi-Factor Authentication enabled and enforced for all users</li><li>Lock down your perimeter to ensure that RDP and other remote access protocols are restricted to set IP ranges if they need to be externally facing or disabled for internal use only.</li><li>Set a robust password policy with word denylists to prevent weaker password creation. Consider implementing the suggestions detailed in our <a href="https://labs.lares.com/password-analysis/">Password Analysis </a>post.</li><li>Consider implementing LAPS or a similar privileged access management solution to prevent local administrator password re-use.</li><li> Perform regular external asset discovery to ensure your perimeter is under control and you know what assets you have.</li></ul><p>Moreover, organisations should embrace the principle of &apos;defence in depth&apos;. This is a comprehensive approach to cybersecurity that layers multiple defensive mechanisms. If one mechanism fails, another steps in immediately to thwart an attack. This approach involves technological solutions and encompasses policies, procedures, and awareness training to ensure that all possible security gaps are covered.</p><h2 id="how-can-we-help">How can we help?</h2><p>Here at Lares, we help empower organizations to maximize their security Potential.</p><p>If you would like any further information, you can get in touch <a href="https://www.lares.com/contact/?ref=labs.lares.com">here</a> or head over to the <a href="https://www.lares.com/?ref=labs.lares.com">Lares.com</a> website for more information about how we can help.</p>]]></content:encoded></item><item><title><![CDATA[Kerberos II - Credential Access]]></title><description><![CDATA[In this part of the series, we will focus on Credential Access and the attacks that Kerberos can facilitate. ]]></description><link>https://labs.lares.com/fear-kerberos-pt2/</link><guid isPermaLink="false">65e0dacd5842ec7502fb45cc</guid><category><![CDATA[penetrationtesting]]></category><category><![CDATA[kerberos]]></category><dc:creator><![CDATA[Raúl Redondo]]></dc:creator><pubDate>Tue, 26 Mar 2024 13:00:36 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2024/03/credential_access3.png" medium="image"/><content:encoded><![CDATA[<img src="https://labs.lares.com/content/images/2024/03/credential_access3.png" alt="Kerberos II - Credential Access"><p>In the <a href="https://labs.lares.com/fear-kerberos-pt1/">first part of the Kerberos series</a>, we&#x2019;ve set the groundwork for the following parts, covering an overview of Kerberos, concepts, encryption types, the authentication flow, and the PKINIT pre-authentication mechanism. </p><p>In this second post, we&apos;ll delve into techniques that can be leveraged to obtain credential access using the Kerberos authentication flow:</p><!--kg-card-begin: markdown--><ul>
<li><a href="#credentialAccess">Credential Access</a>
<ul>
<li><a href="#userenum">User enumeration</a></li>
<li><a href="#passwordGuessing">Password Guessing</a></li>
<li><a href="#asreq">AS-REQroasting</a></li>
<li><a href="#asrep">AS-REProasting</a></li>
<li><a href="#kerberoast">TGS-REProasting (Kerberoast)</a></li>
<li><a href="#UNPAC">UnPAC the hash</a></li>
</ul>
</li>
<li><a href="#resources">Resources</a></li>
</ul>
<!--kg-card-end: markdown--><p>This post is the second part of the next Kerberos series:</p><ul><li><a href="https://labs.lares.com/fear-kerberos-pt1/">Kerberos I - Kerberos Overview.</a></li><li><a href="https://labs.lares.com/fear-kerberos-pt2/">Kerberos II - Credential Access.</a></li><li><a href="https://labs.lares.com/fear-kerberos-pt3/">Kerberos &#xA0;III - User Impersonation.</a></li><li>Kerberos IV - Delegations.</li></ul><!--kg-card-begin: markdown--><h3 align="center" id="credentialAccess">Credential Access:</h3><!--kg-card-end: markdown--><p>Through the Kerberos authentication flow, it is possible to enumerate domain user accounts and validate credentials through the error messages returned by the KDC to the client. In addition, user hashes can be obtained through encrypted parts included in AS-REQ/AS-REP and TGS-REQ/TGS-REP messages (Roasting attacks). Also, in case a user uses PKINIT as a pre-authentication method, it is possible to extract his NT/LM hashes using the UnPAC the hash technique, which we will see in this post.</p><p>Although we won&apos;t delve into low-level detection measures, notes have been added as references as we go through each technique, which can help detect these Kerberos authentication flow abuse techniques.</p><!--kg-card-begin: markdown--><h4 align="left" id="userenum">User Enumeration:</h4><!--kg-card-end: markdown--><p>Due to how Kerberos works, it is possible to enumerate valid domain accounts by sending TGT requests (AS-REQ) and analyzing the <a href="https://web.mit.edu/kerberos/krb5-1.5/krb5-1.5.1/doc/krb5-admin/Kerberos-V5-Library-Error-Codes.html?ref=labs.lares.com#Kerberos%20V5%20Library%20Error%20Codes">KDC errors</a> in the response.</p><p>When Kerberos receives an AS-REQ message from the client, &#xA0;the KDC responds with <code>KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN</code> error message if the user is not found in its database.</p><p>If the KDC responds with <code>KRB5KDC_ERR_PREAUTH_REQUIRED</code> error, or returns a TGT in an AS-REP response (Accounts not requiring pre-authentication), it will confirm that the user exists.</p><p>In addition, KDC will respond with <code>KDC_ERR_CLIENT_REVOKED</code> if the account is locked or disabled.</p><p>The following is an example of this enumeration using the own Kerberos pre-authentication flow via <a href="https://github.com/ropnop/kerbrute?ref=labs.lares.com">Kerbrute</a>:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-46.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="717" height="317" srcset="https://labs.lares.com/content/images/size/w600/2024/02/image-46.png 600w, https://labs.lares.com/content/images/2024/02/image-46.png 717w"><figcaption>Kerbrute user enumeration.</figcaption></figure><p>The traffic generated would be as follows:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-45.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="866" height="388" srcset="https://labs.lares.com/content/images/size/w600/2024/02/image-45.png 600w, https://labs.lares.com/content/images/2024/02/image-45.png 866w" sizes="(min-width: 720px) 720px"><figcaption>Kerbrute network traffic.</figcaption></figure><p>Useful Windows event IDs to take note of:</p><ul><li>4768 - A Kerberos authentication ticket (TGT) was requested. A Kerberos authentication ticket (TGT) was requested to identify one source endpoint trying to obtain an unusual number of Kerberos TGT tickets for non-existing users.</li><li> This event can be monitored closely for excessive Kerberos Authentication ticket requests issued from a single source with no pre-authentication.</li></ul><!--kg-card-begin: markdown--><h4 align="left" id="passwordGuessing">Password Guessing</h4><!--kg-card-end: markdown--><p>The Kerberos authentication flow can be leveraged to validate user credentials, which, from an offensive security or threat actor stance, facilitates the ability to carry out &#x2018;Password Guessing&#x2019; attacks. </p><p>In this process, AS-REQ messages are sent with an encrypted timestamp and the password to be validated. If the password is incorrect, the Key Distribution Center (KDC) responds with the message <code>KDC_ERR_PREAUTH_FAILED</code> (pre-authentication information was invalid).</p><p>The password spray feature of <a href="https://github.com/ropnop/kerbrute?ref=labs.lares.com">kerbrute </a>can automate this process:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-48.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="861" height="335" srcset="https://labs.lares.com/content/images/size/w600/2024/02/image-48.png 600w, https://labs.lares.com/content/images/2024/02/image-48.png 861w" sizes="(min-width: 720px) 720px"><figcaption>Kerbrute password spraying</figcaption></figure><p>Below is an example of the generated traffic from a password-guessing attack, showing that the KDC has not been able to decrypt the timestamp we have sent as the user &#x2018;Tyrell.W&#x2019; because the password is wrong, which causes the KDC to respond with the following Kerberos error message:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-68.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="934" height="511" srcset="https://labs.lares.com/content/images/size/w600/2024/02/image-68.png 600w, https://labs.lares.com/content/images/2024/02/image-68.png 934w" sizes="(min-width: 720px) 720px"><figcaption>KRB5KDC_ERR_PREAUTH_FAILED (Wrong password).</figcaption></figure><p>This kind of enumeration does not trigger event <strong>4625 </strong>(<em>An account failed to log on</em>), but it will increase the number of logon attempts from the target user. It may consequently block the account due to excessive logon attempts.</p><p>This technique will trigger event <a href="https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4771?ref=labs.lares.com">4771 - Kerberos pre-authentication failed</a>, which is disabled by default.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-69.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="804" height="747" srcset="https://labs.lares.com/content/images/size/w600/2024/02/image-69.png 600w, https://labs.lares.com/content/images/2024/02/image-69.png 804w" sizes="(min-width: 720px) 720px"><figcaption>Event 4771 - Kerberos pre-authentication failed.&#xA0;</figcaption></figure><p>Useful Event IDs &amp; Defenses:</p><ul><li>4771 - Kerberos pre-authentication failed. (Event disabled by default).</li><li>4768 - A Kerberos authentication ticket (TGT) was requested.</li><li><a href="https://attack.mitre.org/techniques/T1110/003/?ref=labs.lares.com">Mitre | ATT&amp;CK T1110.003 - Brute Force: Password Spraying</a></li></ul><!--kg-card-begin: markdown--><h4 align="left" id="asreq">AS-REQroasting:</h4><!--kg-card-end: markdown--><p>In the first AS-REQ message with pre-authentication, the client will ask the KDC for a TGT (Ticket Granting Ticket). The client generates a timestamp and encrypts it with its secret key (DES, RC4, AES128 or AES256) derived from the user password. This encrypted timestamp is sent to the KDC together with the username.</p><p>Through man-in-the-middle techniques, it may be possible to capture these pre-authentication messages, including the encrypted timestamps:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-128.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="1034" height="547" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-128.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-128.png 1000w, https://labs.lares.com/content/images/2024/03/image-128.png 1034w" sizes="(min-width: 720px) 720px"><figcaption>AS-REQ timestamp.</figcaption></figure><p>Once the timestamp encrypted with the user&apos;s key is obtained, it is possible to attempt to crack it locally and try to retrieve the password in plain text from the client.</p><p>To crack this type of hash, we need to use the following format: <code>$krb5pa$18$da$$&lt;cipher_bytes&gt;</code></p><p>In hashcat the hash mode 19900(AES256), 19800(AES128) or 7500 (RC4):</p><!--kg-card-begin: markdown--><pre><code>hashcat -O -m 19900 wordlists.txt
hashcat -O -m 19900 -a 3 ?l?l?l?l?l?l?l?l
</code></pre>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-127.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy"><figcaption>hashcat ASREQroasting.</figcaption></figure><p>Useful Defense:</p><ul><li>Since this technique is based on monitoring network traffic, enforce a strong password policy to increase the complexity of possible hash-cracking methods.</li></ul><!--kg-card-begin: markdown--><h4 align="left" id="asrep">AS-REProasting:</h4><!--kg-card-end: markdown--><p>AS-REP messages contain a Ticket-Granting Ticket (TGT) encrypted with the secret key of the ticket-granting service (krbtgt), along with a <strong>session key that is encrypted with the secret key of the user being authenticated</strong> during the Kerberos flow.</p><p>Although we typically associate AS-REP roasting with user accounts that have the &quot;do not require Kerberos Pre-authentication&quot; option enabled, this technique can be employed whenever we can intercept this type of AS-REP message.</p><p>As shown in the following example, we will need the session key, which can be found in &quot;enc-part&quot; part:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-71.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="728" height="348" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-71.png 600w, https://labs.lares.com/content/images/2024/03/image-71.png 728w" sizes="(min-width: 720px) 720px"><figcaption>AS-REP encrypted part.</figcaption></figure><p>Suppose any domain users have the &quot;do not require Kerberos Pre-authentication&quot; option enabled. In that case, we can attempt authentication and retrieve the session key encrypted with the user&apos;s secret key from the AS-REP message.</p><p>Below is an example of the option enabled for the user &quot;Darlene&quot;:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-33-3.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="421" height="547"><figcaption>Dot not require Kerberos preauthentication.</figcaption></figure><p>This technique can be performed using impacket&apos;s GetNPUsers script. The script itself allows for the option to specify a list of users:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-67.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="1147" height="547" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-67.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-67.png 1000w, https://labs.lares.com/content/images/2024/03/image-67.png 1147w" sizes="(min-width: 720px) 720px"><figcaption>Impacket AS-REProast.</figcaption></figure><p>The same attack can also be carried out using an alternative tool from Windows, Rubeus:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-70.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="1100" height="407" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-70.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-70.png 1000w, https://labs.lares.com/content/images/2024/03/image-70.png 1100w" sizes="(min-width: 720px) 720px"><figcaption>Rubeus asreproast.</figcaption></figure><p>Once the hash has been obtained via either method, the next stage would be to conduct hash-cracking techniques. At this stage it can be cracked locally or exfiltrated to a remote computer, using &#xA0;Hashcat or &#xA0;John (JTR) through a combination of dictionary, brute-force, rules...</p><!--kg-card-begin: markdown--><pre><code>hashcat.exe -m18200 &lt;HASH&gt; wordlist
hashcat.exe -m18200 &lt;HASH&gt; -a 3 ?l?l?l?l?l?l?l?l
</code></pre>
<!--kg-card-end: markdown--><p>The following is the plain-text password obtained from the hash retrieved through the AS-REProasting attack, using the hashcat tool:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-69.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="1013" height="280" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-69.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-69.png 1000w, https://labs.lares.com/content/images/2024/03/image-69.png 1013w" sizes="(min-width: 720px) 720px"><figcaption>ASREPRoasting- hashcat</figcaption></figure><p>LdapFilter for &quot;do not require Kerberos pre-authentication&quot;:</p><!--kg-card-begin: markdown--><pre><code>(&amp;(objectclass=user)(objectcategory=user)(useraccountcontrol:1.2.840.113556.1.4.803:=4194304))

</code></pre>
<!--kg-card-end: markdown--><p>Useful Event IDs &amp; Defenses:</p><ul><li>4768 - A Kerberos authentication ticket (TGT) was requested.</li><li>4738 - A user account was changed (to identify a change performed on a domain user object that disables Kerberos Pre-Authentication, UserAccountControl property).</li><li><a href="https://attack.mitre.org/techniques/T1558/004/?ref=labs.lares.com">Mitre | ATT&amp;CK T1558.004- Steal or Forge Kerberos Tickets: AS-REP Roasting</a></li></ul><!--kg-card-begin: markdown--><h4 align="left" id="kerberoast">TGS-REProasting (Kerberoast):</h4><!--kg-card-end: markdown--><p>Any domain user can request as many service tickets for any service as he wants, <strong>even if he does not have access to that service.</strong></p><p>Since we know that service tickets (TGS) are encrypted with the secret key of the service (machine account or service account) it is intended for, we can order service tickets and then subsequently attempt to crack the secret key offline.</p><p>In Active Directory, domain services are typically run from two types of accounts:</p><ul><li>Machine accounts.</li><li>Service accounts.</li></ul><p>While trying to crack a TGS from machine accounts can be an arduous task, as these passwords will (by default) be generated automatically, it will be easier to crack the secret keys of service accounts, as humans have generated these.</p><p>Utilizing either Rubeus on Windows (<em>Kerberoast option</em>) or Impacket&apos;s GetUserSPNs on Linux, a request can be made to obtain tickets from accounts that have SPNs:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-73.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="1015" height="593" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-73.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-73.png 1000w, https://labs.lares.com/content/images/2024/03/image-73.png 1015w" sizes="(min-width: 720px) 720px"><figcaption>Impacket-GetUserSPNs - Kerberoast.</figcaption></figure><p>LDAP filter for Kerberoastable users: </p><!--kg-card-begin: markdown--><pre><code>(&amp;(samAccountType=805306368)(servicePrincipalName=*)(!samAccountName=krbtgt)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))
</code></pre>
<!--kg-card-end: markdown--><p>This will generate a lot of traffic, especially if we have a large number of accounts that contain SPN, and we request it for all kinds of SPN (servicePrincipalName=*).</p><p>The following Wireshark capture shows the traffic generated when requesting TGS from the KDC. In the &quot;enc-part&quot; of the ticket, we can find the data encrypted with the Kerberos key of these service accounts:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-74.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="1144" height="730" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-74.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-74.png 1000w, https://labs.lares.com/content/images/2024/03/image-74.png 1144w" sizes="(min-width: 720px) 720px"><figcaption>Kerberoast network traffic.</figcaption></figure><p>In hashcat, use hash mode 13100 (Kerberos 5 TGS-REP etype 23) to try to crack the hash:</p><!--kg-card-begin: markdown--><pre><code>hashcat.exe -m13100 &lt;HASH&gt; wordlist
hashcat.exe -m13100 &lt;HASH&gt; -a 3 ?l?l?l?l?l?l?l?l
</code></pre>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-117.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy"><figcaption>Cracking service ticket with hashcat.</figcaption></figure><p>It is also possible to perform this technique directly from accounts that do not require pre-authentication. Through the impacket branch <a href="https://github.com/ShutdownRepo/impacket/tree/getuserspns-nopreauth?ref=labs.lares.com">getuserspns-nopreauth </a>from <a href="https://twitter.com/_nwodtuhs?ref=labs.lares.com">@Shutdown</a>. </p><p>Useful Event IDs &amp; Defenses:</p><ul><li>4776 - Credential Validation.</li><li>4769 - A Kerberos service ticket (TGS) was requested. (Multiple).</li><li>4768 - A Kerberos Authentication ticket (TGT) was requested.</li><li>Use strong passwords for service accounts.</li><li>Monitor LDAP queries with servicePrincipalName=* wildcard filter.</li><li>Check for TGS with downgrade encryption from AES to RC4.</li><li>Mitre | ATT&amp;CK T1558.003 - <a href="https://attack.mitre.org/techniques/T1558/003/?ref=labs.lares.com">Steal or Forge Kerberos Tickets: Kerberoasting</a></li></ul><!--kg-card-begin: html--><h4 align="left" id="UNPAC">UnPAC the hash</h4><!--kg-card-end: html--><p>As explained in <a href="https://labs.lares.com/fear-kerberos-pt1/">the first post of the series,</a> Kerberos supports Public Key Cryptography for Initial Authentication (PKINIT) as a pre-authentication method.</p><p>The difference with other pre-authentication methods in Kerberos is that, through PKINIT, in the AS-REP response of the KDC, the TGT is contained in the PAC, the structure <strong><a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-pac/cc919d0c-f2eb-4f21-b487-080c486d85fe?ref=labs.lares.com">PAC_CREDENTIAL_INFO</a></strong>. This structure includes the user&apos;s encrypted credentials (NT and LM hashes). </p><p>In the first communication exchange, during the pre-authentication flow with PKINIT, the client will send a PK_AS_REQ message with its X.509 certificate (<em>signed by the Certification Authority</em>) and an authenticator (<em>timestamp encrypted with the client&apos;s private key</em>).</p><p>After validating the certificate and the timestamp, the KDC will return a TGT with a structure called <code>PAC_CREDENTIAL_INFO</code> within the PAC. Since the TGT is encrypted with a secret key of the krbtgt account, it is not possible to read or extract it:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-83.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="1053" height="548" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-83.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-83.png 1000w, https://labs.lares.com/content/images/2024/03/image-83.png 1053w" sizes="(min-width: 720px) 720px"><figcaption>PKINIT pre-authentication.</figcaption></figure><p>Here is where<strong> User-to-User </strong>authentication (U2U) comes into play, &#xA0;as this effectively allows the client to request that the ticket issued by the KDC (service ticket) be encrypted using a session key from a TGT issued to the party that will verify the authentication.</p><p>To use this extension, the TGS-REQ request must contain an additional TGT (additional tickets field). The ENC-TKT-IN-SKEY option = True, will indicate that the session key of the additional ticket will be used to encrypt the new service ticket to be issued, instead of using the server&apos;s key for which the new ticket will be used. In addition to a service name (sname) which can be the client itself (<em>note: the client doesn&apos;t necessarily have to have an SPN set</em>).</p><p>Following, the client (Elliot.A) asks the KDC for a service ticket from himself while providing the ENC-TKT-IN-SKEY option and adding the TGT issued to us to the &quot;additional tickets&quot; field of the TGS-REQ:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-102.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="957" height="441" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-102.png 600w, https://labs.lares.com/content/images/2024/03/image-102.png 957w" sizes="(min-width: 720px) 720px"><figcaption>U2U TGS-REQ.</figcaption></figure><p>The image below depicts a Wireshark capture of the &#x2018;req body&#x2019;, with the &#x2018;enc-tkt-in-skey&#x2019; option enabled for U2U, with the client &quot;Elliot.A&quot;, as the service request for the Ticket Granting Service (TGS):</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-87.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="1087" height="714" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-87.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-87.png 1000w, https://labs.lares.com/content/images/2024/03/image-87.png 1087w" sizes="(min-width: 720px) 720px"><figcaption>U2U TGS-REQ.</figcaption></figure><p>In the same TGS-REQ request, under the &apos;additional-ticket&apos; section:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-99.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="1086" height="709" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-99.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-99.png 1000w, https://labs.lares.com/content/images/2024/03/image-99.png 1086w" sizes="(min-width: 720px) 720px"><figcaption>U2U TGS-REQ.</figcaption></figure><p>In the TGS-REP response, the KDC will copy the PAC, with the encrypted NT/LM hash, into the service ticket it sends to the client. <strong>This service ticket is encrypted with the session key of the client&apos;s TGT:</strong></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-92.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="801" height="607" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-92.png 600w, https://labs.lares.com/content/images/2024/03/image-92.png 801w" sizes="(min-width: 720px) 720px"><figcaption>U2U TGS-REP + UnPAC the hash.</figcaption></figure><p>In the following Wireshark capture, the TGS-REP response with the service ticket and the PAC_CREDENTIAL_INFO encrypted with the TGT session key and containing the client&apos;s NT hash:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-89.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="1090" height="691" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-89.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-89.png 1000w, https://labs.lares.com/content/images/2024/03/image-89.png 1090w" sizes="(min-width: 720px) 720px"><figcaption>TGS-REP PAC_CREDENTIAL_INFO.</figcaption></figure><p>Using the TGT session key, it&apos;s now possible to decrypt the ticket, extract the PAC, parse, and decrypt the NT hash using the AS-REP session key.</p><p>The image below demonstrates an example of how to request a TGT using Kerberos PKINIT with the certificate/private key of a user using <a href="https://github.com/dirkjanm/PKINITtools/blob/master/gettgtpkinit.py?ref=labs.lares.com">gettgtpkinit.py</a>:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-93.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="892" height="228" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-93.png 600w, https://labs.lares.com/content/images/2024/03/image-93.png 892w" sizes="(min-width: 720px) 720px"><figcaption>gettgtpkinit.py</figcaption></figure><p>Once the TGT is obtained, the getnthash.py script, in conjunction with the TGT and the TGT&#xB4;s session key, can be used to extract the PAC and get the user&apos;s NT hash:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-94.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="974" height="196" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-94.png 600w, https://labs.lares.com/content/images/2024/03/image-94.png 974w" sizes="(min-width: 720px) 720px"><figcaption>getnthash.py</figcaption></figure><p>From Windows, the same can be accomplished with Rubeus; however, first, we need to convert the &#x2018;.pfx&#x2019; file to a Base64 string:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-100.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="793" height="83" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-100.png 600w, https://labs.lares.com/content/images/2024/03/image-100.png 793w" sizes="(min-width: 720px) 720px"><figcaption>convert .pfx to base64.</figcaption></figure><p>The following Rubeus command can then be issued to extract the NTHash:</p><!--kg-card-begin: markdown--><pre><code>.\Rubeus.exe asktgt /getcredentials /user:Elliot.a /certificate:&lt;b64Certificate&gt; /domain:Lareslabs.local /dc:dc1.lareslabs.local /show
</code></pre>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-101.png" class="kg-image" alt="Kerberos II - Credential Access" loading="lazy" width="699" height="769" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-101.png 600w, https://labs.lares.com/content/images/2024/03/image-101.png 699w"><figcaption>Rubeus ASKTGT UnPAC using PKINIT and U2U.</figcaption></figure><p>Defenses:</p><ul><li>Monitor for Kerberos authentication via PKINIT, since the NT/LM hashes is only<br>returned when PKINIT is used.</li><li>Look for TGS requests that have at least the following options set: Forwardable, Renewable, Renewable_ok, Enc_tkt_in_skey(there will be a lot of false positives).</li></ul><p>Wrapping things up &#x2026;</p><p>In this second part of the Kerberos series, we&#x2019;ve dug a little deeper into the Kerberos Credentialed Access techniques, covering the following:</p><ul><li>User enumeration</li><li>Password Guessing</li><li>AS-REQroasting</li><li>AS-REProasting</li><li>TGS-REProasting (Kerberoast)</li><li>UnPAC the hash</li></ul><p>We hope this installment of the Kerberos series has helped provide a better understanding of the number of techniques threat actors can use to attack the Kerberos Authentication flow.</p><p>In the next post of the series, we will continue to delve deeper, next time looking at &#x2018;User Impersonation&#x2019; and talking about ticket management and ticket forging.</p><!--kg-card-begin: markdown--><h4 align="left" id="resources">Resources:</h4><!--kg-card-end: markdown--><ul><li><a href="https://www.splunk.com/en_us/blog/security/detecting-active-directory-kerberos-attacks-threat-research-release-march-2022.html?ref=labs.lares.com">Active Directory Kerberos Attacks Analytic - Splunk</a>.</li><li><a href="https://dirkjanm.io/ntlm-relaying-to-ad-certificate-services/?ref=labs.lares.com">Dirk-Jan Mollema - NTLM relaying to AD CS - On certificates, printers and a little hippo.</a></li><li><a href="https://attl4s.github.io/?ref=labs.lares.com">Atl4s - You do (not) Understand Kerberos.</a></li><li><a href="https://luemmelsec.github.io/S4fuckMe2selfAndUAndU2proxy-A-low-dive-into-Kerberos-delegations/?ref=labs.lares.com">LuemmelSec - S4fuckMe2selfAndUAndU2proxy - A low dive into Kerberos delegations.</a></li><li><a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-pkca/d0cf1763-3541-4008-a75f-a577fa5e8c5b?ref=labs.lares.com">Microsoft - Public Key Cryptography for Initial Authentication (PKINIT) in Kerberos Protocol.</a></li><li><a href="https://medium.com/falconforce/falconfriday-detecting-unpacing-and-shadowed-credentials-0xff1e-2246934247ce?ref=labs.lares.com">FalconFriday &#x2014; Detecting UnPACing and shadowed credentials</a>.</li><li>Tarlogic - <a href="https://www.tarlogic.com/cybersecurity-glossary/kerberos/?ref=labs.lares.com">Kerberos</a>.</li><li>Eloy P&#xE9;rez (@zer1t0) - <a href="https://zer1t0.gitlab.io/posts/attacking_ad/?ref=labs.lares.com">Attacking Active Directory</a>.</li><li>Harmj0y - <a href="https://blog.harmj0y.net/redteaming/kerberoasting-revisited/?ref=labs.lares.com">Kerberoasting Revisited.</a></li></ul><p></p><!--kg-card-begin: html--><style>
    .article-image {
        max-width: 600px;
        margin: 0 auto !important;
        float: none !important;
	}
</style><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Kerberos I - Overview]]></title><description><![CDATA[This post, is the first in the series and will aim to provide an overview of the protocol, from its beginnings to the different (ab)use techniques.]]></description><link>https://labs.lares.com/fear-kerberos-pt1/</link><guid isPermaLink="false">65c6454f5842ec7502fb368a</guid><category><![CDATA[penetrationtesting]]></category><category><![CDATA[kerberos]]></category><dc:creator><![CDATA[Raúl Redondo]]></dc:creator><pubDate>Tue, 19 Mar 2024 13:00:32 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2024/03/kerberos_1-1.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><ul>
<li>
<img src="https://labs.lares.com/content/images/2024/03/kerberos_1-1.png" alt="Kerberos I - Overview"><p><a href="#kerberosAgain">Kerberos, again</a></p>
</li>
<li>
<p><a href="#history">Brief History of Kerberos</a></p>
</li>
<li>
<p><a href="#kerberos101">Kerberos 101</a></p>
<ul>
<li><a href="#concepts">Kerberos concepts</a></li>
<li><a href="#encryption">Encryption types</a></li>
<li><a href="#wireshark">Wireshark &amp; Kerberos decryption</a></li>
<li><a href="#flow">Kerberos Authentication Flow</a>
<ul>
<li><a href="#preauth">Kerberos Pre Authentication</a></li>
<li><a href="#as-req">AS-REQ (Authentication Service Request)</a></li>
<li><a href="#as-rep">AS-REP (Authentication Service Response)</a></li>
<li><a href="#tgs-req">TGS-REQ (Ticket-Granting Service Request)</a></li>
<li><a href="#tgs-rep">TGS-REP (Ticket-Granting Service Response)</a></li>
<li><a href="#AP-REQ">AP-REQ (Application Server Request)</a></li>
<li><a href="#AP-REP">AP-REP (Application Server Response)</a></li>
</ul>
</li>
<li><a href="#PKINIT">Public Key Cryptography for Initial Authentication (PKINIT)</a></li>
</ul>
</li>
<li>
<p><a href="#resources">Resources</a></p>
</li>
</ul>
<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h2 align="center" id="kerberosAgain">Kerberos, again</h2>
<!--kg-card-end: markdown--><p>For many years, the Kerberos protocol has been one of the best friends of offensive security professionals. Leveraging this protocol has brought us many wins during assessments and caused many headaches for &#x2018;blue teamers&#x2019;, who must always be on point and right every time!</p><p>That&apos;s why, at <a href="https://www.lares.com/?ref=labs.lares.com">Lares</a>, we&apos;ve created a series explicitly relating to the Kerberos protocol and a look at the associated headaches.</p><ul><li>Kerberos I - Kerberos Overview (this post).</li></ul><p>The Kerberos Blog series will include and cover:</p><ul><li><a href="https://labs.lares.com/fear-kerberos-pt2/">Kerberos II - Credential Access.</a></li><li><a href="https://labs.lares.com/fear-kerberos-pt3/">Kerberos &#xA0;III - User Impersonation.</a></li><li><a href="https://labs.lares.com/fear-kerberos-pt4/">Kerberos IV - Delegations.</a></li></ul><p>With the outline of the series covered, let&#x2019;s get started &#x2026;</p><!--kg-card-begin: markdown--><h2 align="center" id="history">Brief History of Kerberos</h2><!--kg-card-end: markdown--><p>The development of the Kerberos protocol began in the <strong><a href="https://web.mit.edu/krb5/raeburn/kfw/sources/pismere/athena/auth/leash/htmlhelp/html/leash_topic_kerberos_auth_service.htm?ref=labs.lares.com">Athena Project</a></strong> at the Massachusetts Institute of Technology (MIT). This project started in 1983 and aimed to provide cutting-edge computing resources, including networked workstations, high-speed networking, and collaborative software tools, to empower students and researchers.</p><p><br>Below is an example of the Athena computing environment:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/athena_env.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="1481" height="690" srcset="https://labs.lares.com/content/images/size/w600/2024/02/athena_env.png 600w, https://labs.lares.com/content/images/size/w1000/2024/02/athena_env.png 1000w, https://labs.lares.com/content/images/2024/02/athena_env.png 1481w" sizes="(min-width: 720px) 720px"><figcaption>research.ibm.com/journal/sj/313/ibmsj3103I.pdf&#xA0;</figcaption></figure><p>As shown in the diagram above, the environment consisted of a client-server model of distributed computing using a three-tier architecture.<br>The environment used, among other features, a name resolution service called <a href="https://debathena.mit.edu/trac/wiki/Hesiod?ref=labs.lares.com">Hesiod</a>, instant messaging through the <a href="https://web.mit.edu/saltzer/www/publications/athenaplan/e.4.1.pdf?ref=labs.lares.com">Zephyr </a>service, and Kerberos as a system-wide authentication protocol.</p><p>The Kerberos v1 was developed for this project to authenticate service requests between two or more trusted hosts across an untrusted network and <strong>provide a Single Sign-On (SSO) authentication</strong> to these services. </p><ul><li><strong>Kerberos versions 1</strong> through <strong>3</strong> only operated only within the MIT environment.</li><li><strong>Kerberos version 4</strong> was released on <strong>January 24, 1989;</strong> however, it was considered insecure due to several cryptographic issues (<em>its use of DES encryption</em>).</li><li><strong>Kerberos v5</strong> was released in <strong>1993 and updated in 2005 to solve the problems of the previous versions. This version added additional encryption types, cross-realm authentication, and</strong> the <a href="https://web.mit.edu/kerberos/krb5-1.12/doc/appdev/gssapi.html?ref=labs.lares.com">Generic Security Services Application Program Interface (<em>GSS-API</em>)</a>.</li></ul><p>Kerberos replaced the Windows New Technology LAN Manager (<em>NTLM</em>) as the default AUTHENTICATION protocol from Windows Server 2000 onwards; however, Microsoft still supports NTLM for backward compatibility.</p><p>Project Athena Technical Overview video, produced in 1991 with a MIT copyright.</p><figure class="kg-card kg-video-card kg-card-hascaption"><div class="kg-video-container"><video src="https://labs.lares.com/content/media/2024/03/KERBEROS-PROTECTS-YOUR-PASSWORD.mp4" poster="https://img.spacergif.org/v1/640x480/0a/spacer.png" width="640" height="480" playsinline preload="metadata" style="background: transparent url(&apos;https://labs.lares.com/content/images/2024/03/media-thumbnail-ember7842.jpg&apos;) 50% 50% / cover no-repeat;"></video><div class="kg-video-overlay"><button class="kg-video-large-play-icon"><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><path d="M23.14 10.608 2.253.164A1.559 1.559 0 0 0 0 1.557v20.887a1.558 1.558 0 0 0 2.253 1.392L23.14 13.393a1.557 1.557 0 0 0 0-2.785Z"/></svg></button></div><div class="kg-video-player-container"><div class="kg-video-player"><button class="kg-video-play-icon"><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><path d="M23.14 10.608 2.253.164A1.559 1.559 0 0 0 0 1.557v20.887a1.558 1.558 0 0 0 2.253 1.392L23.14 13.393a1.557 1.557 0 0 0 0-2.785Z"/></svg></button><button class="kg-video-pause-icon kg-video-hide"><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><rect x="3" y="1" width="7" height="22" rx="1.5" ry="1.5"/><rect x="14" y="1" width="7" height="22" rx="1.5" ry="1.5"/></svg></button><span class="kg-video-current-time">0:00</span><div class="kg-video-time">/<span class="kg-video-duration"></span></div><input type="range" class="kg-video-seek-slider" max="100" value="0"><button class="kg-video-playback-rate">1&#xD7;</button><button class="kg-video-unmute-icon"><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><path d="M15.189 2.021a9.728 9.728 0 0 0-7.924 4.85.249.249 0 0 1-.221.133H5.25a3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h1.794a.249.249 0 0 1 .221.133 9.73 9.73 0 0 0 7.924 4.85h.06a1 1 0 0 0 1-1V3.02a1 1 0 0 0-1.06-.998Z"/></svg></button><button class="kg-video-mute-icon kg-video-hide"><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24"><path d="M16.177 4.3a.248.248 0 0 0 .073-.176v-1.1a1 1 0 0 0-1.061-1 9.728 9.728 0 0 0-7.924 4.85.249.249 0 0 1-.221.133H5.25a3 3 0 0 0-3 3v2a3 3 0 0 0 3 3h.114a.251.251 0 0 0 .177-.073ZM23.707 1.706A1 1 0 0 0 22.293.292l-22 22a1 1 0 0 0 0 1.414l.009.009a1 1 0 0 0 1.405-.009l6.63-6.631A.251.251 0 0 1 8.515 17a.245.245 0 0 1 .177.075 10.081 10.081 0 0 0 6.5 2.92 1 1 0 0 0 1.061-1V9.266a.247.247 0 0 1 .073-.176Z"/></svg></button><input type="range" class="kg-video-volume-slider" max="100" value="100"></div></div></div><figcaption>Project Athena Technical Overview video, produced in 1991 with a MIT copyright.</figcaption></figure><!--kg-card-begin: markdown--><h2 align="center" id="kerberos101">Kerberos 101</h2><!--kg-card-end: markdown--><p>The Kerberos authentication protocol outlines how clients (<strong>principals</strong>) engage with a network authentication service and provides a mechanism for mutual authentication between entities before establishing a secure network connection.</p><p><br><a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-principals?ref=labs.lares.com#what-are-security-principals">Security principals</a> acquire <strong>tickets </strong>from the <a href="https://learn.microsoft.com/en-us/windows/win32/secauthn/key-distribution-center?ref=labs.lares.com">Kerberos Key Distribution Center (<em><strong>KDC</strong></em>)</a> and subsequently present these tickets along with any <strong>authenticators </strong>while establishing a connection. Kerberos tickets serve as the representation of the client&apos;s network credentials.<br>Here&#x2019;s a basic representation of the Kerberos Authentication flow:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-140.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy"><figcaption>Kerberos authentication flow</figcaption></figure><!--kg-card-begin: markdown--><h3 align="center" id="concepts">Kerberos concepts</h3><!--kg-card-end: markdown--><p>Let&apos;s walk through some basic concepts in Kerberos:</p><p><strong>Realm: </strong>a domain or administrative boundary that defines a Kerberos authentication space. Realms are often associated with a specific network or organization. e.g.: <em>lareslabs.local.</em></p><p><strong><a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-principals?ref=labs.lares.com">Principal</a></strong>: unique security entity, such as a user or service identified by a name (<strong>principal name</strong>) within a realm, to which Kerberos can assign a ticket. Principals authenticate themselves to access secured resources using tickets. Some examples of security principals could include a user, a workstation, a server, services (NFS, hosts...).</p><p><strong>Principal Names:</strong> Unique identifier to each entity within the domain in Active Directory. e.g.:<em>Elliot.a@Lareslabs.local</em></p><p><strong><a href="https://learn.microsoft.com/en-us/windows/win32/ad/service-principal-names?ref=labs.lares.com">Service Principal Names (SPNs):</a></strong> unique identifier of a service instance. Kerberos authentication uses SPNs to associate a service instance with a service sign-in account. e.g., <em>CIFS/fs.Lareslabs.local, </em>MSSQLSvc<em>/SQL01.Lareslabs.local:1433.</em></p><p>SPNs are referenced in the <a href="https://learn.microsoft.com/en-us/windows/win32/adschema/a-serviceprincipalname?ref=labs.lares.com">servicePrincipalName</a> attribute of the domain machine/user accounts.</p><p><strong>Application/Services Servers (AP): &#xA0;</strong>A host that provides one or more services over the network.</p><p><strong><a href="https://learn.microsoft.com/en-us/windows/win32/secauthn/key-distribution-center?ref=labs.lares.com">Key Distribution Center (KDC)</a></strong>: Implemented as a domain service and located on a domain controller, its primary function is to securely manage the distribution of encryption keys among authorized principals in a network. KDC provides two services that are started automatically by the domain controller&apos;s Local Security Authority (LSA) and run as part of the LSA&apos;s process:</p><ul><li><strong>Authentication Service (AS)</strong>: This service handles the issuing of ticket-granting tickets (TGTs) to connect to the ticket-granting service (TGS) in its domain or other trusted domains. TGTs have an expiration date.</li><li><strong>Ticket-Granting Service (TGS)</strong>: issues service tickets, allowing authenticated users to access specific network services. Upon presenting a Ticket-Granting Ticket (TGT), the TGS verifies and provides a time-limited service ticket for the requested service. </li></ul><p><strong>Tickets: </strong>Kerberos tickets are encrypted structures that ensure confidentiality and integrity during transmission. This encryption helps protect sensitive information, and only entities with the appropriate keys (<em>such as the user, TGS, and target service</em>) can decrypt and verify the contents of the tickets.</p><p>Kerberos tickets are encrypted <strong>using the Kerberos keys derived from the user&#x2019;s password </strong>and additional data.</p><p><em>Note</em>: We will discuss tickets in-depth in the third part of the series, <em><strong>Kerberos III&#x2014; User Impersonation.</strong></em></p><p>Tickets have an expiration time, although they may be renewable and reusable.</p><ul><li><strong>Ticket-granting tickets (TGT): </strong>cryptographic structures obtained by a user during the initial authentication process. They are encrypted using the user&apos;s long-term secret key and can be used to request service tickets without requiring the user to re-enter their credentials (<em>allow Single Sign-On</em>).</li><li><strong>Service Ticket (ST)</strong>: obtained from the TGS after presenting a valid TGT and specifying the desired service to access. Contains information about the user, the service, and a session key for secure communication.</li></ul><p><strong>Authenticators</strong>: Data structures created and encrypted by the client with the session keys provided by the Authentication Services ( KDC).</p><p><strong><a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-pac/166d8064-c863-41e1-9c23-edaaa5f36962?ref=labs.lares.com">Privilege Attribute Certificate (PAC):</a> </strong>Kerberos is an <strong>authentication </strong>protocol, not an authorization protocol, this is why this data structure was created, to provide this authorization data for Kerberos extensions.</p><p>The PAC is included in nearly every ticket (Authorization Data) that encodes <strong>authorization </strong>information, consisting of group memberships, additional credential information, profile and policy information, and supporting security metadata.</p><p>Below is an example of the information that can be found within the PAC, obtained through a network traffic capture:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-105.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="1041" height="830" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-105.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-105.png 1000w, https://labs.lares.com/content/images/2024/03/image-105.png 1041w" sizes="(min-width: 720px) 720px"><figcaption>PAC_LOGON_INFO</figcaption></figure><p>When using Kerberos service tickets for server authentication, the Privilege Attribute Certificate (PAC) can be extracted from a user&apos;s ticket. This provides the server with information about user privileges without the need to query the domain controller.</p><!--kg-card-begin: markdown--><h4 align="center" id="encryption">Encryption Types</h4><!--kg-card-end: markdown--><p>As defined in <a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-kile/2a32282e-dd48-4ad9-a542-609804b02cc9?ref=labs.lares.com">[</a><strong><em><a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-kile/2a32282e-dd48-4ad9-a542-609804b02cc9?ref=labs.lares.com">MS-KILE</a></em></strong><a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-kile/2a32282e-dd48-4ad9-a542-609804b02cc9?ref=labs.lares.com">]</a>, The Kerberos V5 protocol supports multiple encryption types, which are the <strong>algorithms for encrypting the tickets or other data</strong>. The Kerberos V5 protocol negotiates which encryption type to use for a particular connection.</p><p>Windows <strong>must </strong>support :</p><ul><li>AES256-CTS-HMAC-SHA1-96 [18]</li><li>AES128-CTS-HMAC-SHA1-96 [17]</li></ul><p>And &#xA0;<strong>should </strong>support:</p><ul><li>RC4-HMAC [23]</li><li>DES-CBC-MD5 [3]</li><li>DES-CBC-CRC [1]</li></ul><p>The following example shows how to enable the encryption types for a machine account (FS1$) through the <a href="https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/decrypting-the-selection-of-supported-kerberos-encryption-types/ba-p/1628797?ref=labs.lares.com">msDS-SupportedEncryptionTypes</a> attribute</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-116.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="460" height="525"><figcaption>msDS-SupportedEncryptionTypes attribute</figcaption></figure><p>More information on how to set encryption types in Kerberos can be found in the <a href="https://learn.microsoft.com/es-es/archive/blogs/openspecification/windows-configurations-for-kerberos-supported-encryption-type?ref=labs.lares.com"><strong>Microsoft&apos;s documentation</strong>.</a></p><!--kg-card-begin: markdown--><h4 align="center" id="wireshark">Wireshark &amp; Kerberos decryption</h4>
<!--kg-card-end: markdown--><p>To better understand what happens within the Kerberos authentication flow, it is possible to provide Wireshark with a key tab file containing Kerberos principal&apos;s encryption keys.</p><p>To facilitate this, we will need the Kerberos keys of the principals participating in the communication, for example, krbtgt, Elliot.A, and FS1$. To obtain these keys, we can use a number of common tools, such as mimikatz, secretsdump, etc.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-16.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="851" height="602" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-16.png 600w, https://labs.lares.com/content/images/2024/03/image-16.png 851w" sizes="(min-width: 720px) 720px"><figcaption>Mimi dumping krbtgt keys</figcaption></figure><p>The next step is to add the keys to the &#xA0;<a href="https://github.com/dirkjanm/forest-trust-tools/blob/master/keytab.py?ref=labs.lares.com">keytab.py script</a> provided by <a href="https://twitter.com/_dirkjan?ref=labs.lares.com">@dirkjanm</a>:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-17.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="897" height="565" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-17.png 600w, https://labs.lares.com/content/images/2024/03/image-17.png 897w" sizes="(min-width: 720px) 720px"><figcaption>Keytab.py</figcaption></figure><p>Import the output file from keytab.py to Wireshark (Edit&gt;Preferences&gt;Protocols&gt;Krb5):</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-22.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="1041" height="715" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-22.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-22.png 1000w, https://labs.lares.com/content/images/2024/03/image-22.png 1041w" sizes="(min-width: 720px) 720px"><figcaption>Wireshark KRB5 Keytab file</figcaption></figure><p>After that, within the Wireshark capture, we should be able to see several things:</p><p>&#x2022;&#x2003; <strong>Blue highlighted parts,</strong> Wireshark has been able to decrypted information using the Kerberos keys of the different principals.<br>&#x2022;&#x2003;<strong>Yellow highlighted parts,</strong> indications of missing key data, resulting the blob not being decrypted.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-47.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="745" height="313" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-47.png 600w, https://labs.lares.com/content/images/2024/03/image-47.png 745w" sizes="(min-width: 720px) 720px"><figcaption>Wireshark KRB5 Decrypt</figcaption></figure><!--kg-card-begin: markdown--><h3 align="center" id="flow">Kerberos Authentication Flow</h3><!--kg-card-end: markdown--><p>The image below shows the Kerberos authentication flow, using our example of a client (Elliot.A) requesting access to a shared folder (CIFS service) on the server FS1.Lareslabs.local:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-121.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy"><figcaption>Yes, another Kerberos diagram</figcaption></figure><p>In Wireshark, the traffic that is generated when a domain user requests a network resource:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-56.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="1146" height="462" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-56.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-56.png 1000w, https://labs.lares.com/content/images/2024/03/image-56.png 1146w" sizes="(min-width: 720px) 720px"><figcaption>Kerberos auth flow&#xA0;</figcaption></figure><!--kg-card-begin: markdown--><h4 align="center" id="preauthentication">Kerberos Pre-Authentication</h4><!--kg-card-end: markdown--><!--kg-card-begin: markdown--><p>Kerberos supports different types of pre-authentication including password-based and public key cryptography <a href="#PKINIT">PKINIT</a>. The most common is using a Timestamp, (PA-ENC-TIMESTAMP). This is just the current timestamp encrypted with the client&apos;s key.</p>
<!--kg-card-end: markdown--><p>Pre-authentication in the Kerberos protocol involves the KRB_AS_REQ (Authentication Service Request) and KRB_AS_REP (Authentication Service Reply) messages.</p><p>This pre-authentication process is enabled in all accounts by default, but it is possible to disable it with the flag &quot;Do not require pre-authentication&quot;:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-129.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="383" height="494"><figcaption>Do not require pre-authentication option</figcaption></figure><p>The client will first send the AS-REQ without any pre-authentication data. If the server requires pre-authentication for this principal (<strong>default option)</strong> it will return an error (KRB5KDC_ERR_PREAUTH_REQUIRED) to the client to indicate that pre-authentication is expected.</p><p>If you find an account with this option enabled, you can obtain an AS-REP message without knowing the client&apos;s secret key for that account (ASREProasting). We will discuss this and other &#x2018;Roasting&#x2019; techniques in the second part of the series: Kerberos II&#x2014;<em>Credential Access.</em></p><p>In the following scenario, Elliot.A., a domain user of the Lareslabs.local domain, wants to start the negotiation process with Kerberos. First, they send an AS-REQ message with his username (cname) to the authentication server (KDC):</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-108.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="873" height="395" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-108.png 600w, https://labs.lares.com/content/images/2024/03/image-108.png 873w" sizes="(min-width: 720px) 720px"><figcaption>AS-REQ without pre-authentication data</figcaption></figure><p>By default, all domain accounts have pre-authentication enabled; as such the KDC will return an error (KRB5KDC_ERR_PREAUTH_REQUIRED):</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/03/image-109.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="882" height="423" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-109.png 600w, https://labs.lares.com/content/images/2024/03/image-109.png 882w" sizes="(min-width: 720px) 720px"></figure><p>The following image illustrates an initial AS-REQ request from the client without pre-authentication data, along with the response from the KDC:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-118.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="1044" height="587" srcset="https://labs.lares.com/content/images/size/w600/2024/02/image-118.png 600w, https://labs.lares.com/content/images/size/w1000/2024/02/image-118.png 1000w, https://labs.lares.com/content/images/2024/02/image-118.png 1044w" sizes="(min-width: 720px) 720px"><figcaption>Kerberos Pre-authentication flow</figcaption></figure><p>It is possible to use these error messages to confirm that a user account exists. We will cover this technique in depth in the post: <strong><em>Kerberos II - Credential Access</em></strong>.</p><p>Once the KDC confirms that the client requires pre-authentication, the client must send a second AS-REQ message with more data to authenticate against the KDC.</p><!--kg-card-begin: markdown--><h4 align="center" id="as-req">AS-REQ (Authentication Service Request)</h4><!--kg-card-end: markdown--><p>The client requests a TGT from the authentication service (AS) at this stage. To do this, the client must send an AS-REQ message.</p><p>This message will include, but are not limited to, the following data:</p><ul><li><strong>Principal Name</strong> (cname):</li><li><strong>Pre-authentication information</strong> (PA-ENC-TIMESTAMP): Timestamp encrypted with the client&apos;s key). </li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-107.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="840" height="402" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-107.png 600w, https://labs.lares.com/content/images/2024/03/image-107.png 840w" sizes="(min-width: 720px) 720px"><figcaption>AS-REQ with pre-authentication data</figcaption></figure><p>It is essential to know that the encrypted timestamp is only necessary if the &#x2003;user requires pre-authentication, as we have already discussed, is the<strong> default option</strong> unless the user has the DONT_REQ_PREAUTH flag enabled. </p><p>The following image below depicts an example of the AS-REQ message captured using Wireshark:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-63.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="885" height="592" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-63.png 600w, https://labs.lares.com/content/images/2024/03/image-63.png 885w" sizes="(min-width: 720px) 720px"><figcaption>AS-REQ</figcaption></figure><p>In the message body, it is possible to find in the padata field, the TimeStamp encrypted with the client&apos;s secret key (pA-ENC-TIMESTAMP).</p><!--kg-card-begin: markdown--><h4 align="center" id="as-rep">AS-REP (Authentication Service Response)</h4><!--kg-card-end: markdown--><p>The KDC attempts to decrypt the Timestamp sent by the client in the previous AS-REQ message using the client&apos;s secret key. In case of pre-authentication failure, e.g. if the client does not provide a correct password, an error message KDC_ERR_PREAUTH_FAILED will be returned.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-124.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="958" height="434" srcset="https://labs.lares.com/content/images/size/w600/2024/02/image-124.png 600w, https://labs.lares.com/content/images/2024/02/image-124.png 958w" sizes="(min-width: 720px) 720px"><figcaption>AS-REP - KDC response</figcaption></figure><p>This message contains, among other data:</p><ul><li><strong>Ticket Granting Ticket (TGT)</strong>, includes the session key encrypted with the ticket granting service secret key (krbtgt secret key), user name, expiration date, and the <a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-pac/54d570b1-fc54-4c54-8218-f770440ec334?ref=labs.lares.com">PAC</a> (provide SIDs, RIDs, user information, password credentials, used for smart card authentication, S4U data..).</li><li><strong>Encrypted data:</strong> The session key is encrypted with the user&#xB4;s secret key.</li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-9.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="807" height="615" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-9.png 600w, https://labs.lares.com/content/images/2024/03/image-9.png 807w" sizes="(min-width: 720px) 720px"><figcaption>Wireshark AS-REP</figcaption></figure><!--kg-card-begin: markdown--><h4 align="center" id="tgs-req">TGS-REQ (Ticket-Granting Service Request)</h4><!--kg-card-end: markdown--><p>The client sends a TGS-REQ message requesting a service ticket (ST) to access a specific service. The client includes, along with other data:</p><ul><li><strong>Ticket-Granting Ticket (TGT) </strong>with an &quot;enc-part&quot; encrypted with the krbtgt Kerberos key. It also includes the PAC.</li><li><strong>Authenticator: </strong>Encrypted with the user&apos;s login session key.</li><li><strong>Service Principal Name (SPN)</strong> of the requested service.</li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-59.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="1107" height="493" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-59.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-59.png 1000w, https://labs.lares.com/content/images/2024/03/image-59.png 1107w" sizes="(min-width: 720px) 720px"><figcaption>TGS-REQ</figcaption></figure><p>The Wireshark capture below identifies that we have found a TGS_REQ message. In the PA-TGS-REQ block, we can see the Ticket Granting Ticket (TGT) and the authenticator sent by the client (Elliot.A). Additionally, in the &#x2018;re-body&#x2019; blob, we can identify the service name for which access is being requested (CIFS/FS1):</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-58.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="1148" height="769" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-58.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-58.png 1000w, https://labs.lares.com/content/images/2024/03/image-58.png 1148w" sizes="(min-width: 720px) 720px"><figcaption>TGS-REQ</figcaption></figure><!--kg-card-begin: markdown--><h4 align="center" id="tgs-rep">TGS-REP (Ticket-Granting Service Response)</h4><!--kg-card-end: markdown--><p>After receiving the TGS-REQ message and verifying the validity of its Ticket-Granting Ticket (TGT), the KDC returns a response through a TGS_REP message with:</p><ul><li><strong>Service Ticket (TGS)</strong>, encrypted with the service owner (FS1$) Kerberos key.</li><li><strong>Encrypted data (EncTGSRepPart)</strong> is encrypted with a copy of the service session key and the user logon session key.</li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-126.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy"><figcaption>TGS-REP</figcaption></figure><p>The image below depicts a TGS-REP message, along with key points to note:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-11.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="929" height="739" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-11.png 600w, https://labs.lares.com/content/images/2024/03/image-11.png 929w" sizes="(min-width: 720px) 720px"><figcaption>Wireshark TGS-REP</figcaption></figure><!--kg-card-begin: markdown--><h4 align="center" id="AP-REQ">AP-REQ (Application Server Request)</h4><!--kg-card-end: markdown--><p>The client forwards a service request message to the intended service, with the following data, among other information:</p><ul><li><strong>Service Ticket (ST):</strong> Encrypted with the server kerberos key (FS1$).</li><li><strong>Authenticator</strong>: Timestamp encrypted with the current service key.</li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/image-128.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="701" height="668" srcset="https://labs.lares.com/content/images/size/w600/2024/02/image-128.png 600w, https://labs.lares.com/content/images/2024/02/image-128.png 701w"><figcaption>AP-REQ</figcaption></figure><p>Here is a snippet of the related network traffic:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-13.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="919" height="722" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-13.png 600w, https://labs.lares.com/content/images/2024/03/image-13.png 919w" sizes="(min-width: 720px) 720px"><figcaption>Wireshark AP-REP</figcaption></figure><p>If the PAC validation is enabled, which isn&apos;t by default, the AP will verify the PAC against the KDC. Also, if mutual authentication is needed, it will respond to the user with a KRB_AP_REP message.</p><p><strong>Optional - <a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-apds/1d1f2b0c-8e8a-4d2a-8665-508d04976f84?ref=labs.lares.com">KERB_VERIFY_PAC</a> [<a href="https://learn.microsoft.com/es-es/archive/blogs/openspecification/understanding-microsoft-kerberos-pac-validation?ref=labs.lares.com">Need to enable Kerberos PAC validation</a>]</strong>: </p><p><a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-apds/1d1f2b0c-8e8a-4d2a-8665-508d04976f84?ref=labs.lares.com">PAC validation</a> is the procedure of confirming the authenticity of a user&apos;s PAC during authentication with a server. The AP will verify the PAC included in the TGS against the KDC. If mutual authentication is required, it will respond with an AP_REP message to the user.</p><p>This PAC validation can be enabled in the registry key ValidateKdcPacSignature (&#x201C;ValidateKdcPacSignature&#x201D;=dword:00000001), in the path:</p><p>[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters].</p><p>By default, the value of this entry is 0, so Kerberos does not perform PAC validation on a process that runs as a service.</p><p><strong>Optional - RPC status code (PAC Verify Response)</strong>: The domain controller verifies the signature on the response and returns the result to the server. When the method completes, the server operating system MUST examine the return code to determine if the PAC contents have been altered. The server operating system MUST treat any nonzero return code as a failure.</p><!--kg-card-begin: markdown--><h4 align="center" id="AP-REP">AP-REP (Application Server Response)</h4><!--kg-card-end: markdown--><p>If mutual authentication is required in the AP_REQ request (<a href="https://googleprojectzero.blogspot.com/2021/10/using-kerberos-for-authentication-relay.html?ref=labs.lares.com">ISC_REQ_MUTUAL_AUTH </a>request flag), the server must respond with a timestamp encrypted with its own session key:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-53.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="1158" height="663" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-53.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-53.png 1000w, https://labs.lares.com/content/images/2024/03/image-53.png 1158w" sizes="(min-width: 720px) 720px"><figcaption>(OPTIONAL) AP_REP</figcaption></figure><p>Once the client receives it and can decrypt it correctly, it will verify that the server is legitimate. If it does not receive a valid AP_REP, the client can confirm that it is a fake/rogue server and stop the communication.</p><!--kg-card-begin: markdown--><h4 align="center" id="PKINIT">Public Key Cryptography for Initial Authentication in Kerberos (PKINIT)</h4><!--kg-card-end: markdown--><p>As described in the<a href="https://web.mit.edu/kerberos/krb5-1.13/doc/admin/pkinit.html?ref=labs.lares.com"> MIT documentation, PKINIT</a> is a pre-authentication mechanism for Kerberos 5 that uses X.509 certificates to authenticate the KDC to clients and vice versa. PKINIT can also enable anonymity support, allowing clients to communicate securely with the KDC or with application servers without authenticating as a particular client principal.</p><p>PKINIT makes use of the following new pre-authentication types: PA_PK_AS_REQ and PA_PK_AS_REP.</p><p>In the context of using PKINIT, the communication flow would be as follows:</p><p>The client (Elliot.A) uses its X.509 certificate (signed by the Certificate Authority) and an authenticator (timestamp encrypted with the client&#xB4;s private key):</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-90.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="1104" height="526" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-90.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-90.png 1000w, https://labs.lares.com/content/images/2024/03/image-90.png 1104w" sizes="(min-width: 720px) 720px"><figcaption>PKINIT pre-authentication</figcaption></figure><p>Below is the PK-AS-REQ request in Wireshark, including the certificate and timestamp sent by the client:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-85.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="1153" height="649" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-85.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-85.png 1000w, https://labs.lares.com/content/images/2024/03/image-85.png 1153w" sizes="(min-width: 720px) 720px"><figcaption>PK-AS-REQ</figcaption></figure><p>The authentication server (AS) verifies the certificate, signature and client binding.</p><p>If everything is OK, the KDC responds with an TGT encrypted with the krbtgt&#xB4;s private key and a session key. </p><p>In addition, <strong>KDC </strong>i<strong>ncludes the user&apos;s LM and NT hash in the PAC (PAC_CREDENTIAL_INFO structure) of the &#xA0;TGT. </strong>This feature will allow the client to switch to NTLM if the remote host does not accept Kerberos.</p><p>Since the PAC is embedded within the TGT, which is encrypted with one of the Kerberos keys for the krbtgt account, extracting the PAC is currently impossible.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-46.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="1025" height="499" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-46.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-46.png 1000w, https://labs.lares.com/content/images/2024/03/image-46.png 1025w" sizes="(min-width: 720px) 720px"><figcaption>PK-AS-REP</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/image-86.png" class="kg-image" alt="Kerberos I - Overview" loading="lazy" width="1086" height="851" srcset="https://labs.lares.com/content/images/size/w600/2024/03/image-86.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/image-86.png 1000w, https://labs.lares.com/content/images/2024/03/image-86.png 1086w" sizes="(min-width: 720px) 720px"><figcaption>Wireshark PK-AS-REP</figcaption></figure><p>Due to this, it is possible to use the User to User (U2U) extension to request a TGS ticket with PAC encrypted with the TGT&#xB4;s session key instead of the krbtgt key and get the user&apos;s hash. </p><p>In the next post of the series, we will delve deeper into the UnPAC the Hash technique to explore this process more comprehensively. </p><p>Wrapping things up ...</p><p>In the first part of the Kerberos series, we&#x2019;ve set the groundwork for the following parts of the series, covering the following:</p><ul><li>An overview of Kerberos.</li><li>The concepts.</li><li>Encryption types.</li><li>The Kerberos Authentication Flow.</li><li>Public Key Cryptography for Initial Authentication (PKINIT).</li></ul><p>This concludes our first approach to Kerberos. In the next post, we will explore different (ab)use techniques and discuss ticket and delegation management in depth. The following posts will be published in the future, and their posts can be found linked below. </p><ul><li><a href="https://labs.lares.com/fear-kerberos-pt2/">Kerberos II - Credential Access</a>.</li><li>Kerberos &#xA0;III - User Impersonation.</li><li>Kerberos IV - Delegations.</li></ul><!--kg-card-begin: markdown--><h2 align="center" id="resources">Resources</h2><!--kg-card-end: markdown--><ul><li>Attl4s - <a href="https://attl4s.github.io/?ref=labs.lares.com">You do (not) Understand Kerberos</a>.</li><li><a href="https://news.mit.edu/2018/mit-looking-back-project-athena-distributed-computing-for-students-1111?ref=labs.lares.com">Looking back at Project Athena</a>.</li><li>Microsoft - <a href="https://learn.microsoft.com/en-us/windows-server/security/kerberos/kerberos-authentication-overview?ref=labs.lares.com">Kerberos Authentication Overview</a>.</li><li>MIT - <a href="https://web.mit.edu/kerberos/papers.html?ref=labs.lares.com#krb4">Kerberos papers and documentation</a>.</li><li>GoogleProjectZero - <a href="https://googleprojectzero.blogspot.com/2021/10/using-kerberos-for-authentication-relay.html?ref=labs.lares.com">Kerberos Relay Requirements</a>.</li><li>Maksim Chudakov - <a href="https://www.chudamax.com/?ref=labs.lares.com">I understand</a>.</li><li><a href="https://archive.fosdem.org/2023/schedule/event/security_kerberos_pkinit/?ref=labs.lares.com">Kerberos PKINIT: what, why, and how (to break it)</a>.</li><li>Tarlogic - <a href="https://www.tarlogic.com/blog/how-kerberos-works/?ref=labs.lares.com">Kerberos</a></li></ul><p></p><p></p><p></p><!--kg-card-begin: html--><style>
    .article-image {
        max-width: 600px;
        margin: 0 auto !important;
        float: none !important;
	}
</style><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Pentesting 101 Part 4: Penetration Test Report & Debrief - The Deliverables]]></title><description><![CDATA[This part of the series will focus on what a penetration testing report should contain and how we use the penetration engagement, the testing activities carried out, and the information, vulnerability, and/or exploit data we documented to populate the penetration testing report.]]></description><link>https://labs.lares.com/pentesting-101-pt4/</link><guid isPermaLink="false">65a517745842ec7502fb31da</guid><category><![CDATA[penetrationtesting]]></category><category><![CDATA[Pentesting 101]]></category><dc:creator><![CDATA[Steve Spence]]></dc:creator><pubDate>Wed, 13 Mar 2024 16:03:44 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2024/03/PT101-3.png" medium="image"/><content:encoded><![CDATA[<img src="https://labs.lares.com/content/images/2024/03/PT101-3.png" alt="Pentesting 101 Part 4: Penetration Test Report &amp; Debrief - The Deliverables"><p><em>Hacking is the fun part; now, for the business end of things, it is the most crucial output.</em></p><p>Following our previous posts, <a href="https://labs.lares.com/pentesting-101-pt1/">Part1</a>, <a href="https://labs.lares.com/pentesting-101-pt2/">Part 2</a>, &#xA0;<a href="https://labs.lares.com/pentesting-101-pt3/">Part3</a>, let&apos;s continue building on what we have learned, identified, carried out, and moved towards our end goal.</p><p>So, a quick recap &#x2026; again!</p><ul><li>We&#x2019;ve identified the reason for driving/your need to conduct a penetration test, as well as any required testing types.</li><li>We&#x2019;ve identified our engagement prerequisites and the scope of the penetration testing.</li><li>We&apos;ve carried out our penetration testing activities as defined by our agreed Scope of Work.</li><li>We have documented any observations, findings, evidence and exploitation.</li></ul><h2 id="where-do-we-start">Where Do We Start?</h2><p>We are at the stage where we have everything we need to compile our report. From an engagement and business point of view, this is ultimately the deliverable.</p><p>A good friend and colleague of mine regularly says: </p><blockquote>We get paid to write reports, the hacking is free.</blockquote><p>This is definitely true!</p><p>In <a href="https://labs.lares.com/pentesting-101-pt3/">Part 3</a> of our series, I briefly discussed reporting and the debrief and explained that the main deliverable of any penetration test is a formal penetration/engagement test report.</p><p>The test team will write an engagement overview and assemble the findings with associated risk ratings to compile a report. The resulting report is then peer-reviewed by Senior or Principal consultants. Once ready, the final report will be sent directly to the customer and/or related in-house security/technical teams (where agreed upon <em>in advance).</em></p><p>Ultimately, the analysis and reporting of the engagement should include:</p><ul><li>Any security issues uncovered.</li><li>The test team&apos;s assessment of the level of risk of each finding.</li><li>A method of resolving each issue found.</li><li>An opinion on the risk of your organization&apos;s security posture based on the evidence from the penetration testing carried out.</li></ul><p><em>Note: It is important to remember that penetration testing should not be used to drive your organization&apos;s vulnerability management process; it is entirely the reverse. Your organization&apos;s vulnerability management process must be the driving factor when conducting penetration testing activities and assessments.</em></p><p>A typical penetration testing engagement report, at a minimum, should have the following sections:</p><ul><li>Executive Summary</li><li>Technical Summary</li><li>Engagement Overview</li><li>Engagement Phases and Detailed Findings</li><li>Supplemental Data</li><li>Appendices</li></ul><p>That said, when it comes to writing the penetration testing report itself, it will most likely <u>NOT</u> happen in the order listed above. Most, if not all, penetration testers will write their report in reverse:</p><!--kg-card-begin: markdown--><ul>
<li>Detailed Findings
<ul>
<li><em>includes annotating/marking items for inclusion within a standalone appendices section, if required</em></li>
</ul>
</li>
<li>Technical Summary</li>
<li>Engagement Overview</li>
<li>Executive &amp; Assessment Summaries</li>
<li>Appendices</li>
</ul>
<!--kg-card-end: markdown--><h2 id="key-point-to-remember-target-audience">Key Point to Remember... Target Audience</h2><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/03/Drawing-2024-03-04-11.29.08.excalidraw.png" class="kg-image" alt="Pentesting 101 Part 4: Penetration Test Report &amp; Debrief - The Deliverables" loading="lazy" width="1037" height="671" srcset="https://labs.lares.com/content/images/size/w600/2024/03/Drawing-2024-03-04-11.29.08.excalidraw.png 600w, https://labs.lares.com/content/images/size/w1000/2024/03/Drawing-2024-03-04-11.29.08.excalidraw.png 1000w, https://labs.lares.com/content/images/2024/03/Drawing-2024-03-04-11.29.08.excalidraw.png 1037w" sizes="(min-width: 720px) 720px"><figcaption>Report Breakdown</figcaption></figure><p><u><strong>Three</strong></u> distinct types of readers will generally read a report; as such, the report itself needs to be written in a manner that is digestible by each group:</p><ul><li><strong>C-Level:</strong> They usually have minimal time on their hands and, as a result, will probably not have the time to read beyond the first few pages (if that). For this reason, a visual representation of findings to indicate the areas where they need to invest, immediate risks to the business, and any impact on the business&apos;s operations is a good idea.</li><li><strong>Security/Project Managers &amp; Stakeholders:</strong> These sections are generally read from the start of the report to the business and technical summaries, along with the engagement findings overview. Therefore, these sections need to detail the issues and their associated impacts in an understandable and actionable manner. They will need technical details and remediation advice. Details of the overall trends observed during the engagement will enable them to present results to the risk committee and executive board.</li><li><strong>Technical folks:</strong> e.g., Security, IT, Network and App teams, DevOps, Developers, etc. These folks will read the vulnerabilities and findings they have been told to fix. The findings section will need clear details on reproducing the identified issue, a recommendation, and references to enable them to deploy a fix.</li></ul><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/03/Drawing-2024-03-04-12.22.20.excalidraw.png" class="kg-image" alt="Pentesting 101 Part 4: Penetration Test Report &amp; Debrief - The Deliverables" loading="lazy" width="763" height="154" srcset="https://labs.lares.com/content/images/size/w600/2024/03/Drawing-2024-03-04-12.22.20.excalidraw.png 600w, https://labs.lares.com/content/images/2024/03/Drawing-2024-03-04-12.22.20.excalidraw.png 763w" sizes="(min-width: 720px) 720px"></figure><h2 id="let-us-get-down-to-reporting">Let us get down to Reporting.</h2><p>So now we know the typical sections a penetration testing engagement report should have. Let&apos;s expand on each section, digging deeper into its purpose and how and why each is useful in communicating any risk, impact, and overall outcome of the engagement.</p><p>First up, we have: </p><h3 id="executive-summary-section">Executive Summary Section </h3><p>How different testing companies approach this section can be a mixed bag. Ideally, it should be inclusive of the following or incorporate the following:</p><!--kg-card-begin: markdown--><ul>
<li>Executive Overview
<ul>
<li>e.g., It should contain the client name, testing company name, dates when the work took place and type of assessment.</li>
</ul>
</li>
<li>Assessment Summary
<ul>
<li>e.g., Still high-level at  this stage, though should contain more about what type of testing took place, testing actions and a general indiaction of the overall risk and testing outcome.</li>
</ul>
</li>
<li>Engagement Recommendations
<ul>
<li>e.g., Still high-level, these should be overall and accumulative, recommendations and not specific <em>(at this stage)</em>, unless there is an overall need to. These recommendations normally centre around reviewing current policy &amp; procedures around risk prevention, mitigation and vulnerability patching etc</li>
</ul>
</li>
</ul>
<!--kg-card-end: markdown--><p>In short, this section will provide and/or describe a high-level overview of the engagement&apos;s purpose, objectives, general scope, and limitations.</p><p>Next Up, we have the following:</p><h3 id="technical-details-summary-section">Technical Details Summary Section</h3><p>This section will provide and/or describe a more specific, detailed, and technical account of the engagement, along with the associated phases and work undertaken by the test team.</p><p>Key points to look out for are:</p><ul><li>Assessment Contact Information</li><li>Scope of Work (SoW)</li><li>Scope &amp; Engagement Caveats or Limitations</li><li>Post Engagement Clean Up</li><li>Risk Ratings Explanation <em>(pre-agreed risk ratings)</em></li></ul><p><em>Note: Information in several sections listed above can and should be populated from the engagement scoping questionnaire, scoping calls/meetings and data returned from the engagement itself.</em></p><p>This should then naturally be followed by a more concise section:</p><h3 id="engagement-overview-section">Engagement Overview Section</h3><p>The engagement overview section should consist of the technical findings per phase. This is generally in the form of a table <em>(or similar)</em> for each phase, which will be used to communicate details, such as:</p><ul><li>Risk Rating</li><li>Affected component/host</li><li>Finding(s) discovered</li></ul><p><u><em><strong>Note:</strong></em></u><em> This is again used to provide a high-level overview of issues discovered; however, it is aimed more at those responsible for remediating the issues discovered; therefore, more concise and technical language would be expected here.</em></p><p>Lastly, the engagement overview section should ideally serve as a segue into the &quot;meat and potatoes&quot; section of the report, the:</p><h3 id="engagement-phases-and-detailed-findings-section">Engagement Phases and Detailed Findings Section</h3><p>Whilst the report serves as the overall account of when, what, and how things were done, the detailed findings section is probably the most crucial section of a penetration testing report. </p><p>This section provides a detailed overview of the testing phases conducted and the consequent security issues and findings discovered. The main focus is that this section will be specifically for those responsible for remedying the issues found during the engagement.</p><p>Several key areas should be included. These are as follows:</p><!--kg-card-begin: markdown--><ul>
<li>Issue Title &amp; Risk Rating
<ul>
<li>In keeping with the actual issue and identified risk</li>
</ul>
</li>
<li>Description &amp; Evidence
<ul>
<li>What: Summary of issue identified</li>
<li>How: e.g., screenshots, tool and or exploitation output. Evidence such as screenshots and tool/exploit output must be clear and readable</li>
<li>Steps to recreate</li>
</ul>
</li>
<li>Affected Components
<ul>
<li>e.g., IP address and/or hostname</li>
</ul>
</li>
<li>Recommendation
<ul>
<li>Suitable/appropriate &amp; evidence based</li>
</ul>
</li>
<li>References
<ul>
<li>Appropriate - not a random/obscure &apos;blog&apos; or &apos;stackoverflow&apos; post</li>
<li>We often link to Lares Labs&apos; blog posts when referencing previously discussed work that goes into further depth.</li>
</ul>
</li>
</ul>
<!--kg-card-end: markdown--><p>A note on the &#x2018;Description&#x2019; of the issue identified. This should explain how it impacts the affected host/application/area, then detail how this risks the business, end users or interactions with both.</p><p>When reading/reviewing a penetration testing report, a handy technique to ensure that the findings the report details are fit for purpose is to identify that each finding follows along these three simple steps:</p><!--kg-card-begin: markdown--><ul>
<li>Introduce ...
<ul>
<li>This is where the issue/finding is described</li>
</ul>
</li>
<li>Show ...
<ul>
<li>This is where what was found is documented e.g., evidence, images &amp; steps to reproduce</li>
</ul>
</li>
<li>Discuss ...
<ul>
<li>discuss the impact and risk</li>
</ul>
</li>
</ul>
<!--kg-card-end: markdown--><p><u><em>Note:</em></u><em> More evidence is always better than less! Providing steps that are understandable and repeatable is vital.</em></p><h3 id="appendices">Appendices</h3><p>This section should be used for any information such as:</p><!--kg-card-begin: markdown--><ul>
<li>Additional information that is provided or pertains to documented finding outlined within the &#x2018;Engagement Phases and Detailed Findings. For example, exploitation code, proof-of-concepts etc.</li>
<li>Data which would complicate any particular finding, e.g., information that degrade the overall flow and/or readability of the report.</li>
<li>Glossaries</li>
<li>Detailed methodologies</li>
</ul>
<!--kg-card-end: markdown--><h2 id="tying-everything-together-%E2%80%A6">Tying Everything Together &#x2026;</h2><p>Once you&apos;ve written your report, it should cover all the key areas and necessary points. It should also be digestible by the three distinct groups we outlined earlier. Lastly, it should include any potential appendices detailing more information on the findings themselves or additional supporting context to the engagement, including detailed methodologies.</p><p>The report should then be submitted for a technical peer review and quality assurance round to identify any technical inaccuracies and grammatical errors. This will ensure the report is ready for delivery and receipt by the client so that the final product is error-free and both reads and flows well.</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/03/Drawing-2024-03-04-11.44.36.excalidraw.png" class="kg-image" alt="Pentesting 101 Part 4: Penetration Test Report &amp; Debrief - The Deliverables" loading="lazy" width="905" height="174" srcset="https://labs.lares.com/content/images/size/w600/2024/03/Drawing-2024-03-04-11.44.36.excalidraw.png 600w, https://labs.lares.com/content/images/2024/03/Drawing-2024-03-04-11.44.36.excalidraw.png 905w" sizes="(min-width: 720px) 720px"></figure><h2 id="client-debrief">Client Debrief</h2><p>A client debrief should be offered and arranged, allowing enough time for the client and their in-house technical teams to review, digest, and understand the report, its contents, and overall risk/impact. This will also allow them to formulate appropriate follow-up questions and/or queries.</p><p>Sessions such as these can be highly beneficial for several reasons, several of which are listed below:</p><ol><li><strong>Clear Communication of Findings: </strong>During the debriefing session, the test team can systematically walk through their findings, detailing the vulnerabilities discovered, the methods used to exploit them, and the potential impact on the client&apos;s systems. This clear communication ensures that technical and non-technical stakeholders understand the risks identified during the assessment.</li><li><strong>Immediate Feedback and Clarification:</strong> The client can ask questions, seek clarification, or request additional information about any specific issues identified during the penetration testing. This real-time feedback loop allows for a deeper understanding of the vulnerabilities and their potential implications, enabling the client to make informed decisions about remediation priorities and strategies.</li><li><strong>Enhanced Collaboration:</strong> Debrief sessions foster collaboration between the test team and the client, creating an environment conducive to open dialogue and knowledge sharing. Clients may provide insights into their systems or business processes that could further contextualize the findings, while the test team can offer guidance on best practices for addressing security weaknesses.</li><li><strong>Tailored Recommendations:</strong> During the debriefing session, the test team can discuss tailored recommendations and mitigation strategies that align with the client&apos;s needs and constraints. This personalized approach ensures that the remediation efforts are practical, effective, and feasible within the client&apos;s organizational context.</li><li><strong>Opportunity for Improvement:</strong> Debriefing sessions allow clients to reflect on their existing security practices and processes. Organizations can refine their security policies, procedures, and training programs to better defend against future attacks by understanding how vulnerabilities were identified and exploited.</li><li><strong>Documentation and Reporting:</strong> The debrief session serves as a forum for documenting the findings, discussions, and action items arising from the penetration testing. This formal record ensures that all stakeholders understand the assessment outcomes clearly and facilitates accountability for promptly addressing security issues.</li></ol><h2 id="let%E2%80%99s-recap">Let&#x2019;s recap...</h2><p>In summary, in this part of the series, we&#x2019;ve discussed/walked through the following:</p><ul><li>A general recap and overview of a penetration testing report</li><li>The target audience</li><li>The sections of a penetration testing report</li><li>A more detailed view of what each section and what to expect</li><li>The engagement debrief and the benefits</li></ul><p>At this stage of the series, whether you&apos;re writing or receiving a report&#x2014;be it your first or 5,000th report&#x2014;it is essential to ensure that what we have covered during each post directly translates to your specific needs and/or deliverables.</p><p>If you are on the receiving end of the report, hopefully, by now, you should know what to expect from the overall penetration test process. This includes identifying your testing needs, scoping the test, understanding the execution, and ultimately understanding and interpreting the report. Digesting each segment of the report should be pretty straightforward and sufficiently segment the sections between relevant teams in your organization.</p><p>Suppose you are a penetration tester just starting. In that case, hopefully, the topics and areas we have covered will empower you and instil confidence in your ability to carry out a penetration test to a benchmark standard. Ultimately, you will provide your client with a tangible, structured engagement process, execution of work, and penetration testing report at the end of everything.</p><p>If you are ever in doubt or unsure about your penetration testing needs, seeking assistance from a dedicated organization that provides such services regularly is the first step to maturing your security posture. </p><p>Over time, you will become more informed and able to take more ownership of this process.</p><h2 id="how-can-we-help">How can we help?</h2><p>Here at Lares, we help empower organizations to maximize their security Potential.</p><p>Lares is a security consulting firm that helps companies secure electronic, physical, intellectual, and financial assets through a unique blend of assessment, testing, and coaching.</p><p>If you would like any further information, you can get in touch <a href="https://www.lares.com/contact/?ref=labs.lares.com">here</a> or head over to the <a href="https://www.lares.com/?ref=labs.lares.com">Lares.com</a> website for more information about how we can help.</p>]]></content:encoded></item><item><title><![CDATA[Pentesting 101 Part 3: Executing the Scope-of-Work & Penetration Testing]]></title><description><![CDATA[<p><em>It&apos;s time to test some pens ...</em></p><p>Following our previous posts, <a href="https://labs.lares.com/pentesting-101-pt1/">Part1</a> &amp; <a href="https://labs.lares.com/pentesting-101-pt2/">Part 2</a>, let&apos;s continue building on what we have learned and moving towards our end goal.</p><h2 id="so-a-quick-recap">So, a quick recap!</h2><ul><li>We posed and answered the question: what is Penetration Testing?</li><li>We&#x2019;ve identified</li></ul>]]></description><link>https://labs.lares.com/pentesting-101-pt3/</link><guid isPermaLink="false">65a513b45842ec7502fb31b4</guid><category><![CDATA[penetrationtesting]]></category><category><![CDATA[Pentesting 101]]></category><dc:creator><![CDATA[Steve Spence]]></dc:creator><pubDate>Tue, 05 Mar 2024 14:00:00 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2024/03/PT101-2.png" medium="image"/><content:encoded><![CDATA[<img src="https://labs.lares.com/content/images/2024/03/PT101-2.png" alt="Pentesting 101 Part 3: Executing the Scope-of-Work &amp; Penetration Testing"><p><em>It&apos;s time to test some pens ...</em></p><p>Following our previous posts, <a href="https://labs.lares.com/pentesting-101-pt1/">Part1</a> &amp; <a href="https://labs.lares.com/pentesting-101-pt2/">Part 2</a>, let&apos;s continue building on what we have learned and moving towards our end goal.</p><h2 id="so-a-quick-recap">So, a quick recap!</h2><ul><li>We posed and answered the question: what is Penetration Testing?</li><li>We&#x2019;ve identified your driving factors, why you need to conduct a penetration test, and any required testing types.</li><li> We&#x2019;ve identified our engagement prereqs and the scope of the penetration testing engagement.</li></ul><p>Now, we are, or rather should be, at the stage where we have everything we need to conduct our engagement.</p><p>In part 1 of the series, we posed and answered the question: What is a Penetration test? Using the following answer to serve as a generic base:</p><!--kg-card-begin: markdown--><blockquote>
<p>A method for gaining assurance in the security of an IT system/environment, by attempting to breach some or all of that system&apos;s/environment&#x2019;s security, using the same tools and techniques as an adversary might.</p>
</blockquote>
<!--kg-card-end: markdown--><p>Here at Lares, we do just this with our penetration testing, attempt to circumvent security controls and gain unauthorized access to an environment, system or service, from an adversarial stance, as a threat actor. Ultimately, it seeks to identify exposures, weaknesses, misconfigurations, and vulnerabilities, which consequently allow/facilitate the exploitation of given systems, infrastructure, applications, or networks.</p><p>These attack vectors and exploits will attempt to gain control and further penetrate/compromise the network. With the aim to gain an understanding of the extent of exposure, risk, and compromise to which our clients are face, as a result of the infrastructure, services and security maturity in play. Doing so allows us to understand the true impact to any client organization or what it will likely be, e.g., a postulated threat.</p><p>I hear you asking how we do this ... well simply put, we execute our engagements with a detailed methodology, which follows many repeatable steps that can be used no matter the type of engagement.</p><h2 id="methodology-overview">Methodology Overview</h2><p>As I mentioned, a methodology, sometimes referred to as the &#x2018;stages of a penetration test&#x2019;, can be broken down into the following five steps/stages/phases:</p><!--kg-card-begin: markdown--><ul>
<li>Planning &amp; Reconnaissance</li>
<li>Discovery/Enumeration (Automated &amp; Manual)</li>
<li>Attack Simulation &amp; Exploitation (Automated &amp; Manual)
<ul>
<li>Command &amp; Control (optional)</li>
<li>Exfiltration (optional)</li>
</ul>
</li>
<li>Analysis &amp; Reporting</li>
<li>Client Debrief</li>
</ul>
<!--kg-card-end: markdown--><p>However, let&apos;s take a moment or two to revisit a crucial stage of the overall penetration testing process, &#x2018;<strong>Pre-engagement</strong>&#x2019; activities.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/Drawing-2023-05-03-09.23.45.excalidraw.png" class="kg-image" alt="Pentesting 101 Part 3: Executing the Scope-of-Work &amp; Penetration Testing" loading="lazy" width="445" height="303"><figcaption>Setting up for Success!</figcaption></figure><p>The first element of any penetration test should always be pre-engagement with the customer. This is where we define the engagement parameters, e.g., Plan, Prepare &amp; Perform, ultimately setting the engagement up for success! Here are a few key points to tick: a pre-engagement checklist.</p><!--kg-card-begin: markdown--><ul>
<li>Meet with the engagement point-of-contact, commonly referred to as the &#x201C;PoC&#x201D;.</li>
<li>Meet with the customer&apos;s security team/technical liaison.</li>
<li>Ensure there is a description, known as the Statement-of-Work, for the testing types/activities highlighted within the Scope of Work document.
<ul>
<li>Statement of Work: Summary describing the overall work to be carried out.</li>
<li>Scope of Work (SoW): The actual specifics, e.g., IPs, Domains, Environments, Type of testing/scenarios.
<ul>
<li>Note: I see lots of folks use these headings interchangeably, which is not correct and can lead to complications/confusion.</li>
</ul>
</li>
</ul>
</li>
<li>Ideally, there should be no deviation from the scope document. Where a new testing requirement has been identified, a procedure relating to SoW changes or additional work must be followed prior to any new or undefined work being undertaken. Doing so will keep everyone right.</li>
<li>Confirm connectivity, access and any credentials required/provided for testing purposes are working correctly/as expected.</li>
<li>Ensure there is an agreed method to communicate with the PoC&#x2019;s, both primary and secondary (if required), along with establishing a communal &amp; line of communication throughout the testing,
<ul>
<li>Ensure that where details for any technical PoC exist they are also added into any communications.</li>
<li>Ensure that the necessary communications with any involved security team are established, if different from your point of contact.</li>
</ul>
</li>
<li>Where on-site testing site is applicable, or where multiple on-site locations are in scope, then an onsite point-of-contact must be nominated for each site in scope.</li>
<li>Again, include these PoCs in any engagement&#x2019;s communications (as applicable).</li>
<li>Prior to the engagement/testing commencing on the agreed start date, a final authorization to test will be sought via email. This is in order to verify there have been no changes and/or issues with any of the scoped items for review.</li>
</ul>
<!--kg-card-end: markdown--><p>So, now we have revisited the pre-engagement activities and double checked that we&#x2019;re good to go e.g., get to the fun stuff, lets provide some context around each of the steps/stages/phases outlined in the <strong>Methodology Overview</strong> and set some expectations around what to expect.</p><h2 id="a-not-so-linear-process">A not-so-linear process ...</h2><p>With all that said, the penetration testing methodology, or rather the one that I will lay out and step through, describing as a linear model isn&#x2019;t necessarily the best way to describe it; a more accurate representation would look like this <em>(everyone loves a diagram)</em>:</p><figure class="kg-card kg-image-card kg-width-full kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/Drawing-2024-01-15-16.02.50.excalidraw.png" class="kg-image" alt="Pentesting 101 Part 3: Executing the Scope-of-Work &amp; Penetration Testing" loading="lazy" width="1758" height="778" srcset="https://labs.lares.com/content/images/size/w600/2024/02/Drawing-2024-01-15-16.02.50.excalidraw.png 600w, https://labs.lares.com/content/images/size/w1000/2024/02/Drawing-2024-01-15-16.02.50.excalidraw.png 1000w, https://labs.lares.com/content/images/size/w1600/2024/02/Drawing-2024-01-15-16.02.50.excalidraw.png 1600w, https://labs.lares.com/content/images/2024/02/Drawing-2024-01-15-16.02.50.excalidraw.png 1758w"><figcaption>Basic Penetration Testing Methodology</figcaption></figure><p>I should state, at this stage at least, that whilst the methodology depicted in the diagram above can be applied across several different engagement types, the actual activities/actions, taken for example, for a <strong>Red</strong> or <strong>Purple</strong> team engagement, each would significantly differ in execution, due to the engagement deliverables or objectives. So, it is essential to remember this and understand the differences. As such, this post won&apos;t cover the specifics of a Red &amp; Purple team engagement.</p><h2 id="planning-reconnaissance">Planning &amp; Reconnaissance</h2><p>This can differ depending on engagement type and objectives, but in a general sense this can be framed as conducting initial reconnaissance &amp; target confirmation phase of a penetration test.</p><p>The test team will perform activities to enumerate, identify, and confirm information relating to the engagement target(s) or specific environment(s) in a non-invasive or passive manner.</p><p>This phase can or will be conducted in a variety of ways, some examples of which are detailed below:</p><ul><li>Customer-supplied information, i.e., target lists, IP ranges, URLs.</li><li>Use and reference publicly available information sources such as domain name registrars, corporate information disclosed as a matter of public record and/or social media platforms.</li><li>Publicly available data breach information, e.g., emails, passwords, usernames etc.</li></ul><p><strong><em><u>Note:</u></em></strong><em> The points detailed above are not exhaustive, and any source that discloses information regarding a target and/or environment can or may be used to some extent.</em></p><h2 id="discoveryenumeration-automated-manual">Discovery/Enumeration (Automated &amp; Manual)</h2><p>This step involves taking the information and data gathered above and then using it more actively, meaningfully and strategically, e.g., interacting with the target resources and services. This step will typically involve activities such as:</p><ul><li>Port scanning</li><li>Banner grabbing</li><li>Vulnerability assessment &amp; mapping</li><li>User verification/validation</li><li>Security misconfiguration verification/validation</li><li>Password analysis &amp; reuse</li></ul><p>Essentially, the test team will look to validate any of their findings/observations for the services and capabilities, which would ultimately be presented to a threat actor for any of the given assets/applications/environments in scope.</p><h2 id="example-enumeration-and-discovery">Example Enumeration and Discovery:</h2><!--kg-card-begin: markdown--><p>The test team has identified and confirmed a selection of servers as target assets.</p>
<ul>
<li>They will then attempt to identify a list of services running on the host(s).
<ul>
<li>For internal network environments this could be done via passive monitoring of the network or be achieved with active scanning techniques such as port scanning.</li>
</ul>
</li>
<li>Further targeted manual testing and probing of any applications, networks, services and/or devices in scope will be conducted. This is to provide continuity of testing as well as determine or identifying exact versions of software or hardware (where possible) in use on the asset(s) in scope.</li>
<li>The test team will now determine whether any of these services are vulnerable and furthermore, whether any consequent issues identified are associated with publicly disclosed vulnerabilities, which have been documented as leading to successfully compromising the assets or services.</li>
</ul>
<!--kg-card-end: markdown--><p><u><em><strong>Note:</strong></em></u><em> The points detailed above are not exhaustive and are merely provided for context and visualization of what may occur during this phase.</em></p><h2 id="attack-simulation-exploitation-automated-manual">Attack Simulation &amp; Exploitation (Automated &amp; Manual)</h2><!--kg-card-begin: markdown--><ul>
<li>Execute attack path to compromise
<ul>
<li>Command &amp; Control activities <em>(optional &#x2013; dictated by SoW/objectives)</em></li>
<li>Exfiltration activities <em>(optional &#x2013; dictated by SoW/objectives)</em></li>
</ul>
</li>
</ul>
<!--kg-card-end: markdown--><p>During the targeted attack simulation and exploitation phase of testing, the test team will work towards proving or disproving their ability to interact in an unintended manner and/or to compromise the target environment/application/asset(s) using the enumerated data collected, in conjunction with any vulnerabilities that were mapped earlier in the Vulnerability Mapping and Data Analysis phase.</p><p>This will ultimately unfold in such a manner, where the test team will emulate the actions of a malicious individual/threat actor or group; however, a distinct and noticeable difference in general penetration testing engagements, is that they are time-boxed and executed in a controlled manner. This will minimize disruption to client service level agreements, impact to the network and to the services or assets they are targeting; however, a legitimate threat actor, depending on skill/technical ability may not care of the resulting impact of such activities, nor are they limited by time.</p><h2 id="example-attack-scenario-ntlm-relay-attack-high-level-overview">Example Attack Scenario: NTLM Relay Attack (High-level overview)</h2><p>The test team has identified and confirmed the presence of server message block (SMB) traffic, and that Link-Local Multicast Name Resolution (LLMNR), along with NetBIOS Name Resolution (NBT-NS), is enabled.</p><ul><li>Using the tool, CrackMapExec, the consultant generated a relay list of SMB hosts that do not enforce signing, which will serve as relay targets.</li><li>Responder used to carry out a poisoning attack against LLMNR, NBT-NS, and mDNS traffic, along with capturing authentication hashes.</li><li>NTLMrelayX is then used to relay those authentication hashes to the list of relay targets.</li></ul><p>A successful relay can result in the following:</p><ul><li>Command execution</li><li>Establish additional footholds</li><li>Persistence</li><li>Interactive shells on the exploited server</li><li>Lateral/vertical movement</li><li>Establish additional footholds</li><li>Persistence</li><li>Dumping Hashes</li><li>Offline cracking</li></ul><h2 id="command-control-activities-optional-%E2%80%93-dictated-by-sowobjectives">Command &amp; Control activities (optional &#x2013; dictated by SoW/objectives)</h2><p>Where a foothold has been successfully gained, a malicious individual or hacking group will often attempt to take their attacks further by escalating access privileges of any compromised users and/or accounts. This may require a command and control (C2) element but can be done without. Often, Lares consultants will perform additional enumeration without using C2 communications and operate from compromised endpoints or using legitimate user access. </p><p>The test team&apos;s next steps would be to emulate the same approach and install some form of C2; this can be as simple as a reverse connection to using more complex frameworks alongside multiple connectivity methods to ensure redundancy.</p><p>Ultimately, the goal is to gain administrative/complete control of the compromised target. This may include but is not limited to, such assets as:</p><!--kg-card-begin: markdown--><ul>
<li>A domain controller(s)</li>
<li>Active Directory</li>
<li>Critical system(s) containing sensitive data</li>
<li>Network devices i.e. switches, routers, firewalls (if or where applicable)</li>
<li>Application Servers</li>
<li>Cloud environments</li>
</ul>
<!--kg-card-end: markdown--><h2 id="exfiltration-activities-optional-%E2%80%93-dictated-by-sowobjectives">Exfiltration activities (optional &#x2013; dictated by SoW/objectives)</h2><p>Data exfiltration and proof-of-concepts are typically the final active stages of any penetration testing engagement. Data exfiltration is not conducted on every engagement. It is generally agreed in advance as an engagement deliverable, or more commonly reserved for scenario-driven, offensive or bespoke object-orientated testing (commonly referred to as &#x201C;red or purple team&#x201D; type engagements).</p><p>It is worth noting that depending on the data &#x201C;in play&#x201D;, various legal considerations may need to be assessed and understood before any actual execution of data exfiltration. For instance, European/UK clients and their associated data may be governed by legislation such as the General Data Protection Regulation (GDPR) and/or the UK&#x2019;s Data Protection Act.</p><p>In general, data can be categorized as <strong>non-sensitive</strong> or <strong>sensitive</strong>.</p><ul><li><strong>Non-sensitive PII</strong> is information that can be transmitted in an unencrypted form without harming the individual. Non-sensitive PII can be easily gathered from public records, phone books, corporate directories, and websites.</li><li><strong>Sensitive PII</strong> is information that, when disclosed, could harm the individual whose privacy has been breached. Sensitive PII should therefore be encrypted in transit and when data is at rest. Such information includes biometric information, medical information, personally identifiable financial information (PIFI) and unique identifiers such as passport or Social Security numbers.</li></ul><p>So, it is highly recommended, that before any data exfiltration the test team understand the type of data they will be interacting, along with any regulatory/legal requirements.</p><p>Finally, it is essential to realise that, as general penetration tests are carried out within the context of a timeboxed and controlled manner, attacks such as Denial-of-Service (DoS) attacks are often avoided, along with exploits/exploitation, which may be unreliable or are known to work in such a way that they cause damage or disruption.</p><p>Where there is a requirement/deliverable for this type of specific testing, where possible, testing should be carried out in a simulated and representative test environment rather than against the real/live asset(s) itself; this is particularly beneficial where sensitive or high use production environments are being tested.</p><h2 id="analysis-reporting">Analysis &amp; Reporting</h2><p>A good friend and colleague of mine comments regularly that: </p><blockquote>...we get paid to write reports, the hacking is free!</blockquote><p>and this is definitely true!</p><p>The main deliverable of any penetration test is a formal penetration/engagement test report. This should be compiled by the test team and overseen by a senior/lead tester for each engagement. The final report will be ultimately sent directly to the customer and/or related in house security/technical teams <em>(where agreed in advance).</em></p><p>Ultimately, the analysis and reporting of the engagement should include:</p><ul><li>Any security issues uncovered.</li><li>The test team assesses the level of risk that each vulnerability exposes to the organisation or system.</li><li>A method of resolving each issue found.</li><li>We will use our consultants&apos; professional opinion on the accuracy of your organisation&apos;s security posture based on the evidence from the penetration testing.</li><li>Advice on how to improve your vulnerability assessment and management process.</li></ul><p>As such, a typical penetration testing engagement report, at a minimum, should have the following sections:</p><ul><li>Executive Summary</li><li>Technical Summary</li><li>Engagement Overview</li><li>Engagement Phases and Detailed Findings</li><li>Supplemental Data</li><li>Appendices</li></ul><h2 id="client-debrief">Client Debrief</h2><p>A penetration testing debriefing session should be arranged(where applicable per assessment type) after a suitable/pre-agreed timeframe, after which the client&apos;s in-house technical and security teams have had ample time to read, understand, and formulate the basis of any engagement questions and remediation approach.</p><p>This serves as a crucial step in the overall assessment process, providing an opportunity for the test team to communicate their findings comprehensively and for the client to gain deeper insights into the security posture of their systems.</p><h2 id="practical-execution-of-the-methodology-external-penetration-test">Practical Execution of the Methodology: External Penetration Test</h2><p>In reality, an actual practical example of the execution of a penetration test, for example, an external penetration test, might look like this, as depicted in the image below.</p><p><em>Note: this is a high-level representation of the execution of the methodology.</em></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/02/Drawing-2023-05-03-13.20.21.excalidraw.png" class="kg-image" alt="Pentesting 101 Part 3: Executing the Scope-of-Work &amp; Penetration Testing" loading="lazy" width="1412" height="1968" srcset="https://labs.lares.com/content/images/size/w600/2024/02/Drawing-2023-05-03-13.20.21.excalidraw.png 600w, https://labs.lares.com/content/images/size/w1000/2024/02/Drawing-2023-05-03-13.20.21.excalidraw.png 1000w, https://labs.lares.com/content/images/2024/02/Drawing-2023-05-03-13.20.21.excalidraw.png 1412w" sizes="(min-width: 720px) 720px"><figcaption>Practical Example of Executing a Penetration Testing Methodology</figcaption></figure><p>Using our previously defined methodology, let&#x2019;s break down the example in the image above.</p><!--kg-card-begin: markdown--><ul>
<li><strong>Planning &amp; Reconnaissance</strong>
<ul>
<li>Activities are conducted against a number of services/ resources, as annotated within the pink box.</li>
</ul>
</li>
<li><strong>Discovery &amp; Enumeration</strong>
<ul>
<li>Target identification/verification</li>
<li>Port scanning</li>
<li>Banner grabbing</li>
<li>Manual interaction</li>
<li>Vulnerability assessment</li>
</ul>
</li>
<li><strong>Attack Simulation &amp; Exploitation</strong>
<ul>
<li>Test team reference the SOW &amp; engagement deliverables:
<ul>
<li><strong>If allowed:</strong> further targeted activities can be focused on perimeter/network devices, Operating Systems, Servers, Web Servers and Services, with the view to identify vulnerabilities leading to viable attack paths and exploitation.</li>
<li><strong>If not allowed:</strong> Conduct a vulnerability assessment <em>(see note below)</em>, with follow-up non-invasive manual verification, along with documenting any the likely outcome/risk.</li>
</ul>
</li>
</ul>
</li>
</ul>
<!--kg-card-end: markdown--><p><em><u>Note:</u> a vulnerability assessment is not the same as an actual penetration test; these two terms are used interchangeably regularly. A key point to note is that a vulnerability assessment generally focuses on the identification of as many vulnerabilities within the allotted period as possible, whereas an &#x2018;actual&#x2019; penetration test will not only identify vulnerabilities, it will also focus on active exploitation of these vulnerabilities, to fully understand their actual security risk and impact.</em></p><h2 id="let%E2%80%99s-recap">Let&#x2019;s recap...</h2><p>In summary, we&#x2019;ve discussed/walked through the execution of the scope-of-work (SOW) and the actual phases of a penetration test, what they look like in general, the types of actions that could be taken throughout that process, reporting and what that should look like, along with the view of a practical representation of what this looks like in &#x2018;real life&#x2019;, using an external penetration test as our reference point.</p><p>If you are ever in doubt or unsure about your penetration testing needs, seeking assistance from a dedicated organisation that provides such services regularly and has a proven track record and reputation is the first step to maturing your security posture, awareness, and understanding of penetration testing.</p><p>Over time, you will become more informed and able to take more ownership of this process.</p><p>From here, the following steps involve: Given that we carried out the scope of work and our testing activities following our methodology, we now need to compile the engagement report, deliver it to our client, and follow this up with a debrief call/session. This will be covered in part 4 of the &#x2018;Pentesting 101&#x2019; series.</p><h2 id="how-can-we-help">How can we help?</h2><p>Here at Lares, we help empower organizations to maximize their security Potential.</p><p>Lares is a security consulting firm that helps companies secure electronic, physical, intellectual, and financial assets through a unique blend of assessment, testing, and coaching.</p><p>If you would like any further information, you can get in touch <a href="https://www.lares.com/contact/?ref=labs.lares.com">here</a> or head over to the <a href="https://www.lares.com/?ref=labs.lares.com">Lares.com</a> website for more information about how we can help.</p>]]></content:encoded></item><item><title><![CDATA[I Know What Your Password Was Last Summer...]]></title><description><![CDATA[We have spent the last six months researching on the previous two years of prior cracked passwords and built some tools to understand password creation strategies better. Here are the results.]]></description><link>https://labs.lares.com/password-analysis/</link><guid isPermaLink="false">6451b4000b63a611ef98229f</guid><category><![CDATA[passwords]]></category><category><![CDATA[research]]></category><dc:creator><![CDATA[Andy Gill]]></dc:creator><pubDate>Thu, 08 Feb 2024 09:30:28 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2024/01/i_know_what_your_password_was_last_summer--2---1--1.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://labs.lares.com/content/images/2024/01/i_know_what_your_password_was_last_summer--2---1--1.jpg" alt="I Know What Your Password Was Last Summer..."><p>As security professionals, we often run into the age-old issue of passwords across multiple environments, systems, implementations, and other chaos. An interesting aspect we regularly encounter when compromising organisations is the psychology behind how people choose their passwords. This insight reveals patterns and tendencies in password creation within windows environments, shedding light on common vulnerabilities and the human factors influencing password security. &#xA0;</p><p>Understanding these psychological elements is crucial for developing more effective security strategies and educating users about safer password practices. It is equally important when building cracking methodologies to effectively assess an organisation&apos;s security posture and crack the keys to the kingdom.</p><p>This post delves into the trends identified over the past two years, offering insightful comparisons between strong and weak password policies. It also explores the user behaviors that develop due to these policies.</p><p>We use hashcat as a strategic and systematic approach to advancing our engagements over time, particularly in the realm of cracking password hashes. This method has proven effective in obtaining the cleartext values for various interesting passwords, providing valuable insights into organisations&apos; trends and practices in establishing their password policies.</p><p>Additionally, this approach informs our strategies for password guessing and spraying attacks against endpoints, enhancing our understanding of the thought processes prevalent in specific industries and how certain security controls can be bypassed. </p><h2 id="the-core-data">The Core Data</h2><p>All of the analysis in this post is from an amalgamation of cracking windows NTLM passwords over two years; the total amount of hashes was <code>186149</code>, unique hashes were <code>99918</code>, and <code>31200</code> were cracked, resulting in many repeat passwords across users and industries. </p><p>The findings from this extensive data set offer valuable insights:</p><ol><li><strong>Password Reuse</strong>: The large number of repeat passwords suggests a widespread issue of password reuse across different users and industries, a practice that significantly compromises security.</li><li><strong>Common Weak Passwords</strong>: The success in cracking a substantial portion of the hashes indicates that many users continue to rely on weak passwords, which are vulnerable to cracking tools and techniques.</li><li><strong>Industry Patterns</strong>: The data potentially reveals patterns in password creation and policy enforcement across various industries, providing an understanding of industry-specific security postures.</li></ol><h3 id="our-hashcat-rules-and-setups">Our Hashcat Rules and Setups</h3><p>Depending on the hash type will depend on how we approach cracking it on our rig; typically, quicker to crack hashes such as NTLM, we will approach with a wordlist for a quick flyover followed by rules, followed by specifics around the company name, and other relevant wording or phrases. </p><p>Our collective NTLM cracking rate is <code>~600GH/s</code>, comprised of several RTX 4090s, 3090s, and other cards.</p><p>We use a collection of custom and standard wordlists when targeting organisations. The standard public lists we try with various rules are shown:</p><ul><li>HaveIBeenPwned password list from PwnedPasswords (<a href="https://github.com/HaveIBeenPwned/PwnedPasswordsDownloader?ref=labs.lares.com">https://github.com/HaveIBeenPwned/PwnedPasswordsDownloader</a>) </li><li>Common Corp Passwords (<a href="https://github.com/danielmiessler/SecLists/blob/master/Passwords/common_corporate_passwords.lst?ref=labs.lares.com">https://github.com/danielmiessler/SecLists/blob/master/Passwords/common_corporate_passwords.lst</a>)</li><li>English Dictionary (<a href="https://github.com/dwyl/english-words/blob/master/words.txt?ref=labs.lares.com">https://github.com/dwyl/english-words/blob/master/words.txt</a>)</li><li>Crackstation (<a href="https://crackstation.net/crackstation-wordlist-password-cracking-dictionary.htm?ref=labs.lares.com">https://crackstation.net/crackstation-wordlist-password-cracking-dictionary.htm</a>)</li><li>Antipublic (<a href="https://bigpasswordlist.com/DAAP.html?ref=labs.lares.com">https://bigpasswordlist.com/DAAP.html</a>)</li><li>Weakpass_3a (<a href="https://weakpass.com/wordlist/1948?ref=labs.lares.com">https://weakpass.com/wordlist/1948</a>)</li></ul><p>As for rulesets, we use public and private ones again, but here are the public ones we use:</p><ul><li>OneRuleToRuleThemAll &#xA0;(<a href="https://github.com/NotSoSecure/password_cracking_rules?ref=labs.lares.com">https://github.com/NotSoSecure/password_cracking_rules</a>)</li><li>OneRuleToRuleThemStill &#xA0;(<a href="https://github.com/stealthsploit/OneRuleToRuleThemStill?ref=labs.lares.com">https://github.com/stealthsploit/OneRuleToRuleThemStill</a>)</li><li>Pantagrule &#xA0;(<a href="https://github.com/rarecoil/pantagrule/tree/master/rules/private.hashorg.royce?ref=labs.lares.com">https://github.com/rarecoil/pantagrule/tree/master/rules/private.hashorg.royce</a>)</li></ul><p>Finally, on top of wordlists and rules, there are some custom masks we frequently use when targeting specific organisations, but there is a core list of masks and hashcat commands:</p><pre><code>CompanyName?a?a?a?a?a?a
Colour?a?a?a?a?a?a
</code></pre><p>A prevalent trend observed in various environments is the use of situational or time-structured passwords. Users often create passwords incorporating elements such as the current season, month, day, company, or department name, typically followed by a date. This predictable pattern makes it easier to crack these passwords using hashcat rules and masks, allowing for efficient and swift password reversal.</p><p><a href="https://labs.lares.com/author/andy-gill/">Andy Gill</a>, one of our consultants, wrote a toolkit for parsing pot files that we&apos;ve leveraged to build master wordlists and standard rules:</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://github.com/ZephrFish/PotUtils?ref=labs.lares.com"><div class="kg-bookmark-content"><div class="kg-bookmark-title">GitHub - ZephrFish/PotUtils</div><div class="kg-bookmark-description">Contribute to ZephrFish/PotUtils development by creating an account on GitHub.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://github.com/fluidicon.png" alt="I Know What Your Password Was Last Summer..."><span class="kg-bookmark-author">GitHub</span><span class="kg-bookmark-publisher">ZephrFish</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://repository-images.githubusercontent.com/667020568/f84709a9-6223-4e3e-bfd1-d0c0eb98d7ad" alt="I Know What Your Password Was Last Summer..."></div></a></figure><p>The crack flow process typically follows targeting the company with a select wordlist and rulesets, brute-forcing up to the nine-character keyspace with optimized keyspace, parsing the profile, and running the cracked list against a ruleset again to fish out patterns. </p><h2 id="what-was-your-password-last-summer">What was your password last summer?</h2><p>As companies mature, so do their password policies; gone are the days when many of our clients were simply<code>Summer2024!</code> , and you&apos;re in the front door. We still see SeasonYYYY or variations of it in less mature environments now and again. Here are some of the examples we&apos;ve seen of seasons and mentions of them:</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/01/image-1.png" class="kg-image" alt="I Know What Your Password Was Last Summer..." loading="lazy" width="421" height="198"></figure><p>We wrote an in-house tool to do password analysis. When given an input of cracked hashes, it would analyze common words, phrases, and other attributes. The results from said tool are shown in the following screencaps detailing common passwords, top passwords, days of the week, months of the year, seasons, and colours.</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/01/image-2.png" class="kg-image" alt="I Know What Your Password Was Last Summer..." loading="lazy" width="899" height="401" srcset="https://labs.lares.com/content/images/size/w600/2024/01/image-2.png 600w, https://labs.lares.com/content/images/2024/01/image-2.png 899w" sizes="(min-width: 720px) 720px"></figure><p>The average length of 11 characters shows a good improvement year on year and more mature password policies being applied across organisations. While there are still outliers, the general coverage of estates looks to be on an upward trajectory for improvement.</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/01/image-3.png" class="kg-image" alt="I Know What Your Password Was Last Summer..." loading="lazy" width="586" height="483"></figure><p>Despite people being big fans of summer, it would appear the winter months are more prevalent in passwords.</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/01/image-4.png" class="kg-image" alt="I Know What Your Password Was Last Summer..." loading="lazy" width="584" height="565"></figure><p>The title of this post gives it away, but people are big fans of summer, and it&apos;s apparent in their password creations, too.</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/01/image-5.png" class="kg-image" alt="I Know What Your Password Was Last Summer..." loading="lazy" width="584" height="268"></figure><p>Many folks have a favourite colour of blue, with red and green following closely behind.</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/01/image-6.png" class="kg-image" alt="I Know What Your Password Was Last Summer..." loading="lazy" width="584" height="563"></figure><p>Of the top years in passwords, 108 were forward thinkers, getting that 2025 several years ahead; attackers will never think of that!</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/01/image-7.png" class="kg-image" alt="I Know What Your Password Was Last Summer..." loading="lazy" width="575" height="478"></figure><h2 id="interesting-passwords">Interesting Passwords</h2><p>We come across many interesting passwords; here are some of our favourites we&apos;ve seen in the last couple of years, both secure and funny.</p><pre><code>&lt;Passw0rd1&gt;&lt;Passw0rd2&gt;
#1PeppermintPatty
Grits&amp;Gravy4u
HelloSummertime2023!
Security4You
Sec9re_NobodyWillGuessMe
Gustavo12345678901234567890
Green eggs and ham!
Why $o Serious?
</code></pre><p>These passwords were cracked using a combination of mask attacks, wordlist and rule-based attacks. In addition, baseline password lists were used iteratively to crack and inform cracking other passwords. Remember that complexity and length can make cracking time-consuming and resource-intensive, especially with high-entropy passwords.</p><h3 id="further-analysis-on-duplicates">Further Analysis on Duplicates</h3><p>Our analysis revealed significant findings regarding duplicates and unique users with shared passwords. A recurring pattern was observed where accounts set up by an organisation for specific purposes shared identical passwords, often resulting from mass-reset procedures.</p><p>Additionally, instances were noted where users with multiple accounts, especially those with privileged access, reused passwords across different organisations. The research also sheds light on cases where users, upon changing organisations, continued to employ poor password practices, carrying the same weak passwords to their new workplaces.</p><ul><li>Total Hashes: 186149</li><li>Total Duplicate Hashes: 56648</li><li>Total Users with Duplicate Passwords: 11359</li></ul><p>The successfully cracked passwords were analyzed on publicly available lists from SecLists(<a href="https://github.com/danielmiessler/SecLists/tree/master/Passwords/?ref=labs.lares.com">https://github.com/danielmiessler/SecLists/tree/master/Passwords/</a>) to uncover interesting matches in public wordlists.</p><pre><code class="language-bash">2020-200_most_used_passwords.txt: 19 matches
2023-200_most_used_passwords.txt: 20 matches
500-worst-passwords.txt: 39 matches
bt4-password.txt: 212 matches
cirt-default-passwords.txt: 7 matches 
clarkson-university-82.txt: 7 matches
common_corporate_passwords.lst: 118 matches 
darkc0de.txt: 135 matches
darkweb2017-top10.txt: 5 matches
darkweb2017-top100.txt: 9 matches 
darkweb2017-top1000.txt: 54 matches 
darkweb2017-top10000.txt: 161 matches
days.txt: 17 matches 
dutch_common_wordlist.txt: 105 matches
dutch_passwordlist.txt: 724 matches
months.txt: 48 matches
Most-Popular-Letter-Passes.txt: 94 matches
mssql-passwords-nansh0u-guardicore.txt: 118 matches
openwall.net-all.txt: 143 matches
probable-v2-top12000.txt: 148 matches
probable-v2-top1575.txt: 65 matches
probable-v2-top207.txt: 26 matches
richelieu-french-top20000.txt: 104 matches
richelieu-french-top5000.txt: 67 matches
scraped-JWT-secrets.txt: 8 matches
seasons.txt: 40 matches
twitter-banned.txt: 34 matches
unkown-azul.txt: 9 matches
UserPassCombo-Jay.txt: 23 matches
xato-net-10-million-passwords-10.txt: 4 matches
xato-net-10-million-passwords-100.txt: 16 matches
xato-net-10-million-passwords-1000.txt: 53 matches
xato-net-10-million-passwords-10000.txt: 121 matches
xato-net-10-million-passwords-100000.txt: 284 matches
xato-net-10-million-passwords-1000000.txt: 525 matches
xato-net-10-million-passwords-dup.txt: 523 matches
xato-net-10-million-passwords.txt: 755 matches</code></pre><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/01/image-8.png" class="kg-image" alt="I Know What Your Password Was Last Summer..." loading="lazy" width="1979" height="1580" srcset="https://labs.lares.com/content/images/size/w600/2024/01/image-8.png 600w, https://labs.lares.com/content/images/size/w1000/2024/01/image-8.png 1000w, https://labs.lares.com/content/images/size/w1600/2024/01/image-8.png 1600w, https://labs.lares.com/content/images/2024/01/image-8.png 1979w" sizes="(min-width: 720px) 720px"></figure><p>The results indicate that all the passwords identified are already known and included in standard wordlists. This suggests a greater likelihood of successful compromise by attackers.</p><h2 id="advice-for-password-creation">Advice For Password Creation</h2><p><br>When selecting a password, conventional advice has long recommended using a mix of special characters, numbers, and upper and lower case letters, with a minimum length of 8 characters. However, this advice evolves. Observations from our more mature clients indicate that prioritizing password length over complexity and less frequent changes encourages the adoption of passphrases. These are easier to remember yet remain challenging to crack, offering a balance of security and user-friendliness.</p><p>Both the UK and US government security arms have great advice around password creation; therefore, here is a combination of their advice to help you create strong passwords:</p><ol><li>Length is significant; aim for a minimum of 16 characters when creating an active directory policy.</li></ol><p>To help users with creating long passwords, try suggesting using four random words and connecting them with a special character like a <code>-</code> or <code>$</code>, doing so increases the complexity and at the same time the length. An example of this may be:</p><ul><li><code>Sunset$Guitar$Puzzle$Journey</code> or <code>Cloudy-Envelope-Rainbow-Dinosaur</code> (Don&apos;t use these two examples as they&apos;re also on our wordlist ;) )</li></ul><p>Both of these would fall within a decent length as the phrase &quot;Cloudy-Envelope-Rainbow-Dinosaur&quot; consists of 32 characters, including the hyphens, and &#xA0;&quot;Sunset$Guitar$Puzzle$Journey&quot; consists of 28 characters, including the dollar signs.</p><p>2. When setting up default or initial passwords for the organisation, it is advisable to use an algorithm for generating unique user passwords, rather than relying on a static value. If implementing such an algorithm is not feasible, an alternative approach is to require users to change their password upon their first login. This practice helps in minimizing security risks. </p><p>3. To ensure that users maintain unique passwords, it is beneficial to encourage and enforce the use of password managers. These tools assist not only in generating solid passwords but also in creating distinct and unique passwords for different accounts. This approach steers users away from easily crackable passwords, such as basic phrases, common words (like &apos;welcome&apos; or &apos;password&apos;), seasons, months, years, and places. Instead, users can opt for the recommended method of combining four random words, which can then be securely stored in a password manager. This strategy enhances overall password security and management. </p><h2 id="conclusion">Conclusion</h2><p>This post has primarily focused on the security of passwords within Windows environments, particularly from an internal standpoint using data collected across many datasets. However, it is vital to stress that a robust password policy should not be an organisation&apos;s sole line of defence. In addition to strong passwords, it is imperative to implement further protective measures.</p><p>Key among these is the adoption of multi-factor authentication (MFA), which adds a layer of security beyond just the password. MFA requires users to provide two or more verification factors to access a resource such as an application, online account, or a VPN. This significantly reduces the risk of unauthorised access. Where possible, we have seen some clients implement MFA for access to internal resources, utilising existing single sign-on providers and similar identity and access management technology to restrict lateral movement opportunities.</p><p>Moreover, organisations should embrace the principle of &apos;defence in depth&apos;. This is a comprehensive approach to cybersecurity that layers multiple defensive mechanisms. If one mechanism fails, another steps in immediately to thwart an attack. This approach involves technological solutions and encompasses policies, procedures, and awareness training to ensure that all possible security gaps are covered.</p><p>Incorporating these practices alongside a robust password policy creates a more resilient and secure environment, reducing the likelihood of successful cyberattacks and enhancing overall organisational security.</p>]]></content:encoded></item><item><title><![CDATA[SE101: Smishing Attack Overview and Breakdown]]></title><description><![CDATA[‘Smishing’ is a blended word comprised of "SMS" (short message service)and "phishing."
In short, it's a social engineering attack vector that leverages text messages to deceive individuals into taking several actions (outlined later in the post).]]></description><link>https://labs.lares.com/se101-smishing/</link><guid isPermaLink="false">658ea1f35842ec7502fb2d08</guid><category><![CDATA[socialengineering]]></category><category><![CDATA[Social Engineering 101]]></category><dc:creator><![CDATA[Steve Spence]]></dc:creator><pubDate>Thu, 01 Feb 2024 09:30:02 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2024/03/smishing-wordcloud-1.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://labs.lares.com/content/images/2024/03/smishing-wordcloud-1.jpg" alt="SE101: Smishing Attack Overview and Breakdown"><p>Following on from the <a href="https://labs.lares.com/tag/socialengineering/">SE:101 Series</a> created by Chris Pritchard, featuring blogs post by both <a href="https://labs.lares.com/author/chris/">Chris</a> and I, this is the latest post in the series, which covers &#x2018;Smishing&#x2019;, a lesser known, but highly prevalent social engineering attack vector.</p><p><strong>What exactly is &#x2018;Smishing&#x2019;?</strong></p><p>Common tactics employed in smishing attacks include masquerading as reputable entities, such as banks, government agencies, or well-known service providers, family and friends. These messages often contain links or phone numbers that, when interacted with, can lead to the compromise of personal information or the installation of malware.</p><p>Given the prevalence of mobile devices in our daily lives, smishing has become an increasingly favoured tactic among cybercriminals. As such, it is imperative that we remain vigilant and educate ourselves, our colleagues, family and friends on recognizing, and avoiding such deceptive messages to safeguard our sensitive information, or in the case of business, its proprietary and customer information.</p><p><strong>So how does &#x2018;Smishing&#x2019; work at a high-level?</strong></p><p>Well, this is a form/variant of a &#x2018;phishing&#x2019; attack, in which an attacker uses a compelling text message to lure, build rapport and ultimately trick the targeted recipient(s) in to the doing any or all of the following:</p><ul><li>Clicking a link which will have malicious intent or consequences</li><li>Sending the social engineer/threat actor private information</li><li>Sending the social engineer/threat actor financial information</li><li>Making a purchase for gift certificates/store cards <em>e.g. Amazon, Apple&#x2026;</em></li><li>Downloading malicious programs/software to a smartphone or other hardware devices</li></ul><p>It is worth noting that the social engineer/threat actor, or the &#x2018;Smisher&#x2019; as we&#x2019;ll now refer to them, may use your actual name and location to address you directly. Using these details make the pretext of any message more compelling for the recipient.</p><p><strong>Lets Breakdown a &apos;Smishing&apos; Attack</strong></p><p>The following breakdown is taken from an actual &#x2018;Smishing&#x2019; attack which targeted an individual using the pre-text or &#x2018;lure&#x2019; of <strong>urgency</strong> and a <strong>position of authority</strong>. I should point out, at this stage, that the smishing attack featured, was ultimately unsuccessful, due to the security awareness of the targeted individual and their ability to challenge politely but firmly.</p><p>Using the following image, which depicts the &#x2018;Smishing&#x2019; attack message exchange, we can break down the &#x2018;Smishers&#x2019; approach/methodology.</p><p><em>Note: the SMS conversation has been redacted to protect the recipient&#x2019;s identity (yellow box), as well as the senior figure being impersonated (red box).</em></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2023/12/2023-12-29_09-07-31-smish1.jpg" class="kg-image" alt="SE101: Smishing Attack Overview and Breakdown" loading="lazy" width="311" height="430"><figcaption>Conversation from an actual &#x2018;Smishing&#x2019; Attack message exchange</figcaption></figure><p><strong>Step 1) OSINT: </strong>The &#x2018;Smisher&#x2019; has clear done some open-source intelligence gathering (OSINT) and identified a senior figure of importance within the target organization. <em>(Easily done via LinkedIn, Corporate publications/resources, news articles, media coverage etc.)</em></p><p><strong>Step 2) Identify targets:</strong> Using data breaches, social media platforms, sources of public record, a social engineer/threat actor can enumerate an individual or groups of individuals information. Once a target list has been constructed, depending on the technical ability of the &#x2018;Smisher&#x2019; or threat actor, both manual <em>(time consuming) </em>and automated <em>(most efficient, as allows for mass campaigns)</em> means can be used to launch the attack.</p><p><strong>Step 3) The Pretext:</strong> In our example, the &#x2018;Smisher&#x2019; poses as<strong> a high profile, well known and important individual</strong>, within the target organization<strong>. </strong>This is then supported with the &#x201C;<strong>lure/enticement</strong>&#x201D;, and this is conveyed in the following forms:</p><ul><li><strong>First:</strong> A closed question first <em>(e.g. a question that is either a yes/no)</em></li><li><strong>Second:</strong> Politeness</li><li><strong>Third:</strong> Needing Help third</li><li><strong>Fourth:</strong> Urgency fourth</li><li><strong>Lastly:</strong> Directness last <em>(issuing a request, with the initial pretext set as coming from a high profile/important individual)</em></li></ul><p>At this point, <strong>Directness</strong>, the &#x2018;Smisher&#x2019; will either succeed with the lure, get caught out, or attempt to enacted a secondary pretext/lure! In our case they got caught out, as when the colleague issued the verification challenge, requesting a current picture, the &#x2018;Smishing&#x2019; replied with &#x201C;Check on LinkedIn&#x201D;, at which point, the targeted recipient ceased all further interaction with the &#x2018;Smisher&#x2019; and reported the incident to the organization security team.</p><p><strong>So, how can we Protect Ourselves from Smishing Attacks?</strong></p><p>We all know about email phishing, the dangers of it and what to look for, but ultimately if it feels &#x2018;off&#x2019; we call it out! Protecting ourselves from &#x2018;Smishing&#x2019; attacks, we need to take the same approach; however, smishing prevention, much like phishing prevent, depends on the targeted user&#x2019;s ability to identify a smishing attack and ignore or report the message. With this in mind, here are some simple steps, as an individual, to be aware of:</p><ul><li><strong>Check</strong> the listed Caller ID; this usually points to an online voice over IP (VOIP) provider, where looking up the number and its location is not normally possible.</li><li><strong>Check</strong> the message, grammar, spelling and structure</li><li><strong>Don&#x2019;t</strong> click on any links which you are unsure of the origin or validity</li><li><strong>Don&#x2019;t </strong>send anyone private information via SMS</li><li><strong>Don&#x2019;t </strong>send anyone financial information via SMS</li><li><strong>Don&#x2019;t </strong>make purchases for gift certificates/store cards <em>e.g. Amazon, Apple&#x2026; </em>if asked to do so via SMS</li><li><strong>Don&#x2019;t</strong> download malicious programs/software to a smartphone or other hardware devices if asked to do so via SMS</li><li><strong>Ultimately </strong>be aware of your social media/online presence and what you make available</li></ul><p>In addition to the above point, there are several technological solutions which can also prevent, or act as defense in depth:</p><p>&#xB7; SMS Filtering: Many smartphones/cell phone carriers now provide &#x2018;SMS filtering&#x2019; options to identify and block or flag suspicious SMS&#x2019;s.</p><p>&#xB7; Multifactor Authentication (MFA): Utilizing MFA is an additional protective layer, will serve as an additional layer of defense and can prevent a threat actor from using credentials obtained through &#x2018;Smishing&#x2019; attack.</p><p>Anti-phishing Tools: Some security applications for mobile devices, for example, Google Chrome&#x2019;s &#x2018;<a href="https://support.google.com/chrome/answer/9890866?hl=en-GB&amp;co=GENIE.Platform%3DiOS&amp;ref=labs.lares.com">Safe browsing</a>&#x2019; and IOS&#x2019;s &#x2018;<a href="https://support.apple.com/en-al/guide/iphone/iph6e7d349d1/ios?ref=labs.lares.com">Built-in Privacy &amp; Security</a>&#x2019; protections, can help identify phishing links in text messages and prevent users from accessing malicious sites.</p><p><strong>Closing Points</strong></p><p>Anyone with a mobile device, such as a smartphone or tablet, can receive regular cellular text messages, from any number in the world, or indeed via any supported applications e.g., WhatsApp, Telegram, Signal. Many users are already aware of the dangers of clicking a link in email messages; however, fewer people are aware of the dangers of clicking links which are contained within SMS messages and &#x2018;Smishing&#x2019; attacks.</p><p>In short:</p><ul><li><strong>Ignore: </strong>If it looks too good to be true and/or the message is unsolicited, ignore, report and delete. SMS messages offering quick money from winning prizes or collecting cash after entering information.</li><li><strong>Remember: </strong>Financial institutions will never send a SMS asking for credentials or a money transfer. Never send credit card numbers, ATM PINs, or banking information to someone via text messages.</li><li><strong>Avoid: </strong>avoid responding to a SMS/phone number that you don&#x2019;t recognize.</li><li><strong>Awareness: </strong>Make an effort to stay up to date with current smishing tactics and threats. Awareness can be your first line of defense. As an individual this maybe seem like a daunting task; however, your current organization may have security awareness program which covers topics such as this, as such this would be a great place to seek help and understanding. Alternatively, seeking knowledge online from reputable providers can also be another great option.</li></ul><p>As users, we are much more trusting of text messages in this day and age, as this is normally the main means of communications between family and friends, so &#x2018;Smishing&#x2019; is often lucrative to attackers seeking to build rapport and obtain credentials, banking information and private data.</p>]]></content:encoded></item><item><title><![CDATA[Introducing Super Sharp Shares]]></title><description><![CDATA[SuperSharpShares is a tool designed to automate enumerating domain shares, allowing for quick verification of accessible shares by your associated domain account.]]></description><link>https://labs.lares.com/supersharpshares-release/</link><guid isPermaLink="false">659d17cc5842ec7502fb2d75</guid><category><![CDATA[penetrationtesting]]></category><category><![CDATA[enumeration]]></category><category><![CDATA[tooling]]></category><dc:creator><![CDATA[Neil Lines]]></dc:creator><pubDate>Mon, 15 Jan 2024 09:30:28 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2024/01/SuperSharpShares-1.png" medium="image"/><content:encoded><![CDATA[<img src="https://labs.lares.com/content/images/2024/01/SuperSharpShares-1.png" alt="Introducing Super Sharp Shares"><p></p><h3 id="back-story">Back Story</h3><p>SuperSharpShares came about somewhat unexpectedly - it was never intended for release and wasn&apos;t initially developed with that goal in mind. Originally, it served as a solution within a more intricate tool we created that remains unreleased (for now, never say never). However, during a challenging assessment due to the scale of the environment, the automated share enumeration functionality was attractive as something to run quicker than other tools. As such, we copied that functionality and then used it to create this standalone program.</p><p>While numerous tools offer similar functionalities, our preference, where possible, is to develop our tooling in-house. This kind of hands-on approach gives us a better understanding of how something works and enables the opportunity to change or tweak it as required. Releasing the tool allows others to ignore, tweak, or improve as they feel fit.</p><p>If we had to sum up the advantages of SuperSharpShares. They are as follows: </p><ul><li>easy to use, </li><li>quick, even within large environments,</li><li>suitable for auditing, </li><li>A small data footprint with minimal lines of code makes it easier to understand how it works and use it in other projects.</li></ul><p>Again, numerous tools offer similar functionalities, but they are often bundled within a more extensive tool offering; it is nice to have a single function within a tool to help keep it simple.</p><p>As the saying goes, &#x201C;A picture is worth a thousand words,&#x201D; with that, it&apos;s best we just show you SuperSharpShares after execution.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Host_Win10-Lab1_Execute_SuperSharpShares.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="688" height="504" srcset="https://labs.lares.com/content/images/size/w600/2024/01/Host_Win10-Lab1_Execute_SuperSharpShares.png 600w, https://labs.lares.com/content/images/2024/01/Host_Win10-Lab1_Execute_SuperSharpShares.png 688w"><figcaption>Execution of Super Sharp Shares</figcaption></figure><p>Execute SuperSharpShares from a domain-joined host or a runas window, both with no command options required. The program automates the entire process for you: the domain look-up, host machines, accessible shares, and finally, each available share or write access status. We have used SuperSharpShares across multiple domains, and even in large environments, we&apos;ve observed that it swiftly enumerates accessible shares quicker than many other tools.</p><h3 id="read-and-write-access">Read and Write Access</h3><p>Domain shares are filled with gold; in almost every environment, examples of sensitive data are being overly shared. Armed with a typical user&apos;s domain account, adversaries can often access enough internal data to tarnish the business name, manipulate a business&apos;s share price, encrypt data for a ransom, or snoop.</p><p>During an assessment, it&apos;s common to uncover read access to shares that were either unknown or intended to be accessible only by a specific group of individuals.</p><p>Having write access to a share implies the ability to make unauthorized changes to files or folders, allowing manipulation or injection of malicious content. Notably, write access to an <code>ADMIN$</code> or <code>C$</code> share often signifies that the executing account potentially possesses administrative privileges over the identified host.</p><p>The picture below details the following:</p><ol><li>The execution of SuperSharpShares has revealed Write access to the <code>C$</code> share on host <code>WIN10-LAB2</code>.</li><li>Windows File Explorer is used to manually access the share, verifying the administrative access to the host.</li><li>The final CMD prompt confirms that the executing account is only a member of <code>Domain Users</code> group.</li></ol><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Host_Win10-Lab1_Local_Admin_Privs_On_WIN10-LAB2_use_Windows_file_explorer_confirmation_Shows_User_Account1.jpg" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="1251" height="1035" srcset="https://labs.lares.com/content/images/size/w600/2024/01/Host_Win10-Lab1_Local_Admin_Privs_On_WIN10-LAB2_use_Windows_file_explorer_confirmation_Shows_User_Account1.jpg 600w, https://labs.lares.com/content/images/size/w1000/2024/01/Host_Win10-Lab1_Local_Admin_Privs_On_WIN10-LAB2_use_Windows_file_explorer_confirmation_Shows_User_Account1.jpg 1000w, https://labs.lares.com/content/images/2024/01/Host_Win10-Lab1_Local_Admin_Privs_On_WIN10-LAB2_use_Windows_file_explorer_confirmation_Shows_User_Account1.jpg 1251w" sizes="(min-width: 720px) 720px"><figcaption>Write access to C$ share.</figcaption></figure><p>In large environments, it&apos;s common to discover an individual domain user account or the whole group has been added to a machine&apos;s local administrative security group.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/G.White_Member_Local_Admins.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="631" height="609" srcset="https://labs.lares.com/content/images/size/w600/2024/01/G.White_Member_Local_Admins.png 600w, https://labs.lares.com/content/images/2024/01/G.White_Member_Local_Admins.png 631w"><figcaption>Domain user account added to machines local administrators&#x2019; group.</figcaption></figure><h3 id="supersharpshares-under-the-hood">SuperSharpShares Under The Hood</h3><p>The program starts by retrieving the domain name associated with the currently logged-in user.</p><p>After obtaining the domain name, the program calls the <code>GetComputerNames</code> method, which is part of the <code>EnumerateDomainShares</code> class. This method queries Active Directory for computer objects within the specified domain and retrieves a list of their host names.</p><p>The <code>GetComputerNames</code> method uses an <code>LDAP</code> path and Active Directory queries to fetch the list of computer names within the enumerated domain.</p><p>The <code>NetShareEnum</code> function from the <code>Netapi32.dll</code> library is then used to enumerate and retrieve information about the accessible shared resources (shares) on each enumerated computer within the domain.</p><p>The script utilizes the <code>Parallel.For</code> construct, a mechanism provided by the Task Parallel Library (TPL) in C# to help perform parallel processing. </p><p>The TPL automatically manages the allocation of threads based on the available CPU cores. The idea is to divide the workload (iterations of the loop) among multiple threads, allowing concurrent execution to speed up the overall process; it works!</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Host_Win10-Lab1_Auto_Threads_Limited_Processors.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="793" height="673" srcset="https://labs.lares.com/content/images/size/w600/2024/01/Host_Win10-Lab1_Auto_Threads_Limited_Processors.png 600w, https://labs.lares.com/content/images/2024/01/Host_Win10-Lab1_Auto_Threads_Limited_Processors.png 793w" sizes="(min-width: 720px) 720px"><figcaption>Two threads are automatically allocated based on the number of CPU&apos;s</figcaption></figure><h3 id="endpoint-detection-and-response">Endpoint Detection and Response</h3><p>The program would be a valuable addition for any internal IT team to help them audit which shares are accessible by domain members.</p><p>While all included functionality is strictly legitimate, there is still a chance that the program could eventually be categorized as malicious by EDR solutions. At the time of release, there was no categorization by Windows Defender.</p><p>During a recent assessment of a very mature environment, we noted that SuperSharpShares was not blocked from execution but did raise a medium alert for potentially suspicious behavior due to the large amount of internal SMB connections to each host machine during the share enumeration phase.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Host_Win10-Lab1_Defender-1.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="541" height="508"><figcaption>Domain hosts Defender Settings</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Host_Win10-Lab1_Defender2.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="787" height="952" srcset="https://labs.lares.com/content/images/size/w600/2024/01/Host_Win10-Lab1_Defender2.png 600w, https://labs.lares.com/content/images/2024/01/Host_Win10-Lab1_Defender2.png 787w" sizes="(min-width: 720px) 720px"><figcaption>Using Scan with Microsoft Defender on the complied program</figcaption></figure><p>This released version is intended for legitimate auditing purposes only and not super stealthy, sneaky red teaming assessments. This aside, we have verified in our lab that changing the method of execution from parallel to sequential means it does not perform multiple SMB requests at once, and then, in addition, adding a delay option would make the tool undetected. We have not added these options in the public release because it dramatically reduces execution speed.</p><h3 id="building">Building </h3><p>Double-clicking the SuperSharpShares.sln file should load all required to build the program.</p><p>Verify that the release has been selected on the top toolbar.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Compile_Release.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="934" height="307" srcset="https://labs.lares.com/content/images/size/w600/2024/01/Compile_Release.png 600w, https://labs.lares.com/content/images/2024/01/Compile_Release.png 934w" sizes="(min-width: 720px) 720px"><figcaption>Select Release</figcaption></figure><p>Under Solutions Explorer, right-click on the program and select Build.</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/01/CompileBuild-1.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="540" height="219"></figure><p>Under the Output bar, you should see the build location.</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/01/CompileBuild1.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="967" height="181" srcset="https://labs.lares.com/content/images/size/w600/2024/01/CompileBuild1.png 600w, https://labs.lares.com/content/images/2024/01/CompileBuild1.png 967w" sizes="(min-width: 720px) 720px"></figure><h3 id="good-practice">Good Practice</h3><p>Following verification that the initial build was successful, you may wish to rename the program as such.</p><ol><li>Right-click on the program name under Solutions Explorer and select Rename.</li></ol><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Compile1.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="535" height="793"><figcaption>Select Rename</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Compile_Rename2.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="292" height="208"><figcaption>Renaming the program</figcaption></figure><p>2. Right-click on the renamed program under Solutions Explorer right-click and select Properties.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Compile_Properties.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="534" height="927"><figcaption>Select Properties</figcaption></figure><p>3. Change the Assembly name and Default namespace in the Application tab.</p><figure class="kg-card kg-image-card"><img src="https://labs.lares.com/content/images/2024/01/Change_names.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="898" height="339" srcset="https://labs.lares.com/content/images/size/w600/2024/01/Change_names.png 600w, https://labs.lares.com/content/images/2024/01/Change_names.png 898w" sizes="(min-width: 720px) 720px"></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Change_names2.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="918" height="162" srcset="https://labs.lares.com/content/images/size/w600/2024/01/Change_names2.png 600w, https://labs.lares.com/content/images/2024/01/Change_names2.png 918w" sizes="(min-width: 720px) 720px"><figcaption>Assembly name and Default namespace changed</figcaption></figure><p>4. Back under Solutions Explorer, maximize Properties, and select <code>AssemblyInfo.cs</code>.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/AssemblyInfo.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="562" height="166"><figcaption>select AssemblyInfo.cs under Properties found on the Solutions Explorer</figcaption></figure><p>This should load the <code>AssemblyInfo.cs</code> parameters of which you may wish to edit the AssemblyTitle, AssemblyProduct, AssemblyCopyright, and the GUID (use <a href="https://guidgenerator.com/?ref=labs.lares.com">https://guidgenerator.com/</a>)</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Guid.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="1353" height="637" srcset="https://labs.lares.com/content/images/size/w600/2024/01/Guid.png 600w, https://labs.lares.com/content/images/size/w1000/2024/01/Guid.png 1000w, https://labs.lares.com/content/images/2024/01/Guid.png 1353w" sizes="(min-width: 720px) 720px"><figcaption>Suggested changes</figcaption></figure><p></p><p>5. After changing the above-suggested options then, rebuild the program.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Changes_build.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="544" height="219"><figcaption>Building</figcaption></figure><p>You should see that the name and its original descriptions have all been updated.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Clean_bulid_1.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="939" height="196" srcset="https://labs.lares.com/content/images/size/w600/2024/01/Clean_bulid_1.png 600w, https://labs.lares.com/content/images/2024/01/Clean_bulid_1.png 939w" sizes="(min-width: 720px) 720px"><figcaption>Clean build</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/Clean_bulid_2.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="640" height="504" srcset="https://labs.lares.com/content/images/size/w600/2024/01/Clean_bulid_2.png 600w, https://labs.lares.com/content/images/2024/01/Clean_bulid_2.png 640w"><figcaption>Clean build</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://labs.lares.com/content/images/2024/01/image.png" class="kg-image" alt="Introducing Super Sharp Shares" loading="lazy" width="667" height="544" srcset="https://labs.lares.com/content/images/size/w600/2024/01/image.png 600w, https://labs.lares.com/content/images/2024/01/image.png 667w"><figcaption>Verifying the renamed program still executes</figcaption></figure><h3 id="conclusion">Conclusion</h3><p>We have released SuperSharpShares to help IT engineers and security professionals enumerate shares accessible with associated domain accounts. The tool offers a swift and straightforward solution to help review internal network shares.</p><p>Insecure storage and oversharing of sensitive business data are widespread occurrences noted during security assessments; using tools such as SuperSharpShares allows internal and external professionals to identify the foundations of such dangers.</p><p>You can download and compile the tool from our git here: <a href="https://github.com/LaresLLC/SuperSharpShares?ref=labs.lares.com">https://github.com/LaresLLC/SuperSharpShares</a></p>]]></content:encoded></item><item><title><![CDATA[SE101: What's a Pretext?]]></title><description><![CDATA[Explaining pretexting in the context of SE101 and how to fit in with your pretext.]]></description><link>https://labs.lares.com/se101-whats-a-pretext/</link><guid isPermaLink="false">651e91a136fba703f8f1d7cd</guid><category><![CDATA[socialengineering]]></category><category><![CDATA[SE]]></category><category><![CDATA[Social Engineering 101]]></category><dc:creator><![CDATA[Chris Pritchard]]></dc:creator><pubDate>Mon, 06 Nov 2023 10:00:22 GMT</pubDate><media:content url="https://labs.lares.com/content/images/2023/10/hacker-gd5df194da_1920.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://labs.lares.com/content/images/2023/10/hacker-gd5df194da_1920.jpg" alt="SE101: What&apos;s a Pretext?"><p>Often when performing some kind of social engineering, you&apos;ll need a pretext.</p><p>Well, what is a pretext? The Cambridge Dictionary lists it as:</p><!--kg-card-begin: markdown--><blockquote>
<p>A pretended reason for doing something that is used to hide the real reason</p>
</blockquote>
<!--kg-card-end: markdown--><p>It&apos;s a fancy way of saying; it&apos;s your back story (or legend as they call it in the UK, undercover, police world). </p><p>The back story that you&apos;d use in justification if you were challenged or asked why you&apos;re in the server room (when you shouldn&apos;t be).</p><h2 id="fitting-your-pretext">Fitting Your Pretext</h2><p>If you&apos;re physically and socially engineering into a building or office, fit your pretext around your knowledge and skill set, i.e. Don&apos;t say you&apos;re a plumber if you&apos;ve never plumbed before. </p><p>There&apos;s a chance you&apos;ll be asked questions and/or terminology you probably do not know about.</p><p>But if, like me, you&apos;ve got an IT Support and IT Network background, these are ideal things to fit your pretext. </p><p>If you get challenged, or asked questions, not only do you know the terminology but, more importantly, the answers will come to you quickly and you&apos;ll answer confidently. </p><p>It&apos;s a subject you know; you won&apos;t be umming nor arrrr&apos;ing; you&apos;ll just answer without thinking about it. Doing that will give the person asking the question no concerns that you shouldn&apos;t be there. </p><p>There&apos;s much more to it than that. Don&apos;t just wing it; try to get in, and say you&apos;re from IT Support. </p><p>It would be best if you did some background research. Do they even have in-house IT Support? Is it outsourced? To whom? Can you use sites like LinkedIn to find the names of IT Support people? </p><h2 id="your-story">Your Story</h2><p>Also, you need a story! Why are you there? You can&apos;t just turn up and say, &quot;Hi, I&apos;m from IT Support&quot;, and expect to be let in (Although, in fairness, I have done this before and, yes, it worked, but it was an exceptional set of circumstances). </p><p>It would be best to have a reason to be there, doing what you want/need to do. Think of a story and an explanation and your knowledge and skill set.</p><p>You could be from IT Support and there to fix a slow internet issue. </p><p>What&apos;s great about this, assuming you have an IT Support background, is that it would be difficult to check whether a ticket has been raised, and it&apos;s very unlikely someone will check if you are from IT. </p><p>More importantly, EVERYONE wants their internet to run fast and smooth. </p><p>However, this is just an example. Fit it around your knowledge, your target, and the situation.</p><h2 id="just-because">Just Because</h2><p>If you&apos;ve read Robert Cialdini&apos;s book &quot;Influence&quot;, there&apos;s some excellent psychological research around just using the word &quot;because&quot;. </p><p>If you walk into a coffee shop and see a massive queue, people will be annoyed with you, if you loudly proclaim, &quot;I need a coffee urgently!&quot;. You&apos;re going to get booted to the back of the queue. </p><p>However, and there&apos;s research to prove this, if you say, &quot;I need to jump the queue <strong><em>because </em></strong>my car is double parked&quot;, you&apos;ve got a 94% chance that no one will mutter a word. </p><p>What&apos;s crazy, and again they&apos;ve proved this, you could say, &quot;Because the sky is blue&quot;, and it would STILL work!? The percentages are less, but still oddly high at 60%.</p><h2 id="match-your-outfit">Match Your Outfit</h2><p>Whatever you choose as your pretext, match your dress style and outfit to that pretext. There are caveats to this theory. </p><p>Let&apos;s work through some examples; </p><p>You&apos;re an IT Support engineer, and from the reconnaissance (Link to come), you&apos;ve seen that everyone in your target office dresses smartly.</p><p>If everyone is dressed in a suit, shirt, tie, nice trousers (pants my American friends), then you need to match that dress style and outfit because it&apos;s very likely that the IT Support team will wear the same as the rest as the general office staff. </p><p>Ok, that works, but let&apos;s say your pretext is you&apos;re an outsourced or third-party alarm engineer. Well, that&apos;s different. </p><p>It&apos;s likely that the &quot;company&quot; that you&apos;re pretending to work for has an entirely different dress style. </p><p>To generalise, there&apos;s a good chance it could be a polo neck with an embroidered logo, maybe cargo/work trousers (remember pants US friends). </p><p>You&apos;ll also need a toolbox, some tools, a clipboard with a worksheet, etc. You get the idea. </p><p>What I&apos;m saying is you want things to add up. An alarm engineer probably doesn&apos;t wear a suit, but maybe an officer worker doesn&apos;t wear a suit either, it might be dressed down. </p><p>Do the reconnaissance and find out. This blog is part of a SE101 series, and originally appeared here:</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://blog.ghostie.org/whats-a-pretext/?ref=labs.lares.com"><div class="kg-bookmark-content"><div class="kg-bookmark-title">What&#x2019;s a Pretext?</div><div class="kg-bookmark-description">Often when performing some kind of social engineering, you&#x2019;ll need a pretext. Well, what actually is a pretext? The Cambridge dictionary lists it as: A pretended reason for doing something that is used to hide the real reason It&#x2019;s a fancy way of saying; it&#x2019;s your back story (or legend</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://blog.ghostie.org/favicon.ico" alt="SE101: What&apos;s a Pretext?"><span class="kg-bookmark-author">Chris P&apos;s Blog</span><span class="kg-bookmark-publisher">Chris P</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://blog.ghostie.org/content/images/2023/02/hacker-gd5df194da_1920.jpg" alt="SE101: What&apos;s a Pretext?"></div></a></figure>]]></content:encoded></item></channel></rss>