<?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 Ramkumar Nadar on Medium]]></title>
        <description><![CDATA[Stories by Ramkumar Nadar on Medium]]></description>
        <link>https://medium.com/@ramkumarnadar47?source=rss-12f3d8d983bd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*q5J1WzsE70VqBAjK</url>
            <title>Stories by Ramkumar Nadar on Medium</title>
            <link>https://medium.com/@ramkumarnadar47?source=rss-12f3d8d983bd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 05:09:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ramkumarnadar47/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[Strange XSS]]></title>
            <link>https://medium.com/@ramkumarnadar47/strange-xss-18f2c60dbfd0?source=rss-12f3d8d983bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/18f2c60dbfd0</guid>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[application-security]]></category>
            <dc:creator><![CDATA[Ramkumar Nadar]]></dc:creator>
            <pubDate>Sun, 07 Jan 2024 13:01:20 GMT</pubDate>
            <atom:updated>2024-01-07T13:14:27.124Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*mtz69DoUVrWYE8c1jR2GUA.png" /></figure><p>Context: Original XSS was found by the initial tester, I did the confirmatory/reassessment test.</p><p>The original tester used the payload → “;alert(1)// and achieved reflected XSS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wf0lJyAsm_sSe6cq6RI83w.jpeg" /></figure><p>I used the same payload and got no reflection in the response.</p><p>So, I used the payload → “;ralert(1)// and got the reflection in the response but this script was not executable, of course, since there is no such JavaScript method as ralert()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pIBWGZjPzw50YLd_CwID-A.png" /></figure><p>I commented out the r in ralert() making the payload → “;/*r*/alert(1)//</p><p>Assuming this would work I hit the Send button in Repeater and was surprised to see the previous payload “;ralert(1)//”; in the response. I tried hitting the Send two times and got the same response back.</p><p>Annoyed, I aggressively kept hitting the Send button repeatedly…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*vcTdnodb8RVwTlIf-ve83w.gif" /></figure><p>And to my amazement, I got the intended payload “;/*r*/alert(1)// reflected in the response 😦😇.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w9G0s8UZWHpkNcMQ7-dB1A.jpeg" /></figure><p>So this was the strange thing about it, can we get our intended payload in the response just by mashing the send button repeatedly?<br>I checked to see if there were any Cache headers in the request, but there weren’t, I deleted a few unknown headers and yet this behaviour kept on repeating. Strange indeed.</p><p>I think I am missing out on something, maybe someone can pitch in.</p><p>As always, thank you for reading!! Happy hacking🙂.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18f2c60dbfd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I bought Raspberry Pi 4 to learn WiFi hacking]]></title>
            <link>https://medium.com/@ramkumarnadar47/i-bought-raspberry-pi-4-to-learn-wifi-hacking-32b5348d6aed?source=rss-12f3d8d983bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/32b5348d6aed</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[wifihacking]]></category>
            <category><![CDATA[iot-security]]></category>
            <dc:creator><![CDATA[Ramkumar Nadar]]></dc:creator>
            <pubDate>Sat, 30 Sep 2023 18:10:39 GMT</pubDate>
            <atom:updated>2023-09-30T18:10:39.901Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve faced some unique problems while setting it up. With this write-up, I would like to share my experiences resolving that problem and outline the installation journey.</p><p>First I bought the Pi from Amazon for an amount of ₹5,967</p><p><a href="https://www.amazon.in/gp/product/B07XT1QJ4S/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&amp;th=1">Raspberry Pi 4 Model B 4Gb Ram Micro Controller Board for IOT Electronic Hobby Kit</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-5u9V4zoJF0wUIMcUwSRIA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dUYBfgqsvreVuCCNs1hH-Q.jpeg" /></figure><p>You might be tempted to think that that’s that. But it is never that easy with computers.</p><p>There were additional components needed or I had to buy them to get it running as per my plan.</p><p>I wanted to use my old TV as a monitor, it supports HDMI input. So I had to buy a HDMI cable (micro to standard port).</p><p>It cost me ₹235.</p><p><a href="https://www.amazon.in/gp/product/B08PW6W54V/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&amp;psc=1">pibox India, Micro HDMI to HDMI Cable, 4K 60Hz, 1.5 Meter 5 feet, Adapter Ethernet Audio Return Compatible for Raspberry Pi 4 RPI, GoPro Hero 7, Sony Camera (NOT MINI DP/NOT MICRO USB)</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oc-UbkRj4DA2DQoHLMY7ZA.jpeg" /></figure><p>Next up for storage and booting, I bought the below SSD card for a sum of ₹439.</p><p><a href="https://www.amazon.in/gp/product/B0BDRVFDKP/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&amp;th=1">https://www.amazon.in/gp/product/B0BDRVFDKP/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&amp;th=1</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*on5sdrTGVhwG_gqqU7UOgw.jpeg" /></figure><p>This SD card needs to be loaded up with our OS. I intended to flash Kali Linux OS on it.</p><p>For that, first, you need to connect this memory card to your already existing system.</p><p>To get this card listed as a drive in your system you either had to have a separate card reader on you or your laptop or the system should have a card reader built onto it.</p><p>I had this very old card reader on me:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tr3mIDvzg73IGgcAUbbVuA.jpeg" /></figure><p>It had two slots on it: SD and microSD</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sLt2dl_rO_M7feXR" /></figure><p>My unique problem starts here:</p><p>I inserted my card into the microSD and the Windows was just not recognizing the card, it kept popping the error something to the effect of “Please insert your disk”. I mean the card reader was getting recognized but Windows recognized it as a reader without a card in it. I checked the storage space by seeing the properties and it showed 0 disk space.</p><p>To solve this problem, I inserted the card into my Android phone and it formatted the card. After that, using the card reader, my card was recognized.</p><p>After this, I installed the official Imager (the software which will put the OS in our SD card):</p><p><a href="https://www.raspberrypi.com/software/">https://www.raspberrypi.com/software/</a></p><p>And the OS itself: Kali Linux (ARM version for Pi 4–64 bit)</p><p><a href="https://www.kali.org/get-kali/#kali-arm">https://www.kali.org/get-kali/#kali-arm</a></p><p>To know more about installing Kali Linux OS on the SD card:</p><p><a href="https://davidbombal.wiki/kalilinuxpi">https://davidbombal.wiki/kalilinuxpi</a></p><p>Trying to image the card with Pi Imager I was facing this issue:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/0*qwrcnUri7AxdkV5p" /></figure><p>This error also caused the earlier problem to resurface, as in, it caused my memory card to be unrecognizable again.</p><p>Both these above problems were gruelling, to say the least. I suspected the file system to be an issue and upon research got to know that apparently, Pi requires the exFAT filesystem for the SD card. Thought this was the problem and again I put the card into my Android phone and made the card readable but when I tried to format it to FAT system (hoping FAT32 would work) found out that Windows by default does not support the card to be formattable into a FAT system with the support for 64 GB memory space.</p><p>To solve this issue, I downloaded this exe (guiformat.exe):</p><p><a href="http://ridgecrop.co.uk/index.htm?guiformat.htm">http://ridgecrop.co.uk/index.htm?guiformat.htm</a></p><p>And formatted the card to a FAT32 system with support for 64 GB storage space.</p><p>This time around also Pi Imager threw the same error “Error writing to storage”. Again this makes the card non-readable.</p><p>Someone wrote in the Pi forums that using a USB 2.0 slot for the card reader worked for him, so I did the same and switched from USB 3.0 to 2.0, but still no luck.</p><p>It was late at night and I was almost about to wind up but thought I should try one last method.</p><p>I was currently using the latest Pi imager: v1.7.5 and thought that could be a problem.</p><p>I downloaded the oldest version available from GitHub: v1.2 and installed it.</p><p><a href="https://github.com/raspberrypi/rpi-imager/releases/tag/v1.2">https://github.com/raspberrypi/rpi-imager/releases/tag/v1.2</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sEiq8xCwrcO-Whph" /></figure><p>Again I had to put the card in the Android phone and format it, making it 64 GB through guiformat.exe and initiate the imaging.</p><p>This time too the screen got stuck, as it was getting stuck earlier, lost hope and decided to wind up. Just when I was about to shut down the system, the imaging started. 1% writing -&gt; 2% writing…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*e646X_p8n-IY8xSn" /></figure><p>There goes my sleep…</p><p>After the card was ready I inserted it into the board.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WjC46b8wDWYxS1wa" /></figure><p>Note that to prevent the static electricity from damaging the board, I discharged myself off of it by touching the grounded PSU of my shut-down PC and additionally, I also wore rubber gloves.</p><p>It was recommended to use the official USB-C power supply with the 5.1V 3A output. Keeping the long run in mind, I shelled out another ₹830.</p><p><a href="https://www.amazon.in/gp/product/B07XY8F3P7/ref=ppx_yo_dt_b_asin_title_o07_s00?ie=UTF8&amp;psc=1">https://www.amazon.in/gp/product/B07XY8F3P7/ref=ppx_yo_dt_b_asin_title_o07_s00?ie=UTF8&amp;psc=1</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9rGz7X0wvY7wPOeS" /></figure><p>But please note that it works just fine even without this special charger, I gave power to the Pi via my phone charger’s USB 3.0 power cable connecting it to my PC’s USB 3.0 slot.</p><p>Let us connect all the attachments. (Power + HDMI + Mouse &amp; Keyboard + Ethernet)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hfofMy6yZoZs2Big" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q8peB_2BxskYS8o4" /></figure><p>Let’s turn on the power switch. The red and green lights will light upon the power reception.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PhEWwvRiVKAMRrBZ" /></figure><p>The monitor will go like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iry64cEo2v0la0i0" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uECm6Embp3zzfc6k" /></figure><p>And I go like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*QAJuCASJCNZKHQVM" /></figure><p>Always a pleasure to see the boot screen, always;)</p><p>Thereafter, it’s your usual Kali machine.</p><p>Login with username: kali and password: kali</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1dLUHfFYKGXXtHyP" /></figure><p>And go crazy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jd79e6b0mBLUtY6H" /></figure><p>The good thing about Raspberry Pi 4 Model B is that it comes with monitor mode enabled for WiFi, so you can learn some basic WiFi hacking in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3PEJP7TFUIJUSsZO" /></figure><p>Please note that you do not need a monitor, an HDMI cable, a keyboard or a mouse to get the Pi running if you have an already existing system, say, a laptop or a PC, you can use Putty with a VNC viewer to enable access to the Pi. Please go through the below blog to know more.</p><p><a href="https://www.instructables.com/How-to-Setup-Raspberry-Pi-Without-Monitor-and-Keyb/">https://www.instructables.com/How-to-Setup-Raspberry-Pi-Without-Monitor-and-Keyb/</a></p><p>Also, you can boot the OS with a flash drive or through the internet. Please watch to learn more:</p><p><a href="https://www.youtube.com/watch?v=shChBhapdTo&amp;ab_channel=GaryExplains">https://www.youtube.com/watch?v=shChBhapdTo&amp;ab_channel=GaryExplains</a></p><p>Thank you for reading!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32b5348d6aed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Desperate XSS]]></title>
            <link>https://medium.com/@ramkumarnadar47/desperate-xss-ce3619343f57?source=rss-12f3d8d983bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce3619343f57</guid>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-app-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Ramkumar Nadar]]></dc:creator>
            <pubDate>Mon, 31 Jul 2023 17:34:24 GMT</pubDate>
            <atom:updated>2023-08-03T14:55:56.569Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*fiv5eVrAI5AInTq1orJj_w.png" /></figure><p>This application was quite secure and it had this mechanism wherein one request can be sent only once, this validation I think was done by the URL query parameter “OWASP_CSRFTOKEN”. This essentially means you can’t take the request to Repeater and play around with it rather you’re going to have to intercept the request in real-time and inject the payload in the Intercept tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_lZUktVbd-ruRTHRzrEuw.png" /></figure><p>The value of the said token was reflected in the response under the context of a comment.</p><p>Having had the reflecting value, I tried and injected the payload appending the token, something to this effect:</p><pre>.jsp?OWASP_CSRFTOKEN=2F8A-XXXX-XXXX-XXXX/*alert(1)*/</pre><p>This logged me out of the application.</p><p>After a few trials and errors, I learnt that disturbing or changing the value of the token will most definitely throw me out of the application.</p><p>Then I got the idea to use the ampersand (&amp;) and inject the value. Something to the below effect:</p><pre>.jsp?OWASP_CSRFTOKEN=2F8A-XXXX-XXXX-XXXX&amp;/*alert(1)*/</pre><p>This time I got the reflection of the injected payload and I was not being logged out but the payload was not executing though. I thought the black listing was in play, so I tried many different payloads, but no luck.</p><p>Then I began to prepend the payload to try my luck out. Still no cigar.</p><p>In my desperation, I injected a new parameter named “xss” and gave it the value of the payload, prepending it to the “OWASP_CSRFTOKEN”.</p><pre>.jsp?xss=*/prompt(&quot;XSS&quot;)/*&amp;OWASP_CSRFTOKEN=2F8A-XXXX-XXXX-XXXX</pre><p>and it worked. Not straight away, but it did.</p><p>alert(1) was definitely not working. But prompt(“XSS”) worked before that I actually used another payload. I came under the impression that pop-up payload will just not work with this application, so I researched other ways and found out about this neat payload:</p><pre>console.log(document.domain)</pre><p>Using the above, you won’t get a pop-up. Rather, you will have to open the Console in the Developer Tools (Ctrl + Shift + I) in Chrome. If you find that the domain of your application is shown in the Console, it means that the above payload worked.</p><p>So above was just a brief explanation of the thought process involved. Let me illustrate the steps simply now;</p><ol><li>This is the original request.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-XYU31g2SVSQFoE2UTCcZg.png" /></figure><p>2. Below marked is the injection point, where the payload was injected.</p><pre>Payload: xss=*/prompt(&quot;XSS&quot;)/*&amp;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yaM9quaLyYmoZTcJeLwCOQ.png" /></figure><p>3. Payload was reflected under the context of a comment. Hence, I had to use the closing comment symbols (*/) and the opening comment symbols (/*). This leaves our prompt(“XSS”) uncommented and primed to execute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rUcW3lg-0czqFJMQ-ykSGQ.png" /></figure><p>This got executed. And we have a reflected XSS in our hands which can be shared with the URL.</p><p>Thank you for reading!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce3619343f57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hidden XSS]]></title>
            <link>https://medium.com/@ramkumarnadar47/hidden-xss-f34e5addb70d?source=rss-12f3d8d983bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f34e5addb70d</guid>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-application-security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Ramkumar Nadar]]></dc:creator>
            <pubDate>Sun, 23 Jul 2023 05:22:38 GMT</pubDate>
            <atom:updated>2023-07-23T05:22:38.912Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WLatdEcCSQ8odtJkRscVrQ.jpeg" /></figure><p>Learn the hard way that our typical XSS payload won’t execute if it is reflected in the hidden tag ( &lt;input type =”hidden”&gt; ).</p><p>Scratch my head for a while and after a light research found this Portswigger article by Gareth Hayes:</p><p><a href="https://portswigger.net/research/xss-in-hidden-input-fields">XSS in hidden input fields</a></p><p>This helped me to get the payload executed eventually.</p><p>Let me enumerate the steps involved:</p><ol><li>First I got my random input reflected in the response in the value attribute of the hidden input tag.</li><li>Then I used the typical payload which was not executing.</li><li>After reading the above-mentioned article, I injected this payload:</li></ol><p><em>appsec”+accesskey=”X”+onclick=”alert(‘XSS’)</em></p><p>4. Now with the above payload reflecting all you need to do is press Alt + Shift + X to get the pop-up.</p><p>Pressing Alt + Shift + X calls the access key, herein, ‘X’ and activates the hidden input field.</p><p>Please note that I could not get this working in Chrome, but it worked for me in Firefox (for some reason, it takes a while to get the pop-up, so be patient after pressing Alt + Shift + X).</p><p>Thank you for reading. Happy hunting!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f34e5addb70d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Combining Python + ChatGPT + Payload Processor (burp) for brute forcing OTP]]></title>
            <link>https://medium.com/@ramkumarnadar47/combining-python-chatgpt-payload-processor-burp-for-brute-forcing-otp-1a9ad9aca821?source=rss-12f3d8d983bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a9ad9aca821</guid>
            <category><![CDATA[api-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[application-security]]></category>
            <dc:creator><![CDATA[Ramkumar Nadar]]></dc:creator>
            <pubDate>Sat, 20 May 2023 14:41:12 GMT</pubDate>
            <atom:updated>2023-05-20T14:41:12.835Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQbtFx5LeCihuRXOzpuWOA.jpeg" /></figure><p>I failed big in this one and I failed forward. Sharing my experience through this article.</p><p>Before starting the brute force for OTP I checked whether there is any rate-limiting intervention or not. And there wasn’t.</p><p>I also checked for the OTP entering limit: I entered the OTP 15 times and there weren’t any limitations to it. I did so by entering the wrong OTP 14 times and entering the correct one on the 15th attempt and the request was successful. This made me think that there was no OTP entering limit. But boy was I wrong!</p><p>Let me recount the story from the beginning.</p><p>I had a requirement to brute force a 6-digit OTP but I couldn’t do it in a straightforward manner.</p><p>This request had to have a checksum attached to it. The checksum was derived from a checksum logic.</p><p>Let me illustrate the concept with artificial POCs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*U5NcG3uT2_jheNP71tMvcw.png" /></figure><p>In the above request, changing the “otp” and sending the request leads to a checksum error. This means that the checksum is derived from the OTP. Also changing the “ref” and “a1” values leads to a checksum error (shown in the response). This meant that the checksum is derived from all the values.</p><p>So, this means, before brute forcing, we first need to find the checksum logic and the hashing algorithm in use, that is to say, we need to find how exactly the above values are made to go through which hashing algorithm to get the above-shown checksum.</p><p>Essentially, in order for us to bruteforce this request, we’re going to need two things: 6 digit OTP wordlist and a corresponding checksum (derived from the checksum logic).</p><p>The mission for now is to get the checksum logic.</p><p>The first step in such a scenario is to check which hashing algorithm is in use.</p><p>Take the above checksum and analyze it using publicly available tools. Use multiple hash analyzing tools or websites to be sure.</p><p><a href="https://www.onlinehashcrack.com/hash-identification.php">Online Free Hash Identification identifier: find 250+ algorithms | Online Hash Crack</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YhJ7EJroqZ3m6phZBaLdhg.png" /></figure><p><a href="https://www.dcode.fr/hash-identifier">https://www.dcode.fr/hash-identifier</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LNaF5gWajsKgs_5ce-L-yA.png" /></figure><p>It seems like SHA-384 is in use.</p><p>Now, we go about finding the checksum logic. We do that by entering the above request values (and other values, if required) in an SHA-384 hash generator and getting the above-shown checksum. If you are very lucky, you might find the checksum logic to be very weak (no other values used apart from the one in the request, arrangement of the values in a sequential manner etc.)</p><p>In this case, the checksum logic is just the values present in the request ordered in a sequential manner. We get to know that by the hash value (checksum) match.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8NluUJ4byamFx7pwMiuI2Q.png" /></figure><p>After acquiring the logic, it’s now time to initiate the brute force, but now comes a new hurdle.</p><p>We need to enter the checksum along with the OTP. For the checksum part, we need to generate a SHA384 checksum (derived from the checksum logic) for every OTP.</p><p>That means we need to brute force the below two values in sequence:</p><p><strong>000000</strong> with the checksum of <strong>check23000000</strong></p><p><strong>000001 </strong>with the checksum of <strong>check23000001</strong></p><p><strong>000002 </strong>with the checksum of <strong>check23000002</strong></p><p><strong>000003 </strong>with the checksum of <strong>check23000003</strong></p><p>…</p><p>That also means that I need to generate a wordlist of the checksum logic ranging from <strong>check23000000</strong> to <strong>check23999999</strong></p><p>Basically, I needed to write — — 10 ^ 6 (1 and 6 zeroes) — — a 1000000 (a million) entries of the checksum logic.</p><p>Enter Python.</p><p>Generating a wordlist of logics manually would have taken me weeks if not days. I needed to automate the process through scripting.</p><p>Just a little background: For a while, I’ve been reading the book Automate the Boring Stuff with Python by <a href="https://www.youtube.com/user/albert10110">Al Sweigart</a>. Because of this, I was able to understand the syntax of Python. I recommend this <a href="https://automatetheboringstuff.com/">book</a> to anyone who wants to start up with scripting/programming without getting overwhelmed.</p><p>Now, I needed a script to generate the checksum logic wordlist for me. I took the help of ChatGPT for this. And after personalizing the code, below was the script I had: (script.py)</p><p>To the unwitting, copy-pasting the below code in the text editor and saving it with the extension of .py will create a Python script file for you.</p><pre>logic_string = &quot;CHECK23000000&quot;<br><br>with open(&quot;output.txt&quot;,&quot;w&quot;) as file:<br>    for i in range(1000000):<br>        code = str(i).zfill(6)<br>        new_string = logic_string.replace(&quot;000000&quot;, code)<br>        file.write(new_string + &quot;\n&quot;)</pre><p>The above code basically, takes the 000000 part of the defined string (logic_string), replaces it with values ranging from 000000 to 999999 and outputs the values onto the file ouput.txt</p><p>To run this script, I opened the terminal in the Python directory. (Enter cmd in the path)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*mHWGT1BVcWa-CH_J2mbH3Q.png" /></figure><p>Enter the command: python.exe &lt;file-path&gt;</p><p>You can just drag and drop the file to the terminal to get the path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*uADBXKRjKm_fXjYa12fjrg.png" /></figure><p>Because of the above script, in about two seconds, the checksum logic wordlist was ready.</p><p>output.txt is the file created by the Python script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*LQpv9vLDo2D6hVZS-4caMw.png" /><figcaption>Note that the file size is a beefy 14MB.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*-L3Ur_WxSZTTYaTv7I51QA.png" /></figure><p>For the <a href="https://github.com/danielmiessler/SecLists/blob/master/Fuzzing/6-digits-000000-999999.txt">6-digit OTP wordlist</a>, I used the <a href="https://github.com/danielmiessler">danielmiessler’s</a> repo.</p><p>Now, having both the wordlists at our disposal, we can initiate the brute forcing with Intruder. The Attack type to be set is Pitchfork since we need to iterate through both the wordlists simultaneously. Payload set 1 is going to be the 6-digit wordlist. Payload set 2 is going to be the checksum logic wordlist (Note that, loading the 14MB wordlist might take a while). Now remember that we need to enter the SHA384 hash as a checksum, not the checksum logic itself. So we’re going to run the Payload set 2 through the Payload Processor for converting the checksum logic to a hash value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pLN-GJQsE0Z0BNT0J3D2qw.png" /><figcaption>Use the Payload Processing section to process your payload before it is sent in the request.</figcaption></figure><p>Once all the configurations are done. Start the attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZHd4Bjy1phMqTlXxg5v2VQ.png" /></figure><p>See, how different OTP has different checksum to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3nafZX78HU72y9JWyzpFug.png" /></figure><p>Upon this brute-forcing reaching the correct OTP, I was expecting a successful response (I was performing the A-B testing). But to my dismay, I did not. There was indeed an OTP limit and it was somewhere between the 20th and 50th attempts, as I was still getting a successful response after the 20th but not before the 50th attempt.</p><p>It’s quite strange that so many attempts were allowed but still, the odds were strongly against a successful brute force attempt as I had only about 50 attempts to guess the correct one out of a million OTPs.</p><p>This was a grand failure for me but it was fun. The highlight of the episode was the Python script creating the wordlist in seconds. Really cherished that moment.</p><p>Thank you for reading!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a9ad9aca821" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create dump files (memory dumps) of Internet Explorer.]]></title>
            <link>https://medium.com/@ramkumarnadar47/create-dump-files-memory-dumps-of-internet-explorer-e7d4a5c1fffc?source=rss-12f3d8d983bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7d4a5c1fffc</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[digital-forensics]]></category>
            <category><![CDATA[application-security]]></category>
            <dc:creator><![CDATA[Ramkumar Nadar]]></dc:creator>
            <pubDate>Sat, 13 May 2023 07:15:25 GMT</pubDate>
            <atom:updated>2023-05-13T07:15:25.922Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1wu0betE_Cltk14e3f7euQ.jpeg" /></figure><p>The client’s org where I work has a checklist that pertains to checking sensitive information stored in the browser processes by the application. That is to say, we check the memory dumps of those processes for any sensitive information.</p><p>Taking the dump of Chrome and Mozilla is quite straightforward. You open the task manager, find the application, right click on it to get the option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*VKcpppw_rTfPQic6OH3xDw.png" /></figure><p>But you try the same method above for Internet Explorer and you get a greyed-out option. Apparently, IE is a closed-source program and I am presuming this acts as a security measure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*xyJG33gOmgAGJqip077rYw.png" /></figure><p>There are some legacy applications in our client’s environment which exclusively runs on IE. So we need IE to access the application.</p><p>Quick side note: Opening IE might redirect you to the Edge Browser. To prevent the same do the below;</p><p>Access the Internet Options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*v4fRuR80wdfMm0Hx4t1Oog.png" /></figure><p>Disable the highlighted option. (Enable third-party browser extensions*).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*6VynL5ZYtVvVBQj0WwIf7w.png" /></figure><p>Now to create dumps of IE, you’re going to have to download the <a href="https://learn.microsoft.com/en-us/sysinternals/downloads/procdump">ProcDump</a> tool. (Download link is given below)</p><p><a href="https://download.sysinternals.com/files/Procdump.zip">https://download.sysinternals.com/files/Procdump.zip</a></p><p>Extract the files to a folder and open a terminal over it (By entering cmd on the path bar).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*0aJTz0-1waQJYFXzwCmoTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*AFCtI-5Ra_nsIklbp5hYmg.png" /></figure><p>Now, open another terminal and enter the command tasklist. This will give the running processes’ names and their PIDs (process Ids). Getting the process name and/or PID(s) of Internet Explorer is essential to extract the dump.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*bAVs4A3hmldlDmZi1obxlg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*L_jq92Xl7i4ULZ2kjOLUAg.png" /><figcaption>Note, the two different PIDs for the same process name.</figcaption></figure><p>The Internet Explorer’s process name is iexplore.exe, Now the hitch here is since there are two processes running if you try to get the dump by the process name you’ll get an error “Multiple processes match the specified name”, so you need to specify the PID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*xIQXVtbIHCgRRyMTL_svcQ.png" /></figure><p>Command to create the dump by process name:</p><pre>procdump64.exe -ma iexplore.exe dump1.dmp</pre><p>procdump64.exe &gt; Executable File</p><p>-ma &gt; Takes a full memory dump. There are other flags too, but this one is used to take a complete dump of a given process.</p><p>iexplore.exe &gt; Process name that we took from the output of the tasklist command. You can also add the PID here (we’ll see that shortly).</p><p>dump1.dmp &gt; Path and file name of the dump to be created. (Here the path is the same directory as the ProcDump’s, as in, where we opened the terminal earlier)</p><p>Now, since we are getting the error by using the process name, we’re going to use the PID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*qpBbi4oS5R_Pw69RnOHdog.png" /></figure><p>And we’ve successfully created the dump file of the process with the process id 12272.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*lRWLk36sZTcfmw0OOWXTmw.png" /></figure><p>Now you can take the dump of the other PID as well. Once, done you can open the dump file in a Hex editor for analysis.</p><p>I am using WinHex for analysis (You can just drag and drop the dump file to its window).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qxtsP6z0AKDda9qvQm2_lA.png" /></figure><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7d4a5c1fffc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy SQL injection through Burp]]></title>
            <link>https://medium.com/@ramkumarnadar47/easy-sql-injection-through-burp-31cd8691e573?source=rss-12f3d8d983bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/31cd8691e573</guid>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Ramkumar Nadar]]></dc:creator>
            <pubDate>Sun, 26 Mar 2023 12:46:26 GMT</pubDate>
            <atom:updated>2023-03-26T12:46:26.052Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*0mzDhvKgnb4CN3Orfrj12A.png" /></figure><p>About two months ago I did this <a href="https://portswigger.net/web-security/essential-skills/using-burp-scanner-during-manual-testing">lab</a> from Portswigger academy wherein I learnt that instead of doing a full scan on the target or request, you can do a specific scan on the individual parameter(s). (I recommend you to check out the lab)</p><p>I completed that lab and forgot about it. In the present, I was assigned a project in which a full scan was not feasible, as in, every now and then requests were failing and some errors were shown. I am presuming there was a rate-limiting check. This forced me to find an alternative and the above lab was the solution.</p><p>This also impelled me to find SQLi through the same.</p><p>Let me explain in steps how I did it. (All the PoCs are self-constructed for NDA reasons)</p><p>First, there was this request with the parameter ‘individualid’ in it. I fuzzed it by adding an apostrophe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*K4wDuzuIKMWmXoMtmQ9sag.png" /></figure><p>And this threw the below SQL error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*KT9tFMZtshEnchR5RY-7bQ.png" /></figure><p>Next, I decided to do a scan on this particular parameter only. For this first you need to move the request to the intruder and add payload position on the value of your desired parameter, right click to open the context menu &gt; Scan defined insertion points &gt; Open scan launcher. Once the launcher is opened, configure it and start scanning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*e2a2H4tRqOewBut10QTcDA.png" /></figure><p>The alternative to the above is installing the extension ‘Scan manual insertion point’ which will enable you to start defined scanning from anywhere instead of moving the request to the intruder and doing the above.</p><p>All you need to do is highlight the value, right-click&gt; Extensions &gt; Scan manual insertion point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*8UfiN8nytfUIcKoDlVCdjg.png" /></figure><p>The results of both methods will be found in the dashboard. For the former, it will be shown as Audit of &lt;your-target&gt; and for the latter, it will be shown as Extension driven active audit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*Ul4vFDA__V1ADimcwvDFEQ.png" /></figure><p>You can also see the ongoing requests by clicking on ‘View details’ &gt; Logger. Analyzing this helps us understand how Burp tries to find vulnerabilities. It’s worth a look, even if it is a cursory one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*ZgmI_8al3cyVmeqcjv1f-w.png" /></figure><p>You’ll find the discovered vulnerabilities under ‘Issue activity’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*mZ544nC1T9GlnGZwwEVaVg.png" /></figure><p>I enumerated a few table names to boot for PoCs using the payloads from <a href="https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/SQL%20Injection/MySQL%20Injection.md">PayloadsAllTheThings</a>.</p><p>The above request was also put under SQLMap but to no avail. This highlights the importance of using multiple tools for scanning.</p><p>And nothing would have begun if it wasn’t for that initial fuzzing (adding apostrophe) which highlights the importance of manual enumeration.</p><p>Takeaway: Do manual enumeration first and then do automated enumeration through multiple tools.</p><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31cd8691e573" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Account Takeover in an Android Application]]></title>
            <link>https://medium.com/@ramkumarnadar47/account-takeover-in-an-android-application-f7f60ef0b0eb?source=rss-12f3d8d983bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7f60ef0b0eb</guid>
            <category><![CDATA[android-security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Ramkumar Nadar]]></dc:creator>
            <pubDate>Tue, 21 Mar 2023 09:12:04 GMT</pubDate>
            <atom:updated>2023-03-21T09:12:04.332Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*5rndwhJDnr_tze-ekTqZSw.png" /></figure><p>This is my first major finding in the mobile (android) pen test.</p><p>Due to NDA with the client, I am going to use self-constructed PoCs and names for illustration</p><p>Let us begin.</p><p>First off, I started by perusing the source code for understanding the code logic. I used <a href="https://github.com/skylot/jadx/releases/tag/v1.4.6">jadx 1.4.6</a> for the same. I found one class named LoginActivity which had the below code.</p><pre>// demo code<br><br>if (this.pref.getBoolean(ActivationPendingLayout.IFapproved, false)) <br>                startActivity(new Intent(this, MainActivity.class));<br>                finish();<br>{</pre><p>Basically, this code is checking if the IFapproved value is set to true or false in the shared preferences file (Login.xml). If it is true it starts the MainActivity (The activity which comes after successful authentication, that is, after LoginActivity).</p><p>Next up, I logged in to the application using credentials of Alice through a rooted device. (I do so because you can access the shared preferences folder only through a rooted device).</p><p>Now, through the ADB, I acquired the Login.xml file.</p><pre>C:\Users\Appsec\Desktop\&gt;adb pull /sdcard/Download/Login.xml<br>/sdcard/Downlaoad/Login.xml: 1 file pulled, 0 skipped. 0.1 MB/s (471 bytes in 0.005s)</pre><p>The Login.xml file was first copied to the sdcard folder. A direct copy was denied due to a permission check, so I had to first copy the file to the sdcard directory.</p><p>Then I logged out of the application.</p><p>I opened the Login.xml file through a text editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*1EjTm8FFbHKc3TDf80cs_w.png" /><figcaption>There were other values present too. I skipped them for convenience and security reasons.</figcaption></figure><p>The name and id value was changed to that of the victim (Bob).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*Z44rfkr0YGwYbiNnhxNAOA.png" /></figure><p>Once done I pushed the file to the device replacing the original file with the edited one. (A direct push to the destination directory was denied, so first, the file was copied to the sdcard directory and from thereon to the destination directory.)</p><pre>C:\Users\Appsec\Desktop\&gt;adb push Login.xml /sdcard/Download/Login.xml</pre><p>Now to my amazement when I opened the application I was directly given the dashboard of the user Bob without the preceding login screen which asks for a username and password thereby bypassing the authentication activity.</p><p>I checked whether the internal functions were truly available or not as the user Bob and it was.</p><p>The above was first possible because of the application running on a rooted device which highlights the importance of a strong root detection mechanism. The root detection was bypassed before the above exploit through Magisk (enforce denylist) and also the SafetyNet was bypassed through the help of this <a href="https://www.youtube.com/watch?v=ss0rq6jNHQM&amp;t=229s&amp;ab_channel=munchy">video</a> by <a href="https://www.youtube.com/@munchy_cool">munchy</a>.</p><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7f60ef0b0eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I did JSON CSRF or did I?]]></title>
            <link>https://medium.com/@ramkumarnadar47/i-did-json-csrf-or-did-i-4c4a82493b69?source=rss-12f3d8d983bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c4a82493b69</guid>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Ramkumar Nadar]]></dc:creator>
            <pubDate>Tue, 21 Mar 2023 03:47:38 GMT</pubDate>
            <atom:updated>2023-03-21T03:47:38.954Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I am going to dissect how I performed the JSON CSRF. By the time you reach climax, I hope you realize the futility of it. Achieving it for me was akin to hunting an already dead target without knowing it was dead.</p><p>You’ll get the metaphor. Read on.</p><p>Before we start, I am going to use self-constructed POC for illustration. My client has a very strict policy against using the organization’s resources for publication and I am contractually bounded to not use any of their information in whatever manner in the public domain. So everything below bears dummy data. And we’re gonna use the target name as ‘redacted.com’ (I made a typo in creating requests, Host is written as ‘demo.testfire.net’ please consider it as redacted.com)</p><p>Let us begin.</p><ol><li>To achieve CSRF, first, we need to have a state-changing request with the absence of a CSRF token (or a poor token implementation). I had those in place. Below is that request.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RtIxoaj4zRqOxJHyrrcOZw.png" /><figcaption>Note that the “ClockInId” is an integer.</figcaption></figure><p>2. Response to the above request was this;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*3uxDLULB4IbqOc4Qz4jALA.png" /><figcaption>Note that the Access-Control-Allow-origin is set to wildcard(*)</figcaption></figure><p>From the articles, that I’ve referred I’ve learnt that first, we have to change the Content-Type from application/json to others to see if the application accepts it or not. For me, it was not accepting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LF3L3CpODAyKvk4MaO-_JA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*g9smijzIFKa49jPUdzlddQ.png" /></figure><p>Now the final way was to attempt the CSRF with the Content-Type set to application/json</p><p>For this second attempt, we first enter the input in the web interface and intercept the request. Once intercepted, move the request to Repeater and drop the request.</p><p>Now, generate CSRF PoC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQg6tIut_tU8q67vdAb24Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*npxf_3ltTreCDaQLj5C4tw.png" /></figure><p>Note that, by default, the encoding type is set to “text/plain”, this won’t work as we have already tested and Burp also indicates the same in the marked. So we need to construct an appropriate PoC applicable for JSON requests as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*vf7f4qICDO4kFNHLohZ7Fg.png" /></figure><p>This will generate a Cross-Domain request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*bjIuZRFFhEdAoC29gR28pA.png" /><figcaption>Note that the xhr.withCredentials is set to ‘true’.</figcaption></figure><p>Burp warns us that our PoC will most probably initiate a preflight request.</p><p>Once the PoC is up and ready, click on ‘Test in browser’, it will create a link for you, go to that link through the browser connected to Burp. When I did so, a preflight request was initiated.</p><p>A preflight request is sent by a domain to a different domain to check whether the request is allowed or not.</p><p>The purpose of the preflight request is nicely explained by the ChatGPT response;</p><blockquote><em>Preflight requests are sent as part of the Cross-Origin Resource Sharing (CORS) mechanism to determine whether a cross-origin request, which is a request to a different domain than the one that served the original web page, is safe to make.</em></blockquote><blockquote><em>These requests are sent as an OPTIONS request, which includes specific headers indicating the origin, methods, and headers that the client intends to use in the actual request. The server can then respond with headers that allow or deny the request based on its policies.</em></blockquote><blockquote><em>The purpose of the preflight request is to ensure that the actual request does not violate the server’s security policies, such as the Same-Origin Policy, which restricts web pages from making requests to a different domain than the one that served the page.</em></blockquote><p>Our preflight request looked something like the below;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cLLdcIhokSXQalb-_vjcPQ.png" /><figcaption>Note, the origin.</figcaption></figure><p>And the response to it looked like this;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*5TE8Ajpoiiy1qp3B9Cz7ZQ.png" /><figcaption>Note, the Access-Control-Allow-Origin is set to wildcard (*)</figcaption></figure><p>But after this, our original request was not successful. I opened the console to find the below error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41KZRO0oEDQoiJ9OiXzNxA.png" /><figcaption>The above error was found in Google images. I edited over it for illustration.</figcaption></figure><p>Essentially, the above error says that when ACAO is set to * for the resource you can’t send the credentials (In our case, the Cookie).</p><p>So I removed the below attribute from the CSRF PoC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*tWWTvi3aplag7H35rzug-A.png" /></figure><p>Now with the newly created PoC, credentials will not be sent in the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LS4j9C1cWh8Yn4xZ1DQjHw.png" /></figure><p>Note that the cookie header is missing in the request. This request was successfully executed. And I tested this POC on my colleague’s system using his ClockInId by generating the HTML and sending the page to him. The attack was successfully performed.</p><p>Unwittingly everything went smoothly and I never stopped to realize how can an application know from whom the request is being sent without the Cookie header. I paraphrase, how the application will get to know for whom this particular request (attack) is to be processed without the Cookie, I mean there should be some identifier.</p><p>The above line of thought got evoked in me owing to some probing questions by my colleagues.</p><p>The very next day I picked up the above request and removed the cookie header and a series of other headers to see if the request is successful regardless of any authentication and to my expectation it was.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*SEAEelw__OoEHATJkehj4A.png" /><figcaption>Stripped off request with no authentication parameter.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*mTgE8mef5nTpng3IyNi0HA.png" /><figcaption>Successful response.</figcaption></figure><p>The CSRF attack was possible but it was also pointless. Why would you go through all the trouble of the above when all you needed was just the above stripped-off request? This request is an API call which was not tied to the application’s session. In an ideal scenario when you log out of the application the API it embeds should also be rendered useless. But in our case, it wasn’t. This API had no session management, it stayed alive for days and all you needed was the ClockInId of other users (which is integer based — easy to brute force) to perform a successful exploit (Broken Access Control through lack of session management).</p><p>But our intricate and pointless CSRF attack was also possible because ACAO was set to wildcard (*). If it was set properly like hardcoding the host in ACAO then our main request would never be sent by the browser after the preflight request since we would have failed the ACAO check.</p><p>Takeaway: 1) Check the status of API after logging out of the application.</p><p>2) Check for CORS misconfiguration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c4a82493b69" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Active Directory Explained.]]></title>
            <link>https://medium.com/@ramkumarnadar47/active-directory-explained-c15b6aa68a2a?source=rss-12f3d8d983bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c15b6aa68a2a</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[windows-active-directory]]></category>
            <dc:creator><![CDATA[Ramkumar Nadar]]></dc:creator>
            <pubDate>Sun, 26 Feb 2023 11:24:39 GMT</pubDate>
            <atom:updated>2023-02-26T11:24:39.436Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Windows Workstation and Domain Controller." src="https://cdn-images-1.medium.com/max/902/1*dwl3am8-1e7K6hIh3R6hqg.jpeg" /></figure><p>Active Directory is another one of these things whose explanation for me was far more cryptic than the actual thing itself. After scratching my head for a good long while, I finally decided to understand it, at least to the point of giving a brief summary of it.</p><p>Do you want to understand it? Don’t ask ‘what?’ ask ‘why?’. If you ask ‘what’ it is, you’ll find terms like the forest, trees, and trust. ‘Trust’ me you don’t wanna go that way. So let us understand why very simply. Imagine you have about two dozen computers in your organization. A promising absconder joins your organization, sits on every other computer and makes his user id on every one of them and one day suddenly he scoots. Now the admin has the trouble of deleting his user account on every one of those computers. Admin dreams of a technology where he could just delete the absconder’s user id on one computer, such that, every other computer will have its own corresponding user-id deleted. Enter Active Directory.</p><p>The above-imagined scenario was on a P2P network. For Admin to have his dream realized he first has to upgrade to a client-server model of the network architecture and install Microsoft Windows Server [2000 to 2022] on the server and once the installation is completed he will be greeted by the Server Manager window and this is the place where he gets to add roles to the server, one of the roles being ‘Active Directory Domain Services’. [It just means that he gets to install Active Directory]</p><figure><img alt="Windows Server Manager Dashboard" src="https://cdn-images-1.medium.com/max/1024/1*HITSS6u_h-zXn1XyaPjDGw.png" /></figure><figure><img alt="Add Roles and Features Wizard" src="https://cdn-images-1.medium.com/max/796/1*o66zAzO1Dk-z4nR3ieTAlg.png" /></figure><p><em>Quick Clarification -&gt; Active Directory actually means a suite, or set, of services with AD DS (Active Directory Domain Services) as a part of it. These terms are interchangeably used leading to even more confusion.</em></p><p>Once you install the AD DS on the server, it becomes a Domain Controller (DC). Domain, Trees, Forest etc. All these terms are just a way of organising the components of your network. For eg. 10 computers and a DC(server) in your organization can make up a domain. Another building of your org must have more computers forming a domain. These domains together form a tree, you can have more trees. All these trees together form a forest. Forest, I believe, is the topmost classification.</p><figure><img alt="Active Directory Users and Computers." src="https://cdn-images-1.medium.com/max/686/1*QrS_PrVnzB6xylSyhqDUqw.png" /></figure><p>‘ram.local’ is the domain name I have set and under it, you have all the objects, that is, the components of that network. One of the components is the domain controller, I have only one domain controller in my domain and it is named ‘SERVER1’. You can have more than one DC for redundancy/backup purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*-ev7AQsUnroFI6oawG0cJg.png" /></figure><p>I have added one other computer to the domain as a workstation and I named it STATION1, It is found in the Organizational Unit(OU) [the folder above the folder Domain Controllers], Computers. OUs (the folders above) are a way to organize the AD objects and they can also be used to apply policies, which is out of the scope of this article.</p><p>You can add scores of computers as workstations and you don’t need to worry about deleting the user account in all of the computers if the aforementioned scenario is to happen. Because in AD DS usernames, passwords, and accounts are all stored in the AD DS Database. Admin has to delete the account from the DC which is the host of the Database and that’s it. Changing the password happens in one swoop, no need to go to each and every computer to change the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IzHWoZyGKRWB_AOuRnpMBQ.jpeg" /></figure><p>I’ve added my old laptop (Windows 10 Pro) as a workstation to the domain ‘ram.local’, the domain controller of the domain was my PC (Windows Server 2019 — running on Virtual Box with the host system being Windows 10 Pro). Take note that only Windows 10 Pro and Enterprise installed devices can join the Domain.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FYEXVyEalFLU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DYEXVyEalFLU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FYEXVyEalFLU%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/ef031d6daf02196e438bb0c3da6d1dbf/href">https://medium.com/media/ef031d6daf02196e438bb0c3da6d1dbf/href</a></iframe><p>This setup proved to be a thrilling journey and it was climaxed by the ‘Hi’ greeting from the Windows, it was truly a Eureka moment for me.</p><p>The whole process of the above strangely went really smooth, what should have gone wrong, did not and I followed through the video of <em>ittaster</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfRBV-NzYAZw%3Flist%3DPLseqMIwVJlNIlauKIp95HLRYNU0BH98pm&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfRBV-NzYAZw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FfRBV-NzYAZw%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/c4b841f94b64cf85b83481c98ba99137/href">https://medium.com/media/c4b841f94b64cf85b83481c98ba99137/href</a></iframe><p>Huge shout out to him. Check out his content and follow him on twitter.</p><p><a href="https://twitter.com/it_taster.">https://twitter.com/it_taster</a></p><p><a href="https://www.youtube.com/channel/UCxf9VicLnyvZhGplp1SMWVA">ittaster</a></p><p>Thank you for the read.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c15b6aa68a2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>