<?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 Rupak on Medium]]></title>
        <description><![CDATA[Stories by Rupak on Medium]]></description>
        <link>https://medium.com/@rupakbiswas2304?source=rss-13a5dc8b9419------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PDXnT4xeLfdfsa9MSlbSoA.jpeg</url>
            <title>Stories by Rupak on Medium</title>
            <link>https://medium.com/@rupakbiswas2304?source=rss-13a5dc8b9419------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 20:43:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rupakbiswas2304/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[Update && Upgrade OWASP PYGOAT ~ Final Report , GSOC’22]]></title>
            <link>https://medium.com/@rupakbiswas2304/update-upgrade-owasp-pygoat-final-report-gsoc22-a376b0659433?source=rss-13a5dc8b9419------2</link>
            <guid isPermaLink="false">https://medium.com/p/a376b0659433</guid>
            <category><![CDATA[gsoc-2022]]></category>
            <category><![CDATA[owasp-top-10]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[secure-coding]]></category>
            <category><![CDATA[pygoat]]></category>
            <dc:creator><![CDATA[Rupak]]></dc:creator>
            <pubDate>Sun, 11 Sep 2022 09:04:43 GMT</pubDate>
            <atom:updated>2022-09-11T10:11:21.525Z</atom:updated>
            <content:encoded><![CDATA[<h3>Update &amp;&amp; Upgrade OWASP PYGOAT ~ Final Report , GSOC’22</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vRjWFgq3da-8ZMD0QleQAg.png" /></figure><h3>Overview</h3><p>Contributor : <a href="https://github.com/RupakBiswas-2304">Rupak Biswas</a></p><p>Organization: <a href="https://owasp.org/">OWASP</a></p><p>Project: <a href="https://github.com/adeyosemanputra/pygoat">PyGoat</a></p><p>Mentor: <a href="https://github.com/adeyosemanputra">@adeyosemanputra</a></p><p><a href="https://summerofcode.withgoogle.com/programs/2022/projects/MhHmiD69">Proposal</a></p><h3>Project Details</h3><p>The purpose is to give developers and testers a platform for learning how to test applications and code securely. PyGoat is written in python and uses the Django web framework as a platform. It also has web application vulnerabilities (such as XSS and SQLi). PyGoat also provides a section where you may view the source code, identify the error that led to the vulnerability, and make adjustments to secure it. It provides a free platform for improving common coding mistakes and guides toward secure coding.</p><h3>Summary Of Work</h3><h4>Improved UI &amp; Dark mode</h4><p>Previously, PyGoat was in a blue theme, I have added a dark theme. Ths UI is pretty much improved and it has a relatively modern look. Also, I have created a new logo for pygoat also.</p><figure><img alt="Dark theme img" src="https://cdn-images-1.medium.com/max/1024/1*Yuqn8x_3D-llRQX_KQEGeA.png" /><figcaption>Dark theme</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VcHtKdT5ZI6l_v4qBCOI7g.png" /><figcaption>Light theme</figcaption></figure><figure><img alt="Logo with python logo as a backbone and goat on the upper part and python in a lower part" src="https://cdn-images-1.medium.com/max/1024/1*Yl8-kXBF7q_J_vs1ERLqHw.png" /><figcaption>New Logo for Pygoat</figcaption></figure><h4>Overall Structural Change</h4><p>The previous version of Pygoat had a simple linear structure with OWASP-2017 vulnerabilities only. I have created a new separate section for OWASP-21, OWASP-17, MITRE, SANS, Challange, and Help Sections. This way it is more organized and the user will easily get what he/she needs.</p><h4>New Labs</h4><p>Lab III &gt; Broken Access Control [ OWASP’21 section ]</p><blockquote>This lab is based on mistaken broken access. A page ( supposed to accessible by admin only ) is leaked and don&#39;t have autherization controle. Hackers can use automated tools to find out common paths and if such routes are present in production level code, it will be very problamatic.</blockquote><p>Lab I &gt; Cryptographic Failure [ OWASP’21 section ]</p><blockquote>This lab is based on a beginner-level common mistake, choosing the wrong hashing algorithm for password encryption. Hashes like md5 and sha-1 are deprecated and we should not use them for at least password encryption. Sometimes it is possible to find the key just by googling and for a complex password, it has hash-collisions.</blockquote><p>Lab II &gt; Cryptographic Failure [ OWASP’21 section ]</p><blockquote>It is an intermediate level of mistake to use only a strong hash. Even though strong hashes like sha-256 and sha-512 don’t have a hash collision, common password hashes can be reversed using online databases. For compound passwords, there are tools like hashcat, John the Ripper to perform brute force attacks, and dictionary attacks. So it is recommended to use salting-like concepts.</blockquote><p>Lab III &gt; Cryptographic Failure [ OWASP’21 section ]</p><blockquote>Not only passwords but there are also some other critical parameters that need cryptographic protection. This lab is an example. Used proper authentication but the authorization token is in clear text and can be modified for unauthorized access.</blockquote><p>Lab III &gt; Injection [ OWASP’21 section ]</p><blockquote>An injection is one of the most common problems and there is a variety of them. Template injection is one of them on the modern web. This lab is based on template injection. Learn more about template injection <a href="https://medium.com/@rupakbiswas2304/server-side-template-injection-8113cdbb2779">here</a>.</blockquote><p>Lab I &gt; Insecure Design [ OWASP’21 section ]</p><blockquote>Insecure design is a board category where the coding fault is not the problem but the problem arises at a prior stage of the program. Lac of planning can cause this type of problem. This problem demonstrates a movie ticket selling service that is giving 5 free tickets to each user and starts the show once no ticket is left. But there are easy ways to exploit that system.</blockquote><p>Lab III &gt; Security Misconfiguration [ OWASP’21 section ]</p><blockquote>In lab II we have seen that debug information can leak important stuff and configuration but it can also leak some secret key that is important for internal encryption of cookies and tokens, this lab is about exploiting them and avoiding those kinds of mistakes. Another good practice is storing the secrets outside the project dirctory.</blockquote><p>Lab II &gt; Using Components with Known Vulnerabilities &gt; [ OWASP’21 section ]</p><blockquote>Every day new vulnerabilities are detected in modules and dependencies. This lab is about such kind of vulnerabilities found in pillow module version 8.0.0, this vulnerability has such potential that it can terminate the server or give access to remote to such extent. We can use dependbot like tools to get updated about known vulnerabilies and should update our dependency.</blockquote><p>Lab II &gt; Identification and Authentication Failures &gt; [ OWASP’21 section ]</p><blockquote>This lab has an admin-only login page and it has such a security measure that it blocks users for 5 successive wrong password entries. This feature seems to be a good security measure but somebody can take advantage of this feature and the actual admin will be in a problem. This is an example of an insecure design also. There are simmiler mechanism in many system.</blockquote><p>Lab III &gt; Identification and Authentication Failures &gt; [ OWASP’21 section ]</p><blockquote>For this lab, multiple credentials are given to test. It may look secure from a cryptographic aspect but if we see the code, there is a common mistake. Try to find the vulnerability without seeking the code.</blockquote><p>Lab II &gt; Software and Data Integrity Failures &gt; [ OWASP’21 section ]</p><blockquote>We should cross-check the sha1 fingerprint or md5 key to cross-check. This lab has a vulnerability that gives access to hackers to modify the file. It is done through some kind of XXS attacks but this type of attack is very common among bad hackers.</blockquote><p>Lab II &gt; Insufficient Logging &amp; Monitoring &gt; [ OWASP’21 section ]</p><blockquote>When unsanitized user input is passed through a database or HTML there is a chance of injection. The same goes for logging also and this lab is about that. This is a login page that has active monitoring but some raw data is passed in the log file giving access to inject fake logs.</blockquote><p>Lab I &gt; SSRF &gt; [ OWASP’21 Section ]</p><blockquote>SSRF flaws occur whenever a web application is fetching a remote resource without validating the user-supplied URL. This is extremely dangerous and a hacker can get access to internal files using path traversal or remote access also. This lab has some vulnerabilities like that. It has a discussion tab also to practice the secure coding and utility for validating the code also.</blockquote><p>Lab II &gt; SSRF &gt; [ OWASP’21 Section ]</p><blockquote>This lab is a classic example of SSRF. It is required to do some extra work in order to complete the lab ( explained on the lab page ). This lab demonstrates how internal services can be exposed because of vulnerabilities in some services. Unsanitized input is the reason here also.</blockquote><p>Lab I &gt; Improper Neutralization of Input During Web Page Generation &gt; MITRE 25</p><blockquote>This lab has some static files to download in the app. Before showing the download link there exists a small step and the problem starts from there. But the problem is the file can be changed by just by attaching some payload in the URL.</blockquote><p>Lab I &gt; SQL Injection &gt; MITRE 25</p><blockquote>This lab consists of some classic examples of relational database injections.</blockquote><p>CWE-20: Improper input validation &gt; MITRE 25</p><blockquote>Improper input validation is a broad category and the main reason behind most of the security issues like Injections, SSRF, XXS, etc. So this lab consists of some labs ( exists in other categories in the OWASP’22 section ).</blockquote><p>Lab I &gt; CSRF &gt; MITRE 25</p><blockquote>This lab is vulnerable to bank service. There is a money transfer utility and the money is transferred via an API (that does not use a csrf token ). As a result, hackers can send false website links or crafter website links to victims, and just by clicking the link victim could be ruined. So be aware of this kind of attack and as a developer, we should not allow this kind of vulnerability.</blockquote><p>Improper Authentication &gt; MITRE 25</p><blockquote>Improper authentication can cause account takeover and cause lots of problems for users, so it is mandatory to learn about different authentication approaches and their pros and cons. This section has 3 labs and can demonstrate the cons of some approaches.</blockquote><p>Lab I &gt; Command Injection &gt; MITRE 25</p><blockquote>This lab has a port scanning service that uses Nmap internally and user input is passed through Nmap. Again user input is not sanitized properly so a hacker can pass some other things along with IP as input which can cause trouble.</blockquote><p>Lab I &gt; Code Injection &gt; MITRE 25</p><blockquote>Last but not the least, the code injection lab has a simple calculator which is not that simple. It can calculate math expressions and can do some other things also that it should not do.</blockquote><h4>Coding playgrounds</h4><p>There are some coding playgrounds for some labs where the system help user to find out where is the problem in the code and help them to refactor the code. The utility validates or shows the output for the code. Users can change line by line and see the changes.</p><p><a href="https://github.com/adeyosemanputra/pygoat/commits?author=RupakBiswas-2304">Link</a> to all commits to Pygoat</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FdGQTYno3b9U%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdGQTYno3b9U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FdGQTYno3b9U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d3bfa888fc81bf242c2795acb9de54e8/href">https://medium.com/media/d3bfa888fc81bf242c2795acb9de54e8/href</a></iframe><h3>Acknowledgment</h3><p>I want to thank my mentors (<a href="http://twitter.com/adeyosemanputra">@adeyosemanputra</a>) for always directing and supporting me, answering my questions, providing feedback, and encouraging criticism while also fostering my interest in security and open source. I was able to complete all of the project’s goals thanks to their efforts. I appreciate the OWASP Foundation allowing me to participate to this project and giving me such a large network of mentors and other contributors for me to learn. For their assistance with this project, the members of the OWASP Whatsapp group and Pygoat Slack are also appreciated.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a376b0659433" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Server-side Template Injection]]></title>
            <link>https://medium.com/@rupakbiswas2304/server-side-template-injection-8113cdbb2779?source=rss-13a5dc8b9419------2</link>
            <guid isPermaLink="false">https://medium.com/p/8113cdbb2779</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Rupak]]></dc:creator>
            <pubDate>Fri, 10 Jun 2022 08:11:18 GMT</pubDate>
            <atom:updated>2022-06-10T14:52:31.195Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is a template and template engine?</h3><p>It is simply a reusable and dynamic HTML code, and a template engine helps us compile that template. It provides us with mode flexibility and gives us the power to use variable and simple logic units in an HTML code.</p><p>Let&#39;s understand with an example; let&#39;s say we have to make a profile page for users. It is nearly impossible to serve only static HTML pages ( we can&#39;t make HTML files for every user ). Here are template engines; we can make a template page, render different variable data, and serve that. Another solution for this problem is sending an ajax request and rendering it in runtime(out of topic rn).</p><p>Some examples: ( Django template)</p><pre>{% extends ‘introduction/base.html’ %}<br>{% block content %}<br>&lt;div&gt;<br>    Name : {{user.name}}<br>    Email : {{user.email}}<br>    {{user.profile_img}}<br>&lt;/div&gt;<br>{% endblock %}</pre><h3>A brief list of commonly used template engines</h3><p>PHP → Twigs, Smarty</p><p>NodeJS → pug,ejs, haml.js, twing,Blade,Jade etc</p><p>Python → Jinja, mako, tornado, Django template, etc</p><p>Java → velocity, Freemaker, etc</p><p>Ruby → Liquid</p><h3>So, where is the risk?</h3><p>In some use-cases, these engines render some dynamic data input by the user. These engines can run some commands on server machines and access some environment variables and local variables. So if the user input is not verified properly, the user can give some malicious input and get the output when the page is rendered.</p><h3>Some Example :</h3><h4>Django template:</h4><p>{% debug %} → This tag exposed debug information if Debug = True in Django</p><p>{{ &#39;&lt;script&gt; alert(&quot;hello&quot;)&lt;/script&gt;&#39; | safe }} → Example of an XSS attack, this script will be ignored by the normal XSS filter.</p><p>{% include &#39;admin/base.html&#39; %} → In Django by default admin page is at /admin/ but it can be changed and it is recommended to change into some unpredictable URL, but using this admin page can be accessed.</p><pre>{% load log %}<br>{% get_admin_log 5 as log %}<br>{% for e in log %}<br>    {{e.user.get_username}} : {{e.user.password}}<br>{% endfor %}</pre><p>→ Accessing Django logs and filtering logs for admin and using simple . notation to get the username and corresponding password hash.</p><h4>Jinja template [ default template engine in flask ] :</h4><p>{{7*7}} → Can evaluate a simple expression</p><p>{{request.application}} → We can get access to the running application and do some interesting stuff. We can run the system commands after importing the os module from global builtins. Example →</p><pre>{{request.application.__globals__.__builtins__.__import__(&#39;os&#39;).popen(&#39;pwd&#39;).read()}}</pre><p>{{ config }} → Returns all configurations including secret_key, used in the flask application.</p><h4>Twig [PHP] :</h4><p>{{_self}} → Returns the reference of the current application</p><p>for example, we can access the env as {{_self.env}}</p><p>{{7*7}} → basic math operation</p><p>{{[&#39;any_command&#39;]|fillter(&#39;any_filter&#39;)}} → Command execution with filter</p><h4>PugJs [ Nodejs ]:</h4><p>#{7*7} → basic math operations</p><p>#function(){ //some function that going to run in backend }} → remote code execution</p><h4>ERB [ Ruby ]:</h4><p>&lt;%= 7*7 %&gt; → basic math operations</p><p>&lt;%= system(&quot;command&quot;) %&gt; → Remote code execution</p><p>&lt;% require &#39;some_module&#39; %&gt; → module import and we can use that module</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8113cdbb2779" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>