<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>The Security Wind</title><link>https://blog.thesecuritywind.com/</link><description>Recent content on The Security Wind</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Mon, 14 Apr 2025 14:08:14 +0000</lastBuildDate><atom:link href="https://blog.thesecuritywind.com/index.xml" rel="self" type="application/rss+xml"/><item><title>1753CTF 2025</title><link>https://blog.thesecuritywind.com/post/1753ctf-2025/</link><pubDate>Mon, 14 Apr 2025 14:08:14 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/1753ctf-2025/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/1753ctf-2025/cover.jpg" alt="Featured image of post 1753CTF 2025" /&gt;&lt;p&gt;This time I couldn&amp;rsquo;t invest a lot of time, but I still solved some easy challenges.&lt;/p&gt;
&lt;p&gt;1753CTF 2025 was different from those I participated in the past, in a way that the interaction with the platform (submitting flags, registering, etc.) was handled through a Discord AI bot, and it was refreshing and fun.&lt;/p&gt;
&lt;p&gt;&lt;img alt="My interaction with the bot" class="gallery-image" data-flex-basis="617px" data-flex-grow="257" height="632" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_1.png" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_1_hu_f3837e7add8153b0.png 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_1_hu_7465230092a200f0.png 1600w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_1.png 1625w" width="1625"&gt;&lt;/p&gt;
&lt;h2 id="challenges"&gt;Challenges
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="#escatlate-flag-1---web" &gt;Escatlate (flag #1)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="#escatlate-flag-2---web" &gt;Escatlate (flag #2)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="#entropyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy---webcrypto" &gt;Entropyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first two challenges use the same source code.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="escatlate-flag-1---web"&gt;Escatlate (flag #1) - Web
&lt;/h2&gt;&lt;p&gt;The challenge provided a URL and the source code of &lt;code&gt;index.js&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="667px" data-flex-grow="278" height="920" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_2.png" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_2_hu_fb5a9eb489e537b3.png 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_2_hu_872627f715c32e34.png 1600w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_2_hu_10e173a77005102f.png 2400w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_2.png 2560w" width="2560"&gt;&lt;/p&gt;
&lt;p&gt;After I opened &lt;code&gt;index.js&lt;/code&gt;, I immediately searched for the keyword &lt;code&gt;flag&lt;/code&gt; to get an idea of what I should do.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1274px" data-flex-grow="530" height="281" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_3.png" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_3_hu_93f965c3a97d4032.png 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_3.png 1492w" width="1492"&gt;&lt;/p&gt;
&lt;p&gt;It looks like there are two separate flags for the two different challenges.&lt;/p&gt;
&lt;p&gt;If the user role is admin, the server will send the admin flag when accessing the &lt;code&gt;/api/message&lt;/code&gt; endpoint. If the user role is moderator, it will send the moderator flag.&lt;/p&gt;
&lt;p&gt;I searched for the keyword &lt;code&gt;moderator&lt;/code&gt; and there were no other places with this keyword.&lt;/p&gt;
&lt;p&gt;I continued reading the code, specifically the &lt;code&gt;/api/register&lt;/code&gt; endpoint.&lt;/p&gt;
&lt;p&gt;We can see that this function checks if the user already exists (line 85-86), validates that the &lt;code&gt;role&lt;/code&gt; parameter in the request body is not the admin role (88-89), and then creates the user.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="440px" data-flex-grow="183" height="598" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_4.jpg" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_4_hu_86859b7d1483984a.jpg 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_4.jpg 1097w" width="1097"&gt;&lt;/p&gt;
&lt;p&gt;So it might be simple - all we have to do is register with the &lt;code&gt;moderator&lt;/code&gt; role.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="432px" data-flex-grow="180" height="1027" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_5.jpg" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_5_hu_17068693855c86d0.jpg 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_5_hu_d3be0b7aca5bbec9.jpg 1600w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_5.jpg 1850w" width="1850"&gt;&lt;/p&gt;
&lt;p&gt;And we can access the flag.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="496px" data-flex-grow="206" height="892" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_6.jpg" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_6_hu_e398217f0518c036.jpg 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_6_hu_37a5533b9acdc309.jpg 1600w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_6.jpg 1845w" width="1845"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="escatlate-flag-2---web"&gt;Escatlate (flag #2) - Web
&lt;/h2&gt;&lt;p&gt;Let&amp;rsquo;s move on to retrieving the admin&amp;rsquo;s flag. We know that we need an &lt;code&gt;admin&lt;/code&gt; role, but the registration functionality checks if we register with the administrative role:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;admin&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As we previously saw, the flag will be exposed only if the output of &lt;code&gt;role.toUpperCase()&lt;/code&gt; would be &lt;code&gt;ADMIN&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toUpperCase&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;ADMIN&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`Hi Admin! Your flag is &lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ADMIN_FLAG&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It means that we need to find an input for the &lt;code&gt;role&lt;/code&gt; value which will behave like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;admin&amp;#39;&lt;/span&gt; &lt;span class="c1"&gt;//false
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toUpperCase&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;ADMIN&amp;#39;&lt;/span&gt; &lt;span class="c1"&gt;//true
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And the solution for this is to use a character that looks like &lt;code&gt;i&lt;/code&gt; instead of the &lt;code&gt;i&lt;/code&gt; in &lt;code&gt;admin&lt;/code&gt; (Unicode normalization), for example &lt;strong&gt;Latin Small Letter Dotless I&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="388px" data-flex-grow="161" height="1005" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_7.jpg" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_7_hu_2493a7cde775c542.jpg 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_7_hu_2c60896091858d40.jpg 1600w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_7.jpg 1628w" width="1628"&gt;&lt;/p&gt;
&lt;p&gt;We can see that it should work:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="635px" data-flex-grow="264" height="244" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_8.jpg" width="646"&gt;&lt;/p&gt;
&lt;p&gt;And here&amp;rsquo;s the PoC:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="446px" data-flex-grow="185" height="989" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_9.jpg" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_9_hu_b624bd1ca61dc8a7.jpg 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_9_hu_6f81efb22245328e.jpg 1600w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_9.jpg 1839w" width="1839"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="506px" data-flex-grow="211" height="870" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_10.jpg" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_10_hu_934015687dbb3519.jpg 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_10_hu_d5fd9089933b0b57.jpg 1600w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_10.jpg 1836w" width="1836"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="entropyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy---webcrypto"&gt;Entropyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy - Web/Crypto
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; It&amp;rsquo;s finally here. Something everyone&amp;rsquo;s been waiting for. A service that solves the biggest problem of humanity. People passwords. They are tooooooooooo short.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="313px" data-flex-grow="130" height="868" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_11.jpg" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_11_hu_3b7a7c5d14ed8728.jpg 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_11.jpg 1134w" width="1134"&gt;&lt;/p&gt;
&lt;p&gt;We got a PHP app. By looking at the code (specifically the long entropy and the use of Bcrypt), I knew the solution right away.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="443px" data-flex-grow="184" height="720" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_12.jpg" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_12_hu_4f54010f8d14f5ac.jpg 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_12.jpg 1331w" width="1331"&gt;&lt;/p&gt;
&lt;p&gt;We can see that the password is hashed using bcrypt and is generated by the combination of username, entropy and password.&lt;/p&gt;
&lt;p&gt;A few months ago, I read an article about a potential issue with bcrypt, which was discovered in Okta (but of course relevant to other applications too).&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="304px" data-flex-grow="126" height="1410" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_13.jpg" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_13_hu_8ede19ce324047ab.jpg 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_13_hu_93a11c1f828e1887.jpg 1600w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_13.jpg 1786w" width="1786"&gt;&lt;/p&gt;
&lt;p&gt;Bcrypt only uses the first 72 characters for the hash.&lt;/p&gt;
&lt;p&gt;As we said, the hash is derived from the username, entropy and password:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$hash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;password_hash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$usernameAdmin&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$entropy&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$passwordAdmin&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;PASSWORD_BCRYPT&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The username is &lt;code&gt;Admin&lt;/code&gt; which is 5 chars and the entropy length is 66 chars. Both of them are 71 chars long. The 72nd character is the first character of the password, which means it ignores all the rest of the password. So we only need to guess the first character of the password.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="388px" data-flex-grow="161" height="1126" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/1753ctf-2025/img_14.jpg" srcset="https://blog.thesecuritywind.com/post/1753ctf-2025/img_14_hu_210756a28bdde138.jpg 800w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_14_hu_c2fff1612de032db.jpg 1600w, https://blog.thesecuritywind.com/post/1753ctf-2025/img_14.jpg 1822w" width="1822"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel 🌏&lt;/p&gt;</description></item><item><title>Small Winds - No. 07</title><link>https://blog.thesecuritywind.com/post/small-winds-no-07/</link><pubDate>Mon, 07 Apr 2025 01:41:58 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/small-winds-no-07/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/small-winds-no-07/cover.jpg" alt="Featured image of post Small Winds - No. 07" /&gt;&lt;p&gt;&lt;em&gt;A personal mini blog about infosec and life&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s been a while since I posted. Here&amp;rsquo;s what I&amp;rsquo;ve been up to.&lt;/p&gt;
&lt;h2 id="thoughts-and-experiences"&gt;&lt;strong&gt;Thoughts and Experiences&lt;/strong&gt;
&lt;/h2&gt;&lt;p&gt;(🐞) My bug bounty plans have been changed. Inspired by &lt;a class="link" href="https://www.monke.ie/" target="_blank" rel="noopener"
 &gt;Ciarán&lt;/a&gt;, I made myself a challenge (60 hours challenge). I chose a target site and I&amp;rsquo;ll see how things progress. My expectations are not very high because the scope of the program is quite small, but let&amp;rsquo;s see how it goes! Oh, and actually this mini blog series is also inspired by his blog.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m already 5 hours in and mainly used it to set automations for this website. Specifically, monitoring changes in JS files. I&amp;rsquo;m not done with it and wonder if it&amp;rsquo;s worth my time, since the JS files are very obfuscated, large (1-2 MB), and the obfuscation changes about every day. One thing I could do, is to monitor for changes, prettify the files, check for new or removed lines (while ignoring lines that were modified, as it modifies the obfuscated variable names - I take into account the possibility of missing stuff), and keep only the new lines.&lt;/p&gt;
&lt;p&gt;This program isn&amp;rsquo;t new to me and there are things I&amp;rsquo;ve already done. So here are the recent highlights including other stuff.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;(🗒️🗒️🗒️) Organized and gathered my notes and leads. I exported the relevant things from Burp Suite to Caido.&lt;/li&gt;
&lt;li&gt;(🪲) I found a bug in my target site that exposes PII, but it was a duplicate.&lt;/li&gt;
&lt;li&gt;(🔍) I started using Caido. Although it lacks some of the features Burp Suite provides, it has other nice features, like workflows, findings, files and other interesting sections. They make it better frequently. I also really like the UI and the fact that it works very fast. I&amp;rsquo;m really afraid it would be emotionally hard for me to get back to Burp Suite if I have to.&lt;/li&gt;
&lt;li&gt;(🪲) I tested a certain feature in a website I use, for personal reasons and it led to a bug. I reported it and it was considered informative. This will probably be my next target site for my next challenge, after I finish this one.&lt;/li&gt;
&lt;li&gt;(👩🏻‍💻👩🏾‍💻👨‍💻👨🏻‍💻👨🏾‍💻) Critical Thinking had another hackalong event which was fun and beneficial. I continued testing this target with the leads I gathered during the event.&lt;/li&gt;
&lt;li&gt;(👩🏻‍💻👩🏾‍💻👨‍💻👨🏻‍💻👨🏾‍💻) Critical Thinking also had a bug escalation event where people shared some unbaked bugs and we tried to exploit them together. It was funny and informative.&lt;/li&gt;
&lt;li&gt;(📱) There&amp;rsquo;s a certain mobile app I use on a daily basis, and it motivated me to do some Android mobile hacking, so in my spare time I focus on this. I think this is one of the reasons I commonly encounter the advice of doing bug bounty of apps you already use, or apps that interest you. Personally, I have more motivation there.&lt;/li&gt;
&lt;li&gt;(📝🎫) A while ago, I spent a lot of time in doing threat modeling on the application I test, organizing everything and reading the documentation. Although it took a lot of time, it was beneficial and important. It made me understand the application much better and the testing much more efficient. Specifically, reading the documentation resulted in the discovery of new attack surfaces and ideas and also valid coupon/invitation codes, email addresses and usernames I can use for testing. It was kind of funny that they accidentally exposed an invitation link in a video when hovering over a link.&lt;/li&gt;
&lt;li&gt;(⚙️) I used &lt;a class="link" href="https://github.com/lc/gau" target="_blank" rel="noopener"
 &gt;gau&lt;/a&gt; for the target site, and it revealed a lot of useful URLs - some of them contain credentials and even valid coupons or invitation links. This is a very powerful tool.&lt;/li&gt;
&lt;li&gt;(🐞) Found a bug in BMW that got accepted: &lt;a class="link" href="https://app.intigriti.com/profile/orelg" target="_blank" rel="noopener"
 &gt;https://app.intigriti.com/profile/orelg&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="interesting-resources"&gt;&lt;strong&gt;Interesting Resources:&lt;/strong&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://regexper.com/" target="_blank" rel="noopener"
 &gt;https://regexper.com/&lt;/a&gt; - website that shows regex using a diagram.&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://portswigger.net/research/top-10-web-hacking-techniques-of-2024-nominations-open" target="_blank" rel="noopener"
 &gt;https://portswigger.net/research/top-10-web-hacking-techniques-of-2024-nominations-open&lt;/a&gt; - all the 2024 nominations for the top 10 web hacking techniques.&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://medium.com/@illoyscizceneghposter/exposed-credentials-guide-not-just-in-client-javascripts-101-case-studies-131b765e07a2" target="_blank" rel="noopener"
 &gt;https://medium.com/@illoyscizceneghposter/exposed-credentials-guide-not-just-in-client-javascripts-101-case-studies-131b765e07a2&lt;/a&gt; - niche areas for exposed credentials.&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://medium.com/@maxpasqua/type-confusion-dos-in-fb4a-747837d3a8e3" target="_blank" rel="noopener"
 &gt;https://medium.com/@maxpasqua/type-confusion-dos-in-fb4a-747837d3a8e3&lt;/a&gt; - Type Confusion in Facebook.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Small Winds - No. 06</title><link>https://blog.thesecuritywind.com/post/small-winds-no-06/</link><pubDate>Fri, 20 Dec 2024 17:45:17 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/small-winds-no-06/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/small-winds-no-06/cover.jpg" alt="Featured image of post Small Winds - No. 06" /&gt;&lt;p&gt;&lt;em&gt;A personal mini blog about infosec and life&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;One day, about two weeks ago, my partner was talking to me, and I felt the urge to pay closer attention as he spoke. I focused on his body language, facial expressions, and other nonverbal cues, knowing that by doing so, I could better understand his feelings, what he really tried to tell me, and connect with him on a deeper level. I&amp;rsquo;m not sure what made me do this, but I believe that many times people speak to me (and I&amp;rsquo;m sure I&amp;rsquo;m not the only one), and although I&amp;rsquo;m usually attentive to their words and emotions, placing even more focus on the person I&amp;rsquo;m communicating with can yield much more from the conversation. A while ago I started reading a certain book (maybe I&amp;rsquo;ll review it once I&amp;rsquo;ve finished reading it) that touches on this topic in one way or another. Years ago, I got familiar with the concept of &lt;a class="link" href="https://en.wikipedia.org/wiki/Active_listening" target="_blank" rel="noopener"
 &gt;active listening&lt;/a&gt;, so this subject wasn&amp;rsquo;t new to me. Still, I want to be more conscious of it as it truly enrich relationships, and I really encourage others to get familiar with it as it can enrich yours as well.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A heartwarming picture I took of two companion or mate parrots - they’re always together!" class="gallery-image" data-flex-basis="426px" data-flex-grow="177" height="1080" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-06/img_1.jpg" srcset="https://blog.thesecuritywind.com/post/small-winds-no-06/img_1_hu_a98fa358465b8f10.jpg 800w, https://blog.thesecuritywind.com/post/small-winds-no-06/img_1_hu_d8f091f8503b4a95.jpg 1600w, https://blog.thesecuritywind.com/post/small-winds-no-06/img_1.jpg 1920w" width="1920"&gt;&lt;/p&gt;
&lt;h2 id="recent-thoughts-and-experiences"&gt;&lt;strong&gt;Recent Thoughts and Experiences&lt;/strong&gt;
&lt;/h2&gt;&lt;p&gt;(🤩) My last &lt;a class="link" href="https://www.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web" target="_blank" rel="noopener"
 &gt;CTF writeup&lt;/a&gt; was shared in two different blogs, wow! That really surprised me.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://baozongwi.xyz/2024/12/04/WorldWideCTF2024/" target="_blank" rel="noopener"
 &gt;https://baozongwi.xyz/2024/12/04/WorldWideCTF2024/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://blog.regularofvanilla.com/posts/wwctf#World%20Wide%20Email" target="_blank" rel="noopener"
 &gt;https://blog.regularofvanilla.com/posts/wwctf#World%20Wide%20Email&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I also won the &amp;lsquo;Most Detailed Writeup&amp;rsquo; competition for the World Wide CTF! It was for &lt;a class="link" href="https://www.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web" target="_blank" rel="noopener"
 &gt;this&lt;/a&gt; writeup. I didn&amp;rsquo;t even know about this competition when I wrote it.&lt;/p&gt;
&lt;p&gt;&lt;img alt="The announcement of my winning" class="gallery-image" data-flex-basis="769px" data-flex-grow="320" height="754" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-06/img_2.png" srcset="https://blog.thesecuritywind.com/post/small-winds-no-06/img_2_hu_6b92638b2bd386ea.png 800w, https://blog.thesecuritywind.com/post/small-winds-no-06/img_2_hu_63b3e72c32a07f94.png 1600w, https://blog.thesecuritywind.com/post/small-winds-no-06/img_2_hu_826296e8ccaaad38.png 2400w, https://blog.thesecuritywind.com/post/small-winds-no-06/img_2.png 2418w" width="2418"&gt;&lt;/p&gt;
&lt;p&gt;(🔬) Someone (I believe it was &lt;a class="link" href="https://bsky.app/profile/jameskettle.com" target="_blank" rel="noopener"
 &gt;James Kettle&lt;/a&gt;) mentioned in the past something about how a person could start research. More specifically, he mentioned an article that I want to find. He talked about people sometimes asking which subject they should research and whether their research ideas are good enough. I remember him saying that if you have an idea for research, just go for it, there are no bad ideas for research (I hope I&amp;rsquo;m not misquoting him 😬). Either way, I believe in that approach, and I&amp;rsquo;ve been waiting for interesting ideas for things I&amp;rsquo;d like to research. Recently, in one of my tests, I encountered two strange behaviors related to servers or reverse proxies. One of them involves a discrepancy related to encoding, and the other is related to a certain malformed HTTP request structure and the behavior of servers and reverse proxies to that.&lt;/p&gt;
&lt;p&gt;(🚩) Last weekend I participated in a certain CTF and tried a certain challenge that taught me a few things but in overall it was a guessy challenge. A guessy challenge refers to one that lacks clear direction, includes red herrings, and requires guessing unrelated to logical reasoning.&lt;/p&gt;
&lt;p&gt;Generally, I believe these kinds of challenges are considered less favorable because they waste the solvers&amp;rsquo; time on parts that might be irrelevant to their solving attempts.&lt;/p&gt;
&lt;p&gt;For example, you can see the following comments from people about such challenges:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Low ratings for different CTFs because “guessy” challenges" class="gallery-image" data-flex-basis="801px" data-flex-grow="334" height="444" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-06/img_3.png" srcset="https://blog.thesecuritywind.com/post/small-winds-no-06/img_3_hu_5ee6010da3ad2e51.png 800w, https://blog.thesecuritywind.com/post/small-winds-no-06/img_3.png 1483w" width="1483"&gt;&lt;/p&gt;
&lt;p&gt;Here are a few points that can be problematic in challenges:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Participants have to guess things unrelated to logic (for example, a username, or even worse - one that isn&amp;rsquo;t found in common wordlists).&lt;/li&gt;
&lt;li&gt;No source code is provided, the web application has many functionalities, and nothing appears suspicious or everything returns 500 errors.&lt;/li&gt;
&lt;li&gt;A challenge that provides source code, which is not the real source code, with parts of it removed.&lt;/li&gt;
&lt;li&gt;Suspicious behaviors or even vulnerabilities in the web application that are unrelated to the solution.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are more aspects that can decrease the quality of a challenge, such as copied challenges from other CTFs, wrong flags, etc., but this section is about something else.&lt;/p&gt;
&lt;p&gt;(🔎🐛) I haven&amp;rsquo;t invested enough time in bug bounty lately because of the many tasks I have, and since I sometimes feel very tired after work, I&amp;rsquo;ll try to lower my weekly goals to 5 hours a week and see how it goes from there. I&amp;rsquo;ll update each time on how my goal progresses, and I&amp;rsquo;ll start with one month.&lt;/p&gt;
&lt;p&gt;I haven&amp;rsquo;t mentioned it, but my main goal in bug bounty is to get better at application security. Sometimes, I encounter the belief that after a certain amount of time—let&amp;rsquo;s say one to three years—there&amp;rsquo;s a feeling that a person has reached a level beyond which there isn&amp;rsquo;t much more to learn. However, when I encounter bugs, ideas, exploitation methods, a deep understanding of certain technologies, programming skills, and more, I see how much more room there is for improvement and learning.&lt;/p&gt;
&lt;p&gt;My second goal is to hopefully earn money from this.&lt;/p&gt;
&lt;p&gt;(🚩) This year, I&amp;rsquo;ve reached the goal I set for myself two and a half years ago regarding CTFs. I find CTFs to be another way for improvement. If previously I focused on getting the highest score, currently I invest a certain amount of hours each weekend on a specific challenge or challenges, and focus on learning and research. This means that I still try to solve the challenge, but I delve deeper into things like documentation, deeply understanding the source code, researching topics, and trying to comprehend and learn, even if it comes at the cost of not solving the challenge in time. Actually, a lot of times the opposite is true - focusing and investing time on understanding the system and researching helps with solving the challenge.&lt;/p&gt;
&lt;p&gt;(🤖) &lt;a class="link" href="https://xbow.com/" target="_blank" rel="noopener"
 &gt;XBOW&lt;/a&gt; - In the past months, there have been talks about XBOW, which is supposed to be an AI-based tool that helps with penetration testing and bug bounty. The company claims that the tool&amp;rsquo;s capabilities are very powerful, for example, you can see some of them &lt;a class="link" href="https://bsky.app/profile/xbow.com/post/3ldjakpubo22z" target="_blank" rel="noopener"
 &gt;here&lt;/a&gt;. Since September, they&amp;rsquo;ve reached the #11 place in the USA on HackerOne and found 20 critical bugs. Although some of the programs may have been VDPs, it still raises questions such as: How will this tool or other ones in the future affect bug bounty hunters and programs? How will it affect penetration testers&amp;rsquo; job positions? Is it really as good as they claim? Which bug types can it find?&lt;/p&gt;
&lt;p&gt;People say various things, and I agree with some of them. If it&amp;rsquo;s as good as they claim, it may be beneficial to the security research field as it will give penetration testers and bug bounty hunters more time for research instead of investing time in finding basic vulnerabilities.&lt;/p&gt;
&lt;p&gt;It may also drive people to get even better and search for even more complex bugs.&lt;/p&gt;
&lt;p&gt;Time will tell.&lt;/p&gt;
&lt;p&gt;(📄) As time passes, my belief that Mirantis will help me with the voucher problem for the DCA exam disappears. I believe I&amp;rsquo;ve studied enough to pass it, but I&amp;rsquo;m not planning on paying another ~$200 for a voucher :)&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll try contacting them a few more times, but maybe I&amp;rsquo;ll leave it in the near future. I&amp;rsquo;ve gained the knowledge and experience I wanted.&lt;/p&gt;
&lt;p&gt;Now I&amp;rsquo;m thinking about my next certification, and it will probably be one of the AWS ones as I want to study cloud security.&lt;/p&gt;
&lt;p&gt;Regarding my studies for the DCA exam, in the last few months I&amp;rsquo;ve noticed how my control and understanding of Docker have increased. I&amp;rsquo;ve used Docker for creating images that helped me with tasks at work and when docker files were provided in CTFs. Now I&amp;rsquo;ve also started using it for personal labs and mini-projects or poc&amp;rsquo;s I need.&lt;/p&gt;
&lt;p&gt;(🐛🐛🐛) This week I participated in an online Hack-Along event for a certain bug bounty program. I partially participated but my main goal is to also see how others hack, while &lt;a class="link" href="https://bsky.app/profile/rhynorater.bsky.social" target="_blank" rel="noopener"
 &gt;Rhynorater&lt;/a&gt; was streaming. Although there were some similarities of things I do, I learned a few things and got some new ideas. I need to strengthen my client-side hacking and I might give Caido a try in the future. Two people even found vulnerabilities, one of them found a few critical ones.&lt;/p&gt;
&lt;h2 id="interesting-resources"&gt;&lt;strong&gt;Interesting Resources&lt;/strong&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://github.com/assetnote/nowafpls" target="_blank" rel="noopener"
 &gt;https://github.com/assetnote/nowafpls&lt;/a&gt; - Documented WAF limitations that can help with bypassing WAFs.&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://blittle.github.io/chrome-dev-tools/" target="_blank" rel="noopener"
 &gt;https://blittle.github.io/chrome-dev-tools/&lt;/a&gt; - Dev Tools tips. I haven&amp;rsquo;t tried it yet, but checked it out and I totally plan to.&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://xsinator.com/testing.html#" target="_blank" rel="noopener"
 &gt;https://xsinator.com/testing.html#&lt;/a&gt; - XS leak tests for browsers.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Small Winds - No. 05</title><link>https://blog.thesecuritywind.com/post/small-winds-no-05/</link><pubDate>Mon, 02 Dec 2024 21:28:42 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/small-winds-no-05/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/small-winds-no-05/cover.jpg" alt="Featured image of post Small Winds - No. 05" /&gt;&lt;p&gt;&lt;em&gt;A personal mini blog about infosec and life&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Recently, I took the chance to better get to know the city I live in and went for a long walk (also for exercise). I got familiar with other parts of the city I hadn&amp;rsquo;t known. I realized there was a large area with many stores but almost no people or cars. It felt like an abandoned city, especially because it was maintained and clean. It was very strange to experience that, it was almost like a dream. Also, in another area there was a disproportionately huge residential building (its proportions could hardly be grasped from this image). It actually reminded me of the buildings and atmosphere from &lt;a class="link" href="https://www.google.com/search?sca_esv=54bc90cb432fd13f&amp;amp;rlz=1C1GCEU_enIL1097IL1097&amp;amp;sxsrf=ADLYWIK9v162KV9utlzQvfTUekEge3u72Q:1732389559149&amp;amp;q=little&amp;#43;nightmares&amp;#43;ii&amp;#43;building&amp;amp;udm=2&amp;amp;fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J603JUkR9Y5suk8yuy50qOYMMWTNCTu57lKPsZpPcfqPxsr7W9ht6aSHdZDeYOHGXjlTr9vFv2xeJBxGwfKNFiSA3iT6TUbct8mo3-5FBJ76Dm3mQELK6Fak3hzmoE5NrrkKPDbJhkK_veZD8Wy9JYeu7llN&amp;amp;sa=X&amp;amp;ved=2ahUKEwiw-aOClvOJAxVggP0HHS2SFhAQtKgLegQIFhAB&amp;amp;biw=1396&amp;amp;bih=750&amp;amp;dpr=2.75#vhid=1gfldXW8DXhKtM&amp;amp;vssid=mosaic" target="_blank" rel="noopener"
 &gt;Little Nightmares II&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="288px" data-flex-grow="120" height="2250" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-05/img_1.jpg" srcset="https://blog.thesecuritywind.com/post/small-winds-no-05/img_1_hu_ffbaed7d9c559016.jpg 800w, https://blog.thesecuritywind.com/post/small-winds-no-05/img_1_hu_f6006bf645572a89.jpg 1600w, https://blog.thesecuritywind.com/post/small-winds-no-05/img_1_hu_c601318f90d32e87.jpg 2400w, https://blog.thesecuritywind.com/post/small-winds-no-05/img_1.jpg 2708w" width="2708"&gt;&lt;/p&gt;
&lt;h2 id="monthly-thoughts-and-experiences"&gt;&lt;strong&gt;Monthly Thoughts and Experiences&lt;/strong&gt;
&lt;/h2&gt;&lt;p&gt;(📗) I finished reading the book &amp;ldquo;&lt;a class="link" href="https://www.amazon.com/Real-World-Bug-Hunting-Field-Hacking/dp/1593278616" target="_blank" rel="noopener"
 &gt;Real-World Bug Hunting: A Field Guide to Web Hacking&lt;/a&gt;&amp;rdquo;. It was published in 2019. The book is structured so that in the beginning there is a brief explanation of web concepts and the HTTP protocol. Later it goes through different vulnerability types. There&amp;rsquo;s an explanation for each type, and then the author shows different bug reports and explains each of them from the easiest to the most difficult while providing takeaways for each one (I really liked the takeaways).&lt;/p&gt;
&lt;p&gt;It also provides some tips related to bug bounty in general.&lt;/p&gt;
&lt;p&gt;I was already familiar with a great part of the book but I learned some good tips and new techniques I wasn&amp;rsquo;t familiar with. It was also nice to refresh my knowledge. Throughout the book I took notes (created some kind of checklist) of interesting techniques I want to check in the future.&lt;/p&gt;
&lt;p&gt;The book was written very clear and was structured in a thoughtful and smart way. I would suggest it to beginners and also to intermediate-advanced level bug hunters, researchers and penetration testers who want to refresh their knowledge and maybe learn some new things. I&amp;rsquo;d give it ⭐⭐⭐⭐⭐ (out of five).&lt;/p&gt;
&lt;p&gt;(🐛) I still haven&amp;rsquo;t heard from the vendor who has a high/critical vulnerability in their software. I also haven&amp;rsquo;t yet received a CVE number or reply from MITRE and I&amp;rsquo;m not sure if there is a technical issue that causes that. I&amp;rsquo;ll try getting help from CERT, and hopefully it will bear fruit.&lt;/p&gt;
&lt;p&gt;I found a company that has a bug bounty program that is vulnerable to this, so meanwhile I reported this issue to them.&lt;/p&gt;
&lt;p&gt;I was also added to the Israeli VDP reporters table for reporting an LFD vulnerability I previously mentioned.&lt;/p&gt;
&lt;p&gt;(🔎🐛) Although I tried in the past, I have started investing time in doing bug bounty. Currently, I aim to invest about 7-8 hours per week (although it doesn&amp;rsquo;t feel enough, especially when there are open leads and everyone can report potential bugs instead of you). I already found some things that look like potential bugs.&lt;/p&gt;
&lt;p&gt;I also joined the &amp;lsquo;Critical Thinking&amp;rsquo; Discord server (actually, I joined it long ago but just started to be more active). It&amp;rsquo;s the Discord server of the &lt;a class="link" href="https://www.criticalthinkingpodcast.io/" target="_blank" rel="noopener"
 &gt;&amp;lsquo;Critical Thinking&amp;rsquo; podcast&lt;/a&gt;. There are interesting discussions about web app vulnerabilities and bug hunting.&lt;/p&gt;
&lt;p&gt;(🦫) I learned a bit about Go when trying to solve a CTF challenge. I focused on learning while solving this challenge, so I invested time in understanding different things I encountered in the web application source code and in things related to the Go templating engine. I also noticed again that by writing a writeup, because I have to explain my solution, some questions arise that I don&amp;rsquo;t have answers to right away so I have to learn and understand more, which makes me study it more deeply.&lt;/p&gt;
&lt;p&gt;(🏟) I went to the &lt;a class="link" href="https://intentsummit.org/" target="_blank" rel="noopener"
 &gt;INTENT conference&lt;/a&gt;, mainly for participating in the CTF (although I could probably do that remotely). There were two web challenges. I tried one that was written in Ruby. I haven&amp;rsquo;t solved it, but the challenge was about accessing an administrative page only accessible using a session that includes the admin&amp;rsquo;s email address. I believed that the vulnerability was the discrepancy between the login process and the registration process which used the Mail gem. I wanted to find a way that I could register with one email address and when I log in, it would be parsed as another email address. Since it was the last minutes of the CTF, I didn&amp;rsquo;t find a way to do that. However, a few days ago I read this article &lt;a class="link" href="https://portswigger.net/research/splitting-the-email-atom" target="_blank" rel="noopener"
 &gt;https://portswigger.net/research/splitting-the-email-atom&lt;/a&gt; and I knew it had something to do with it, but when I read this part, I was even more confident about it.&lt;/p&gt;
&lt;p&gt;Maybe I&amp;rsquo;ll later run the challenge in Docker and write a writeup about it. Either way it was worth it since I made some new friends after going to the conference.&lt;/p&gt;
&lt;p&gt;(🐋) I wanted to take the DCA exam but because of an issue on the website of the company that manages the exams, the voucher I purchased was canceled. I tried to contact Examity and Mirantis but it seems that both companies don&amp;rsquo;t want to help with this issue. I&amp;rsquo;ll try contacting Mirantis a few more times, and hopefully I&amp;rsquo;ll receive an answer.&lt;/p&gt;
&lt;p&gt;(🎄) The annual THM &lt;a class="link" href="https://tryhackme.com/r/room/adventofcyber2024" target="_blank" rel="noopener"
 &gt;Advent of Cyber 2024&lt;/a&gt; has started and I&amp;rsquo;ll give it a shot, it has nice prizes.&lt;/p&gt;
&lt;h2 id="cool-articles"&gt;&lt;strong&gt;Cool Articles&lt;/strong&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://0xdf.gitlab.io/cheatsheets/404" target="_blank" rel="noopener"
 &gt;Identify technology by 404 page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://nastystereo.com/security/cross-site-post-without-content-type.html" target="_blank" rel="noopener"
 &gt;Cross-Site POST Requests Without a Content-Type Header&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://dreyand.rs/code/review/2024/10/27/what-are-my-options-cyberpanel-v236-pre-auth-rce" target="_blank" rel="noopener"
 &gt;Bypassing restrictions using OPTIONS methods allows RCE&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>World Wide CTF 2024 - World Wide Email Search (Web)</title><link>https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/</link><pubDate>Sun, 01 Dec 2024 12:15:51 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/cover.jpg" alt="Featured image of post World Wide CTF 2024 - World Wide Email Search (Web)" /&gt;&lt;p&gt;I think this was the first time I was part of one of the first teams to solve a hard challenge in a big CTF. We were the third team to solve it (it ended with 7 solves out of ~580 teams). &lt;a class="link" href="https://www.linkedin.com/in/sagiv-michael-838406249/" target="_blank" rel="noopener"
 &gt;Sagiv&lt;/a&gt; and I worked together on this challenge and it was enriching and fun, especially because I tried a lot of different things along the way and learned new things.&lt;/p&gt;
&lt;p&gt;The solution to this challenge might seem a bit straightforward or easy but I think what made it a hard challenge were the subtle hints and limited suspicious behaviors, which affected the leads.&lt;/p&gt;
&lt;p&gt;So instead of writing a concise writeup, I&amp;rsquo;ll explain how we got there.&lt;/p&gt;
&lt;p&gt;If you want a TL;DR, click here =&amp;gt; teleport me&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="218px" data-flex-grow="91" height="1236" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_1.jpg" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_1_hu_b40b5c86204bbe95.jpg 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_1.jpg 1126w" width="1126"&gt;&lt;/p&gt;
&lt;p&gt;After entering the URL we see that we can enter an email address and could probably retrieve the results for that email address.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="467px" data-flex-grow="194" height="1164" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_2.png" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_2_hu_fab920335e41eb08.png 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_2_hu_bca3d81d4dea31f3.png 1600w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_2.png 2267w" width="2267"&gt;&lt;/p&gt;
&lt;p&gt;I wanted to understand what technology is in use, but didn&amp;rsquo;t see any indications of that, so I used the 404 error message to understand what the technology might be.&lt;/p&gt;
&lt;p&gt;According to this useful &lt;a class="link" href="https://0xdf.gitlab.io/cheatsheets/404" target="_blank" rel="noopener"
 &gt;article&lt;/a&gt;, the web app is probably written in Python, using Flask.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="698px" data-flex-grow="290" height="806" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_3.png" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_3_hu_6d75b4ccbc2e225b.png 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_3_hu_32c2a3f824f07595.png 1600w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_3.png 2345w" width="2345"&gt;&lt;/p&gt;
&lt;p&gt;Back to the main functionality. Searching for a certain email address results in these messages.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="465px" data-flex-grow="194" height="1238" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_4.png" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_4_hu_8feaeb44737ef265.png 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_4_hu_11c2f542cbb174f3.png 1600w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_4_hu_1cdcd5bba5122f3a.png 2400w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_4.png 2402w" width="2402"&gt;&lt;/p&gt;
&lt;p&gt;Two different messages - interesting. Maybe it indicates something?&lt;/p&gt;
&lt;p&gt;An invalid email format results in this error and it doesn&amp;rsquo;t reflect the input. Also, interesting - why wouldn&amp;rsquo;t it reflect the input?&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="489px" data-flex-grow="203" height="1152" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_5.png" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_5_hu_6e2fbb333ec2b725.png 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_5_hu_ea8871b80eded520.png 1600w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_5.png 2349w" width="2349"&gt;&lt;/p&gt;
&lt;p&gt;We tried to understand the web application&amp;rsquo;s behavior, fuzzed a little bit, and tried different injections, which didn&amp;rsquo;t work.&lt;/p&gt;
&lt;p&gt;The web application removed the following characters from the input:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;'&lt;/li&gt;
&lt;li&gt;&amp;quot;&lt;/li&gt;
&lt;li&gt;\&lt;/li&gt;
&lt;li&gt;some whitespace characters&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At this point we had a few ideas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SSTI using the reflection of the email address. Although it reflected inputs like {{7*&lt;a class="link" href="mailto:7%7d%7d@gmail.com" &gt;7}}@gmail.com&lt;/a&gt; without evaluating them, we wondered if we needed to enter an input that would be both a valid template and a valid email format from start to end.&lt;/li&gt;
&lt;li&gt;We wondered if we should find the correct email address to retrieve the flag. If so, maybe NoSQL injection or blind SQL injection could help with that.&lt;/li&gt;
&lt;li&gt;Some of the email addresses were reflected in the server&amp;rsquo;s response while others were decoded:&lt;/li&gt;
&lt;li&gt;Maybe there&amp;rsquo;s a system command on the backend that is used and we can exploit it to perform command injection?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Right before continuing, one of the first things that came to my mind was a research &lt;a class="link" href="https://portswigger.net/research/splitting-the-email-atom" target="_blank" rel="noopener"
 &gt;article&lt;/a&gt; by Gareth that I had wanted to read for some time now, and I thought it might be related (I** highly** recommend reading it). Most of it talks about how various valid unpopular email formats can be valid email addresses, while they might cause security issues.&lt;/p&gt;
&lt;p&gt;We thought about whether we could enter an input that would be considered a valid email format but would later be parsed as something different which could help us with our leads. Unfortunately nothing worked. HOWEVER, one of the things that Gareth mentioned was Unicode overflows.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="311px" data-flex-grow="129" height="1927" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_6.png" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_6_hu_47c6fc697632344b.png 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_6_hu_a77e277d0361fff3.png 1600w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_6_hu_98f3313b6870b83c.png 2400w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_6.png 2504w" width="2504"&gt;&lt;/p&gt;
&lt;p&gt;I tried that and it didn&amp;rsquo;t work. I&amp;rsquo;m not sure if it&amp;rsquo;s because it works differently in Python or because of another reason. But I tried to copy the weird &amp;rsquo;l&amp;rsquo; characters (I tried the other ones as well) and it turned it to a normal &amp;rsquo;l'.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="430px" data-flex-grow="179" height="1308" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_7.png" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_7_hu_afacc46276168bdc.png 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_7_hu_1e65f78585675a7a.png 1600w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_7.png 2344w" width="2344"&gt;&lt;/p&gt;
&lt;p&gt;I know this Python&amp;rsquo;s behavior. It&amp;rsquo;s Unicode normalization. Sometimes it can be used to bypass blacklists when trying to bypass sandboxes or maybe with when trying to exploit SSTI too.&lt;/p&gt;
&lt;p&gt;We tried a few things and then we&amp;rsquo;ve thought - &amp;ldquo;wait, if we can turn characters to other ones like к to k, can we do that for other characters? For example for a single quote?&lt;/p&gt;
&lt;p&gt;We got some ideas from perplexity:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1205px" data-flex-grow="502" height="324" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_8.jpg" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_8_hu_adf94caa19f7965a.jpg 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_8_hu_a143ddd08d6afde9.jpg 1600w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_8.jpg 1628w" width="1628"&gt;&lt;/p&gt;
&lt;p&gt;Note that the first character is not a backtick which didn&amp;rsquo;t work for this challenge.&lt;/p&gt;
&lt;p&gt;Eventually, we had a lead! The left single quotation mark was reflected as a single quote in the first message and resulted in a syntax error in the second message.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="434px" data-flex-grow="181" height="1276" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_9.png" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_9_hu_c0032fa9a62baae1.png 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_9_hu_4c7da98d75be3ba3.png 1600w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_9.png 2311w" width="2311"&gt;&lt;/p&gt;
&lt;p&gt;Perplexity, do your magic.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="990px" data-flex-grow="412" height="433" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_10.png" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_10_hu_a12aca4a8f7e2e89.png 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_10_hu_9a91dda3cd66f9a2.png 1600w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_10.png 1787w" width="1787"&gt;&lt;/p&gt;
&lt;p&gt;So it&amp;rsquo;s SQLite. From here, the solution might be pretty straightforward.&lt;/p&gt;
&lt;p&gt;Just to make sure.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="433px" data-flex-grow="180" height="1267" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_11.png" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_11_hu_f8148ac8dd0ea918.png 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_11_hu_4401d8f6be69bd51.png 1600w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_11.png 2291w" width="2291"&gt;&lt;/p&gt;
&lt;p&gt;Table structure (we replaced spaces with /**/).&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="668px" data-flex-grow="278" height="661" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_12.png" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_12_hu_b4f85fef64ab6efb.png 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_12_hu_cf252992e1955a2e.png 1600w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_12.png 1841w" width="1841"&gt;&lt;/p&gt;
&lt;p&gt;And here&amp;rsquo;s the flag.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="707px" data-flex-grow="294" height="627" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_13.jpg" srcset="https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_13_hu_c3feb7d28b52d6e.jpg 800w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_13_hu_db4b6eb52a7ceaf.jpg 1600w, https://blog.thesecuritywind.com/post/world-wide-ctf-2024-world-wide-email-search-web/img_13.jpg 1849w" width="1849"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;TL;DR:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The user enters an email address.&lt;/li&gt;
&lt;li&gt;The web application only supposedly allows a valid email format, and removes single quotes, double quotes and whitespaces from the input.&lt;/li&gt;
&lt;li&gt;Python has Unicode normalization, so it turns the left single quotation mark into a single quote.&lt;/li&gt;
&lt;li&gt;Using that, it&amp;rsquo;s possible to use this and /**/ as a substitute for whitespace to craft an SQL injection payload to retrieve the flag. You can find the payload above.&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;p&gt;Feel free to message me if you think there are any inaccuracies in the article.&lt;/p&gt;
&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel 📧&lt;/p&gt;</description></item><item><title>4T$ CTF 2024 - My Sky Blog</title><link>https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/</link><pubDate>Sun, 10 Nov 2024 18:00:44 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/cover.jpg" alt="Featured image of post 4T$ CTF 2024 - My Sky Blog" /&gt;&lt;p&gt;This CTF challenge was mainly about SSTI in Go. There were various functionalities, and I&amp;rsquo;m not sure if all of them were necessary, so I&amp;rsquo;ll focus only on the ones relevant to this solution. Although there weren&amp;rsquo;t many solves, this challenge wasn&amp;rsquo;t hard and I liked it because it helped me learn more about Go and how SSTI works in Go.&lt;/p&gt;
&lt;p&gt;Source code provided at the end of the article.&lt;/p&gt;
&lt;p&gt;The web application is some kind of blog that lets us register, view and create blog posts.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="314px" data-flex-grow="131" height="1306" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_1.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_1_hu_2f3445073106e3f6.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_1_hu_963d74bdf6f1382f.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_1.png 1713w" width="1713"&gt;&lt;/p&gt;
&lt;p&gt;As we can see, it&amp;rsquo;s a Go application. There are different files for the different functionalities. Here we can see the web application&amp;rsquo;s routes.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="324px" data-flex-grow="135" height="1428" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_2.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_2_hu_340920e6a6f66bb8.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_2_hu_4efb1eb8f57f6699.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_2.png 1933w" width="1933"&gt;&lt;/p&gt;
&lt;p&gt;As always, one of the first things I do is to understand what is probably required for retrieving the flag. So let&amp;rsquo;s see what the &amp;lsquo;flag&amp;rsquo; function does.&lt;/p&gt;
&lt;p&gt;As we can see (line 45), it checks if we are an admin user. If we are, the server returns the flag.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="501px" data-flex-grow="209" height="1088" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_3.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_3_hu_e90062deac3d5522.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_3_hu_bc4f7e3466547ec.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_3.png 2275w" width="2275"&gt;&lt;/p&gt;
&lt;p&gt;I checked a couple of things but then I saw on the CTF Discord server that there was an issue with this challenge and the creator sent the changes made in the code.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="487px" data-flex-grow="202" height="1413" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_4.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_4_hu_2797264e23ab61b.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_4_hu_7a1882bc3b34b610.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_4_hu_d63183e428397d92.png 2400w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_4.png 2868w" width="2868"&gt;&lt;/p&gt;
&lt;p&gt;According to this, the solution should be related to something in the &amp;lsquo;index.go&amp;rsquo; file.&lt;/p&gt;
&lt;p&gt;In the old (and secure) code they rendered the template using {{.User.Username}} as the username of the logged in user. The username in this case will be safely displayed without evaluating the value within it (when the username value is an SSTI payload).&lt;/p&gt;
&lt;p&gt;The new and insecure version takes the username itself, appends it to the random sentence (to one of the sentences in lines 13-16) and then renders the template.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="444px" data-flex-grow="185" height="1649" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_5.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_5_hu_da3596451d15fdd8.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_5_hu_973c234be7dcfc85.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_5_hu_7eb2ebaa7d6449b9.png 2400w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_5.png 3055w" width="3055"&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s say the username is {{html &amp;ldquo;Orel&amp;rdquo;}}, it will look like this in secure code vs. insecure code:&lt;/p&gt;
&lt;p&gt;Secure code before rendering:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;Hey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{{.&lt;/span&gt;&lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Username&lt;/span&gt;&lt;span class="p"&gt;}};&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;there&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;are&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{{.&lt;/span&gt;&lt;span class="nx"&gt;NbPosts&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;right&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;now&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;!&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Secure code after rendering:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Hey, {{html &amp;#34;Orel&amp;#34;}}; there are 1 posts right now !
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Insecure code before rendering:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Hey, {{html &amp;#34;Orel&amp;#34;}}; there are 1 posts right now !
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Insecure code after rendering:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Hey, Orel; there are 1 posts right now !
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In Go, as far as I understand, SSTI is restricted in a way that we can only access exported (public) struct fields and methods passed to the template. Line 35 tells us that &amp;rsquo;s&amp;rsquo; is passed to it, which is the Session struct (line 20).&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="444px" data-flex-grow="185" height="1649" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_6.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_6_hu_da3596451d15fdd8.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_6_hu_973c234be7dcfc85.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_6_hu_7eb2ebaa7d6449b9.png 2400w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_6.png 3055w" width="3055"&gt;&lt;/p&gt;
&lt;p&gt;So let&amp;rsquo;s see what fields we can access in the Session struct. Remember that our goal is to access &amp;lsquo;/flag&amp;rsquo; using an admin account.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="629px" data-flex-grow="262" height="1107" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_7.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_7_hu_f9294fce8833d983.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_7_hu_35a8fda6427aecb9.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_7_hu_b11df1343ba1fec5.png 2400w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_7.png 2904w" width="2904"&gt;&lt;/p&gt;
&lt;p&gt;&amp;lsquo;User&amp;rsquo; refers to our account, nothing interesting there. But let&amp;rsquo;s see what&amp;rsquo;s in the &amp;lsquo;Post&amp;rsquo; struct.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="444px" data-flex-grow="185" height="1245" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_8.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_8_hu_34601f54d64cd5b.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_8_hu_69de51b843c1ed7c.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_8.png 2304w" width="2304"&gt;&lt;/p&gt;
&lt;p&gt;&amp;lsquo;Author&amp;rsquo; looks interesting, it&amp;rsquo;s a pointer to the &amp;lsquo;User&amp;rsquo; struct.&lt;/p&gt;
&lt;p&gt;Every user has access to a post that has the admin user as the &amp;lsquo;Author&amp;rsquo; field.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="408px" data-flex-grow="170" height="1761" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_9.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_9_hu_9739986b7b22c20.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_9_hu_866e858f6bb41b2c.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_9_hu_71acd50f48bf6cce.png 2400w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_9.png 2995w" width="2995"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="386px" data-flex-grow="160" height="1280" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_10.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_10_hu_bdbb943c15bbef98.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_10_hu_af01a12ac4e68a6f.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_10.png 2060w" width="2060"&gt;&lt;/p&gt;
&lt;p&gt;Our payload would begin with {{ (index .Posts 0).Author }} which is the admin&amp;rsquo;s User object.&lt;/p&gt;
&lt;p&gt;Currently the payload is combined from Session &amp;gt; Posts (Post struct) &amp;gt; Author (User struct) &amp;gt; ?.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s see what fields or methods we can access in the &amp;lsquo;User&amp;rsquo; struct. The &amp;lsquo;ChangePassword&amp;rsquo; method looks interesting.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="445px" data-flex-grow="185" height="1350" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_11.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_11_hu_67f9641f2fc26d7d.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_11_hu_7bf90447b80b5630.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_11_hu_490e4480515a6c1a.png 2400w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_11.png 2508w" width="2508"&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s form our payload and try it:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Posts&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;ChangePassword&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;NewPass&amp;#34;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Registration with the SSTI payload as the username:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="818px" data-flex-grow="340" height="810" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_12.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_12_hu_a36a3425077adb8a.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_12_hu_7c0a5a7ec6fc0af9.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_12_hu_2b515e9ee8b3b8e6.png 2400w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_12.png 2761w" width="2761"&gt;&lt;/p&gt;
&lt;p&gt;Log in so the web application will render the template with the username. Note that it evaluated the template action (expression) and shows &amp;rsquo;true&amp;rsquo; as the rendered value.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="531px" data-flex-grow="221" height="1200" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_13.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_13_hu_55ad2f3bae256bee.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_13_hu_74bd889e50dd05c3.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_13_hu_a4b4143cfead7834.png 2400w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_13.png 2656w" width="2656"&gt;&lt;/p&gt;
&lt;p&gt;We can log in with the new admin credentials and access the flag.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="575px" data-flex-grow="239" height="1154" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_14.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_14_hu_3ab7e61c277e6d40.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_14_hu_aeb8f05a81eaaf53.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_14_hu_b95780d555bb7765.png 2400w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_14.png 2767w" width="2767"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="462px" data-flex-grow="192" height="1431" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_15.png" srcset="https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_15_hu_31f0e78432fa500c.png 800w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_15_hu_cc12c1a09988eace.png 1600w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_15_hu_4c72b9b7b29afd53.png 2400w, https://blog.thesecuritywind.com/post/4t-ctf-2024-my-sky-blog/img_15.png 2755w" width="2755"&gt;&lt;/p&gt;
&lt;p&gt;Source code: &lt;a class="link" href="https://gitlab.com/4ts/ctf-2024/web/sky-blog/-/tree/main/src?ref_type=heads" target="_blank" rel="noopener"
 &gt;https://gitlab.com/4ts/ctf-2024/web/sky-blog/-/tree/main/src?ref_type=heads&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel 🌧&lt;/p&gt;</description></item><item><title>Small Winds - No. 04</title><link>https://blog.thesecuritywind.com/post/small-winds-no-03-1/</link><pubDate>Mon, 14 Oct 2024 21:23:22 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/small-winds-no-03-1/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/small-winds-no-03-1/cover.webp" alt="Featured image of post Small Winds - No. 04" /&gt;&lt;p&gt;&lt;em&gt;A personal mini blog about infosec and life&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Recently, YouTube reminded me of a piece I used to listen to: &lt;a class="link" href="https://www.youtube.com/watch?v=2zcTKhohtJg" target="_blank" rel="noopener"
 &gt;https://www.youtube.com/watch?v=2zcTKhohtJg&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This video includes the Minuet and Badinerie movements of Bach&amp;rsquo;s Suite No. 2 in B minor. I became familiar with these pieces, specifically the Badinerie from the old 1993 &amp;ldquo;Bonus&amp;rdquo; PC game I played when I was younger. It turns out that my partner knows this game as well, so it was nostalgic and fun.&lt;/p&gt;
&lt;p&gt;&lt;img alt="‘Bonus’ PC game" class="gallery-image" data-flex-basis="319px" data-flex-grow="133" height="1887" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-03-1/img_1.jpg" srcset="https://blog.thesecuritywind.com/post/small-winds-no-03-1/img_1_hu_e4b3260bc3b89a49.jpg 800w, https://blog.thesecuritywind.com/post/small-winds-no-03-1/img_1_hu_bd0473943dcd3c0b.jpg 1600w, https://blog.thesecuritywind.com/post/small-winds-no-03-1/img_1_hu_d4d613f15cae6e6f.jpg 2400w, https://blog.thesecuritywind.com/post/small-winds-no-03-1/img_1.jpg 2513w" width="2513"&gt;&lt;/p&gt;
&lt;p&gt;(🎮) I also play &lt;a class="link" href="https://en.wikipedia.org/wiki/Little_Nightmares_II" target="_blank" rel="noopener"
 &gt;Little Nightmares II&lt;/a&gt;. It&amp;rsquo;s a game where the character is small (young?) and weak, in a world full of nightmares and finds another little companion along the journey. I&amp;rsquo;ve never encountered a game in this genre with graphics, puzzles, and surroundings as creative and unique as this one (or maybe I just don&amp;rsquo;t play a lot 🙃). They have surely succeeded in delivering the feeling of being weak and vulnerable in a world full of threats and surprises, along with self-belief and the feeling of being able to survive.&lt;/p&gt;
&lt;p&gt;(🎥) Additionally, randomly chosen, I watched the South Korean sci-fi TV series &lt;a class="link" href="https://www.imdb.com/title/tt11570202/" target="_blank" rel="noopener"
 &gt;The Silent Sea&lt;/a&gt; which is one of the best TV series I&amp;rsquo;ve ever watched.&lt;/p&gt;
&lt;h2 id="new-things-i-learned-"&gt;**New Things I learned **
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;(🔬) EJS is a templating engine usually used with Node.js. When used with Express, EJS can be susceptible to SSTI vulnerability when we can control the template rendering process. Since Express.js enables extended query string parsing by default (e.g. filter[status]=active&amp;amp;filter[age][gte]=30), it allows us to control the options passed to EJS render() function.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(🔬) A cool blog post about a vulnerability chain involving Clickjacking that led to $4133.7 from Google. It was nice to see the process of exploitation and the persistence when things didn&amp;rsquo;t work as expected: &lt;a class="link" href="https://x.com/rebane2001/status/1836653696639271329" target="_blank" rel="noopener"
 &gt;https://x.com/rebane2001/status/1836653696639271329&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(🔬🐍) In Python, if we can send a string that will be formatted or control the format template, we can execute arbitrary code and read internal data. Two examples:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(🔬💉🛢️) If there is a nosql injection in MongoDB and it uses aggregation, we can interact with data from other collections. We can use &amp;lsquo;$lookup&amp;rsquo; and &amp;lsquo;$unionWith&amp;rsquo;. How can we know there is aggregation when there is no source code? As mentioned in the article in the references:
&amp;ldquo;In MongoDB, the aggregate method always expects an array of aggregation stages as its first argument. Therefore, look for JSON arrays as a parameter. The &amp;ldquo;$match&amp;rdquo; and &amp;ldquo;$lookup&amp;rdquo; operators in a JSON request can also indicate the use of the aggregate method&amp;rdquo;.
References:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(📗) I didn&amp;rsquo;t think about it before, but I learned from the book &amp;ldquo;Real-World Bug Hunting&amp;rdquo; that even if HttpOnly attribute is set, in situations where there is XSS and also misconfiguration such as /phpinfo.php (which reflects the cookies) we can steal them anyway.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="weekly-thoughts-and-updates"&gt;&lt;strong&gt;Weekly Thoughts and Updates&lt;/strong&gt;
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;(📄) My first CVE was published 🎉
&lt;a class="link" href="https://www.cve.org/CVERecord?id=CVE-2024-44807" target="_blank" rel="noopener"
 &gt;https://www.cve.org/CVERecord?id=CVE-2024-44807&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;(📄) Handling the CVE process because of this CVE publication (and because of another one I really wish to publish), made me think about going through various random CVEs. Since they usually have public references (as part of the requirement for CVE publication), I can read, learn from them and gain inspiration for vulnerabilities.&lt;/li&gt;
&lt;li&gt;(🐛) A week ago I contacted the vendor of the product I found a high-critical vulnerability in, but still no reply from them, I&amp;rsquo;ll wait another week and contact them again. Meanwhile I&amp;rsquo;m trying to see if any of the vulnerable companies using this product has VDP or BPP.&lt;/li&gt;
&lt;li&gt;(🐋) I&amp;rsquo;ve finished the Docker course and now I&amp;rsquo;m preparing for the certification test.&lt;/li&gt;
&lt;li&gt;(🔨) Got an idea for a tool that identifies the framework/programming language/etc. of web apps using different methods. I put it in my To Do/backlog list, and I will later check this idea..&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>BuckeyeCTF 2024 - quotes (Web)</title><link>https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/</link><pubDate>Mon, 30 Sep 2024 05:19:04 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/cover.png" alt="Featured image of post BuckeyeCTF 2024 - quotes (Web)" /&gt;&lt;p&gt;Unfortunately, I did not have much time to try more challenges so this will be a short one.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="484px" data-flex-grow="201" height="415" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_1.png" srcset="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_1_hu_1d50122fa49e1d71.png 800w, https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_1.png 838w" width="838"&gt;&lt;/p&gt;
&lt;p&gt;The challenge provided the URL for the web app and its source code (can be downloaded at the end of this article).&lt;/p&gt;
&lt;p&gt;When I accessed the URL, the web app displayed this message:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="947px" data-flex-grow="394" height="170" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_2.jpg" width="671"&gt;&lt;/p&gt;
&lt;p&gt;The source code contained these files:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="182px" data-flex-grow="75" height="324" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_3.png" width="246"&gt;&lt;/p&gt;
&lt;p&gt;After searching for the flag&amp;rsquo;s location, I noticed it is the 8th quote in the &amp;lsquo;quotes&amp;rsquo; file.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1560px" data-flex-grow="650" height="314" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_4.png" srcset="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_4_hu_89bea01a9ec689d.png 800w, https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_4_hu_f6109efb70d28f9d.png 1600w, https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_4.png 2042w" width="2042"&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s check the &amp;lsquo;app.js&amp;rsquo; file to understand how to retrieve it.&lt;/p&gt;
&lt;p&gt;By sending a GET request to &amp;lsquo;/register&amp;rsquo; we can generate a JWT:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="303px" data-flex-grow="126" height="583" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_5.png" width="738"&gt;&lt;/p&gt;
&lt;p&gt;The web app reads the contents of the &amp;lsquo;quotes&amp;rsquo; file, and splits it into an array of strings, where each element represents a single quote:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="2880px" data-flex-grow="1200" height="69" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_6.png" srcset="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_6_hu_c13f6a0ad56ba163.png 800w, https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_6.png 828w" width="828"&gt;&lt;/p&gt;
&lt;p&gt;There are some other functionalities in the web app, but after reviewing the code and thinking they might be irrelevant, I focused on this part:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="251px" data-flex-grow="104" height="775" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_7.png" srcset="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_7_hu_2bf4fd4d994b23dc.png 800w, https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_7.png 812w" width="812"&gt;&lt;/p&gt;
&lt;p&gt;By sending a GET request to &amp;lsquo;/quote&amp;rsquo; with the &amp;lsquo;id&amp;rsquo; parameter which is the quote id, we might somehow retrieve the flag.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s break this code:&lt;/p&gt;
&lt;p&gt;line 66: Number() converts &amp;lsquo;id&amp;rsquo; to a number (i).&lt;/p&gt;
&lt;p&gt;line 68-72: checks if &amp;lsquo;i&amp;rsquo; is equal to or greater than FREE_TIER_QUOTE_LIMIT (which is 5. I did not add this code section).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It means that it prevents us from retrieving the flag which is the 8th quote (index &amp;lsquo;7&amp;rsquo;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;line 74-78: checks if &amp;lsquo;i&amp;rsquo; is in the array bounds.&lt;/p&gt;
&lt;p&gt;line 80-85: applies parseInt() on &amp;lsquo;i&amp;rsquo;, and will display the corresponding quote depending on the result (for example, 5 will show the quote in index &amp;lsquo;5&amp;rsquo;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I knew that parseInt() has certain behaviors that might be related to the vulnerability. It reminded me of a challenge I had solved before, but this time it was a bit different: &lt;a class="link" href="https://www.thesecuritywind.com/post/uoftctf-2024-writeups#viewer-qdfm150837" target="_blank" rel="noopener"
 &gt;https://www.thesecuritywind.com/post/uoftctf-2024-writeups#viewer-qdfm150837&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In summary:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;We provide an &amp;lsquo;id&amp;rsquo; value.&lt;/li&gt;
&lt;li&gt;The &amp;lsquo;id&amp;rsquo; is converted to a number (&amp;lsquo;i&amp;rsquo;).&lt;/li&gt;
&lt;li&gt;parseInt(i) parses the input until it encounters a non-digit character. For example &amp;lsquo;1b2&amp;rsquo; will be parsed as &amp;lsquo;1&amp;rsquo;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So I searched for a value that is considered a number, remains unchanged after the Number() function, but will be parsed as &amp;lsquo;7&amp;rsquo; after the parseInt() function.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Note: In retrospect, I realized that there are valid values which can change when passed to the Number() function.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I tried some values and fuzzed a little bit. All of my attempts resulted in quotes I was permitted to read, &amp;rsquo;null&amp;rsquo; or errors.&lt;/p&gt;
&lt;p&gt;Then I found a certain number representation that could work for our conditions (different representations can be found here: &lt;a class="link" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number" target="_blank" rel="noopener"
 &gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="352px" data-flex-grow="146" height="867" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_8.png" srcset="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_8_hu_8a898a2cdd287026.png 800w, https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_8.png 1274w" width="1274"&gt;&lt;/p&gt;
&lt;p&gt;Number(&amp;ldquo;7e-310&amp;rdquo;) is converted to 7e-310.&lt;/p&gt;
&lt;p&gt;7e-310 is between 0 and 7 (7*10^-310 is a positive number close to 0).&lt;/p&gt;
&lt;p&gt;parseInt(7e-310) is 7.&lt;/p&gt;
&lt;p&gt;It works because JavaScript represents very small numbers using scientific notation. For example, while &amp;lsquo;0.000007&amp;rsquo; is represented as &amp;lsquo;0.000007&amp;rsquo;, &amp;lsquo;0.0000007&amp;rsquo; is represented as &amp;lsquo;7e-7&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="656px" data-flex-grow="273" height="440" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_9.png" srcset="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_9_hu_b8d75bbcc8bd33e5.png 800w, https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_9.png 1203w" width="1203"&gt;&lt;/p&gt;
&lt;p&gt;So even if we send an id of &amp;lsquo;0.0000007&amp;rsquo;, it should work as well since Number(&amp;ldquo;0.0000007&amp;rdquo;) will convert it to &amp;lsquo;7e-7&amp;rsquo; and parseInt() will parse it as &amp;lsquo;7&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="767px" data-flex-grow="319" height="854" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_10.png" srcset="https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_10_hu_2ab0a67c7b401f3b.png 800w, https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_10_hu_c550b1753f1efaa4.png 1600w, https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_10_hu_7dbedbe4f451533a.png 2400w, https://blog.thesecuritywind.com/post/buckeyectf-2024-quotes-web/img_10.png 2730w" width="2730"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Source code:&lt;/p&gt;
&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel 🐠&lt;/p&gt;</description></item><item><title>PatriotCTF 2024 - Open Seasame (Web)</title><link>https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/</link><pubDate>Mon, 23 Sep 2024 17:10:51 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/cover.jpg" alt="Featured image of post PatriotCTF 2024 - Open Seasame (Web)" /&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="229px" data-flex-grow="95" height="1261" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_1.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_1_hu_e0ad2cb647186f28.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_1.png 1205w" width="1205"&gt;&lt;/p&gt;
&lt;p&gt;The challenge provided two files - server.py and admin.js, and a link to a web application that lets us enter a URL path that the bot will visit, which means this challenge is probably XSS or SSRF-related.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="583px" data-flex-grow="243" height="921" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_2.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_2_hu_4d9466f6f774ce0e.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_2_hu_e7e5636555c346fd.png 1600w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_2.png 2239w" width="2239"&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s dive into the source code and see where the flag is mentioned, so we can think about the next steps.&lt;/p&gt;
&lt;p&gt;Unfortunately, I did not find any mentions of a flag, but we can see in &amp;lsquo;server.py&amp;rsquo; that a secret value is read from &amp;lsquo;secret.txt&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="577px" data-flex-grow="240" height="845" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_3.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_3_hu_96e77ec30341a12b.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_3_hu_aedb5a6ce9c1030a.png 1600w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_3.png 2034w" width="2034"&gt;&lt;/p&gt;
&lt;p&gt;Later in the code, we can see that this secret value needs to be set in the cookies for the &amp;lsquo;/api/cal&amp;rsquo; API endpoint. We can also see that it is probably possible to exploit a command injection vulnerability, using the &amp;lsquo;modifier&amp;rsquo; parameter. It would look something like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;?modifier&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;ls 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="481px" data-flex-grow="200" height="831" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_4.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_4_hu_e6872ed589853ec6.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_4_hu_4b3e1965884fa31e.png 1600w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_4.png 1667w" width="1667"&gt;&lt;/p&gt;
&lt;p&gt;Maybe we can tell the bot to visit this API endpoint if the bot has the secret in its cookies, and somehow send us the command injection results.&lt;/p&gt;
&lt;p&gt;Looking at the &amp;lsquo;admin.js&amp;rsquo; file, we can see that the bot has the secret in its cookies, but we cannot tell it to visit any URLs that include &amp;lsquo;cal&amp;rsquo; or &amp;lsquo;%&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="409px" data-flex-grow="170" height="1379" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_5.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_5_hu_900b72be7013ed14.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_5_hu_4757c3b57c6097cb.png 1600w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_5.png 2355w" width="2355"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="389px" data-flex-grow="162" height="1092" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_6.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_6_hu_f33ef74116b61279.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_6_hu_df3568d8ca7e870a.png 1600w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_6.png 1770w" width="1770"&gt;&lt;/p&gt;
&lt;p&gt;So we need to find another way to make the bot access the API endpoint vulnerable to the command injection.&lt;/p&gt;
&lt;p&gt;We can add a high score in the system by sending &amp;lsquo;username&amp;rsquo; and &amp;lsquo;high_score&amp;rsquo; parameters and we will receive a UUID.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="601px" data-flex-grow="250" height="854" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_7.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_7_hu_530ea36fe7117763.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_7_hu_45cd0a09276fb281.png 1600w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_7.png 2142w" width="2142"&gt;&lt;/p&gt;
&lt;p&gt;And this API endpoint returns the high score UUID data.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1343px" data-flex-grow="559" height="377" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_8.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_8_hu_39c3b1f27371ddda.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_8_hu_efa3ff0e52a22fa8.png 1600w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_8.png 2110w" width="2110"&gt;&lt;/p&gt;
&lt;p&gt;This is the main functionality of the web app. We need to retrieve the secret value to be able to exploit the command injection, or to make the bot access it.&lt;/p&gt;
&lt;p&gt;We can try to inject a script as the &amp;lsquo;username&amp;rsquo; parameter&amp;rsquo;s value in the &amp;lsquo;/api/stats&amp;rsquo; endpoint and then, tell the bot to visit the UUID that contains the XSS payload.&lt;/p&gt;
&lt;p&gt;Injecting a script in the &amp;lsquo;username&amp;rsquo; parameter&amp;rsquo;s value:&lt;/p&gt;
&lt;p&gt;The script tells the bot to access &amp;lsquo;/api/cal/?modifier=;cat secret.txt&amp;rsquo; (the endpoint vulnerable to command injection), and to read the content of the &amp;lsquo;secret.txt&amp;rsquo; file. Then it will create a new Image object with the source of our server, and appends the response of the &amp;lsquo;/api/cal&amp;rsquo; request a parameter&amp;rsquo;s value.&lt;/p&gt;
&lt;p&gt;An image object was used instead of XHR or fetch() requests to bypass the same-origin policy requirements which are not applied to images (I&amp;rsquo;m actually not sure why it blocked the requests in my initial attempts using fetch(), as they were GET requests without any special headers, but I didn&amp;rsquo;t delve into this, and I just replaced it with an Image object).&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="537px" data-flex-grow="223" height="1235" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_9.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_9_hu_1959f8b4f4403286.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_9_hu_9522923c53883fa3.png 1600w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_9_hu_c3d561777680d4db.png 2400w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_9.png 2766w" width="2766"&gt;&lt;/p&gt;
&lt;p&gt;This is how the bot probably see it:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="536px" data-flex-grow="223" height="1236" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_10.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_10_hu_c2fd6d0f1a2fdabf.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_10_hu_4691a5a4899f829d.png 1600w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_10_hu_d6e3e772a560babe.png 2400w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_10.png 2765w" width="2765"&gt;&lt;/p&gt;
&lt;p&gt;Telling to bot to visit this UUID:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="602px" data-flex-grow="250" height="1106" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_11.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_11_hu_c12a91759c3bdee1.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_11_hu_26872308cdb8798c.png 1600w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_11_hu_75867978f16e1bee.png 2400w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_11.png 2775w" width="2775"&gt;&lt;/p&gt;
&lt;p&gt;The bot request to our server which includes the contents of &amp;lsquo;secret.txt&amp;rsquo; file:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="973px" data-flex-grow="405" height="942" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_12.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_12_hu_8b7c5d33b3b0fbea.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_12_hu_69cc79811f6c2f65.png 1600w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_12_hu_316be5eccc89d494.png 2400w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_12.png 3820w" width="3820"&gt;&lt;/p&gt;
&lt;p&gt;Using the secret to find the flag file and read it:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="615px" data-flex-grow="256" height="1078" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_13.png" srcset="https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_13_hu_5e8ca114775485f9.png 800w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_13_hu_25e327d10c743d64.png 1600w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_13_hu_b1542266a884234c.png 2400w, https://blog.thesecuritywind.com/post/patriotctf-2024-open-seasame-web/img_13.png 2766w" width="2766"&gt;&lt;/p&gt;
&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel 🍊&lt;/p&gt;</description></item><item><title>Small Winds - No. 03</title><link>https://blog.thesecuritywind.com/post/small-winds-no-03/</link><pubDate>Tue, 10 Sep 2024 18:37:05 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/small-winds-no-03/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/small-winds-no-03/cover.png" alt="Featured image of post Small Winds - No. 03" /&gt;&lt;p&gt;&lt;em&gt;A personal mini blog about infosec and life&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Previously, I mentioned my interest in improving my knowledge of browser internals and application security.&lt;/p&gt;
&lt;p&gt;Although I am working on this in the background (and probably should invest more time in it), I also know it is crucial for me to strengthen my skills in cloud-native technologies and cloud platform security. So I have started studying for the Docker Certified Associate certification (&lt;a class="link" href="https://github.com/Evalle/DCA" target="_blank" rel="noopener"
 &gt;https://github.com/Evalle/DCA&lt;/a&gt;). I will probably finish it by the start of next month.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A.I. generated image of a docker puppet for for no real reason other than Docker" class="gallery-image" data-flex-basis="420px" data-flex-grow="175" height="1024" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-03/img_1.png" srcset="https://blog.thesecuritywind.com/post/small-winds-no-03/img_1_hu_47605323f08f4f06.png 800w, https://blog.thesecuritywind.com/post/small-winds-no-03/img_1_hu_3a4395d4c916bda4.png 1600w, https://blog.thesecuritywind.com/post/small-winds-no-03/img_1.png 1792w" width="1792"&gt;&lt;/p&gt;
&lt;h2 id="weekly-thoughts-and-updates"&gt;&lt;strong&gt;Weekly Thoughts and Updates&lt;/strong&gt;
&lt;/h2&gt;&lt;h3 id="comparing-link-finder-tools"&gt;&lt;strong&gt;Comparing Link Finder Tools&lt;/strong&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;I compared the results of &amp;lsquo;&lt;a class="link" href="https://portswigger.net/bappstore/0e61c786db0c4ac787a08c4516d52ccf" target="_blank" rel="noopener"
 &gt;JS Link Finder&lt;/a&gt;&amp;rsquo;, &amp;lsquo;&lt;a class="link" href="https://github.com/GerbenJavado/LinkFinder" target="_blank" rel="noopener"
 &gt;LinkFinder&lt;/a&gt;&amp;rsquo;, and &amp;lsquo;&lt;a class="link" href="https://portswigger.net/bappstore/0ab7a94d8e11449daaf0fb387431225b" target="_blank" rel="noopener"
 &gt;JS Miner&lt;/a&gt;&amp;rsquo;.&lt;/li&gt;
&lt;li&gt;Personally, when full coverage isn&amp;rsquo;t very important, I would prefer using &amp;lsquo;JS Link Finder&amp;rsquo; and &amp;lsquo;JS Miner&amp;rsquo;, as almost all the time the first two tools found the same things, while &amp;lsquo;JS Link Finder&amp;rsquo; performed a bit better.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="comparing-tools-to-potentially-finding-a-cve"&gt;&lt;strong&gt;Comparing Tools to Potentially Finding a CVE&lt;/strong&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;While doing this comparison, I found an interesting URL path that led to some kind of administrative feature that potentially allows me to add and remove servers, view IPs, ports, names, and maybe other things as well.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="related-ctf-challenge"&gt;&lt;strong&gt;Related CTF Challenge&lt;/strong&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;As a coincidence, last weekend I tried a certain CTF challenge (SnakeCTF - Affekot) that was related to this topic. The web application used Next.js, and one of the URL paths was a page for developers to register an admin user. After that, it was easy to get the flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="255px" data-flex-grow="106" height="1135" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-03/img_2.png" srcset="https://blog.thesecuritywind.com/post/small-winds-no-03/img_2_hu_653d196416e8c3dd.png 800w, https://blog.thesecuritywind.com/post/small-winds-no-03/img_2.png 1210w" width="1210"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="538px" data-flex-grow="224" height="963" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-03/img_3.png" srcset="https://blog.thesecuritywind.com/post/small-winds-no-03/img_3_hu_50164dc579ac2baf.png 800w, https://blog.thesecuritywind.com/post/small-winds-no-03/img_3_hu_7b6ea722ab80ff28.png 1600w, https://blog.thesecuritywind.com/post/small-winds-no-03/img_3.png 2159w" width="2159"&gt;&lt;/p&gt;
&lt;h3 id="web-timing-attacks"&gt;&lt;strong&gt;Web Timing Attacks&lt;/strong&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;I&amp;rsquo;ve finished James Kettle&amp;rsquo;s article about timing attacks, and it was super interesting. This issue or type of attack is probably relevant to a huge amount of web applications, much like how SQL injection was very common years ago.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Link: &lt;a class="link" href="https://portswigger.net/research/listen-to-the-whispers-web-timing-attacks-that-actually-work" target="_blank" rel="noopener"
 &gt;https://portswigger.net/research/listen-to-the-whispers-web-timing-attacks-that-actually-work&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="a-few-other-notes"&gt;&lt;strong&gt;A Few Other Notes&lt;/strong&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;I had the chance to gain some experience with a Java Spring environment, so I learned a few new things about it, which was pretty fun.&lt;/li&gt;
&lt;li&gt;I received a CVE number for the vulnerability I mentioned in the past. The next step is to contact the vendor.&lt;/li&gt;
&lt;li&gt;I haven&amp;rsquo;t heard anything new about the LFD vulnerability I found and sent through the VDP. I&amp;rsquo;ll wait a week or two and see if there&amp;rsquo;s any update.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Small Winds - No. 02</title><link>https://blog.thesecuritywind.com/post/small-winds-no-02/</link><pubDate>Fri, 16 Aug 2024 20:53:25 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/small-winds-no-02/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/small-winds-no-02/cover.jpg" alt="Featured image of post Small Winds - No. 02" /&gt;&lt;p&gt;&lt;em&gt;A personal mini blog about infosec and life&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The past week and a half was not very productive since I was unwell most of the time.&lt;/p&gt;
&lt;p&gt;It was probably a mistake, but last weekend my partner and I decided to buy an XL pizza from the best pizzeria in town according to us.&lt;/p&gt;
&lt;p&gt;We realized that by ordering directly from the pizzeria&amp;rsquo;s website, we pay the same for an XL pizza as we would for a family-size pizza using Wolt food delivery app.&lt;/p&gt;
&lt;p&gt;Anyway, this size was probably too much for me.&lt;/p&gt;
&lt;p&gt;&lt;img alt="The Regrettable Pizza" class="gallery-image" data-flex-basis="320px" data-flex-grow="133" height="3024" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-02/img_1.jpg" srcset="https://blog.thesecuritywind.com/post/small-winds-no-02/img_1_hu_8378a41fea46ed1e.jpg 800w, https://blog.thesecuritywind.com/post/small-winds-no-02/img_1_hu_aeaf36dac6d31e5e.jpg 1600w, https://blog.thesecuritywind.com/post/small-winds-no-02/img_1_hu_7d1ca81c33f1f297.jpg 2400w, https://blog.thesecuritywind.com/post/small-winds-no-02/img_1.jpg 4032w" width="4032"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id="weekly-activities-and-notes"&gt;&lt;strong&gt;Weekly Activities and Notes&lt;/strong&gt;
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;I submitted my first CVE request. Let&amp;rsquo;s wait and see if it is approved.&lt;/li&gt;
&lt;li&gt;I sent my first VDP to the Israel National Cyber Directorate. It detailed a local file inclusion vulnerability in a very large Israeli company. By reading the environment variables (/proc/self/environ), it was possible to retrieve sensitive information such as a secret used for authentication for one of their services.&lt;/li&gt;
&lt;li&gt;Although I don&amp;rsquo;t use them much, I was thinking about comparing the results of BuiltWith and Wappalyzer. I added this to my To-Do list.&lt;/li&gt;
&lt;li&gt;About two weeks ago, Trail of Bits hosted a webinar with James Kettle (Director of Research at PortSwigger). They discussed several tips regarding Burp Suite, introduced the new Intercept tool, and talked about a few other topics. Some of James&amp;rsquo; and Trail of Bits&amp;rsquo; suggestions were:&lt;/li&gt;
&lt;li&gt;PortSwigger has created a new Discord server. It might be a good place to have discussions with other researchers. Invitation link: &lt;a class="link" href="https://discord.com/invite/portswigger" target="_blank" rel="noopener"
 &gt;https://discord.com/invite/portswigger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;James Kettle has published new research about timing attacks and their major impact on web applications. He published an article a year ago, but it was more theoretical. This time, it&amp;rsquo;s not theoretical anymore. He has found a way to perform this attack on many web applications and shows how to do it. I haven&amp;rsquo;t finished reading the article yet, but I surely plan to do it. Link: &lt;a class="link" href="https://portswigger.net/research/listen-to-the-whispers-web-timing-attacks-that-actually-work" target="_blank" rel="noopener"
 &gt;https://portswigger.net/research/listen-to-the-whispers-web-timing-attacks-that-actually-work&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="ctf"&gt;&lt;strong&gt;CTF&lt;/strong&gt;
&lt;/h3&gt;&lt;p&gt;Last weekend I participated in LIT CTF. I did not plan to publish an independent post with writeups because it wasn&amp;rsquo;t very challenging, so I will write the solutions of two of the challenges here:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;web/jwt-2: The Express web application uses JWT for authorization to access the flag. There are 4 conditions:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="365px" data-flex-grow="152" height="1642" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-02/img_2.png" srcset="https://blog.thesecuritywind.com/post/small-winds-no-02/img_2_hu_d7a1e8c94ed2576b.png 800w, https://blog.thesecuritywind.com/post/small-winds-no-02/img_2_hu_6efdcc5f2b2786ce.png 1600w, https://blog.thesecuritywind.com/post/small-winds-no-02/img_2_hu_9b5bad467c34d882.png 2400w, https://blog.thesecuritywind.com/post/small-winds-no-02/img_2.png 2502w" width="2502"&gt;&lt;/p&gt;
&lt;p&gt;This means that all we need is for our signature to match the expected signature. What do we need to generate the expected token?&lt;/p&gt;
&lt;p&gt;According to section #3 in the image, we need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;To create an HMAC object using the jwtSecret, which we have:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="980px" data-flex-grow="408" height="265" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-02/img_3.png" srcset="https://blog.thesecuritywind.com/post/small-winds-no-02/img_3_hu_8b6ce9208e1975c9.png 800w, https://blog.thesecuritywind.com/post/small-winds-no-02/img_3.png 1083w" width="1083"&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The header and payload JWT sections. So nothing prevents us from generating this signature and using it in our modified JWT where the &amp;lsquo;admin&amp;rsquo; property is set to &amp;rsquo;true&amp;rsquo;:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="556px" data-flex-grow="231" height="1214" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-02/img_4.png" srcset="https://blog.thesecuritywind.com/post/small-winds-no-02/img_4_hu_1f832b32667d6a33.png 800w, https://blog.thesecuritywind.com/post/small-winds-no-02/img_4_hu_1b584734f33ce44a.png 1600w, https://blog.thesecuritywind.com/post/small-winds-no-02/img_4_hu_9c09ddd077a12012.png 2400w, https://blog.thesecuritywind.com/post/small-winds-no-02/img_4.png 2815w" width="2815"&gt;&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;web/kirbytime - In this challenge we should essentially guess the password using a timing attack. For each correct character, the system waits 1 second. This way, we can try all of the characters and determine the correct next character. We can do this using a script or manually.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="554px" data-flex-grow="230" height="993" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/small-winds-no-02/img_5.png" srcset="https://blog.thesecuritywind.com/post/small-winds-no-02/img_5_hu_9d95f42f4ffce247.png 800w, https://blog.thesecuritywind.com/post/small-winds-no-02/img_5_hu_87f065711e86f019.png 1600w, https://blog.thesecuritywind.com/post/small-winds-no-02/img_5.png 2293w" width="2293"&gt;&lt;/p&gt;</description></item><item><title>Small Winds - No. 01</title><link>https://blog.thesecuritywind.com/post/copy-of-small-winds-no-01/</link><pubDate>Wed, 07 Aug 2024 16:24:53 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/copy-of-small-winds-no-01/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/copy-of-small-winds-no-01/cover.jpg" alt="Featured image of post Small Winds - No. 01" /&gt;&lt;p&gt;&lt;em&gt;A personal mini blog about infosec and life&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Recently, I encountered a blog that inspired me to create a more personal mini blog as part of The Security Wind. I plan to post on a weekly or biweekly basis, and it will probably include more personal stuff and thoughts, combined with other things related to information security - likely interesting things I&amp;rsquo;ve learned, plans, tips and whatever else comes to my mind :)&lt;/p&gt;
&lt;p&gt;I will probably know better later on.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;A while ago, I had some kind of emotional buying urge (is there such a thing? Probably). It started with the revelation (🙄) that I am not where I want to be professionally regarding application security. More specifically, I wanted to get better with browser internals, beyond the basics. I wanted to buy a physical book because I often read a lot on my computer and was looking for a different option (as well as the fact that I enjoy reading from physical book and they&amp;rsquo;re easier for me to read while commuting).&lt;/p&gt;
&lt;p&gt;I did some research and found two books that met my needs: The Browser Hacker&amp;rsquo;s Handbook (2014) and The Tangled Web (2011). They are a bit old but a lot of the content is still relevant.&lt;/p&gt;
&lt;p&gt;So it started with the idea of buying one book and I found myself ending up with seven.&lt;/p&gt;
&lt;p&gt;My reasoning behind buying each book:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The Browser Hacker&amp;rsquo;s Handbook (2014), The Tangled Web (2011)&lt;/strong&gt; - They teach about browser internals. I wasn&amp;rsquo;t entirely sure if one book offered more information on certain subject so I bought both to have both perspectives.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Attacking and Exploiting Modern Web Applications (2023)&lt;/strong&gt; - Some modern attacks, technologies and perspectives that I would like to read about.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Web Security for Developers (2020)&lt;/strong&gt; - To better understand security from the development point of view.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Real-World Bug Hunting (2019)&lt;/strong&gt; - To learn tricks that I&amp;rsquo;m not aware of.&lt;/li&gt;
&lt;li&gt;**Bug Bounty Bootcamp (2021), **&lt;strong&gt;JavaScript for hackers (2022)&lt;/strong&gt; - Don&amp;rsquo;t ask. Aside from my buying urge, these books were recommended and they probably offer more tips and tricks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="weekly-thoughts"&gt;Weekly Thoughts
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;A few weeks ago I started reading &amp;lsquo;The Browser Hacker&amp;rsquo;s Handbook&amp;rsquo; but because of an issue, I temporarily stopped and switched to &amp;lsquo;Real-World Bug Hunting&amp;rsquo;. I began creating some kind of checklist of things I want to test in penetration tests. Some of them are specific (for example methods I use to cause detailed error messages) and others are more general.
I use this book to add ideas and attack types to this checklist.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I&amp;rsquo;ve finished about half of the book so far, and it&amp;rsquo;s well written. It explains several attack types, provides examples of interesting bug bounty reports that have been disclosed, and a takeaway for each example.
Although I&amp;rsquo;m already familiar with a major part of this book, there are some techniques that are new to me or perspectives that I find beneficial.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One bug bounty report mentioned in the book is this one: &lt;a class="link" href="https://hackerone.com/reports/127703/" target="_blank" rel="noopener"
 &gt;https://hackerone.com/reports/127703/&lt;/a&gt;
In scenarios where the CSRF token is correctly implemented, we might find the CSRF token in certain JS files. Since loading JavaScript files from another origin does not violate the Same Origin Policy, when the victim enters the attacker&amp;rsquo;s website, it can load the script which contains the victim&amp;rsquo;s CSRF token and send a request with the CSRF token included.&lt;/p&gt;
&lt;p&gt;For some reason it reminded me of the Same Origin Method Execution (SOME) attack:
It probably reminded me of this attack because both methods rely on loading a script to bypass the SOP restrictions and perform an attack. This made me more aware of the possibility of abusing this behavior in loading scripts when needed.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I&amp;rsquo;ve started creating a tool for bypassing WAFs or CDNs by trying to find the actual server&amp;rsquo;s IP address hidden behind the CDN IP address, using three different methods. I hope to have updates next week.&lt;/li&gt;
&lt;li&gt;I created a new page in my Notion account for new tools or things I want to do before or during future tests. Some of them are:&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>BSidesTLV 2024 CTF</title><link>https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/</link><pubDate>Thu, 27 Jun 2024 17:00:10 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/cover.png" alt="Featured image of post BSidesTLV 2024 CTF" /&gt;&lt;p&gt;This year I participated with Flag Fortress 2, and we reached the 2nd place (which is well above my goals I set for myself two years ago).&lt;/p&gt;
&lt;p&gt;Here are writeups of two of the challenges:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Web - Call the Manager pliz!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Radio Frequency - Covert Signal&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id="web---call-the-manager-pliz"&gt;Web - Call the Manager pliz!
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="231px" data-flex-grow="96" height="1213" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_1.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_1_hu_62880e3f78a6af68.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_1.png 1168w" width="1168"&gt;&lt;/p&gt;
&lt;p&gt;After accessing the challenge link, we are redirected to /fetcher. We&amp;rsquo;ll get back to it later. We can also notice that the source code ZIP is commented in the HTML.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="380px" data-flex-grow="158" height="1200" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_2.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_2_hu_73ca8697f2c727ff.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_2_hu_779b16421d3c1fa7.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_2.png 1904w" width="1904"&gt;&lt;/p&gt;
&lt;p&gt;After downloading it we can view the following routes and controllers:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="121px" data-flex-grow="50" height="1320" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_3.png" width="667"&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s start with the &amp;lsquo;flag&amp;rsquo; route (this is what we eventually want, right?).&lt;/p&gt;
&lt;p&gt;According to the code, when accessing /flag, before the execution of &amp;lsquo;FlagController.getFlagFinaleFlag&amp;rsquo; method there are two middleware (Middleware are functions that process requests and responses, sitting between the server receiving a request and the controller). One of them is for token authentication and the other is for validating that the user role is &amp;lsquo;admin&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="467px" data-flex-grow="194" height="1199" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_4.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_4_hu_21f9b39e86fe13c2.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_4_hu_37e2ce14a4935786.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_4.png 2336w" width="2336"&gt;&lt;/p&gt;
&lt;p&gt;Inside this controller we can see that the mentioned method probably reads the actual flag. But we can see that there is another method (getFlags) that was not mentioned in the /flags route or anywhere else in the code, and it is vulnerable to SQL Injection.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="244px" data-flex-grow="101" height="1664" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_5.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_5_hu_78c46a6d3d498072.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_5_hu_7fc1dd2a3791e110.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_5.png 1694w" width="1694"&gt;&lt;/p&gt;
&lt;p&gt;Although it is not implemented in the code, let&amp;rsquo;s try accessing it anyway using the /flag route, and the parameter mentioned in the code (id). It seems we need an access token.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="608px" data-flex-grow="253" height="1155" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_6.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_6_hu_38c29c7400e9c59e.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_6_hu_edc16a69c5d01d49.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_6_hu_bf09834cc97e48da.png 2400w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_6.png 2928w" width="2928"&gt;&lt;/p&gt;
&lt;p&gt;Searching the code for this error, brings us to the &amp;lsquo;authenticateToken&amp;rsquo; middleware.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="377px" data-flex-grow="157" height="1087" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_7.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_7_hu_e60caa329e1bb5cc.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_7_hu_6977796e17e5d197.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_7.png 1711w" width="1711"&gt;&lt;/p&gt;
&lt;p&gt;So we probably need an account. The &amp;lsquo;users&amp;rsquo; route mention a creation process but there is a middleware that checks that the request originates from localhost.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="668px" data-flex-grow="278" height="772" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_8.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_8_hu_7cd89029ba42ccc5.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_8_hu_3434c9fe42eb3027.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_8.png 2149w" width="2149"&gt;&lt;/p&gt;
&lt;p&gt;The method requires username and password, and we cannot control the user&amp;rsquo;s role which is set to &amp;lsquo;user&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="413px" data-flex-grow="172" height="1346" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_9.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_9_hu_d24098a0d9e5d936.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_9_hu_6f037e8cae4a5229.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_9.png 2321w" width="2321"&gt;&lt;/p&gt;
&lt;p&gt;Back to the /fetch path, we can exploit an SSRF vulnerability (can also be identified in the code). Using that, we can set the domain as &amp;rsquo;localhost&amp;rsquo; and bypass the localhost middleware. We can see that we are able to create a new user, login with its credentials and receive an access token (the login functionality can also be understood from the code).&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="638px" data-flex-grow="266" height="1104" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_10.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_10_hu_1bfca3798f5d1880.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_10_hu_93d8dcd968139957.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_10_hu_2ddd9cfde8c2273f.png 2400w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_10.png 2937w" width="2937"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="529px" data-flex-grow="220" height="1308" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_11.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_11_hu_39e309991f5ef5b.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_11_hu_554c41e589175c41.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_11_hu_29060b68ec35a2c4.png 2400w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_11.png 2885w" width="2885"&gt;&lt;/p&gt;
&lt;p&gt;Using the access token, we can exploit the SQLI I have mentioned earlier. In a normal behavior it should return &amp;lsquo;id&amp;rsquo; and &amp;lsquo;flag&amp;rsquo; which are integer and string so we should keep this structure so there will be no errors.&lt;/p&gt;
&lt;p&gt;I guessed that the first user probably has an &amp;lsquo;admin&amp;rsquo; role, so searched for the first user. It makes sense since the challenge author&amp;rsquo;s name is Liav (it is also possible to replace &amp;lsquo;username&amp;rsquo; with &amp;lsquo;role&amp;rsquo; in the payload just to make sure).&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="452px" data-flex-grow="188" height="1555" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_12.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_12_hu_363ecab285adba8d.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_12_hu_81a61cd8bbe1aac6.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_12_hu_4376f5ea791c01c2.png 2400w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_12.png 2929w" width="2929"&gt;&lt;/p&gt;
&lt;p&gt;Same for password:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="518px" data-flex-grow="216" height="1360" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_13.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_13_hu_c1e402aad6cf2044.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_13_hu_26c2ccac9d6fd54b.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_13_hu_9c6b44f4f672b811.png 2400w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_13.png 2938w" width="2938"&gt;&lt;/p&gt;
&lt;p&gt;I logged in with these credentials, retrieved the access token and accessed /flags/flag.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="708px" data-flex-grow="295" height="1162" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_14.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_14_hu_858deeee24b4f728.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_14_hu_702e2a847b0d07ce.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_14_hu_99f6e36c65cf6f0a.png 2400w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_14.png 3429w" width="3429"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="radio-frequency---covert-signal"&gt;Radio Frequency - Covert Signal
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="208px" data-flex-grow="86" height="1362" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_15.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_15_hu_8bf42750567f1eb3.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_15.png 1182w" width="1182"&gt;&lt;/p&gt;
&lt;p&gt;The challenge provided a WAV file that sounded very similar to an SSTV transmission (&lt;a class="link" href="https://www.youtube.com/watch?v=SffT9U8scBc" target="_blank" rel="noopener"
 &gt;https://www.youtube.com/watch?v=SffT9U8scBc&lt;/a&gt;), so I said to myself, &amp;lsquo;Oh, this should be easy,&amp;rsquo; and opened the SSTV software I usually use (RX-SSTV). After trying different modes, I realized there was more to it.&lt;/p&gt;
&lt;p&gt;I had a hunch from the start that it would not be straightforward and that the challenge description probably contained hints. Some of the keywords would likely be Olivia, 4:00, and 125.&lt;/p&gt;
&lt;p&gt;After searching a bit, I discovered that Olivia is the name of an MFSK mode, which is a method of delivering data (usually text) using radio frequencies, compared to SSTV, which is used to deliver image data.&lt;/p&gt;
&lt;p&gt;I downloaded some software and struggled a bit in the beginning.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="440px" data-flex-grow="183" height="2038" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_16.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_16_hu_588bfc91f249a579.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_16_hu_95fcef47fc11a306.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_16_hu_a57854bd01f45d9e.png 2400w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_16.png 3738w" width="3738"&gt;&lt;/p&gt;
&lt;p&gt;But then I downloaded one that seemed pretty simple to use.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="288px" data-flex-grow="120" height="1868" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_17.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_17_hu_80606bf9a14e3a47.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_17_hu_4208b161275c6b45.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_17.png 2248w" width="2248"&gt;&lt;/p&gt;
&lt;p&gt;After choosing the correct mode (Olivia OL 4-125) and loaded the WAV file, the flag was written letter by letter.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="390px" data-flex-grow="162" height="1231" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_18.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_18_hu_c2a13720120698a7.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_18_hu_b7f56b26aeadcfe1.png 1600w, https://blog.thesecuritywind.com/post/bsidestlv-2024-ctf/img_18.png 2005w" width="2005"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel 🥥&lt;/p&gt;</description></item><item><title>TBTL CTF Web Writeups</title><link>https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/</link><pubDate>Tue, 14 May 2024 00:13:15 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/cover.png" alt="Featured image of post TBTL CTF Web Writeups" /&gt;&lt;p&gt;Challenges:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Rnd For Data Science&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;Butterfly&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id="rnd-for-data-science"&gt;Rnd For Data Science
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="198px" data-flex-grow="82" height="1458" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_1.png" srcset="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_1_hu_f08f6aa27495478e.png 800w, https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_1.png 1206w" width="1206"&gt;&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;Vulnerability: Injection in Pandas library query allows to bypass filtering restriction&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;This challenge included two files whose general purpose was to retrieve column names and a delimiter from the user and to create a CSV file from them.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="383px" data-flex-grow="159" height="707" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_2.png" srcset="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_2_hu_6acaf91cebbef581.png 800w, https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_2.png 1129w" width="1129"&gt;&lt;/p&gt;
&lt;p&gt;The server uses the column names as headers for the table and fills the table with random numbers.&lt;/p&gt;
&lt;p&gt;After that, it adds another row (the 11th row) that inserts the flag into the second column place.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;index&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;delimiter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;delimiter&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;delimiter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;ERROR&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;num_columns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;numColumns&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;num_columns&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;ERROR&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;id&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;columnName&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num_columns&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;forb_list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;and&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;or&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;not&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;ERROR&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\&amp;#39;\&amp;#34;&lt;/span&gt;&lt;span class="s1"&gt;!@&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;ERROR&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;forb_word&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;forb_list&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;forb_word&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;ERROR&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;csv_file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;delimiter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rnd&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;randint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num_columns&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;csv_file&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;delimiter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;NaN&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;FLAG&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;flag&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num_columns&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;csv_file&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;delimiter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[:&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;csv_file&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then it sends this table to the main app to create a CSV file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nd"&gt;@app.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/generate&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;methods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;POST&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;form&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;delimiter_const&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;delimiter&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;http://127.0.0.1:5001&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;ERROR&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;ERROR&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;csv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;StringIO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Filter out secrets&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;columns&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s1"&gt; != &amp;#34;FLAG&amp;#34;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;string_df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;StringIO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sep&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;delimiter_const&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;bytes_df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;BytesIO&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;bytes_df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string_df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getvalue&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;bytes_df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;seek&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We can see that the server takes the second column name: &lt;strong&gt;first = list(df.columns.values)[1]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;And here it performs a query to retrieve all rows where the value in the second column does not equal &amp;lsquo;FLAG&amp;rsquo;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;df = df.query(f&amp;rsquo;{first} != &amp;ldquo;FLAG&amp;rdquo;&amp;rsquo;)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s debug it and run it locally.&lt;/p&gt;
&lt;p&gt;After entering two columns named &amp;ldquo;col1&amp;rdquo; and &amp;ldquo;col2&amp;rdquo;, we receive this table. As we can see, the flag was not included in this table.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="251px" data-flex-grow="104" height="647" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_3.png" width="678"&gt;&lt;/p&gt;
&lt;p&gt;By debugging the code, we can see that before the filter, the table includes the flag (SecretFlag), and after the filter it is not included.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="174px" data-flex-grow="72" height="1577" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_4.png" srcset="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_4_hu_be8c0e11718d98bc.png 800w, https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_4.png 1147w" width="1147"&gt;&lt;/p&gt;
&lt;p&gt;So we need to find a way to alter the the table structure or alter the query, using one of our inputs.&lt;/p&gt;
&lt;p&gt;Just like SQL Injection, we can inject to the pandas query a comment and it will ignore everything that comes after it.&lt;/p&gt;
&lt;p&gt;By entering a number in the query it returns the corresponding row.&lt;/p&gt;
&lt;p&gt;So assuming our first column is named &amp;ldquo;10#&amp;rdquo;, the query will look like this:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;df = df.query(f'10# != &amp;ldquo;FLAG&amp;rdquo;&amp;rsquo;)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;and be interpreted as **df.query(&amp;lsquo;10&amp;rsquo;) **which contains the flag.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="317px" data-flex-grow="132" height="1173" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_5.png" srcset="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_5_hu_620d145f9ec8c840.png 800w, https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_5.png 1550w" width="1550"&gt;&lt;/p&gt;
&lt;p&gt;After filtering the query returned a table that lists the columns and values of row number 10.&lt;/p&gt;
&lt;p&gt;And the CSV file will contain the flag:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="448px" data-flex-grow="186" height="311" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_6.png" width="581"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="butterfly"&gt;Butterfly
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="227px" data-flex-grow="94" height="1281" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_7.png" srcset="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_7_hu_259a7dd4835e6e65.png 800w, https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_7.png 1213w" width="1213"&gt;&lt;/p&gt;
&lt;p&gt;We have access to a web app:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="270px" data-flex-grow="112" height="2014" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_8.png" srcset="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_8_hu_30a93c2965b244ce.png 800w, https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_8_hu_8ab2cd1348892ba5.png 1600w, https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_8.png 2273w" width="2273"&gt;&lt;/p&gt;
&lt;p&gt;I did not see any functionalities or interesting requests, so I checked the source code and the browser&amp;rsquo;s storage.&lt;/p&gt;
&lt;p&gt;The LocalStorage and SessionStorage contained a key and this string: {&amp;ldquo;code&amp;rdquo;:&amp;ldquo;CryptoJS.AES.decrypt(CIPHERTEXT, KEY).toString(CryptoJS.enc.Utf8)&amp;rdquo;}&lt;/p&gt;
&lt;p&gt;I assumed that the key should be in the KEY position, but where is the ciphertext?&lt;/p&gt;
&lt;p&gt;Looking in the source code I saw a big obfuscated JavaScript code. I used online deobfuscator and beautifier and this was part of the deobfuscated code:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="219px" data-flex-grow="91" height="1862" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_9.jpg" srcset="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_9_hu_a7678bff18ae7024.jpg 800w, https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_9_hu_1d912c011ec44c56.jpg 1600w, https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_9.jpg 1705w" width="1705"&gt;&lt;/p&gt;
&lt;p&gt;I tried to understand what may be the ciphertext. Maybe part of the &amp;rsquo;enc&amp;rsquo; array or the full string after joining them together.&lt;/p&gt;
&lt;p&gt;However, after checking online what the ciphertext should look like, it was less likely that this was the ciphertext because of its length, structure and different characters.&lt;/p&gt;
&lt;p&gt;Knowing that the ciphertext had been altered, I continued to explore other interesting parts in the obfuscated code.&lt;/p&gt;
&lt;p&gt;Some of them were &amp;ldquo;transaction&amp;rdquo; &amp;ldquo;readwrite&amp;rdquo; &amp;ldquo;target.result&amp;rdquo;. I googled them together to understand what are they related to and understood they are related to IndexedDB.&lt;/p&gt;
&lt;p&gt;IndexedDB is a NoSQL database provided by modern browsers. It saved the data on the client-side, in the user&amp;rsquo;s local system. In order to retrieve the data from it, the user need to use JavaScript.&lt;/p&gt;
&lt;p&gt;I asked one of the LLMs how to retrieve data from IndexedDB, it gave me a script that needed a small modification and updating the database name and the store object that were &amp;ldquo;strangeStorage&amp;rdquo; and &amp;ldquo;FLAG&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;I retrieved the ciphertext from the DB, and decrypted it.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="528px" data-flex-grow="220" height="824" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_10.png" srcset="https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_10_hu_e9c77bd9ff55bb14.png 800w, https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_10_hu_486eb322042a511d.png 1600w, https://blog.thesecuritywind.com/post/tbtl-ctf-web-writeups/img_10.png 1816w" width="1816"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Thanks for reading,&lt;br&gt;
Orel 🌑&lt;/p&gt;</description></item><item><title>Large Language Models for CTFs</title><link>https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/</link><pubDate>Wed, 01 May 2024 14:54:44 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/cover.webp" alt="Featured image of post Large Language Models for CTFs" /&gt;&lt;p&gt;I really like using Large Language Models (LLMs). One of my uses for them is solving CTFs.&lt;/p&gt;
&lt;p&gt;Recently I started comparing a couple of them, especially since there have been some major updates lately.&lt;/p&gt;
&lt;p&gt;I was curious and wanted to create a table that would compare their capabilities in solving CTFs. My significant other then asked me why not write an article about it, so here we are😉.&lt;/p&gt;
&lt;p&gt;I read some opposing views towards using LLMs for CTFs. However, for me, using them is the same as googling and searching the web for learning, and trying to find answers to challenges or tasks we have. If we had the option to use google much more efficiently and find the results we want right away, I believe most of us would do that.&lt;/p&gt;
&lt;p&gt;Some people may say that LLMs solve the challenges for us, unlike searching the web, and some of that is true, but not always.&lt;/p&gt;
&lt;p&gt;I would divide it into two situations:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;When we are focusing on getting points or solving tasks:
In this case, I see no problem with using all the tools we have in order to be the most efficient and do what we want in the fastest way possible.&lt;/li&gt;
&lt;li&gt;When we want to learn and understand how to do things:
From my experience, often (or even the vast majority of times), the answer is not presented right away and I think that:&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;By getting the LLM output and the results, we also learn by reading the solution.&lt;/li&gt;
&lt;li&gt;We still think and learn because a lot of times the LLM gives us only leads and we have to test them and continue using the hints and leads we have received. So we will still try to solve the challenges on our own.&lt;/li&gt;
&lt;li&gt;Sometimes we simply request the model to explain a code snippet, a certain technology, etc., and not really ask it to solve the challenge.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="the-models-i-used"&gt;The Models I Used
&lt;/h2&gt;&lt;p&gt;Some of the top and most interesting LLMs that I was familiar with include:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;OpenAI GPT 4.0&lt;/li&gt;
&lt;li&gt;Claude 3 Opus&lt;/li&gt;
&lt;li&gt;Google Gemini Pro 1.5&lt;/li&gt;
&lt;li&gt;Pi - Inflection-2.5&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There are some additional LLMs that I did not test or partially tested. For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Microsoft Copilot, since it uses GPT 4.0 and this model is already part of the comparison, so I assumed there should be no major differences.&lt;/li&gt;
&lt;li&gt;Some LLMs that were just not good enough.&lt;/li&gt;
&lt;li&gt;Google Gemini Ultra 1.0 which should be Google&amp;rsquo;s best model and requires a monthly payment. It is impossible to work with because the security mechanism stops conversations or deletes links many times. It is a bummer since I believe Gemini could help a lot. Here are some of its behaviors:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1666px" data-flex-grow="694" height="244" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/img_1.png" srcset="https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/img_1_hu_60dfd1905cf0b712.png 800w, https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/img_1_hu_353dd3b56ea907ed.png 1600w, https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/img_1.png 1694w" width="1694"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="434px" data-flex-grow="180" height="861" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/img_2.png" srcset="https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/img_2_hu_401d11e3cbb5fced.png 800w, https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/img_2.png 1558w" width="1558"&gt;&lt;/p&gt;
&lt;h2 id="the-comparison"&gt;The Comparison
&lt;/h2&gt;&lt;p&gt;The following table shows which LLMs succeeded in solving the different challenges.&lt;/p&gt;
&lt;p&gt;A couple of notes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The results combine which LLMs succeeded in solving the challenges and how many prompts (hits) it took. The main goal was to understand which model is the best for CTF competitions.&lt;/li&gt;
&lt;li&gt;I usually sent the same prompt to all the LLMs, including the CTF description, any provided files or code, and my request. Also, I gave each of them a similar number of attempts before considering the result as failed.&lt;/li&gt;
&lt;li&gt;The challenges I used for comparison came from different CTFs, which I had already solved or had solutions for. They were mainly Web and Forensics challenges, because these are the categories I usually focus on, but I know it is possible to solve or get help for other categories as well.&lt;/li&gt;
&lt;li&gt;I will provide a general description and notes for each challenge in the section following the table.&lt;/li&gt;
&lt;/ol&gt;
&lt;table style="border-collapse:collapse;width:100%;font-size:0.9em;"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="border:1px solid #717171;padding:8px 10px;"&gt;&lt;/th&gt;
&lt;th style="border:1px solid #717171;padding:8px 10px;"&gt;GPT 4.0&lt;/th&gt;
&lt;th style="border:1px solid #717171;padding:8px 10px;"&gt;Claude Opus&lt;/th&gt;
&lt;th style="border:1px solid #717171;padding:8px 10px;"&gt;Gemini Pro 1.5&lt;/th&gt;
&lt;th style="border:1px solid #717171;padding:8px 10px;"&gt;Pi 2.5&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;"&gt;.git Challenge&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;1 hit (.git and Directory Brute Forcing)&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ff9800;color:#000;"&gt;Directory Brute Forcing&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ff9800;color:#000;"&gt;Directory Brute Forcing&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ff9800;color:#000;"&gt;Directory Brute Forcing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;"&gt;Secret PNG in PDF&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;3 hits&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;3 hits&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;3 hits -instructed to extract only JPEG&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;"&gt;Zip Slip Symlink&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;1 hit&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;1 hit&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;1 hit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;"&gt;JS/LocalStorage Manipulation&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;1 hit&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;1 hit&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;1 hit&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;1 hit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;"&gt;Prototype Pollution&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ff9800;color:#000;"&gt;Only identified&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;5 hits - almost exploited&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ff9800;color:#000;"&gt;Only identified&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ff9800;color:#000;"&gt;Only identified&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;"&gt;Parameter Pollution&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;2 hits&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;1 hit&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;"&gt;Message in RGB Values&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;3 hits&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;"&gt;LLM Token IDs&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ff9800;color:#000;"&gt;Suggested other models&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;"&gt;Hidden Data in ShellBags&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;1 hit&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;"&gt;Prompt Injection #1&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;5 hits&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;2 hits&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;5 hits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;"&gt;Prompt Injection #2&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;7 hits&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#ef5350;color:#000;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #717171;padding:8px 10px;background:#4caf50;color:#000;"&gt;5 hits&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="challenges-descriptions-for-reference-skip-to-conclusions-if-desired"&gt;Challenges Descriptions for Reference (skip to conclusions if desired)
&lt;/h3&gt;&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;.git challenge - There is only access to a simple website. The solution is downloading the .git folder and searching for the flag in previous commits.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Secret PNG in PDF - A PDF file contains a secret PNG with the flag but does not display it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Zip Slip Symlink - A website with the functionality of uploading a ZIP file, extracting it and reading the extracted files. The solution is to upload a ZIP file of a Symbolic link, pointing to the flag&amp;rsquo;s location.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Simple JS/LocalStorage Manipulation - A button that needs to be pressed a many times to reveal the flag and the clicks are stored in the LocalStorage. Everything is on the client side.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Prototype Pollution - A website containing two main functionalities.
Claude Solution (the correct solution is without &amp;ldquo;secret&amp;rdquo;):&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="291px" data-flex-grow="121" height="1199" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/img_3.png" srcset="https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/img_3_hu_cadb7480e7b1b91a.png 800w, https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/img_3.png 1456w" width="1456"&gt;&lt;/p&gt;
&lt;ol start="6"&gt;
&lt;li&gt;Parameter Pollution - A website that allows registering, login, and donating money. As a user, you start with $1000, and can only donate to Jeff Bezos, not other users. The goal is to gain more than a certain amount of money to obtain the flag.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The solution was to create a couple of users and send money to one of them using:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;to=lisanalgaib&amp;amp;to=orel&amp;amp;currency=1000
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ol start="7"&gt;
&lt;li&gt;Message in RGB Values - The challenge provided a small square image with random colors in each pixel:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="240px" data-flex-grow="100" height="19" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/large-language-models-for-ctfs/img_4.png" width="19"&gt;&lt;/p&gt;
&lt;p&gt;The solution is to take each pixel&amp;rsquo;s RGB values, combine them and convert to ascii which will result in a message containing the flag.&lt;/p&gt;
&lt;p&gt;Note: all the tested LLMs mentioned solutions related to RGB values but only ChatGPT suggested to sum them.&lt;/p&gt;
&lt;ol start="8"&gt;
&lt;li&gt;LLM Token IDs - For this challenge we were provided with LLM tokens: [2864, 35, 1182, 37, 90, 28936, 8401, 821, 2957, 5677, 265, 7037, 40933, 29415, 92].&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The solution was to find the correct model that translates these tokens to the flag.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;While ChatGPT didn&amp;rsquo;t solve it, it suggested trying different models and understood it needs to be translated to words/the flag.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For some reason Claude acted like GPT 3.5 and was sure that the flag is UMDCTF{hackerman}&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Gemini 1.5 went too far and suggested unrelated solutions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;And Pi was sure the flag is UMDCTF{DontUnderestimateVladimirHarkonnen} 🤦🏻‍♀️&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="9"&gt;
&lt;li&gt;Hidden Data In ShellBags - The challenge provided a VDI file and we had to find some deleted information that still exists in ShellBags (&lt;a class="link" href="https://www.hackingarticles.in/forensic-investigation-shellbags/" target="_blank" rel="noopener"
 &gt;https://www.hackingarticles.in/forensic-investigation-shellbags/&lt;/a&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Gemini was the only one that suggested a correct and a quick solution.&lt;/li&gt;
&lt;li&gt;Claude was pretty close but its solution did not work for me.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="10"&gt;
&lt;li&gt;Prompt Injection - The LLM should not generate any code.&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Claude Opus did not want to help because of unethical hacking reasons.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="11"&gt;
&lt;li&gt;Prompt Injection - The LLM should not display the password.&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Claude Opus did not want to help because of unethical hacking reasons.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="conclusions-and-final-thoughts"&gt;Conclusions and Final Thoughts
&lt;/h2&gt;&lt;p&gt;In conclusion, here are the results (excluding the partial solutions):&lt;/p&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Model&lt;/th&gt;
					&lt;th&gt;Number of Successes&lt;/th&gt;
					&lt;th&gt;Web Challenges&lt;/th&gt;
					&lt;th&gt;Forensics Challenges&lt;/th&gt;
					&lt;th&gt;Misc Challenges&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;GPT 4.0&lt;/td&gt;
					&lt;td&gt;7&lt;/td&gt;
					&lt;td&gt;3/4&lt;/td&gt;
					&lt;td&gt;3/4&lt;/td&gt;
					&lt;td&gt;1/3&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Claude Opus&lt;/td&gt;
					&lt;td&gt;5&lt;/td&gt;
					&lt;td&gt;4/4&lt;/td&gt;
					&lt;td&gt;1/4&lt;/td&gt;
					&lt;td&gt;0/3&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Gemini Pro 1.5&lt;/td&gt;
					&lt;td&gt;4&lt;/td&gt;
					&lt;td&gt;1/4&lt;/td&gt;
					&lt;td&gt;1/4&lt;/td&gt;
					&lt;td&gt;2/3&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Pi 2.5&lt;/td&gt;
					&lt;td&gt;4&lt;/td&gt;
					&lt;td&gt;2/4&lt;/td&gt;
					&lt;td&gt;0/4&lt;/td&gt;
					&lt;td&gt;2/3&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="general-impression"&gt;General Impression
&lt;/h3&gt;&lt;p&gt;The top models I have found to be the most intelligent were GPT 4.0 and Claude Opus.&lt;/p&gt;
&lt;p&gt;There are two main disadvantages of Claude compared to ChatGPT:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The fact that sometimes it will not help with prompts it perceives as malicious.&lt;/li&gt;
&lt;li&gt;Its inability to run code, which limits its capabilities and sometimes leads to nonsense outputs (similar to GPT 3.5).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Moreover, it seems to me that GPT 4.0 is slightly better. There are times when it understands the context better and mentions one small additional piece of information that makes a huge difference.&lt;/p&gt;
&lt;p&gt;There are some tasks that Gemini was really good with (it is also very good with summarizing the results, the leads and next steps), but in general it is not good enough, especially when comparing to GPT and Claude.&lt;/p&gt;
&lt;p&gt;I really wish I could use Gemini Ultra for this for this, but its limitation makes it irrelevant.&lt;/p&gt;
&lt;p&gt;Although Pi 2.5 is perceived as less intelligent than the others (by intelligence, I mainly mean understanding and staying in context, having sufficient data, and solving the task), there were times it provided surprisingly helpful outputs, sometimes even more than other models.&lt;/p&gt;
&lt;h3 id="performance-by-category"&gt;Performance By Category
&lt;/h3&gt;&lt;p&gt;&lt;strong&gt;ChatGPT&lt;/strong&gt;&amp;rsquo;s results with web and forensics challenges are very good. I believe its poor score in the misc category was due to not trying enough challenges in this category, and because two of the three misc challenges were related to prompt injection, which it seems it is really bad with.&lt;/p&gt;
&lt;p&gt;I actually believe ChatGPT should be good with misc challenges since it has an advantage as it can run and generate pretty good code as I saw in other challenges not mentioned in this article.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Claude&lt;/strong&gt; performed VERY well with the web challenges but quite poor with the forensics challenges. One reason for its poor score in the misc category is its refusal to help with prompts considered malicious (the prompt injection challenges).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Gemini&lt;/strong&gt; and &lt;strong&gt;Pi&lt;/strong&gt; had about the same results across all of categories, so no special comments for them.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;I hope you enjoyed reading.&lt;/p&gt;
&lt;p&gt;Feel free to contact me if you have further insights, different opinions, or anything else.&lt;br&gt;
Orel 🕵🏻‍♀️&lt;/p&gt;</description></item><item><title>UofTCTF 2024 Writeups</title><link>https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/</link><pubDate>Wed, 24 Jan 2024 15:53:03 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/cover.png" alt="Featured image of post UofTCTF 2024 Writeups" /&gt;&lt;p&gt;This time we reached the 83rd place out of 1225 teams, which is a really nice score.&lt;/p&gt;
&lt;p&gt;Although it wasn&amp;rsquo;t a very hard CTF, I found it fun and some of the challenges were challenging.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="295px" data-flex-grow="123" height="577" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_1.png" width="711"&gt;&lt;/p&gt;
&lt;p&gt;Voice Changer - Web&lt;/p&gt;
&lt;p&gt;The Varsity - Web&lt;/p&gt;
&lt;p&gt;No Code - Web&lt;/p&gt;
&lt;p&gt;Guestbook - Web&lt;/p&gt;
&lt;p&gt;Hourglass - Forensics&lt;/p&gt;
&lt;p&gt;Flying High - Osint&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="voice-changer---web"&gt;Voice Changer - Web
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="566px" data-flex-grow="236" height="513" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_2.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_2_hu_4b9606592738cb26.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_2.png 1211w" width="1211"&gt;&lt;/p&gt;
&lt;p&gt;This challenge provided a link to a voice changer web application.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="234px" data-flex-grow="97" height="1465" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_3.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_3_hu_da75ee2c213bc90d.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_3.png 1429w" width="1429"&gt;&lt;/p&gt;
&lt;p&gt;The request contained parameters that were related to the pitch and the uploaded recording.&lt;/p&gt;
&lt;p&gt;In the server&amp;rsquo;s response we can see that the web application used ffmpeg command which is a video/audio handling software, in the operating system shell.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="484px" data-flex-grow="202" height="1442" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_4.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_4_hu_fd4f3e1e1f441c21.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_4_hu_af407a39331d00f8.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_4_hu_73d7b0279b21509f.png 2400w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_4.png 2913w" width="2913"&gt;&lt;/p&gt;
&lt;p&gt;After I analyzed the web app behavior, I noticed it used the &amp;lsquo;pitch&amp;rsquo; parameter as ffmpeg command argument, I tried breaking out of the command execution context and running an additional command.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="713px" data-flex-grow="297" height="958" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_5.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_5_hu_85502d908e3ad198.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_5_hu_361645c929916e68.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_5_hu_a5a732ac19523018.png 2400w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_5.png 2848w" width="2848"&gt;&lt;/p&gt;
&lt;p&gt;uoftctf{Y0UR Pitch IS 70O H!9H}&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="the-varsity---web"&gt;The Varsity - Web
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="344px" data-flex-grow="143" height="757" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_6.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_6_hu_8bc854ffa1513972.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_6.png 1086w" width="1086"&gt;&lt;/p&gt;
&lt;p&gt;In this challenge, we got a website that allows the reading of newspapers, but some of the newspapers are for subscribers.&lt;/p&gt;
&lt;p&gt;We also got the source code.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="265px" data-flex-grow="110" height="990" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_7.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_7_hu_6fcbb9958d8e7923.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_7.png 1094w" width="1094"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="529px" data-flex-grow="220" height="1004" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_8.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_8_hu_236f5af9b45351d0.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_8_hu_9a02a732bc1f2b85.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_8.png 2217w" width="2217"&gt;&lt;/p&gt;
&lt;p&gt;We can see that article 10 is only for subscribers.&lt;/p&gt;
&lt;p&gt;I could not find a way to be a subscriber (bypassing the voucher option in the registration form) so I checked for business logic related bugs.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="231px" data-flex-grow="96" height="1610" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_9.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_9_hu_7a070e5bd288664f.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_9.png 1554w" width="1554"&gt;&lt;/p&gt;
&lt;p&gt;If we enter &amp;lsquo;9&amp;rsquo; (which is actually the 10th issue) as the issue number, the code will enter the second &amp;lsquo;if&amp;rsquo; statement and will return an error.&lt;/p&gt;
&lt;p&gt;However, if we enter &amp;lsquo;9;&amp;rsquo; as the issue number, it will not enter the second &amp;lsquo;if&amp;rsquo; statement because&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;issue&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;returns &amp;lsquo;false&amp;rsquo; as &amp;lsquo;9;&amp;rsquo; cannot be parsed as a number.&lt;/p&gt;
&lt;p&gt;After that, the string &amp;lsquo;9;&amp;rsquo; enters:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;issue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;issue&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &amp;lsquo;issue&amp;rsquo; variable value will be 9 because parseInt() function parses all the input until the first non-numerical character.&lt;/p&gt;
&lt;p&gt;Now, since the &amp;lsquo;issue&amp;rsquo; variable is integer and is in the articles range, it will not enter the next if statement:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;issue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;issue&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;articles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And then it retrieves issue number 9 that contains the flag:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-javascript" data-lang="javascript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;articles&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;issue&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="857px" data-flex-grow="357" height="805" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_10.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_10_hu_9577905acc85e2b4.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_10_hu_c33ee1a9570ff265.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_10_hu_7fb18c5facf125e8.png 2400w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_10.png 2877w" width="2877"&gt;&lt;/p&gt;
&lt;p&gt;uoftctf{w31rd_b3h4v10r_0f_parseInt()!}&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="no-code---web"&gt;No Code - Web
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="378px" data-flex-grow="157" height="706" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_11.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_11_hu_d9d35bce63be2564.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_11.png 1112w" width="1112"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="323px" data-flex-grow="134" height="1024" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_12.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_12_hu_17149fb94b7bcefc.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_12.png 1382w" width="1382"&gt;&lt;/p&gt;
&lt;p&gt;We received a link and a source code of a web application.&lt;/p&gt;
&lt;p&gt;It contains the POST /execution route.&lt;/p&gt;
&lt;p&gt;Using regex, the code checks if the value at the beginning of our string is in the range of the ASCII characters. If the value is within the ASCII range, the program returns an error; otherwise, it executes the code.&lt;/p&gt;
&lt;p&gt;We can see that by forming a POST request and send our code, it returns an error because the characters are within the ASCII range.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="564px" data-flex-grow="235" height="1242" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_13.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_13_hu_d975e59b8fbb51bb.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_13_hu_92684f7b54af0caf.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_13_hu_40ceb2c490556ee.png 2400w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_13.png 2919w" width="2919"&gt;&lt;/p&gt;
&lt;p&gt;However, by adding a newline (using its URL encoded value) at the beginning of our code, it passes the regex check and runs the code.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="583px" data-flex-grow="243" height="1205" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_14.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_14_hu_37f44c50ac2c974d.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_14_hu_9083ea12a95c303c.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_14_hu_be9eecd70e148aad.png 2400w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_14.png 2930w" width="2930"&gt;&lt;/p&gt;
&lt;p&gt;uoftctf{r3g3x_3p1c_f41L_XDDD}&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="guestbook---web"&gt;Guestbook - Web
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="485px" data-flex-grow="202" height="571" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_15.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_15_hu_36fd73a7bd636e58.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_15.png 1156w" width="1156"&gt;&lt;/p&gt;
&lt;p&gt;In this challenge we got an HTML File. I opened it in the browser and in VS code. Note that the sheetID is exposed and we can view only the last entries.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="817px" data-flex-grow="340" height="626" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_16.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_16_hu_a746e572eaaea576.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_16_hu_f1ae8ec5d1e1b90.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_16.png 2132w" width="2132"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="414px" data-flex-grow="172" height="1103" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_17.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_17_hu_4f9cf9ec8559c7dd.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_17_hu_aaebf4e98792fea8.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_17.png 1906w" width="1906"&gt;&lt;/p&gt;
&lt;p&gt;By Googling/using ChatGPT, I understood that I could try accessing a certain sheet using its sheet ID with the following URL: [https://docs.google.com/spreadsheets/d/&lt;a class="link" href="https://docs.google.com/spreadsheets/d/[sheetID%7d/edit" target="_blank" rel="noopener"
 &gt;sheetID}/edit&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I entered this link using the sheet ID in the code and I retrieved the flag.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="538px" data-flex-grow="224" height="938" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_18.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_18_hu_38a92829c277b47b.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_18_hu_3eb02493f7f5d22f.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_18.png 2103w" width="2103"&gt;&lt;/p&gt;
&lt;p&gt;uoftctf{@PP_5cRIP7_!5_s0_coOL}&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="hourglass---forensics"&gt;Hourglass - Forensics
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="323px" data-flex-grow="134" height="515" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_19.png" width="695"&gt;&lt;/p&gt;
&lt;p&gt;This challenge provided an OVA file of Windows 10. According to the description we need to find something suspicious in the system.&lt;/p&gt;
&lt;p&gt;I searched in different areas that might contain interesting or suspicious data.&lt;/p&gt;
&lt;p&gt;I did not find anything until I entered the Task Scheduler and noticed a suspicious task that mention some path (C:\Windows\DiagTrack\Settings\settings.txt)&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="405px" data-flex-grow="168" height="1769" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_20.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_20_hu_168c91cb0d672a04.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_20_hu_1c0d6655e0f079d7.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_20_hu_548d2c0ad9c214e1.png 2400w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_20.png 2986w" width="2986"&gt;&lt;/p&gt;
&lt;p&gt;Here we can see the &amp;rsquo;txt&amp;rsquo; file mentioned in the suspicious task, which looks like a Base64 encoded string.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="547px" data-flex-grow="228" height="985" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_21.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_21_hu_a77e687acdb7dcc1.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_21_hu_904e6f755e72d219.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_21.png 2248w" width="2248"&gt;&lt;/p&gt;
&lt;p&gt;This is the decoded string, which is the flag:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="731px" data-flex-grow="304" height="162" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_22.png" width="494"&gt;&lt;/p&gt;
&lt;p&gt;uoftctf{T4sK_Sch3Dul3r_FUN}&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="flying-high---osint"&gt;Flying High - Osint
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="196px" data-flex-grow="81" height="1413" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_23.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_23_hu_270cc3f1d783c300.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_23.png 1154w" width="1154"&gt;&lt;/p&gt;
&lt;p&gt;So, according to the description, we had to find the airport, airline of the rightmost airplane, and airplane model.&lt;/p&gt;
&lt;p&gt;This is the image we got:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="378px" data-flex-grow="157" height="1614" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_24.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_24_hu_8e7c981c0836849a.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_24_hu_182db27dbfe33f7f.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_24_hu_7f88e728e3157480.png 2400w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_24.png 2546w" width="2546"&gt;&lt;/p&gt;
&lt;p&gt;By zooming in we can see that there is some kind of hangar with &amp;lsquo;NOVESPACE&amp;rsquo; written on it.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="466px" data-flex-grow="194" height="830" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_25.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_25_hu_7ea9ccce68eb310e.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_25_hu_6fae29b7464469ba.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_25.png 1615w" width="1615"&gt;&lt;/p&gt;
&lt;p&gt;Googling &amp;rsquo;novespace airports&amp;rsquo; result in this web page. It says that this company operates mainly for scientific and technical research programs and &lt;strong&gt;it&amp;rsquo;s based in Bordeaux-Merignac Airport.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="726px" data-flex-grow="302" height="1075" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_26.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_26_hu_75ad28ec71595f39.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_26_hu_4d141787edc4ab83.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_26_hu_d71675099cdb563e.png 2400w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_26.png 3256w" width="3256"&gt;&lt;/p&gt;
&lt;p&gt;After searching this airport in Google Maps, we can notice that there is a place called Novespace. By clicking on it, we arrive the the same place as in the image.&lt;/p&gt;
&lt;p&gt;We can notice that this image if from July 2012.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="316px" data-flex-grow="131" height="1300" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_27.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_27_hu_d256d6590baf8644.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_27_hu_47572b4489450b78.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_27.png 1714w" width="1714"&gt;&lt;/p&gt;
&lt;p&gt;Regarding the airline company, it was pretty easy to find it by google searching its logo description.&lt;/p&gt;
&lt;p&gt;For the aircraft model, I tried all of the current aircrafts they use unsuccessfully, but then I remembered that the photo was taken in 2012 so I searched in the former fleet section. I tried a couple of models that were used in 2012 until I got the correct one.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="386px" data-flex-grow="161" height="1165" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_28.png" srcset="https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_28_hu_df5025ed7881920e.png 800w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_28_hu_19d89157c82904ab.png 1600w, https://blog.thesecuritywind.com/post/uoftctf-2024-writeups/img_28.png 1878w" width="1878"&gt;&lt;/p&gt;
&lt;p&gt;Thank you for reading. I hope you learned something new.&lt;br&gt;
Orel 🪷&lt;/p&gt;</description></item><item><title>MetaRed CTF Argentina</title><link>https://blog.thesecuritywind.com/post/metared-ctf-argentina/</link><pubDate>Sat, 28 Oct 2023 01:32:55 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/metared-ctf-argentina/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/cover.png" alt="Featured image of post MetaRed CTF Argentina" /&gt;&lt;p&gt;In this CTF we finished in 26th place.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="321px" data-flex-grow="134" height="547" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_1.png" width="733"&gt;&lt;/p&gt;
&lt;p&gt;Here are two writeups of challenges I have solved.&lt;/p&gt;
&lt;p&gt;I didn&amp;rsquo;t put many screenshots since the CTF was down not long after it was ended.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Shuffle - Forensics&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Extracttheflag! - Web&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id="shuffle---forensics"&gt;Shuffle - Forensics
&lt;/h2&gt;&lt;p&gt;I was provided with a binary file.&lt;/p&gt;
&lt;p&gt;I tried to identify what this file is using the &amp;lsquo;file&amp;rsquo; command but it could not identify it.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1054px" data-flex-grow="439" height="198" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_2.png" srcset="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_2_hu_3878fbdf52c672d.png 800w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_2.png 870w" width="870"&gt;&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;&amp;lsquo;File&amp;rsquo; command usually checks Magic Numbers and the Magic File to determine the file type.&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;&amp;ldquo;Magic bytes&amp;rdquo; are a sequence of bytes that appear at the beginning of a file and are used to identify the type of the file. This sequence of bytes is sometimes called a &amp;ldquo;magic number&amp;rdquo; or &amp;ldquo;file signature&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;For example, these are the magic bytes of a PNG file (left: Hex, right: ASCII)&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1954px" data-flex-grow="814" height="175" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_3.png" srcset="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_3_hu_d84fd3006bb06ec0.png 800w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_3.png 1425w" width="1425"&gt;&lt;/p&gt;
&lt;p&gt;(Here&amp;rsquo;s a large list of different magic bytes: &lt;a class="link" href="https://www.garykessler.net/library/file_sigs.html" target="_blank" rel="noopener"
 &gt;https://www.garykessler.net/library/file_sigs.html)&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;I opened it in Notepad++:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="597px" data-flex-grow="248" height="745" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_4.png" srcset="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_4_hu_ec95fabbee1caec.png 800w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_4_hu_aab0b0efab939a04.png 1600w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_4.png 1855w" width="1855"&gt;&lt;/p&gt;
&lt;p&gt;It looks like a PNG file. We can understand it from the beginning of the file, which looks like the Magic Bytes of a PNG file type (as shown before), but something is broken. From my experience, I know that the &amp;ldquo;PNG&amp;rdquo; ASCII characters should be on the same line.&lt;/p&gt;
&lt;p&gt;After trying to change it manually without success I opened the file in &amp;lsquo;010 Editor&amp;rsquo; (a great hex editor):&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="589px" data-flex-grow="245" height="721" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_5.png" srcset="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_5_hu_ee513c48f90fc768.png 800w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_5_hu_74e772b0fa443be.png 1600w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_5.png 1772w" width="1772"&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s examine the hexadecimal sequence for the beginning of a PNG file and identify any discrepancies.&lt;/p&gt;
&lt;p&gt;The sequence of a PNG file type should always start with the following hexadecimal sequence:&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52.&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;This sequence is the magic bytes and the beginning of the IHDR chunk.&lt;/p&gt;
&lt;p&gt;Wait, what is IHDR chunk? What are chunks?&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;&amp;ldquo;Chunks&amp;rdquo; are the building blocks of the file format. A PNG file is made up of multiple chunks, each of which conveys certain information about the image or the data it contains.&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;For example, some of the chunks for PNG file are IHDR, PLTE, IDAT, sRGB and many more.&lt;/p&gt;
&lt;p&gt;This is the chunks structure &lt;strong&gt;for PNG file:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Length: A 4-byte integer that specifies the &lt;strong&gt;length&lt;/strong&gt; of the **data field **of the chunk (number of bytes dedicated to it.&lt;/li&gt;
&lt;li&gt;Type: A 4-byte chunk type code. For example, &amp;ldquo;IHDR&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;Data: The actual data bytes of the chunk.&lt;/li&gt;
&lt;li&gt;CRC: A 4-byte code to check if chunk data has changed.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For example, these are the length and type section of the IHDR chunk which always stay the same (0x08-0x0B, 0x0C-0x0F respectively):&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="397px" data-flex-grow="165" height="1167" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_6.png" srcset="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_6_hu_6d9e5f13f0128f8f.png 800w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_6_hu_27f72e707cd87dd1.png 1600w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_6.png 1935w" width="1935"&gt;&lt;/p&gt;
&lt;p&gt;So&amp;hellip; back to the challenge, the initial sequence (first 16 bytes - file type signature and some sections of the IHDR chunk) always remains the same.&lt;/p&gt;
&lt;p&gt;However, in this case, it appears to be shuffled:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="2634px" data-flex-grow="1097" height="172" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_7.png" srcset="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_7_hu_6094c03348b628c.png 800w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_7_hu_82fbf02cd2afb5ea.png 1600w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_7.png 1888w" width="1888"&gt;&lt;/p&gt;
&lt;p&gt;Initially, I attempted to manually correct the sequence, but the image remained corrupted.&lt;/p&gt;
&lt;p&gt;I realized I might have to correct the entire hexadecimal sequence. But I can&amp;rsquo;t determine the original sequence unless there&amp;rsquo;s a pattern. Maybe some of the hexadecimal values were swapped with each other. Let&amp;rsquo;s manually fix the sequences that I already know (those that are always the same), and see if there&amp;rsquo;s a clear pattern in the shuffling:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="807px" data-flex-grow="336" height="525" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_8.png" srcset="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_8_hu_5d677be8244a1201.png 800w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_8_hu_6db8df356bbedaee.png 1600w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_8.png 1766w" width="1766"&gt;&lt;/p&gt;
&lt;p&gt;The orange text marks the hex that I manually fixed.&lt;/p&gt;
&lt;p&gt;It seems that the shuffle goes in this pattern:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Keep the first 2 bytes as they are.&lt;/li&gt;
&lt;li&gt;Replace the 3rd byte with the 5th.&lt;/li&gt;
&lt;li&gt;Replace the 4th byte with the 6th.&lt;/li&gt;
&lt;li&gt;Continue this pattern for the entire file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I asked ChatGPT to create a script for me to reshuffle the bytes using the pattern I provided:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="627px" data-flex-grow="261" height="1382" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_9.png" srcset="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_9_hu_fb43b373a276f5e1.png 800w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_9_hu_a49c04d6a67e249d.png 1600w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_9_hu_63088c1ba8016d8.png 2400w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_9.png 3612w" width="3612"&gt;&lt;/p&gt;
&lt;p&gt;I opened the new file, and I got the original file:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="427px" data-flex-grow="178" height="988" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_10.png" srcset="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_10_hu_fe96112ed3b3a420.png 800w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_10_hu_6bec3f205076d1db.png 1600w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_10.png 1761w" width="1761"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="extracttheflag---web"&gt;Extracttheflag! - Web
&lt;/h2&gt;&lt;p&gt;I&amp;rsquo;ve got the source code of a PHP page. Here are the interesting parts:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="746px" data-flex-grow="310" height="321" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_11.png" srcset="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_11_hu_3480eb65d26da302.png 800w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_11.png 998w" width="998"&gt;&lt;/p&gt;
&lt;p&gt;A session is started, and the admin session variable is set to false.&lt;/p&gt;
&lt;p&gt;I checked what the extract() function is.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="561px" data-flex-grow="233" height="1079" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_12.png" srcset="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_12_hu_f535ed0e6a6fde26.png 800w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_12_hu_6383007c7feb0f6b.png 1600w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_12_hu_ecd586056b5c9168.png 2400w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_12.png 2524w" width="2524"&gt;&lt;/p&gt;
&lt;p&gt;Note that it&amp;rsquo;s insecure to use untrusted data for this function from user input.&lt;/p&gt;
&lt;p&gt;In PHP, the extract($_POST) function is used to convert POST request data into corresponding internal variables.&lt;/p&gt;
&lt;p&gt;When PHP runs the extract() function on the $_POST array, it creates variables that mirror the array&amp;rsquo;s contents. This can pose a security risk if extract() ends up overwriting pre-existing variables, which, in our scenario, is exactly what happens.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="610px" data-flex-grow="254" height="636" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_13.png" srcset="https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_13_hu_4ebbf9b36932500f.png 800w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_13_hu_4e5c20bb27019d0.png 1600w, https://blog.thesecuritywind.com/post/metared-ctf-argentina/img_13.png 1619w" width="1619"&gt;&lt;/p&gt;
&lt;p&gt;According to this code part, my session&amp;rsquo;s admin variable should be true in order to see the flag.&lt;/p&gt;
&lt;p&gt;Sending a POST request with _SESSION[&amp;lsquo;admin&amp;rsquo;] set as &amp;rsquo;true&amp;rsquo;, would cause the session admin variable to be rewritten and the flag would be exposed:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl &lt;span class="s1"&gt;&amp;#39;https://extracttheflag.ctf.cert.unlp.edu.ar&amp;#39;&lt;/span&gt; -X POST -d _SESSION&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;admin&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;]=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel 🧩&lt;/p&gt;</description></item><item><title>DEADFACE CTF 2023</title><link>https://blog.thesecuritywind.com/post/deadface-ctf-2023/</link><pubDate>Tue, 24 Oct 2023 00:09:15 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/deadface-ctf-2023/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/deadface-ctf-2023/cover.png" alt="Featured image of post DEADFACE CTF 2023" /&gt;&lt;p&gt;The theme of this CTF was an evil hacker group called &amp;ldquo;DEADFACE&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Additionally, there were some other groups and companies that were part of the storyline.&lt;/p&gt;
&lt;p&gt;The CTF contained many challenges, many of which I would define as beginner-intermediate level.&lt;/p&gt;
&lt;p&gt;We reached 70th place out of 1100 teams.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;shout out to the admins on being very friendly&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="282px" data-flex-grow="117" height="406" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_1.png" width="478"&gt;&lt;/p&gt;
&lt;p&gt;This blog post will contain 3 forensics/steganography challenges that I solved:&lt;/p&gt;
&lt;p&gt;Syncopated Beat - Steganography&lt;/p&gt;
&lt;p&gt;Tin Balloon - Forensics&lt;/p&gt;
&lt;p&gt;Electric Steel - Steganography&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="syncopated-beat---steganography"&gt;Syncopated Beat - Steganography
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="230px" data-flex-grow="96" height="1221" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_2.png" srcset="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_2_hu_4cf6697791dbf683.png 800w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_2.png 1173w" width="1173"&gt;&lt;/p&gt;
&lt;p&gt;I downloaded a zip that contained two audio files:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="2057px" data-flex-grow="857" height="190" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_3.png" srcset="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_3_hu_2aa99e3917f161e8.png 800w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_3_hu_6c429709e87e362c.png 1600w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_3.png 1629w" width="1629"&gt;&lt;/p&gt;
&lt;p&gt;I played the first audio file and in the middle of it, there was a part that was sound like a reversed audio,&lt;/p&gt;
&lt;p&gt;I opened Audacity, reversed that part and it said that I have to use the steganography software from Mr. Robot and the password for the file is the new CEO of Evil Corp, I googled both things, and found that there&amp;rsquo;s a software called DeepSound.&lt;/p&gt;
&lt;p&gt;I opened the second audio using this software.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="270px" data-flex-grow="112" height="1103" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_4.png" srcset="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_4_hu_53f9e27c23874b87.png 800w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_4.png 1245w" width="1245"&gt;&lt;/p&gt;
&lt;p&gt;I used the password and extracted the hidden file.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="547px" data-flex-grow="228" height="403" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_5.png" srcset="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_5_hu_d7af32139d94b2b3.png 800w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_5.png 919w" width="919"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="tin-balloon---forensics"&gt;Tin Balloon - Forensics
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="168px" data-flex-grow="70" height="1689" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_6.png" srcset="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_6_hu_c95601c0aa235253.png 800w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_6.png 1183w" width="1183"&gt;&lt;/p&gt;
&lt;p&gt;After downloading the zip file, there are two files - an audio and a doc file.&lt;/p&gt;
&lt;p&gt;The doc file was encrypted with a password and once again, part of the audio sounded strange.&lt;/p&gt;
&lt;p&gt;I opened the audio with Audacity, trimmed the part I wanted, used the spectrogram option, and found the doc&amp;rsquo;s password which contained the flag.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="358px" data-flex-grow="149" height="918" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_7.png" srcset="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_7_hu_8bed11183f082cfc.png 800w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_7.png 1372w" width="1372"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="electric-steel---steganography"&gt;Electric Steel - Steganography
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="303px" data-flex-grow="126" height="934" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_8.png" srcset="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_8_hu_ff197af4d6e601c4.png 800w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_8.png 1183w" width="1183"&gt;&lt;/p&gt;
&lt;p&gt;I downloaded the image:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="301px" data-flex-grow="125" height="1072" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_9.png" srcset="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_9_hu_fdca7a86f2e938c.png 800w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_9.png 1346w" width="1346"&gt;&lt;/p&gt;
&lt;p&gt;I used binwalk tool to search for hidden files:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1097px" data-flex-grow="457" height="553" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_10.png" srcset="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_10_hu_acf15db39a5cab11.png 800w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_10_hu_31235fdfba70f36f.png 1600w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_10_hu_32be71c0febcb652.png 2400w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_10.png 2529w" width="2529"&gt;&lt;/p&gt;
&lt;p&gt;One of the hidden files was tar file:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1047px" data-flex-grow="436" height="357" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_11.png" srcset="https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_11_hu_60896cb469a60ba8.png 800w, https://blog.thesecuritywind.com/post/deadface-ctf-2023/img_11.png 1558w" width="1558"&gt;&lt;/p&gt;
&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel 🍵&lt;/p&gt;</description></item><item><title>UMDCTF 2023</title><link>https://blog.thesecuritywind.com/post/umdctf-2023/</link><pubDate>Tue, 02 May 2023 15:25:44 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/umdctf-2023/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/umdctf-2023/cover.png" alt="Featured image of post UMDCTF 2023" /&gt;&lt;p&gt;Together with members of the Hallios community and CyberSecMaverick, I participated in UMDCTF 2023.&lt;/p&gt;
&lt;p&gt;The CTF theme was Pokémon and I really liked its design and style of the website and challenges themselves.&lt;/p&gt;
&lt;p&gt;We reached 86th place which is a respectable position for this CTF.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="275px" data-flex-grow="114" height="607" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_1.png" width="696"&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll mainly share writeups of challenges I solved that I found interesting.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Web - pop calc&lt;/li&gt;
&lt;li&gt;Web - notsogeo&lt;/li&gt;
&lt;li&gt;Misc - ChungusBot v3&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id="web---pop-calc"&gt;WEB - pop calc
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="314px" data-flex-grow="131" height="1013" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_2.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_2_hu_f930f5bc6eba4ff5.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_2.png 1328w" width="1328"&gt;&lt;/p&gt;
&lt;p&gt;The challenge provided a link to a web application:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="307px" data-flex-grow="128" height="1144" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_3.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_3_hu_66221a15600a83be.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_3.png 1465w" width="1465"&gt;&lt;/p&gt;
&lt;p&gt;Trying to make valid operations resulted in this HTTP request/response (I deleted some of the request headers only for the writeup):&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="517px" data-flex-grow="215" height="809" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_4.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_4_hu_eb432785edbba92a.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_4_hu_86d871715989f81.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_4.png 1743w" width="1743"&gt;&lt;/p&gt;
&lt;p&gt;Performing invalid calculation resulted in an error and reflects the input:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="435px" data-flex-grow="181" height="1114" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_5.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_5_hu_760b0181476cc06b.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_5_hu_83ff68b130fe4c2.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_5.png 2023w" width="2023"&gt;&lt;/p&gt;
&lt;p&gt;I tried to understand the system behavior, tried various injections (sqli, ssti, etc.), sent fuzzed inputs and tried many different kinds of attacks unsuccessfully.&lt;/p&gt;
&lt;p&gt;Trying SSTI:&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;An SSTI (Server-Side Template Injection) vulnerability is a type of security weakness found in web applications. When a web application uses templates to generate dynamic content, it may allow user input to be included in the template without proper validation or sanitization. This could potentially allow an attacker to inject malicious code into the template, which is then executed on the server-side when the page is rendered.&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="331px" data-flex-grow="138" height="1462" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_6.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_6_hu_c6e3b28f3174e338.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_6_hu_c8d5c6bf04dca664.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_6.png 2019w" width="2019"&gt;&lt;/p&gt;
&lt;p&gt;I didn&amp;rsquo;t find anything interesting (except the internal server error.&lt;/p&gt;
&lt;p&gt;I had fallen asleep and I dreamt about sending some input which caused the server returning information about a service called &amp;lsquo;pop&amp;rsquo; 🤷🏻‍♀️.&lt;/p&gt;
&lt;p&gt;I woke up and thought a little bit. I looked at my SSTI payload and noticed that my payload&amp;rsquo;s syntax might be incorrect.&lt;/p&gt;
&lt;p&gt;I sent a different payload:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="392px" data-flex-grow="163" height="1253" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_7.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_7_hu_d193333bc1ca811.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_7_hu_5ec05da6133b07dc.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_7.png 2051w" width="2051"&gt;&lt;/p&gt;
&lt;p&gt;Now I am 100% sure it&amp;rsquo;s an SSTI issue.&lt;/p&gt;
&lt;p&gt;I checked Hacktricks for payloads and tips and used an RCE payload to read the flag.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="492px" data-flex-grow="205" height="1336" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_8.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_8_hu_6c0d37d066a245a1.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_8_hu_628ceacd75e26bd6.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_8_hu_ba5388c6b40ea801.png 2400w, https://blog.thesecuritywind.com/post/umdctf-2023/img_8.png 2739w" width="2739"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="web---notsogeo"&gt;WEB - notsogeo
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="250px" data-flex-grow="104" height="1125" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_9.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_9_hu_6bfe1e86da7e743e.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_9.png 1172w" width="1172"&gt;&lt;/p&gt;
&lt;p&gt;This challenge generally asks us to cheat on GeoGuessr games.&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;GeoGuessr is an online geography game that uses Google Street View to place players in random locations worldwide. Players must guess their location by examining the environment for clues and then placing a pin on a world map.&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;The challenge provides a source code of a version of this game.&lt;/p&gt;
&lt;p&gt;Using the source code, we can try to identify a way to guess our coordinates and guess our correct location on the world map.&lt;/p&gt;
&lt;p&gt;I entered into the game.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="367px" data-flex-grow="153" height="1140" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_10.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_10_hu_57f3560e3d663888.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_10_hu_baa9c24a69f4525f.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_10.png 1745w" width="1745"&gt;&lt;/p&gt;
&lt;p&gt;The game source code:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="454px" data-flex-grow="189" height="1208" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_11.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_11_hu_cabaeab3701e14e.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_11_hu_72538fd49dd6f2b0.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_11.png 2288w" width="2288"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="699px" data-flex-grow="291" height="938" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_12.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_12_hu_f495897677ac3944.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_12_hu_3e9f7f7b5b99e108.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_12_hu_a560e76abe659938.png 2400w, https://blog.thesecuritywind.com/post/umdctf-2023/img_12.png 2735w" width="2735"&gt;&lt;/p&gt;
&lt;p&gt;From the challs.json file and other files, it can be understood that those are the locations that will be part of the game.&lt;/p&gt;
&lt;p&gt;We have to guess the correct coordinates to get the flag.&lt;/p&gt;
&lt;p&gt;The locations consist of &amp;lsquo;pano&amp;rsquo; (id of the location) and coordinates. However, we don&amp;rsquo;t have access to the files.&lt;/p&gt;
&lt;p&gt;Going through the HTTP requests, I could not find the coordinates. However, I kept seeing something called &amp;ldquo;panoid&amp;rdquo; which sounded like the location ID.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1122px" data-flex-grow="467" height="585" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_13.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_13_hu_80452a90a3675525.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_13_hu_af14072b382ae3c1.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_13_hu_80b6185820beb6a4.png 2400w, https://blog.thesecuritywind.com/post/umdctf-2023/img_13.png 2735w" width="2735"&gt;&lt;/p&gt;
&lt;p&gt;Searching Google &amp;ldquo;Find coordinates by panoid&amp;rdquo; results in this Google Street View documentation:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1154px" data-flex-grow="481" height="463" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_14.jpg" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_14_hu_d524b89d0bd9f499.jpg 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_14_hu_6b3f7dcee6516fda.jpg 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_14.jpg 2228w" width="2228"&gt;&lt;/p&gt;
&lt;p&gt;So we got the &amp;lsquo;panoid&amp;rsquo; and have to find the Google Maps key. Searching for the term &amp;ldquo;key=&amp;rdquo; results in this:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="356px" data-flex-grow="148" height="963" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_15.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_15_hu_ef6263f33c1e186f.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_15.png 1430w" width="1430"&gt;&lt;/p&gt;
&lt;p&gt;Constructing the URL we found in the Google Street View documentation by adding the &amp;lsquo;panoid&amp;rsquo; and &amp;lsquo;key&amp;rsquo; values, gives us the coordinates.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="766px" data-flex-grow="319" height="525" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_16.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_16_hu_4ea9fa1dbadbfc89.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_16_hu_7b38eae9193d345.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_16.png 1676w" width="1676"&gt;&lt;/p&gt;
&lt;p&gt;Using the coordinates, we select to correct location on the map and get the key :)&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="misc---chungusbot-v3"&gt;MISC - &lt;a class="link" href="https://umdctf.io/challenges#ChungusBot%20v3-44" target="_blank" rel="noopener"
 &gt;ChungusBot v3&lt;/a&gt;
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="358px" data-flex-grow="149" height="810" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_17.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_17_hu_a2e5c91307c12d04.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_17.png 1209w" width="1209"&gt;&lt;/p&gt;
&lt;p&gt;We can find the Discord bot source code in Github.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="649px" data-flex-grow="270" height="921" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_18.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_18_hu_a6791711ad360453.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_18_hu_fa3d566ee98e6d4a.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_18_hu_d2392fabbe4a6f0d.png 2400w, https://blog.thesecuritywind.com/post/umdctf-2023/img_18.png 2492w" width="2492"&gt;&lt;/p&gt;
&lt;p&gt;Reading the source code we can understand that the flag is divided to four parts.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="620px" data-flex-grow="258" height="567" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_19.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_19_hu_c9a041db18a7d48f.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_19.png 1465w" width="1465"&gt;&lt;/p&gt;
&lt;p&gt;The first part asks to send the URL in the code (which translates to a gif).&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="884px" data-flex-grow="368" height="549" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_20.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_20_hu_47fc5b201493ef78.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_20_hu_2ecfccdab416cf14.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_20.png 2024w" width="2024"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="275px" data-flex-grow="114" height="1014" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_21.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_21_hu_b35456810b57c55a.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_21.png 1165w" width="1165"&gt;&lt;/p&gt;
&lt;p&gt;The second part of the flag will be revealed after we guess the correct coin random flips.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="590px" data-flex-grow="246" height="582" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_22.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_22_hu_8aefda0740826046.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_22.png 1432w" width="1432"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="601px" data-flex-grow="250" height="353" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_23.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_23_hu_1ec3c5c695f998df.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_23.png 884w" width="884"&gt;&lt;/p&gt;
&lt;p&gt;Third part will be revealed after we send four numbers that will answer the following sentence.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="916px" data-flex-grow="381" height="288" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_24.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_24_hu_51dde2f986c93a8d.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_24.png 1100w" width="1100"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="672px" data-flex-grow="280" height="337" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_25.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_25_hu_dee22e3364432a9a.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_25.png 945w" width="945"&gt;&lt;/p&gt;
&lt;p&gt;The fourth part will be revealed after sending a file that will contain the text &amp;ldquo;You like jazz?&amp;rdquo; and will be 100 or more characters long.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="691px" data-flex-grow="288" height="589" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_26.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_26_hu_dfbfebdc36b252eb.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_26_hu_1c5c75b3159a96a4.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_26.png 1697w" width="1697"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="702px" data-flex-grow="292" height="696" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/umdctf-2023/img_27.png" srcset="https://blog.thesecuritywind.com/post/umdctf-2023/img_27_hu_4829e6b592e02003.png 800w, https://blog.thesecuritywind.com/post/umdctf-2023/img_27_hu_4335b631e517351b.png 1600w, https://blog.thesecuritywind.com/post/umdctf-2023/img_27.png 2036w" width="2036"&gt;&lt;/p&gt;
&lt;p&gt;Now we have obtained all the flag parts :)&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel 👒&lt;/p&gt;</description></item><item><title>Space Heroes CTF</title><link>https://blog.thesecuritywind.com/post/space-heroes-ctf/</link><pubDate>Mon, 24 Apr 2023 15:24:55 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/space-heroes-ctf/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/space-heroes-ctf/cover.png" alt="Featured image of post Space Heroes CTF" /&gt;&lt;p&gt;Playing with Cyber R0nin team,&lt;/p&gt;
&lt;p&gt;Here are several writeups of some of the challenges:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;attack-strategies - WEB&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Bank-of-Knowhere - WEB&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Bynary Encoding - Crypto&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Time Leap - Forensics&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id="attack-strategies---web"&gt;attack-strategies - WEB
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="301px" data-flex-grow="125" height="544" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_1.png" width="684"&gt;&lt;/p&gt;
&lt;p&gt;Entering the link, we can see that we can choose a folder and a file. Also, we see that there is a &amp;lsquo;show_hidden&amp;rsquo; cookie set to &amp;lsquo;false&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="406px" data-flex-grow="169" height="796" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_2.png" srcset="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_2_hu_5cb0cb84c0e0e75.png 800w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_2.png 1348w" width="1348"&gt;&lt;/p&gt;
&lt;p&gt;After changing the cookie&amp;rsquo;s value to &amp;rsquo;true&amp;rsquo; we can see the updated &amp;lsquo;folder&amp;rsquo; list, and that flag.txt exists there.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="432px" data-flex-grow="180" height="430" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_3.png" width="775"&gt;&lt;/p&gt;
&lt;p&gt;Choosing flag.txt returns an internal server error&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="693px" data-flex-grow="289" height="624" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_4.png" srcset="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_4_hu_9f267c63cc5e46ad.png 800w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_4_hu_e1365be270947913.png 1600w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_4.png 1804w" width="1804"&gt;&lt;/p&gt;
&lt;p&gt;Pressing &amp;lsquo;View&amp;rsquo; returns a general error that indicates that the file/folder does not exist.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="531px" data-flex-grow="221" height="731" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_5.png" srcset="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_5_hu_7c7c7b1f5f77fa72.png 800w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_5_hu_d553275e2765f41c.png 1600w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_5.png 1620w" width="1620"&gt;&lt;/p&gt;
&lt;p&gt;I assume it&amp;rsquo;s because of the fact that flag.txt is not a folder but a file.&lt;/p&gt;
&lt;p&gt;So I&amp;rsquo;ll try to use LFI to retrieve this file.&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;LFI (Local File Inclusion) is a security issue where attackers include local server files in a web application&amp;rsquo;s output, exposing sensitive info. &amp;ldquo;../&amp;rdquo; is used to move up one level in
the directories structure, helping them access unintended files.&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="352px" data-flex-grow="146" height="1238" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_6.png" srcset="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_6_hu_c9ea149fc0999827.png 800w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_6_hu_c6a35ad4fbcc587f.png 1600w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_6.png 1817w" width="1817"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="bank-of-knowhere---web"&gt;Bank-of-Knowhere - WEB
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="278px" data-flex-grow="116" height="621" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_7.png" width="721"&gt;&lt;/p&gt;
&lt;p&gt;As the challenge description says, only those with at least $2000 are in the inner circle and can get the secret information.&lt;/p&gt;
&lt;p&gt;We can see that we have $850.&lt;/p&gt;
&lt;p&gt;I had two ideas - trying to gain more money or trying to retrieve other users&amp;rsquo; information.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="382px" data-flex-grow="159" height="836" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_8.png" srcset="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_8_hu_8e9e8c2fe99310dd.png 800w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_8.png 1331w" width="1331"&gt;&lt;/p&gt;
&lt;p&gt;This is the money transfer request. I tried to send myself money from other usernames, tried to play with the amount, SQL injection, and various attacks but they didn&amp;rsquo;t work.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="564px" data-flex-grow="235" height="772" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_9.png" srcset="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_9_hu_ede98e595f09f5d4.png 800w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_9_hu_be232d472af744bd.png 1600w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_9.png 1815w" width="1815"&gt;&lt;/p&gt;
&lt;p&gt;Trying to send money to myself (Groot) from another username (Rocket) caused an error.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="542px" data-flex-grow="226" height="806" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_10.png" srcset="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_10_hu_ff4f7afaea4b73b8.png 800w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_10_hu_7c1535b90bf1eb8.png 1600w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_10.png 1823w" width="1823"&gt;&lt;/p&gt;
&lt;p&gt;The solution to this challenge is Parameter Pollution.&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;Parameter Pollution is a security flaw where attackers manipulate web app inputs by injecting extra parameters, causing unexpected behavior and potentially gaining unauthorized access.&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;In the context of this challenge, sending two of the same &amp;lsquo;receiver&amp;rsquo; parameter bypasses the server&amp;rsquo;s restriction. Probably because the check is for the first &amp;lsquo;receiver&amp;rsquo; parameter and it sends money to the last &amp;lsquo;receiver&amp;rsquo; parameter.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="540px" data-flex-grow="225" height="816" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_11.png" srcset="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_11_hu_ed04462aa4a46d0c.png 800w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_11_hu_e9e03f69132d74c1.png 1600w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_11.png 1839w" width="1839"&gt;&lt;/p&gt;
&lt;p&gt;Now we have more than $2000.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="985px" data-flex-grow="410" height="312" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_12.png" srcset="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_12_hu_931dd7f27fe6f481.png 800w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_12.png 1281w" width="1281"&gt;&lt;/p&gt;
&lt;p&gt;I still didn&amp;rsquo;t see the flag, and I tried to enter different directories like &amp;lsquo;/flag&amp;rsquo;, &amp;lsquo;circle&amp;rsquo;, etc. but didn&amp;rsquo;t find anything. After brute-forcing different directories, I saw that the robots.txt file exists and contains the directory /admin.php&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="347px" data-flex-grow="144" height="676" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_13.png" srcset="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_13_hu_7d08678eca1e1dfb.png 800w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_13.png 979w" width="979"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="bynary-encoding---crypto"&gt;Bynary Encoding - Crypto
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="309px" data-flex-grow="129" height="533" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_14.png" width="688"&gt;&lt;/p&gt;
&lt;p&gt;After downloading the file, it looks empty with a lot of spaces, but trying to delve a little deeper we can notice that the text is tabs and spaces. Combining it with the challenge name and description, we can assume that it&amp;rsquo;s related to binary (base 2).&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="151px" data-flex-grow="63" height="1183" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_15.png" width="749"&gt;&lt;/p&gt;
&lt;p&gt;Replacing spaces with 0 and tabs with 1 results in this:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="73px" data-flex-grow="30" height="1152" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_16.png" width="353"&gt;&lt;/p&gt;
&lt;p&gt;Converting it to text:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="181px" data-flex-grow="75" height="1307" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_17.png" srcset="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_17_hu_fc56243ef3be4674.png 800w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_17.png 987w" width="987"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="time-leap---forensics"&gt;Time Leap - Forensics
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="238px" data-flex-grow="99" height="738" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_18.png" width="734"&gt;&lt;/p&gt;
&lt;p&gt;After downloading the file and decompressing it, we got an .img file which we can&amp;rsquo;t load normally (at least I couldn&amp;rsquo;t when I tried). I opened it with Autopsy and saw the flag as a deleted gif file:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="358px" data-flex-grow="149" height="1174" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_19.png" srcset="https://blog.thesecuritywind.com/post/space-heroes-ctf/img_19_hu_6899e2358d16ebd8.png 800w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_19_hu_bc0aeaeed825a886.png 1600w, https://blog.thesecuritywind.com/post/space-heroes-ctf/img_19.png 1755w" width="1755"&gt;&lt;/p&gt;
&lt;p&gt;I hope you enjoyed,&lt;br&gt;
Orel 🎍&lt;/p&gt;</description></item><item><title>BDSEC 2022 CTF Writeups</title><link>https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/</link><pubDate>Thu, 21 Jul 2022 18:34:48 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/cover.png" alt="Featured image of post BDSEC 2022 CTF Writeups" /&gt;&lt;p&gt;I will share my way of thinking and how I solved two challenges.&lt;/p&gt;
&lt;p&gt;Dominoes (Cryptography - 50)&lt;/p&gt;
&lt;p&gt;Knight Squad Shop (web - 100 points)&lt;/p&gt;
&lt;h2 id="dominoes-cryptography---50-points"&gt;Dominoes (Cryptography - 50 points)
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="284px" data-flex-grow="118" height="401" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_1.png" width="475"&gt;&lt;/p&gt;
&lt;p&gt;We got the encrypted flag:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="704px" data-flex-grow="293" height="75" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_2.png" width="220"&gt;&lt;/p&gt;
&lt;p&gt;And we got the python code which encrypted the flag.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="201px" data-flex-grow="84" height="686" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_3.png" width="577"&gt;&lt;/p&gt;
&lt;p&gt;Red mark: reads the flag and then sends it to the encryption function (y).&lt;/p&gt;
&lt;p&gt;Green mark: (I replaced an obfuscated character with &amp;ldquo;clearText&amp;rdquo; for readability). For each character in the flag, it makes an XOR operation (^ - I will use it interchangeably) with the XORed value of it (more precisely, with the integer representation of it - A=65).&lt;/p&gt;
&lt;p&gt;For example, if the flag is &amp;ldquo;BDSEC&amp;rdquo;, the integer representation of &amp;ldquo;B&amp;rdquo; (66) will be XORed with &amp;ldquo;9&amp;rdquo; (57) which is &amp;ldquo;{&amp;rdquo;. Then &amp;ldquo;9&amp;rdquo; XORed with &amp;ldquo;D&amp;rdquo; is &amp;ldquo;{&amp;rdquo; as so on, as can be seen in the encrypted flag.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s possible to make a reverse operation for XOR:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="492px" data-flex-grow="205" height="259" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_4.png" width="531"&gt;&lt;/p&gt;
&lt;p&gt;The encrypted flag is: 9{?l)jO;dQa&amp;gt;[oZ#|A)I}N}&lt;/p&gt;
&lt;p&gt;9 ^ original_character = {&lt;/p&gt;
&lt;p&gt;{ ^ original_character = ?&lt;/p&gt;
&lt;p&gt;So I wrote a python code that checks if &lt;em&gt;9 ^ original_character = {&lt;/em&gt;* *and so on.&lt;/p&gt;
&lt;p&gt;Each character of the encrypted message was tested with different characters in order to guess the correct one.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="538px" data-flex-grow="224" height="375" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_5.png" srcset="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_5_hu_490e066f6e9f9a05.png 800w, https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_5.png 841w" width="841"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="knight-squad-shop-web---100-points"&gt;Knight Squad Shop (web - 100 points)
&lt;/h2&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="542px" data-flex-grow="226" height="206" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_6.png" width="466"&gt;&lt;/p&gt;
&lt;p&gt;The source code of the web application was provided:&lt;/p&gt;
&lt;p&gt;&lt;a class="link" href="https://drive.google.com/file/d/1cHCasWHdfl21q2XrATET_jy0fDQ2gfMK/view" target="_blank" rel="noopener"
 &gt;https://drive.google.com/file/d/1cHCasWHdfl21q2XrATET_jy0fDQ2gfMK/view&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also access to the web application:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="232px" data-flex-grow="96" height="488" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_7.png" width="473"&gt;&lt;/p&gt;
&lt;p&gt;It seemed that there is a &amp;lsquo;products&amp;rsquo; object and one of its instances is &amp;lsquo;flags&amp;rsquo; which contains the flag.&lt;/p&gt;
&lt;p&gt;This is what I wanted.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="571px" data-flex-grow="238" height="301" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_8.png" width="717"&gt;&lt;/p&gt;
&lt;p&gt;How do I get it? Let&amp;rsquo;s look further into the code.&lt;/p&gt;
&lt;p&gt;There are two endpoints: &lt;em&gt;/sell&lt;/em&gt; and &lt;em&gt;/buy&lt;/em&gt; that are responsible for the buying and selling operations.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="360px" data-flex-grow="150" height="862" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_9.png" srcset="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_9_hu_ddaeffcc088f85ec.png 800w, https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_9.png 1293w" width="1293"&gt;&lt;/p&gt;
&lt;p&gt;Since there was a bug or misconfiguration, I could only try to buy &amp;lsquo;digispark&amp;rsquo;. However, I did not have enough money for it.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="263px" data-flex-grow="109" height="362" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_10.png" width="397"&gt;&lt;/p&gt;
&lt;p&gt;I tried to sell products by manually crafting a request to the* /sell* endpoint and tested some things but I did not see any changes.&lt;/p&gt;
&lt;p&gt;How can I get more money?&lt;/p&gt;
&lt;p&gt;Looking further into the code, I saw there is another endpoint (&lt;em&gt;/money&lt;/em&gt;), that checks if I have an admin session, and if so, it adds the money amount I request in the &lt;em&gt;&amp;lsquo;money&amp;rsquo;&lt;/em&gt; parameter.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="751px" data-flex-grow="312" height="170" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_11.png" width="532"&gt;&lt;/p&gt;
&lt;p&gt;As I thought and as the code says, I&amp;rsquo;m not an admin.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="494px" data-flex-grow="205" height="442" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_12.png" srcset="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_12_hu_39772e50ab3ce284.png 800w, https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_12.png 910w" width="910"&gt;&lt;/p&gt;
&lt;p&gt;How do I get an admin session?&lt;/p&gt;
&lt;p&gt;Looking at the code again seems like the request IP should be originated from &amp;lsquo;127.0.0.1&amp;rsquo; in order to get an admin session.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="552px" data-flex-grow="230" height="236" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_13.png" width="543"&gt;&lt;/p&gt;
&lt;p&gt;Before continuing a bit of information about &amp;lsquo;X-Forwarded-For&amp;rsquo; header:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1160px" data-flex-grow="483" height="168" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_14.png" srcset="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_14_hu_17f90da6c8a1c983.png 800w, https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_14.png 812w" width="812"&gt;&lt;/p&gt;
&lt;p&gt;Basically, front-end servers such as proxies and load balancers use that in order to tell the back-end (web application) server from which IP the request originated.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s try it :)&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="481px" data-flex-grow="200" height="454" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_15.png" srcset="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_15_hu_46f2b40fc6c7f08d.png 800w, https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_15.png 911w" width="911"&gt;&lt;/p&gt;
&lt;p&gt;It did not work and I have to find another way.&lt;/p&gt;
&lt;p&gt;Maybe if I will cause an error, it will expose interesting information.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="694px" data-flex-grow="289" height="305" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_16.png" srcset="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_16_hu_f55d2073df1d1ee0.png 800w, https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_16.png 882w" width="882"&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I do not know if it is correct&lt;/strong&gt; but knowing that asynchronous functions are sometimes vulnerable to race condition + I read that &amp;lsquo;req.ip&amp;rsquo; could be affected by &amp;lsquo;X-Forwarded-For:&amp;rsquo; header, I tried to cause some kind of race condition by adding &amp;lsquo;X-Forwarded-For: 127.0.0.1&amp;rsquo; to the request, and changing the &amp;lsquo;Origin&amp;rsquo; and &amp;lsquo;Referrer&amp;rsquo; headers to this IP address, just in case.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="236px" data-flex-grow="98" height="629" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_17.png" width="620"&gt;&lt;/p&gt;
&lt;p&gt;And it worked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Money added&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Using the same session I added **a lot **of money.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="231px" data-flex-grow="96" height="949" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_18.png" srcset="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_18_hu_7388871a67e15139.png 800w, https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_18.png 916w" width="916"&gt;&lt;/p&gt;
&lt;p&gt;But still, I do not have enough money. How is it that my session does not have enough money?&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="323px" data-flex-grow="134" height="550" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_19.png" width="742"&gt;&lt;/p&gt;
&lt;p&gt;Is there a chance that the money is added to the session in the &amp;lsquo;Set-Cookie&amp;rsquo; response header?&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="434px" data-flex-grow="180" height="504" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_20.png" srcset="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_20_hu_682df230ddd0f0c8.png 800w, https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_20.png 912w" width="912"&gt;&lt;/p&gt;
&lt;p&gt;I tried to buy the flag by replacing my session with the session in the &amp;lsquo;Set-Cookie&amp;rsquo; header and it worked.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="436px" data-flex-grow="182" height="501" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_21.png" srcset="https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_21_hu_fe88f631bab99a72.png 800w, https://blog.thesecuritywind.com/post/bdsec-2022-ctf-writeups/img_21.png 912w" width="912"&gt;&lt;/p&gt;
&lt;p&gt;I tried it again and only sometimes it works for me so I am not sure exactly if all of these steps were necessary.&lt;/p&gt;
&lt;p&gt;Also, before trying that, I uploaded the source code to Snyk for vulnerability scanning and it found a Prototype Pollution vulnerability, and as far as I understood, it may be another solution for this challenge.&lt;/p&gt;
&lt;p&gt;Please let me know if there were inaccuracies or any other insights about this solution.&lt;br&gt;
Orel 🍉&lt;/p&gt;</description></item><item><title>BSidesTLV 2022 CTF - "Medium Expectations"</title><link>https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/</link><pubDate>Fri, 01 Jul 2022 14:47:39 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/cover.png" alt="Featured image of post BSidesTLV 2022 CTF - "Medium Expectations"" /&gt;&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="156px" data-flex-grow="65" height="1063" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/img_1.png" width="694"&gt;&lt;/p&gt;
&lt;p&gt;I tried a pretty easy Crypto challenge.&lt;/p&gt;
&lt;p&gt;After using Netcat, the server asks us to guess the correct numbers repeatedly.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="181px" data-flex-grow="75" height="737" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/img_2.png" width="556"&gt;&lt;/p&gt;
&lt;p&gt;After looking at the source code (&amp;ldquo;challenge.py&amp;rdquo;), it seemed that the server generates a random number in the appropriate range each time.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="514px" data-flex-grow="214" height="432" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/img_3.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/img_3_hu_7bd280a44b22fc3c.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/img_3.png 926w" width="926"&gt;&lt;/p&gt;
&lt;p&gt;However, there is an interesting function - random.seed().&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="3030px" data-flex-grow="1262" height="86" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/img_4.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/img_4_hu_f8a82433a4607272.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/img_4.png 1086w" width="1086"&gt;&lt;/p&gt;
&lt;p&gt;After reading about this function, I understood that it takes a number (the result of the operation inside it) and this will be the seed for the random functions (rand_range).&lt;/p&gt;
&lt;p&gt;Okay, so it is not actually random. The random seed has a fixed value.&lt;/p&gt;
&lt;p&gt;I checked the result of this operation and got a reasonable value, but it did not work after I tried it.&lt;/p&gt;
&lt;p&gt;I thought it might be quicker if I just ran this program in PyCharm after modifying and printing the results for each iteration, and it worked. After connecting to the server, I just used the numbers and got the flag.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="177px" data-flex-grow="73" height="1895" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/img_5.png" srcset="https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/img_5_hu_babaf3decb68e75a.png 800w, https://blog.thesecuritywind.com/post/bsidestlv-2022-ctf-medium-expectations/img_5.png 1401w" width="1401"&gt;&lt;/p&gt;
&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel 🐇&lt;/p&gt;</description></item><item><title>PortSwigger Labs - Cross-Site Scripting Answers</title><link>https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/</link><pubDate>Sat, 18 Jun 2022 19:37:04 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/cover.png" alt="Featured image of post PortSwigger Labs - Cross-Site Scripting Answers" /&gt;&lt;p&gt;Hi, in this &lt;strong&gt;updating&lt;/strong&gt; blog post, I will post answers and explanations of how I solved them.&lt;/p&gt;
&lt;p&gt;The difficulty levels are Apprentice, Practitioner, and Expert.&lt;/p&gt;
&lt;p&gt;What is Cross-Site Scripting?&lt;/p&gt;
&lt;p&gt;Cross-Site Scripting (XSS) is an injection attack that allows an attacker to inject scripts into websites that will affect other user/s.&lt;/p&gt;
&lt;p&gt;The problem arises because lack of input validation and lack of character encoding.&lt;/p&gt;
&lt;p&gt;The main XSS types are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reflected XSS - User input is returned by the web application in the server&amp;rsquo;s response without encoding it to make it safe to be rendered in the user&amp;rsquo;s browser.&lt;/li&gt;
&lt;li&gt;Stored XSS - The user&amp;rsquo;s input is stored in the database of the target server (for example, after post creation in forums, private messages, etc.), then the victim is able to retrieve the stored data without encoding, which makes it unsafe to be rendered on the victim&amp;rsquo;s browser.&lt;/li&gt;
&lt;li&gt;DOM-based XSS - This type of XSS is when all the attack flow stays in the DOM of the browser. The payload will not be sent to the server.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;1. Reflected XSS into attribute with angle brackets HTML-encoded&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Difficulty: Apprentice&lt;/p&gt;
&lt;p&gt;First, I checked which characters were encoded.&lt;/p&gt;
&lt;p&gt;In the first reflection, all of them are encoded. In the second reflection &amp;rsquo; and &amp;quot; are not encoded.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="409px" data-flex-grow="170" height="711" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_1.png" srcset="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_1_hu_c74cb721b8444e52.png 800w, https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_1.png 1212w" width="1212"&gt;&lt;/p&gt;
&lt;p&gt;I could not escape the &lt;input&gt; element because &amp;lt;&amp;gt; characters are encoded, but I knew I could add an attribute since all I need is the &amp;quot; character.&lt;/p&gt;
&lt;p&gt;I added the &amp;lsquo;onmouseover&amp;rsquo; attribute, which tells the browser to run a script when the mouse cursor is above this element.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="460px" data-flex-grow="191" height="634" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_2.png" srcset="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_2_hu_f407df00bbb884c5.png 800w, https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_2.png 1217w" width="1217"&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Stored XSS into anchor href attribute with double quotes HTML-encoded&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Difficulty: Apprentice&lt;/p&gt;
&lt;p&gt;The description says there is a stored XSS in the comment section so let&amp;rsquo;s send a comment and check **all parameters **(sometimes only one parameter is vulnerable).&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="509px" data-flex-grow="212" height="623" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_3.png" srcset="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_3_hu_bbe120d2673b4e7d.png 800w, https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_3.png 1322w" width="1322"&gt;&lt;/p&gt;
&lt;p&gt;After entering the comment page, we see that all parameters are HTML-encoded except for some characters of the &amp;lsquo;website&amp;rsquo; parameter from the last request.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="534px" data-flex-grow="222" height="705" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_4.png" srcset="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_4_hu_e7ef5a787c76bd0f.png 800w, https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_4.png 1569w" width="1569"&gt;&lt;/p&gt;
&lt;p&gt;I sent a similar payload as in the previous lab. After initiating the script by moving the mouse cursor above the element, the lab was considered solved.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="2798px" data-flex-grow="1166" height="62" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_5.png" width="723"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="3447px" data-flex-grow="1436" height="41" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_6.png" width="589"&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Reflected XSS into a JavaScript string with angle brackets HTML encoded&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Difficulty: Apprentice&lt;/p&gt;
&lt;p&gt;In short, XSS inside a script.&lt;/p&gt;
&lt;p&gt;As in the previous labs, I tested which characters are not encoded. I only used these special characters: ; and /.&lt;/p&gt;
&lt;p&gt;I used // in order to comment out all the remaining characters.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="777px" data-flex-grow="323" height="547" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_7.png" srcset="https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_7_hu_4451d82e6faae0b.png 800w, https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_7_hu_596d685b82c80c7d.png 1600w, https://blog.thesecuritywind.com/post/portswigger-labs-cross-site-scripting-answers/img_7.png 1771w" width="1771"&gt;&lt;/p&gt;</description></item><item><title>A Race Against Time</title><link>https://blog.thesecuritywind.com/post/a-race-against-time/</link><pubDate>Thu, 02 Jun 2022 17:04:46 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/a-race-against-time/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/a-race-against-time/cover.png" alt="Featured image of post A Race Against Time" /&gt;&lt;p&gt;There was a delivery service that was introduced to the company I work for. They allowed employees to order groceries without a shipping fee, and get them on the same day.&lt;/p&gt;
&lt;p&gt;I was curious and checked a couple of things on the website (security-wise). There were many requests, and I tested some things. After not finding anything interesting, I stopped.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="243px" data-flex-grow="101" height="356" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/a-race-against-time/img_1.png" width="361"&gt;&lt;/p&gt;
&lt;p&gt;I got back to it a few weeks or probably months later. I really wanted to find something in there, especially since I did not find anything the last time.&lt;/p&gt;
&lt;p&gt;Now, this platform usually targets companies and after an onboarding session with a representative, they give you some credits. I will get back to it later.&lt;/p&gt;
&lt;p&gt;I registered an account. I wanted to see if there was something interesting on the account&amp;rsquo;s profile page, so I went there.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s see what happens when I press &amp;ldquo;Save&amp;rdquo; for the account&amp;rsquo;s details.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="350px" data-flex-grow="146" height="665" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/a-race-against-time/img_2.png" srcset="https://blog.thesecuritywind.com/post/a-race-against-time/img_2_hu_8188ff8fe8998a45.png 800w, https://blog.thesecuritywind.com/post/a-race-against-time/img_2.png 972w" width="972"&gt;&lt;/p&gt;
&lt;p&gt;Hmm, the server&amp;rsquo;s response contained parameters that caught my eye (&amp;rsquo;&lt;em&gt;store_credits&lt;/em&gt;&amp;rsquo;, &amp;lsquo;&lt;em&gt;onboarded&lt;/em&gt;&amp;rsquo; and &amp;lsquo;&lt;em&gt;verified&lt;/em&gt;&amp;rsquo;).&lt;/p&gt;
&lt;p&gt;&amp;lsquo;&lt;em&gt;store_credits&lt;/em&gt;&amp;rsquo; probably refers to money and the &amp;lsquo;&lt;em&gt;onboarded&lt;/em&gt;&amp;rsquo; parameter refers to the onboarding process I mentioned earlier.&lt;/p&gt;
&lt;p&gt;I added the &amp;lsquo;&lt;em&gt;store_credits&lt;/em&gt;&amp;rsquo; parameter to the request in order to change my credits. Sending normal values or unexpected values did not change the number of credits.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s try to change the &amp;lsquo;&lt;em&gt;onboarded&lt;/em&gt;&amp;rsquo; and &amp;lsquo;&lt;em&gt;verified&lt;/em&gt;&amp;rsquo; values to &amp;rsquo;true&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="675px" data-flex-grow="281" height="276" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/a-race-against-time/img_3.png" width="777"&gt;&lt;/p&gt;
&lt;p&gt;Okay, it worked and now I am onboarded and verified. Wait for a second, I also gained credits (3000 credits which are equivalent to 30 New Israeli Shekels)!&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s try to send it again, maybe I will get even more credits!&lt;/p&gt;
&lt;p&gt;Unfortunately, it did not work.&lt;/p&gt;
&lt;p&gt;So we have an authorization bypass here. We can onboard and verify our account and get credits for that.&lt;/p&gt;
&lt;p&gt;Then a thought came to my mind and I asked myself - is there a chance there is a race condition here?&lt;/p&gt;

 &lt;blockquote&gt;
 &lt;p&gt;As per the OWASP testing guide: *&amp;ldquo;A race condition is a flaw that produces an unexpected result when the timing of actions impact other actions&amp;rdquo;. *&lt;/p&gt;

 &lt;/blockquote&gt;
&lt;p&gt;For example, in this web application, if there is a race condition, the system will process these requests simultaneously while increasing my credits over and over before noticing that my account is already onboarded.&lt;/p&gt;
&lt;p&gt;I created a new account (with 0 credits), prepared the same request, sent it to Burp Suite Intruder (a tool that automates attacks) and sent it many times using a large number of concurrent requests.&lt;/p&gt;
&lt;p&gt;This is what I got from the server&amp;rsquo;s response. It looks like it did not affect the credits and I only got 20 NIS. **😭 **&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="219px" data-flex-grow="91" height="352" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/a-race-against-time/img_4.png" width="322"&gt;&lt;/p&gt;
&lt;p&gt;Also, on the catalog page, it seemed that I only got the 20 NIS discount.&lt;/p&gt;
&lt;p&gt;I probably wanted to test further issues when I entered the cart and was surprised to discover that it worked and I have a discount of much more credits than I should have (I should have 20 NIS discount and got 60 NIS).&lt;/p&gt;
&lt;p&gt;Here I could get only 60 NIS, but I also succeeded to do that with 120 NIS.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="262px" data-flex-grow="109" height="434" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/a-race-against-time/img_5.png" width="474"&gt;&lt;/p&gt;
&lt;p&gt;Race condition is fun!&lt;/p&gt;
&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel&lt;/p&gt;</description></item><item><title>Forgot Password Vulnerabilities</title><link>https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/</link><pubDate>Fri, 20 May 2022 22:46:33 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/cover.png" alt="Featured image of post Forgot Password Vulnerabilities" /&gt;&lt;p&gt;I will probably update this post with new examples and screenshots.&lt;/p&gt;
&lt;p&gt;One of the features I like to test the most is the &amp;lsquo;forgot password&amp;rsquo; process. Since it may lead to account takeover, or sometimes it is like a riddle that you have to solve by understanding its logic.&lt;/p&gt;
&lt;p&gt;In my opinion, the probability of &amp;lsquo;forgot password&amp;rsquo; issues in a web application is 6-7/10. So it is not very common, but not that rare.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Some web applications require entering the target email address or username. Then they send an email with the &amp;lsquo;forgot password&amp;rsquo; link. Usually, there is a form there that asks for a new password. While intercepting the request, sometimes the username is sent next to the &amp;lsquo;forgot password&amp;rsquo; token and the new password. The &amp;lsquo;username&amp;rsquo; parameter tells the server to change the password to this account. Note that this process could be combined from several requests, so the whole process should be understood.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="862px" data-flex-grow="359" height="200" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_1.png" width="719"&gt;&lt;/p&gt;
&lt;ol start="2"&gt;
&lt;li&gt;Another example is a guessable token. Some tokens or &amp;lsquo;forgot password&amp;rsquo; links are combined from guessable data, such as company IDs, timestamps, iterators, etc.
An example of such a link is:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="3897px" data-flex-grow="1623" height="63" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_2.png" srcset="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_2_hu_6aafa8711797c405.png 800w, https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_2.png 1023w" width="1023"&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s say that the &amp;lsquo;c&amp;rsquo; parameter is company ID, &amp;lsquo;i&amp;rsquo; is an iterator, and &amp;rsquo;t&amp;rsquo; is some kind of another iterator, maybe an encrypted timestamp.&lt;/p&gt;
&lt;p&gt;If we send another reset password request to the same user, we will probably get this link:&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="3972px" data-flex-grow="1655" height="60" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_3.png" srcset="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_3_hu_70680f37f8db8e12.png 800w, https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_3.png 993w" width="993"&gt;&lt;/p&gt;
&lt;p&gt;As we can see, the &amp;lsquo;i&amp;rsquo; parameter&amp;rsquo;s value has been increased by one, and the &amp;rsquo;t&amp;rsquo; parameter&amp;rsquo;s value (in Hexadecimal) also increased. The company ID could also be guessed easily if it is a sequential number or by using other ways.&lt;/p&gt;
&lt;p&gt;Now we can send ourselves a reset password request and very fast after that, send a reset password request to our victim.
We use the values in the link that was sent to us in order to guess the parameters&amp;rsquo; values of our victim.&lt;/p&gt;
&lt;p&gt;We know that the &amp;lsquo;i&amp;rsquo; value was increased by 1, and we probably know or can guess the victim&amp;rsquo;s company ID.
An automated tool can be used for this attack (such as Burp Suite&amp;rsquo;s Intruder) and only a few characters should be guessed. It should take a short moment before guessing the correct link.&lt;/p&gt;
&lt;ol start="3"&gt;
&lt;li&gt;One of the requests in the &amp;lsquo;forgot password&amp;rsquo; process may send the user&amp;rsquo;s credentials in the URL.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="1844px" data-flex-grow="768" height="168" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_4.png" srcset="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_4_hu_1740b835cd647970.png 800w, https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_4.png 1291w" width="1291"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="4842px" data-flex-grow="2017" height="62" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_5.png" srcset="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_5_hu_7a2a6cee2cf05e94.png 800w, https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_5.png 1251w" width="1251"&gt;&lt;/p&gt;
&lt;p&gt;These credentials may be saved in proxy history, browser history, etc. Malicious users who have access to these areas may try to log in or steal the account.&lt;/p&gt;
&lt;ol start="4"&gt;
&lt;li&gt;
&lt;p&gt;Tokens that can be brute-forced and are guessable (such as &amp;lsquo;9389913&amp;rsquo;), even if they are random, may lead to account takeovers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tokens that are not expired after a limited and short amount of time increase the chances of being discovered. Also, allowing several valid tokens at the same time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A &lt;em&gt;very&lt;/em&gt; common issue (with a &lt;em&gt;very&lt;/em&gt; low impact probability) is &amp;lsquo;forgot password&amp;rsquo; tokens sent to 3rd parties. Usually, after entering the &amp;lsquo;forgot password&amp;rsquo; link sent to our email address, there an analytics and logs requests sent to 3rd parties. These requests usually contain the reset password token in the &amp;lsquo;referer&amp;rsquo; header or one of the GET or POST parameters. Data leakage from this 3rd parties website, or a malicious user who has access to this data, may compromise users using these tokens. The probability of this attack is increased as the token expiration is higher.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="692px" data-flex-grow="288" height="455" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_6.png" srcset="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_6_hu_9465768f4b5f71cf.png 800w, https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_6.png 1312w" width="1312"&gt;&lt;/p&gt;
&lt;ol start="7"&gt;
&lt;li&gt;Reset password poisoning - sometimes, we can try and send a reset password request with the &amp;lsquo;Host&amp;rsquo; or &amp;lsquo;X-Forwarded-Host&amp;rsquo; headers containing the attacker&amp;rsquo;s server URL.
There are cases where an email message will be sent to the victim and contain a link with the attacker server&amp;rsquo;s URL, and the &amp;lsquo;reset password&amp;rsquo; token attached.
After the victim enters the link, a request with the &amp;lsquo;reset password&amp;rsquo; token will be sent to the attacker&amp;rsquo;s server.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="446px" data-flex-grow="186" height="225" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_7.png" width="419"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="474px" data-flex-grow="197" height="216" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/forgot-password-vulnerabilities/img_8.png" width="427"&gt;&lt;/p&gt;
&lt;ol start="8"&gt;
&lt;li&gt;Sending two email addresses - some web applications will also send the victim&amp;rsquo;s token to the attacker in case a similar payload is sent:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;email=victim@gmail.com&amp;amp;email=attacker@gmail.com 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In other cases, instead of using &amp;lsquo;&amp;amp;&amp;rsquo; we can try other characters or URL encoding of them.&lt;/p&gt;
&lt;ol start="9"&gt;
&lt;li&gt;Email flooding - some systems allow sending many &amp;lsquo;forgot password&amp;rsquo; requests without any anti-automation mechanism or other limitations. By sending many requests, we can flood our victim&amp;rsquo;s mailbox.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Thank you,&lt;br&gt;
Orel 🌷&lt;/p&gt;</description></item><item><title>Duolingo - Unlimited XP Points</title><link>https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/</link><pubDate>Sat, 14 May 2022 21:20:43 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/cover.jpg" alt="Featured image of post Duolingo - Unlimited XP Points" /&gt;&lt;p&gt;This is a story about the importance of testing the less popular areas in web applications.&lt;/p&gt;
&lt;p&gt;Duolingo gives experience points for different actions on the website. For example, doing challenges.&lt;/p&gt;
&lt;p&gt;By increasing the XP points, you go up on the league board.&lt;/p&gt;
&lt;p&gt;So I joined a league and unfortunately I only have 8 XP.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="223px" data-flex-grow="93" height="424" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/img_1.png" width="395"&gt;&lt;/p&gt;
&lt;p&gt;It is essential to understand the flow of the web application&amp;rsquo;s processes and not miss requests and features that seem like edge cases or are not widely used. Because in a lot of cases, they have issues.&lt;/p&gt;
&lt;p&gt;So back to our example - Duolingo lessons have a different levels (1-5 and &amp;ldquo;Legendary&amp;rdquo;). The &amp;ldquo;Legendary&amp;rdquo; level contains a lot of questions and for that, they &amp;ldquo;promise&amp;rdquo; 20 XP for those who finish just half of the questions.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="187px" data-flex-grow="78" height="519" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/img_2.png" width="405"&gt;&lt;/p&gt;
&lt;p&gt;So let&amp;rsquo;s intercept the traffic just before we arrive the middle of the lesson.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="494px" data-flex-grow="206" height="562" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/img_3.png" srcset="https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/img_3_hu_8ab5883afc6e655e.png 800w, https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/img_3.png 1158w" width="1158"&gt;&lt;/p&gt;
&lt;p&gt;I answered the question (the answer was &amp;ldquo;The bear is beautiful&amp;rdquo;) and quitted the lesson.&lt;/p&gt;
&lt;p&gt;They asked me if I am sure and I said &amp;ldquo;Yes!&amp;rdquo;. Nothing happened so I clicked &amp;ldquo;Yes&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;There were many requests and after finding the request I searched for, I went through all of the parameters (and there were many of them).&lt;/p&gt;
&lt;p&gt;There were some interesting ones, and one of them was &amp;ldquo;xpPromised&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="232px" data-flex-grow="96" height="404" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/img_4.png" width="391"&gt;&lt;/p&gt;
&lt;p&gt;XP promised?? Only 20? Can you please promise me more?&lt;/p&gt;
&lt;p&gt;I changed it to 1329 and it looks good for now.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="410px" data-flex-grow="171" height="654" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/img_5.png" srcset="https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/img_5_hu_5ee45cae4e041e81.png 800w, https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/img_5.png 1119w" width="1119"&gt;&lt;/p&gt;
&lt;p&gt;Lets check the league chart.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="236px" data-flex-grow="98" height="426" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/duolingo-unlimited-xp-points-yes/img_6.png" width="420"&gt;&lt;/p&gt;
&lt;p&gt;Yay, I have 1337 points! Sorry Dena.&lt;/p&gt;
&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel&lt;/p&gt;</description></item><item><title>Simple IDOR With Critical Impact</title><link>https://blog.thesecuritywind.com/post/simple-idor-with-critical-impact/</link><pubDate>Sat, 14 May 2022 19:10:28 +0000</pubDate><guid>https://blog.thesecuritywind.com/post/simple-idor-with-critical-impact/</guid><description>&lt;img src="https://blog.thesecuritywind.com/post/simple-idor-with-critical-impact/cover.png" alt="Featured image of post Simple IDOR With Critical Impact" /&gt;&lt;p&gt;I have a friend who studied in a popular academic institution. I happened to be in his house and I said why not &amp;ldquo;look&amp;rdquo; at their website real quick? They had this new area on the website where all the personal information exists.&lt;/p&gt;
&lt;p&gt;It really took only a couple of minutes to find a &lt;em&gt;very&lt;/em&gt; critical IDOR (authorization bypass) issue. The issue was that it was possible to (probably) retrieve all the grade chart which contains all of the grades and other personal information of all the students.&lt;/p&gt;
&lt;p&gt;For those unfamiliar with the term IDOR (Insecure Direct Object Reference), it is a vulnerability that allows to refer and access an object that should not be authorized to the user.&lt;/p&gt;
&lt;p&gt;Sorry in advance for the massive redaction and lack of evidence, I do not want to cause any problems for my friend.&lt;/p&gt;
&lt;p&gt;After asking for the grade chart, a POST request was sent and in its body, there was this suspicious parameter (which I am not sure if it is the grade chart ID, the student ID or something else. I did not delve into this).&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="846px" data-flex-grow="352" height="74" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/simple-idor-with-critical-impact/img_1.png" width="261"&gt;&lt;/p&gt;
&lt;p&gt;I edited the &amp;ldquo;ptMsl&amp;rdquo; parameter&amp;rsquo;s value, which of course was a sequential value (which is a problem by itself) and sent the request.&lt;/p&gt;
&lt;p&gt;&lt;img class="gallery-image" data-flex-basis="728px" data-flex-grow="303" height="84" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://blog.thesecuritywind.com/post/simple-idor-with-critical-impact/img_2.png" width="255"&gt;&lt;/p&gt;
&lt;p&gt;After that, there was a request or more that contained some unique identifiers (that originated from the malformed request) and then I saw a grade chart of another person.&lt;/p&gt;
&lt;p&gt;An attacker could automate it to probably retrieve all of the students&amp;rsquo; grade charts, which is &lt;em&gt;very&lt;/em&gt; bad for the institution&amp;rsquo;s reputation (in addition to the fact that students&amp;rsquo; data were exposed).&lt;/p&gt;
&lt;p&gt;I am publishing it after I verified it was fixed, but the fact this absurd issue exited (and for a long time), it is not hard for me to believe there are more issues like this on the website.&lt;/p&gt;
&lt;p&gt;Secure development training is very important for websites that contain sensitive data.&lt;/p&gt;
&lt;p&gt;Happy Hacking,&lt;br&gt;
Orel&lt;/p&gt;</description></item></channel></rss>