<?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 Nanditha Harish Bhat on Medium]]></title>
        <description><![CDATA[Stories by Nanditha Harish Bhat on Medium]]></description>
        <link>https://medium.com/@nandithahbhat?source=rss-b80d6c221d54------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rtbxy6_qL4iOvf-pZwrJpw.jpeg</url>
            <title>Stories by Nanditha Harish Bhat on Medium</title>
            <link>https://medium.com/@nandithahbhat?source=rss-b80d6c221d54------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 03:49:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nandithahbhat/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[I Got Root on a Server in My OS Class, Then Spent the Rest of the Lab Locking Myself Out]]></title>
            <link>https://medium.com/@nandithahbhat/i-got-root-on-a-server-in-my-os-class-then-spent-the-rest-of-the-lab-locking-myself-out-ffcd8fe76171?source=rss-b80d6c221d54------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffcd8fe76171</guid>
            <category><![CDATA[buffer-overflow]]></category>
            <category><![CDATA[memory-safety]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Nanditha Harish Bhat]]></dc:creator>
            <pubDate>Fri, 12 Jun 2026 14:22:20 GMT</pubDate>
            <atom:updated>2026-06-12T14:53:27.747Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part 1 of “Down the Stack”: a descent from web bugs to silicon.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/0*k3A8CLQ52NNMysfV.jpg" /></figure><p>If you’ve done SQL injection, you already understand the concept: mixing untrusted input with trusted commands. Here’s the same idea one layer down and the four things that make it genuinely tricky to exploit.</p><p>If you’ve ever exploited SQL injection or XSS, you already know the moral of this story: <strong>never trust input that crosses a boundary.</strong></p><p>In a web app, untrusted input crosses into a query or a page, and the system mistakes your <em>data</em> for <em>commands</em>. A buffer overflow is the same crime, one floor down, in the program’s own memory. And down there, the “command” you smuggle in isn’t a query. It’s <em>which instruction the CPU runs next.</em></p><p>In my Secure Software Design lab, I exploited a vulnerable network service and walked away with a root shell. But the part that actually taught me something was the second half, when I was made to turn around and defeat my own exploit, one defense at a time.</p><h3><strong>The bug is almost insultingly simple</strong></h3><p>The target was a classic: a server that copies network input into a fixed buffer of 100 bytes (using a function with no bounds checking) while happily accepting up to 517 bytes. That’s it. That’s the whole vulnerability. The program never asks “does this fit?”</p><p>Two details made it dangerous. It ran as <strong>root</strong>, and it was reachable <strong>over the network</strong>. That second part is why the “server version” hit home for me: the malicious input arrives through a TCP socket, the exact same delivery channel as the web payloads I’d been writing about. Same door. The thing waiting on the other side is just lower-level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*NNrA-CBUIspOVdM1KJi-LQ.png" /><figcaption>A service that tells you where its own memory lives is a service that trusts you far too much.</figcaption></figure><h3><strong>Getting root (the short version)</strong></h3><p>When input overflows that 100-byte buffer, the excess doesn’t vanish. It keeps writing into the memory right next to the buffer, including the <strong>saved return address</strong>, the note that says “when this function finishes, jump back to <em>here</em>.”</p><p>Overwrite that note, and the function returns to an address <em>you</em> chose instead. Point it into a region of harmless filler instructions that slide down into your payload (a “landing zone”), and control flow is yours. Because the service ran as root, the shell I landed in was root too. whoami came back root on the first try.</p><p>I’m deliberately keeping that conceptual: no payload, no script. The mechanism is the lesson; the working exploit is just plumbing, and it belongs in a sandbox, not a blog.</p><p>What’s worth sitting with: this is the <em>same instinct</em> as parameterized queries. Upstairs on the web, you stop letting input become query structure. Downstairs, you stop letting input become control flow. <strong>Respect the boundary. Measure before you pour.</strong></p><h3><strong>Then I had to lock myself out, four ways</strong></h3><p>Here’s the half nobody screenshots for clout. The exploit above only worked because every modern protection was switched <em>off</em> on purpose. The real assignment was turning them back on and watching my “trivial” attack die.</p><p><strong>Wall 1: ASLR (move the furniture every time).</strong> Address Space Layout Randomization scrambles where things live in memory on every run, so a hardcoded target address points at nothing. I connected five times and logged what the server reported.</p><p>No pattern, all over the map, and my exploit’s fixed return address was instantly worthless. The catch: a 32-bit system only has about 19 bits of stack entropy (~500K possibilities), which a persistent attacker can brute-force in minutes-to-hours. On 64-bit, the entropy jumps high enough to make that hopeless. (One more quiet argument for retiring 32-bit.)</p><p><strong>Wall 2: StackGuard (a tripwire before the exit).</strong> Recompile with the stack protector and the compiler slips a secret “canary” value in just before the return address. Overflow far enough to reach the return address and you <em>have</em> to trample the canary on the way. The function checks it before returning, sees it’s wrong, and bails:</p><pre>*** stack smashing detected ***: terminated</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*hEN9h9aDOFMsC1Y5X0ymxQ.png" /><figcaption>The canary died so the return address didn’t have to.</figcaption></figure><p>It catches the corruption <em>before</em> control flow can be hijacked. Its weakness: if you can <em>read</em> the canary through a separate leak, you can forge it.</p><p><strong>Wall 3: NX (data is not code).</strong> The No-eXecute bit marks the stack as non-executable at the hardware level. So even if you overflow perfectly and land execution right in your payload, the CPU refuses to run data as instructions and faults out:</p><pre>Segmentation fault (core dumped)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*DItBsilkIkL35fjfehEsBg.png" /><figcaption>Perfectly placed shellcode, zero permission to run.</figcaption></figure><p>Its weakness is the most interesting one, because it’s where attackers got <em>creative</em>: if you can’t inject new code, reuse the code that’s already there. <strong>Return-oriented programming</strong> stitches together tiny fragments of the program’s own legitimate instructions to do your bidding: no new code, so nothing for NX to block.</p><h3><strong>The real takeaway</strong></h3><p>No single wall is enough. ASLR falls to a leak. The canary falls to a leak. NX falls to ROP. The protection isn’t any one of them. It’s <em>all of them stacked</em>, plus the boring fundamentals: run services with the least privilege they need, and stop writing the bug in the first place by using memory-safe languages.</p><p>That last point isn’t academic anymore. A 1970s-era bug class still ships in production C and C++ today, which is exactly why “rewrite it in something memory-safe” went from hobbyist talking point to government and industry policy. The cheapest defense against everything above is a language that won’t let you overflow the buffer to begin with.</p><h3>Where this goes next</h3><p>The stack is the <em>tidy</em> version of this story: neat frames, a return address sitting in a predictable spot. The next layer down is the <strong>heap</strong>, where memory is handed out and freed dynamically and the boundaries get genuinely murky. Same instinct, messier battlefield.</p><p>Same lesson, all the way down. That’s the series.</p><blockquote><em>Program testing can be used to show the presence of bugs, but never to show their absence!”</em><br> Edsger W. Dijkstra, <em>Notes on Structured Programming</em> (1970)</blockquote><p>⚠️ <em>Written for education and defense. Everything here used the SEED Labs framework on a deliberately vulnerable server inside an isolated Docker network, with protections disabled on purpose. The goal is to build systems that don’t make these mistakes.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffcd8fe76171" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Made a CPU Crash by Changing Its Voltage (And You Can Too)]]></title>
            <link>https://medium.com/@nandithahbhat/i-made-a-cpu-crash-by-changing-its-voltage-and-you-can-too-7a5ccb1a6e6b?source=rss-b80d6c221d54------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a5ccb1a6e6b</guid>
            <category><![CDATA[chipwhisperer]]></category>
            <category><![CDATA[side-channel-attacks]]></category>
            <category><![CDATA[fault-injection]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <category><![CDATA[hardware-security]]></category>
            <dc:creator><![CDATA[Nanditha Harish Bhat]]></dc:creator>
            <pubDate>Tue, 05 May 2026 20:11:24 GMT</pubDate>
            <atom:updated>2026-05-05T20:11:24.465Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Photo by Stockcake" src="https://cdn-images-1.medium.com/max/500/0*WHdyrf8l-NmNOUEN" /><figcaption>Photo by Stockcake</figcaption></figure><p>I sent 7,500 power glitches to an ARM chip. On attempt 973, something incredible happened: I made the processor forget how to count.</p><p>Let me show you what attacking hardware actually looks like.</p><h3>The Setup</h3><p>A small circuit board on my desk. An ARM Cortex-M0+ microcontroller — the same chip you’d find in smart locks, medical devices, or IoT sensors. A laptop running Python scripts. And a tool called ChipWhisperer Nano that costs less than a textbook.</p><p>My goal? Make the chip do something it was never supposed to do. Not by writing clever code or finding a buffer overflow. By manipulating its power supply.</p><p>This is voltage fault injection. And it’s one of the scariest hardware attacks you’ve never heard of.</p><h3>What Even Is Voltage Glitching?</h3><p>Think of a CPU like your brain trying to solve math problems. Now imagine someone flickering the lights on and off while you’re working. You might skip a step. Write down the wrong number. Forget what you were doing entirely.</p><p>That’s essentially what voltage glitching does to a processor.</p><p>Every instruction a CPU executes requires stable power. When you briefly drop the voltage — we’re talking microseconds here — the chip doesn’t have enough energy to complete its operation correctly. Instructions get skipped. Calculations produce wrong results. Security checks suddenly stop working.</p><p>The beautiful part? The chip doesn’t know it made a mistake. It just keeps running with corrupted state.</p><h3>My First Target: A Loop That Should Run 100 Times</h3><p>I started with something simple. The microcontroller was running a program with a loop:</p><pre>for (i = 0; i &lt; 100; i++) {<br>    // do something<br>}</pre><p>Basic stuff. The chip should execute this 100 times, then move on.</p><p>My goal: Make it run exactly once.</p><p>Here’s the attack setup:</p><pre># ChipWhisperer glitch configuration<br>scope.glitch.clk_src = &quot;clkgen&quot;<br>scope.glitch.output = &quot;glitch_only&quot;<br>scope.glitch.trigger_src = &quot;ext_single&quot;</pre><pre># Parameter sweep - finding the magic combination<br>for repeat in range(1, 20):<br>    for ext_offset in range(0, 60):<br>        scope.glitch.repeat = repeat<br>        scope.glitch.ext_offset = ext_offset<br>        <br>        scope.arm()<br>        target.simpleserial_write(&#39;g&#39;, bytearray([]))<br>        <br>        ret = target.simpleserial_read(&#39;r&#39;, 4)<br>        if ret and ret[0] == 1:  # Success!<br>            print(f&quot;GLITCH SUCCESS: repeat={repeat}, offset={ext_offset}&quot;)</pre><p>The parameters I could control:</p><ul><li><strong>repeat</strong>: How many glitch pulses to send (duration)</li><li><strong>ext_offset</strong>: Fine-tuning the timing (when to hit)</li></ul><p>Then I started sweeping parameters. Try one combination. Check if the loop broke. Move to the next combination. Repeat 7,500 times.</p><h3>7,500 Attempts Later</h3><p>Most glitches did nothing. The chip would reset. Or the loop would run normally. Or the program would crash in a way that wasn’t useful.</p><p>But on attempt 973, I got it.</p><p><strong>The loop executed once and then exited.</strong></p><p>The winning parameters: repeat=12, ext_offset=42.</p><p>I had corrupted the loop counter instruction. Made the processor skip the comparison that checks i &lt; 100. The chip thought it had already finished 100 iterations when it had only done one.</p><p>99 out of 100 iterations just… vanished.</p><p>When I looked at the data from all 7,500 attempts, the pattern was stark. Imagine a massive grid where each cell represents one parameter combination — one specific timing and duration of the voltage drop. The entire grid is dark (failed attempts) except for one bright spot: attempt 973.</p><p>That single glowing cell at coordinates (repeat=12, ext_offset=42) represented the exact microsecond window where the CPU was vulnerable. Off by even 10 nanoseconds in either direction? Nothing. But hit that precise moment? Complete instruction corruption.</p><h3>Why This Is Terrifying</h3><p>Here’s what makes voltage glitching so dangerous:</p><p><strong>It bypasses software entirely.</strong> You’re not exploiting a coding mistake. You’re exploiting physics.</p><p><strong>It’s incredibly precise.</strong> We’re talking sub-microsecond timing. The glitch I used lasted less time than it takes light to travel across a room.</p><p><strong>It’s hard to detect.</strong> The chip doesn’t log errors. There’s no stack trace. From the processor’s perspective, everything executed normally.</p><p><strong>And it works on real products.</strong></p><p>That ARM Cortex-M0+ I was testing? It’s in production devices right now. Smart locks. Payment terminals. Industrial controllers. Any of them could potentially be vulnerable to the same attack.</p><h3>What Else Can You Break?</h3><p>Once you can corrupt instructions, a lot of security mechanisms fall apart:</p><p><strong>Secure boot verification?</strong> Skip the signature check instruction. The system boots unsigned firmware without complaint.</p><p><strong>PIN verification?</strong> Glitch the comparison that checks if your entered PIN matches the stored one. Wrong password suddenly becomes the right password.</p><p><strong>Encryption operations?</strong> Corrupt intermediate calculations and the output becomes predictable. Extract keys from systems that should be cryptographically secure.</p><p>I actually tried this. Set up a password bypass experiment where the chip was supposed to reject my incorrect password. I sent 6,855 glitches targeting the password check routine.</p><p>Every attempt failed. The chip reset or rejected the password correctly.</p><p>But here’s the thing — I was learning. Each failed attempt taught me something about the chip’s timing, its vulnerability windows, its power characteristics. When I plotted success rate versus parameter combinations, I could see “warm spots” in the data — regions where glitches caused unusual behavior even if they didn’t achieve the full bypass.</p><p>In a real attack scenario, you have unlimited attempts. And eventually, with enough patience and the right parameters, defenses crack.</p><h3>The ChipWhisperer Advantage</h3><p>You might be thinking: “This sounds like you need expensive lab equipment.”</p><p>Nope. The ChipWhisperer Nano I used costs about $60. It connects via USB. The entire attack runs from Python scripts.</p><p>NewAE Technology (the company behind ChipWhisperer) basically democratized hardware attacks. What used to require oscilloscopes, custom power supplies, and deep electrical engineering knowledge is now accessible to anyone who can write basic Python.</p><p>That’s exciting for researchers like me. But it’s also concerning if you’re designing secure systems.</p><h3>The Parameter Hunt</h3><p>The successful glitch had these exact parameters:</p><ul><li><strong>repeat = 12</strong> (glitch pulse count)</li><li><strong>ext_offset = 42</strong> (timing offset)</li></ul><p>Those numbers mean nothing in isolation. But they represent hours of automated testing, sweeping through thousands of combinations, waiting for that one magic configuration where the timing aligns perfectly with the instruction you want to corrupt.</p><p>It’s like safecracking, except instead of listening for tumblers, you’re watching power traces and looking for the exact microsecond when the CPU is vulnerable.</p><p>The full parameter space looked like this in the data:</p><pre>Attempts: 7,500<br>Successes: 8 (0.11% success rate)<br>Most reliable: repeat=12, ext_offset=42</pre><p>When I visualized the results as a heatmap — with repeat values on one axis and ext_offset on the other — most of the grid was cold (blue, no effect). But there was a narrow diagonal stripe where attempts produced unusual results: partial crashes, unexpected output values, timing anomalies. And right in the center of that stripe was the hot spot: full instruction skip.</p><p>That visualization told me something important: the vulnerability window isn’t random. It follows the chip’s internal clock cycles. If you know the architecture, you can predict roughly where to look.</p><h3>What I Learned</h3><p>Hardware attacks feel different from software exploits.</p><p>With software, you’re working in abstractions. Memory addresses, function calls, string buffers. It’s all logical structures you can reason about.</p><p>With hardware, you’re manipulating reality. Voltage levels. Electromagnetic interference. The physical propagation of electrons through silicon.</p><p>When that loop glitch finally worked, I wasn’t looking at a successful exploit — I was looking at proof that I’d found the exact moment in time when a calculation was vulnerable. I’d reached through the software layer and touched the hardware directly.</p><p>That’s a fundamentally different kind of power.</p><h3>Why This Matters</h3><p>Every embedded system you interact with probably has some kind of security check:</p><ul><li>Your car’s key fob authentication</li><li>Your phone’s secure element</li><li>Your laptop’s TPM chip</li><li>Your smart home devices</li><li>Medical implants</li><li>Industrial control systems</li></ul><p>All of them run on processors. All of them need stable power to execute instructions correctly. And all of them are potentially vulnerable to voltage fault injection.</p><p>The scary part isn’t that this attack exists. It’s that most systems aren’t designed with glitching in mind. Security models assume attackers work at the software level. But if you can manipulate the hardware, a lot of those assumptions break down.</p><h3>The Defense Side</h3><p>Not all hardware is equally vulnerable. Some countermeasures exist:</p><ul><li><strong>Redundant checks</strong> (run security-critical operations multiple times)</li><li><strong>Voltage monitoring</strong> (detect when power supply goes outside normal range)</li><li><strong>Light sensors</strong> (some chips detect when they’re under attack from laser fault injection)</li><li><strong>Secure execution environments</strong> with hardware protections</li></ul><p>But these defenses add cost and complexity. And they’re not perfect. Attackers and defenders are playing an ongoing cat-and-mouse game at the transistor level.</p><p>The ARM chip I tested had basic brown-out detection — it’s supposed to reset if voltage drops too low. But a glitch that lasts less than a microsecond? The detection circuit doesn’t react fast enough. The instruction corrupts, the voltage returns to normal, and the chip continues as if nothing happened.</p><h3>What’s Next</h3><p>Voltage glitching is just one type of hardware attack. There are others that are even more subtle.</p><p>Next week, I’m going to show you how to steal secrets from a computer without touching it at all. No glitches. No voltage manipulation. Just careful observation.</p><p>Because sometimes the most powerful attacks don’t change anything. They just watch.</p><p><strong>If you’re working on embedded security, secure boot implementations, or hardware cryptography, I’d love to hear how you’re thinking about physical attacks. Drop a comment or connect with me.</strong></p><p><strong>Tags:</strong> Hardware Security, Fault Injection, Embedded Systems, Side Channel Attacks, ChipWhisperer</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a5ccb1a6e6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I Stopped Hacking Websites and Started Hacking Silicon]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">After finding my 15th SQL injection vulnerability, I had a realization that changed everything: I was attacking the wrong layer.</p><p class="medium-feed-link"><a href="https://medium.com/@nandithahbhat/why-i-stopped-hacking-websites-and-started-hacking-silicon-3c75db30d124?source=rss-b80d6c221d54------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@nandithahbhat/why-i-stopped-hacking-websites-and-started-hacking-silicon-3c75db30d124?source=rss-b80d6c221d54------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c75db30d124</guid>
            <category><![CDATA[gpu-security]]></category>
            <category><![CDATA[side-channel-attacks]]></category>
            <category><![CDATA[hardware-security]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Nanditha Harish Bhat]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 05:30:41 GMT</pubDate>
            <atom:updated>2026-04-17T05:30:41.227Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[XSS Attack Demonstration: Preventing XSS in Web Application Backends (Part 3/3)]]></title>
            <link>https://medium.com/@nandithahbhat/xss-attack-demonstration-preventing-xss-in-web-application-backends-part-3-3-b0da08a1ef98?source=rss-b80d6c221d54------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0da08a1ef98</guid>
            <category><![CDATA[cross-site-scripting]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[digital-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Nanditha Harish Bhat]]></dc:creator>
            <pubDate>Wed, 22 Oct 2025 20:57:02 GMT</pubDate>
            <atom:updated>2025-10-22T20:57:02.214Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l9czfMqLZayr1AjC" /></figure><p>This series walks you through the process of building a web application from scratch while simultaneously examining one of the most common and lethal security flaws: cross-site scripting (XSS).</p><p>By the end of this series, you will have not only a completely functional online application but also a thorough understanding of how to avoid XSS vulnerabilities and other typical web application security challenges.</p><p>In the third installment of the series, we’ll look at cross-site scripting (XSS), one of the most common and deadly vulnerabilities in web applications. We’ll show how attackers can use unsanitized user input in a signup form and how to avoid such attacks. This will entail inserting malicious JavaScript code into the form and witnessing the attack in progress. <br> By the end of this section, you’ll understand not just the fundamentals of XSS attacks, but also how to defend your apps against them.</p><h3>What is XSS (Cross-Site Scripting)?</h3><p>XSS is a vulnerability that allows an attacker to inject malicious JavaScript code into a website. This script is then executed by the victim’s browser, which can lead to a wide range of malicious activities, such as:</p><ul><li>Stealing session cookies to hijack user sessions.</li><li>Redirecting the user to a phishing website.</li><li>Modifying the content of the webpage and tricking the user into entering sensitive information.</li><li>Performing actions on behalf of the user without their consent.</li></ul><p>XSS vulnerabilities occur when user inputs are not properly sanitized before being reflected on a webpage. This allows an attacker to inject their own scripts, which the browser then executes.</p><h3>How XSS Works: Exploiting the Signup Form</h3><p>Let’s assume we have the same signup form from the previous part of this series, which collects a <strong>username</strong>, <strong>email</strong>, and <strong>password</strong>. In a vulnerable web application, the form input isn’t sanitized before being displayed back to the user, allowing an attacker to inject malicious JavaScript.</p><h3>Step 1: Simulating the XSS Attack</h3><h4>1. Submit the Form with Malicious Code</h4><ul><li>Open the signup.html form and enter the following script in the username field:</li></ul><pre>&lt;script&gt;alert(&#39;XSS Attack!&#39;);&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1c4JnZ6xaLHBgEaFQWL3JA.png" /><figcaption>Fig. 1: Injecting malicious code into the username field to demonstrate an XSS attack.</figcaption></figure><h4>2. Store Data in the Database</h4><ul><li>The form data is sent to the backend and stored in the <strong>MySQL database</strong> without being sanitized.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mr18Hgtfg8LIFhnpkmpqaw.png" /><figcaption>Fig. 2: stored in the MySQL database without being sanitized.</figcaption></figure><h4>3. Display Data and Trigger the Attack</h4><ul><li>If the application doesn’t sanitize the data properly, the injected JavaScript will execute.</li></ul><h4>4. Observe the Attack</h4><ul><li>When the profile page is loaded, the alert box saying “XSS Attack!” will appear because the injected script is executed by the browser.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eWEG6UqNU0VarL82liwuFA.png" /><figcaption>Fig. 3: Demonstrating the XSS attack: The injected script is executed, displaying an alert box.</figcaption></figure><h3>Step 2: General Prevention Techniques for XSS Attacks</h3><p>XSS (cross-site scripting) is one of the most common vulnerabilities in web applications. Fortunately, XSS attacks can be prevented by following a set of best practices that protect your web application from malicious scripts. Below are the general techniques to prevent XSS vulnerabilities.</p><h4>1. Sanitize User Input</h4><p>Sanitizing user input is essential for preventing malicious code from being executed in your application. Sanitization involves cleaning the input by removing or encoding any potentially harmful characters (like &lt;, &gt;, and &amp;) that could be interpreted as HTML or JavaScript.</p><p><strong>What to sanitize</strong>:</p><ul><li>All form inputs (e.g., username, email, password)</li><li>URL parameters</li><li>Any data that comes from user input and is later rendered to the web page</li></ul><p><strong>How to Sanitize Input</strong>:</p><ul><li>In PHP, you can use the htmlspecialchars() function to convert special characters into HTML entities:</li></ul><pre>$safe_input = htmlspecialchars($_POST[&#39;user_input&#39;], ENT_QUOTES, &#39;UTF-8&#39;);</pre><p>This function converts characters like</p><ul><li>&lt; to &amp;lt;</li><li>&gt; to &amp;gt;</li><li>&amp; to &amp;amp;</li><li>“ to &amp;quot;</li></ul><p>This prevents the browser from interpreting these characters as HTML or JavaScript.</p><h4>2. Encode Output Properly</h4><p>In addition to sanitizing inputs, encoding the output ensures that even if malicious content is submitted, it will be treated as plain text by the browser.</p><p>When displaying user-submitted content on the page, use encoding to ensure that any potentially harmful input is rendered as text instead of executable code.</p><p>When displaying the username, sanitize the output like this:</p><pre>echo &quot;Welcome, &quot; . htmlspecialchars($username, ENT_QUOTES, &#39;UTF-8&#39;);</pre><p>This will prevent any injected scripts from being executed in the user&#39;s browser.</p><h4>3. Use Prepared Statements for Database Queries</h4><p>Prepared statements are crucial not only for SQL injection prevention but also for ensuring that user input is always treated as data and not executable code. While prepared statements are primarily used to prevent SQL injection, they also help ensure that any user input stored in a database cannot be interpreted as part of an executable query or script.</p><p><strong>Prepared statements</strong>:</p><ul><li>Treat user input as data, never code.</li><li>Protect against both <strong>XSS</strong> and <strong>SQL injection</strong> vulnerabilities.</li></ul><pre>$stmt = $conn-&gt;prepare(&quot;INSERT INTO users (username, email, password) VALUES (?, ?, ?)&quot;);<br>$stmt-&gt;bind_param(&quot;sss&quot;, $username, $email, $password);</pre><p>Using this approach, even if the user enters malicious input, it will be stored as plain data, preventing the possibility of script execution.</p><h4>5. Use HTTPOnly and Secure Cookies</h4><p>When dealing with sensitive user data such as session cookies, it’s important to make sure they are not accessible to JavaScript. By setting the HTTPOnly flag, you can prevent JavaScript from accessing the cookies, which helps protect them from session hijacking.</p><p>Additionally, using the Secure flag ensures that cookies are only transmitted over HTTPS, preventing interception during transmission.</p><pre>setcookie(&quot;SESSIONID&quot;, $session_id, [<br>    &#39;httponly&#39; =&gt; true,  // Prevent JavaScript access<br>    &#39;secure&#39; =&gt; true,    // Only send cookie over HTTPS<br>    &#39;samesite&#39; =&gt; &#39;Strict&#39; // Prevent cross-site cookie sharing<br>]);</pre><h4>6. Regularly Update and Patch Dependencies</h4><p>Web applications often rely on external libraries, plugins, and frameworks. Outdated dependencies can introduce security vulnerabilities, including those related to XSS.</p><p>Always use the latest versions of your dependencies and patch any security vulnerabilities in third-party libraries.</p><p>Stay informed about updates and security advisories related to the frameworks and libraries you’re using.</p><h4>7. Use Strong Authentication and Authorization</h4><p>Though not directly related to XSS, implementing <strong>strong authentication</strong> and authorization mechanisms ensures that only authorized users can access and interact with your application. This makes it harder for an attacker to exploit vulnerabilities like XSS.</p><ul><li>Use techniques like multi-factor authentication (MFA) to add an extra layer of security.</li></ul><h4>8. Implement a Security-Layered Defense Approach</h4><p>No single security measure is foolproof. To better protect your application, you should use a layered security approach, implementing multiple techniques such as</p><ul><li>Input validation and sanitization</li><li>Output encoding</li><li>Regular security audits</li><li>Implementing security headers like CSP and X-Content-Type-Options</li></ul><p>By applying multiple layers of security, you make it much more difficult for attackers to exploit any single vulnerability.</p><h3>Conclusion</h3><p>Preventing XSS attacks involves a combination of techniques to ensure that user inputs cannot be executed as code in the browser. By <strong>sanitizing inputs</strong>, <strong>encoding outputs</strong>, <strong>using prepared statements</strong>, and implementing other security measures like <strong>CSP</strong> and <strong>HTTPOnly cookies</strong>, you can significantly reduce the risk of XSS vulnerabilities in your web application.</p><p>Always follow best practices and stay up-to-date with security advancements to keep your applications secure. XSS attacks are serious threats, but with the right approach, they can be mitigated effectively.</p><blockquote><strong>Remember:</strong> Testing for vulnerabilities is important, but always ensure you have authorization to perform such tests on websites and applications.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0da08a1ef98" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Step-by-Step Plan to Secure Web Backends with XAMPP (Part 2/3)]]></title>
            <link>https://medium.com/@nandithahbhat/a-step-by-step-plan-to-secure-web-backends-with-xampp-part-2-3-c8800b6dbeb3?source=rss-b80d6c221d54------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8800b6dbeb3</guid>
            <category><![CDATA[xampp]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Nanditha Harish Bhat]]></dc:creator>
            <pubDate>Mon, 08 Sep 2025 11:05:14 GMT</pubDate>
            <atom:updated>2025-09-08T11:05:14.489Z</atom:updated>
            <content:encoded><![CDATA[<h4>Establishing a Secure Web Development Environment</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*8i0q-hlmXT3PHRSA8fUnwg.jpeg" /></figure><p>This series walks you through the process of building a web application from scratch while simultaneously examining one of the most common and lethal security flaws: cross-site scripting (XSS).</p><p>By the end of this series, you will have not only a completely functional online application but also a thorough understanding of how to avoid XSS vulnerabilities and other typical web application security challenges.</p><p>Cross-site scripting (XSS) is one of the most common and dangerous web vulnerabilities, allowing attackers to inject malicious scripts into trusted websites. In this guide, you’ll learn not just how to build a signup form, but how to do it securely-laying the groundwork for XSS prevention from the start</p><p>In the second part of this series, we will dive into the backend development of a simple web application. Our focus will be on creating a user sign-up form that enables users to register on the website, with their data stored in a MySQL database using PHP. This will involve developing both the frontend and backend components of the application.</p><p>If you haven’t installed XAMPP yet, I recommend reading <a href="https://medium.com/p/6971d01467d2/edit">this post </a>first to ensure you have the proper environment setup before beginning backend programming.</p><p>We’ll take a look at</p><ol><li>Create a user-friendly sign-up form with HTML.</li></ol><p>2. Writing a PHP script to handle form submissions.</p><p>3. Connecting the form to the MySQL database to save user information.</p><p>4. Using CSS to style the form.</p><p>By the end of this session, you’ll have a completely functional sign-up form and a solid understanding of how the backend processes and stores form input safely in the database.</p><h4>Step 1: Frontend — Building the Signup Form</h4><p>The first part of any registration system is the user interface. We will begin by creating a simple HTML form to gather the necessary information from the user: their username, email, and password.</p><p><strong>Signup.html</strong></p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot; /&gt;<br>  &lt;title&gt;Signup&lt;/title&gt;<br>  &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&gt;<br>&lt;/head&gt;<br><br>&lt;body&gt;<br>  &lt;div class=&quot;wrapper&quot;&gt;<br>    &lt;h1&gt;Signup&lt;/h1&gt;<br><br>    &lt;form action=&quot;insert.php&quot; method=&quot;post&quot;&gt;<br>      &lt;div&gt;<br>        &lt;input type=&quot;text&quot; name=&quot;username&quot; placeholder=&quot;Enter Username&quot; /&gt;<br>      &lt;/div&gt;<br>    <br>      &lt;div&gt;<br>        &lt;input type=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Enter Email&quot; required /&gt;<br>      &lt;/div&gt;<br>    <br>      &lt;div&gt;<br>        &lt;input type=&quot;password&quot; name=&quot;pwd&quot; placeholder=&quot;Enter Password&quot;<br>         pattern=&quot;(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).{8,}&quot; <br>         title=&quot;Password must be at least 8 characters long, with uppercase, lowercase, number, and symbol.&quot; required /&gt;<br>      &lt;/div&gt;<br>    <br>      &lt;div&gt;<br>        &lt;button type=&quot;submit&quot;&gt;Sign Up&lt;/button&gt;<br>      &lt;/div&gt;<br>    &lt;/form&gt;    <br>  &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>The HTML file creates a signup page using UTF-8 character encoding. The page title is “Signup,” and a CSS file is linked for styling. The main content is wrapped in a div with a “wrapper” class and displays a “Signup” heading. The form sends user data to a backend script called “insert.php,” which stores it in a database. The form collects username, email, and password, which are validated using a regex pattern. A submit button is provided.</p><h4>Step 2: Backend — Handling Form Submission with PHP</h4><p>The next step is to process the form data using PHP. We will use PHP to retrieve the form data submitted by the user and store it in a MySQL database.</p><p><strong>insert.php</strong></p><pre>&lt;?php<br>$servername = &quot;localhost&quot;;<br>$username = &quot;root&quot;; // DB username<br>$pwd = &quot;&quot;;          // DB password (empty if using XAMPP)<br>$dbname = &quot;myfirstdatabase&quot;; // Your DB<br><br>// Connect to DB<br>$conn = new mysqli($servername, $username, $pwd, $dbname);<br>if ($conn-&gt;connect_error) {<br>    die(&quot;Connection failed: &quot; . $conn-&gt;connect_error);<br>}<br><br>// Step 1: Clean &amp; trim inputs<br>$user = trim($_POST[&#39;username&#39;]);<br>$email = trim($_POST[&#39;email&#39;]);<br>$password_raw = $_POST[&#39;pwd&#39;];<br><br>// Step 2: Validate input formats<br>//if (!preg_match(&#39;/^[A-Za-z0-9]{5,20}$/&#39;, $user)) {<br>  //  die(&quot;Invalid username: must be 5–20 alphanumeric characters.&quot;);<br>//}<br>if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {<br>    die(&quot;Invalid email format.&quot;);<br>}<br>if (!preg_match(&#39;/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).{8,}$/&#39;, $password_raw)) {<br>    die(&quot;Password too weak. Use at least 1 uppercase, 1 lowercase, 1 number, 1 symbol.&quot;);<br>}<br><br>// Step 3: Secure hash<br>$hashedPwd = password_hash($password_raw, PASSWORD_DEFAULT);<br><br>// Step 4: Store to DB using prepared statement<br>$stmt = $conn-&gt;prepare(&quot;INSERT INTO users (username, email, pwd) VALUES (?, ?, ?)&quot;);<br>$stmt-&gt;bind_param(&quot;sss&quot;, $user, $email, $hashedPwd);<br><br>if ($stmt-&gt;execute()) {<br>    session_start();  // Start session<br>    $_SESSION[&#39;username&#39;] = $user;  // Save username to session<br>    header(&quot;Location: success.php&quot;);  // Redirect<br>    exit();<br>} else {<br>    echo &quot;Error: &quot; . $stmt-&gt;error;<br>}<br><br>$stmt-&gt;close();<br>$conn-&gt;close();<br><br>?&gt;</pre><p>This PHP script manages a signup form’s backend by connecting to a MySQL database, removing whitespace, validating input, and hashing passwords. It inserts sanitized data into a users table, preventing SQL injection, and displays errors. PHP and MySQL enable persistent data storage.</p><h4><strong>Step 3: Setting Up the Database and Table for Storing User Data</strong></h4><p>After setting up the form submission processing with PHP, we need to store the data securely in a MySQL database. Here’s how you can set up the MySQL database and create the users table where the user data will be stored.</p><ol><li><strong>Open phpMyAdmin</strong>:<br> phpMyAdmin is a graphical interface for managing MySQL databases, and it comes pre-installed with XAMPP.</li></ol><ul><li>Go to <a href="http://localhost/phpmyadmin">http://localhost/phpmyadmin</a><strong> </strong>in your web browser.</li></ul><p>2. <strong>Create a New Database</strong>:</p><ul><li>Once in phpMyAdmin, click on the Databases tab at the top.</li><li>In the Create database section, enter a name for your database, such as user_database.</li><li>Click ‘Create’ to create the database.</li><li>Once the database is created, you’ll be redirected to the newly created database. Now you can proceed to create tables.</li></ul><p><strong>3. Create the Table</strong></p><p>In the MySQL command line, run the following command:</p><pre>USE user_database;</pre><p>Now, create the users table using the following SQL command:</p><pre>CREATE TABLE users (<br>  id INT AUTO_INCREMENT PRIMARY KEY,<br>  username VARCHAR(255) NOT NULL,<br>  email VARCHAR(255) NOT NULL,<br>  password VARCHAR(255) NOT NULL<br>);</pre><p>4. <strong>Confirm the Table Creation</strong>:</p><p>Run the command to confirm the table creation:</p><pre>SHOW TABLES;</pre><p>This should list the users table that you just created.</p><h4>Step 4: Styling the Signup Form with CSS</h4><p>A good user experience requires an appealing and easy-to-use form. To enhance the form’s appearance, we will apply styles using CSS (Cascading Style Sheets).</p><p><strong>style.css</strong></p><pre>/* Reset some default styles */<br>* {<br>  box-sizing: border-box;<br>  margin: 0;<br>  padding: 0;<br>  font-family: &#39;Segoe UI&#39;, Tahoma, Geneva, Verdana, sans-serif;<br>}<br><br>body {<br>  height: 100vh;<br>  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);<br>  display: flex;<br>  justify-content: center;<br>  align-items: center;<br>  animation: fadeIn 1.5s ease-in-out;<br>}<br><br>@keyframes fadeIn {<br>  0% { opacity: 0; transform: translateY(-20px); }<br>  100% { opacity: 1; transform: translateY(0); }<br>}<br><br>form {<br>  background: #ffffff;<br>  padding: 40px;<br>  width: 100%;<br>  max-width: 400px;<br>  border-radius: 20px;<br>  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);<br>  transition: transform 0.3s ease;<br>}<br><br>form:hover {<br>  transform: translateY(-5px);<br>}<br><br>h2 {<br>  text-align: center;<br>  margin-bottom: 25px;<br>  color: #333;<br>  font-weight: 600;<br>  font-size: 1.8rem;<br>}<br><br>input[type=&quot;text&quot;],<br>input[type=&quot;email&quot;],<br>input[type=&quot;password&quot;] {<br>  width: 100%;<br>  padding: 15px;<br>  margin: 12px 0;<br>  border: none;<br>  border-radius: 12px;<br>  background-color: #f0f0f0;<br>  box-shadow: inset 2px 2px 5px #d1d1d1, inset -2px -2px 5px #ffffff;<br>  transition: all 0.2s ease;<br>}<br><br>input:focus {<br>  outline: none;<br>  background-color: #fff;<br>  box-shadow: 0 0 0 2px #6c63ff;<br>}<br><br>button {<br>  width: 100%;<br>  padding: 14px;<br>  margin-top: 20px;<br>  background: linear-gradient(to right, #6c63ff, #3f51b5);<br>  color: #fff;<br>  border: none;<br>  border-radius: 12px;<br>  font-weight: bold;<br>  font-size: 1rem;<br>  cursor: pointer;<br>  transition: background 0.3s ease, transform 0.2s ease;<br>}<br><br>button:hover {<br>  background: linear-gradient(to right, #5a54e9, #2e3cae);<br>  transform: translateY(-2px);<br>}<br><br>@media (max-width: 500px) {<br>  form {<br>    padding: 30px 20px;<br>  }<br><br>  h2 {<br>    font-size: 1.5rem;<br>  }<br>}</pre><p>The CSS file creates a modern, responsive signup form with a pastel gradient background, fade-in animation, and rounded corners. It features bold headings, soft inset shadows, and a vibrant purple submit button. The design is optimized for desktop and mobile views, ensuring an elegant and user-friendly experience.</p><h4>Step 5: Handling Successful Form Submission—success.php</h4><p>Once the user submits their form, we need to confirm that their data was inserted correctly into the database. After the data is successfully added, we redirect the user to a success.php page.</p><h4>The PHP Success Page</h4><p>This page will display a simple confirmation message and provide a link to the user dashboard.</p><h4>success.php</h4><pre>&lt;?php<br>session_start();<br>if (!isset($_SESSION[&#39;username&#39;])) {<br>    header(&quot;Location: insert.php&quot;); // fail-safe<br>    exit();<br>}<br>?&gt;<br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;title&gt;Signup Success&lt;/title&gt;<br>  &lt;link href=&quot;https://fonts.googleapis.com/css2?family=Nunito:wght@600&amp;display=swap&quot; rel=&quot;stylesheet&quot;&gt;<br>  &lt;style&gt;<br>    body {<br>      background: linear-gradient(to right, #fbc2eb, #a6c1ee);<br>      display: flex;<br>      justify-content: center;<br>      align-items: center;<br>      height: 100vh;<br>      font-family: &#39;Nunito&#39;, sans-serif;<br>      margin: 0;<br>    }<br>    .container {<br>      text-align: center;<br>    }<br>    .icon {<br>      font-size: 60px;<br>      color: orange;<br>      margin-bottom: 20px;<br>    }<br>    h1 {<br>      color: orange;<br>      font-size: 36px;<br>      margin-bottom: 30px;<br>    }<br>    .btn {<br>      padding: 10px 25px;<br>      margin: 10px;<br>      background: #ffc371;<br>      border: none;<br>      border-radius: 20px;<br>      box-shadow: 0 4px 12px rgba(0,0,0,0.2);<br>      font-weight: bold;<br>      cursor: pointer;<br>    }<br>    .btn:hover {<br>      background: #ffb347;<br>    }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;div class=&quot;container&quot;&gt;<br>    &lt;div class=&quot;icon&quot;&gt;✔️&lt;/div&gt;<br>    &lt;h1&gt;Signup Successful!&lt;/h1&gt;<br>    &lt;button class=&quot;btn&quot; onclick=&quot;window.location.href=&#39;signup.html&#39;&quot;&gt;Back to Login&lt;/button&gt;<br>    &lt;button class=&quot;btn&quot; onclick=&quot;window.location.href=&#39;dashboard.php&#39;&quot;&gt;Go to Dashboard&lt;/button&gt;<br>  &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bM0wWIHIbm-FFBglgNJvsA.png" /><figcaption>Fig.1: Signup Successful!</figcaption></figure><p>This PHP + HTML file is a sign-up success page that uses UTF-8 encoding, Google Font “Nunito” for typography, and CSS style to create a visually pleasing background and center the content. It certifies successful registration and provides security via session validation.</p><h4>Step 6: Creating the User Dashboard—dashboard.php</h4><p>Once the user has successfully registered, they should be redirected to a <strong>dashboard.php</strong> page, where they can see their personal details, update their account information, and interact with the application.</p><p><strong>dashboard.php</strong></p><pre>&lt;?php<br>session_start();<br>if (!isset($_SESSION[&#39;username&#39;])) {<br>    header(&quot;Location: insert.php&quot;);<br>    exit();<br>}<br>$username = $_SESSION[&#39;username&#39;];<br>$date = date(&quot;l, F j, Y&quot;);<br><br>// Optional: Pull a random quote<br>$quotes = [<br>    &quot;Creativity begins where the sun touches the soul.&quot;,<br>    &quot;Let the warmth of your ideas light up the web.&quot;,<br>    &quot;Rise, shine, and build something beautiful.&quot;,<br>    &quot;Every pixel counts. Every detail matters.&quot;,<br>    &quot;Design with heart, code with soul.&quot;<br>];<br>$quote = $quotes[array_rand($quotes)];<br>?&gt;<br><br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot;&gt;<br>  &lt;title&gt;Dashboard&lt;/title&gt;<br>  &lt;link href=&quot;https://fonts.googleapis.com/css2?family=Nunito:wght@600&amp;display=swap&quot; rel=&quot;stylesheet&quot;&gt;<br>  &lt;style&gt;<br>    body {<br>      margin: 0;<br>      font-family: &#39;Nunito&#39;, sans-serif;<br>      background: #FFF6EC;<br>      padding: 40px;<br>    }<br>    .welcome-card {<br>      background: linear-gradient(to right, #FF7E5F, #FEB47B);<br>      border-radius: 20px;<br>      padding: 30px;<br>      color: white;<br>      box-shadow: 0 10px 30px rgba(0,0,0,0.1);<br>      max-width: 500px;<br>      margin: auto;<br>      text-align: center;<br>    }<br>    .welcome-card h2 {<br>      margin-bottom: 10px;<br>      font-size: 30px;<br>    }<br>    .welcome-card p {<br>      margin: 5px 0;<br>      font-size: 18px;<br>    }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;div class=&quot;welcome-card&quot;&gt;<br>    &lt;h2&gt;Welcome back, &lt;?php echo ($username); ?&gt; 🌞&lt;/h2&gt;<br>    &lt;p&gt;&lt;?php echo $date; ?&gt;&lt;/p&gt;<br>    &lt;p&gt;&lt;em&gt;&quot;&lt;?php echo $quote; ?&gt;&quot;&lt;/em&gt;&lt;/p&gt;<br>  &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*udKTrS_5mFMZpp1yEW4pDQ.png" /><figcaption>Fig.2: User dashboard</figcaption></figure><p>This PHP and HTML software generates a personalized dashboard page for logged-in users, confirming the session ‘username’ and redirecting if necessary. It generates date and inspiring quotes and uses CSS to create a visually beautiful welcome card.</p><h4>Step 7: Testing the Signup Form</h4><p>Once you’ve set up the HTML form, PHP script, and CSS styles, it’s time to test everything.</p><ol><li><strong>Access the Signup Form in the Browser</strong></li></ol><p>a. Ensure XAMPP is Running:</p><ul><li>Open the XAMPP Control Panel.</li><li>Start both Apache (web server) and MySQL (database server) by clicking the “Start” buttons next to each.</li></ul><p>b. Place the Signup Files in the Correct Folder:</p><ul><li>Move your signup.html, insert.html and style.css files into the htdocs folder located in the XAMPP installation directory: C:\xampp\htdocs</li></ul><p>Launch your web browser and navigate to the signup form by typing “http://localhost/signup-form/signup.html&quot; in the address bar.</p><p><strong>2. Testing the signup form</strong></p><p><strong>a. Enter Data into the Form</strong>: Open the signup.html page and fill out the sign-up form.</p><p><strong>b. Submit the Form</strong>: When you click the “Sign Up” button, the form data will be sent to insert.php and inserted into the MySQL database.</p><p><strong>c. Check the Database</strong>: Open your MySQL database (using phpMyAdmin or any MySQL client) and confirm that the data has been inserted into the users table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LdnwvtWtmjl9OX3BUwFogw.png" /><figcaption>Fig.3: sign-up form</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fa4t4Q2dvzdNO2PmJ-GHUA.png" /><figcaption>Fig.4: Data has been inserted into the users table.</figcaption></figure><h3>Conclusion</h3><p>You have now created a simple but functional user sign-up system that stores data in a MySQL database. This is an essential part of many web applications, and understanding how the form, backend script, and database work together is crucial for building dynamic websites.</p><p>Stay tuned for Part 3, where we will dive into Cross-Site Scripting (XSS) and demonstrate how attackers can exploit unsanitized input in web forms. You’ll also learn how to prevent these attacks to ensure the security of your web application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8800b6dbeb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Step-by-Step Plan to Secure Web Backends with XAMPP (Part 1/3)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://infosecwriteups.com/a-step-by-step-plan-to-secure-web-backends-with-xampp-part-1-3-6971d01467d2?source=rss-b80d6c221d54------2"><img src="https://cdn-images-1.medium.com/max/736/1*hrTWEaCtfjdicmlN5hGRHQ.jpeg" width="736"></a></p><p class="medium-feed-snippet">Installing and Configuring XAMPP</p><p class="medium-feed-link"><a href="https://infosecwriteups.com/a-step-by-step-plan-to-secure-web-backends-with-xampp-part-1-3-6971d01467d2?source=rss-b80d6c221d54------2">Continue reading on InfoSec Write-ups »</a></p></div>]]></description>
            <link>https://infosecwriteups.com/a-step-by-step-plan-to-secure-web-backends-with-xampp-part-1-3-6971d01467d2?source=rss-b80d6c221d54------2</link>
            <guid isPermaLink="false">https://medium.com/p/6971d01467d2</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[xss-attack]]></category>
            <dc:creator><![CDATA[Nanditha Harish Bhat]]></dc:creator>
            <pubDate>Fri, 06 Jun 2025 05:02:42 GMT</pubDate>
            <atom:updated>2025-06-06T05:02:42.885Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[SQL Injection on DVWA: Automated and Manual Exploits (Part 2)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/infosec-ninja/sql-injection-on-dvwa-automated-and-manual-exploits-part-2-b54fc90bbbc0?source=rss-b80d6c221d54------2"><img src="https://cdn-images-1.medium.com/max/2600/0*JQ6pYsfts0ZTjvky" width="6950"></a></p><p class="medium-feed-snippet">A Hands-On Guide to Cracking SQL Injections</p><p class="medium-feed-link"><a href="https://medium.com/infosec-ninja/sql-injection-on-dvwa-automated-and-manual-exploits-part-2-b54fc90bbbc0?source=rss-b80d6c221d54------2">Continue reading on InfosecPandey »</a></p></div>]]></description>
            <link>https://medium.com/infosec-ninja/sql-injection-on-dvwa-automated-and-manual-exploits-part-2-b54fc90bbbc0?source=rss-b80d6c221d54------2</link>
            <guid isPermaLink="false">https://medium.com/p/b54fc90bbbc0</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[sql-injection-attack]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Nanditha Harish Bhat]]></dc:creator>
            <pubDate>Fri, 30 May 2025 06:40:24 GMT</pubDate>
            <atom:updated>2025-05-30T06:40:24.063Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[SQL Injection on DVWA: Building the Foundation (Part 1)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@nandithahbhat/sql-injection-on-dvwa-building-the-foundation-part-1-7cc700dbdc8b?source=rss-b80d6c221d54------2"><img src="https://cdn-images-1.medium.com/max/712/1*TS0Uh7KFtbgXSkIJbLY_3Q.jpeg" width="712"></a></p><p class="medium-feed-snippet">Warning: This is for educational purposes only. Always practice in legal, controlled environments like DVWA.</p><p class="medium-feed-link"><a href="https://medium.com/@nandithahbhat/sql-injection-on-dvwa-building-the-foundation-part-1-7cc700dbdc8b?source=rss-b80d6c221d54------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@nandithahbhat/sql-injection-on-dvwa-building-the-foundation-part-1-7cc700dbdc8b?source=rss-b80d6c221d54------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cc700dbdc8b</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[dvwa]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Nanditha Harish Bhat]]></dc:creator>
            <pubDate>Wed, 21 May 2025 11:47:07 GMT</pubDate>
            <atom:updated>2025-05-21T11:47:07.878Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[From Curiosity to Exploits: My Cybersecurity Journey Begins]]></title>
            <link>https://medium.com/@nandithahbhat/from-curiosity-to-exploits-my-cybersecurity-journey-begins-edb811607092?source=rss-b80d6c221d54------2</link>
            <guid isPermaLink="false">https://medium.com/p/edb811607092</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[about-me]]></category>
            <dc:creator><![CDATA[Nanditha Harish Bhat]]></dc:creator>
            <pubDate>Sat, 17 May 2025 08:33:45 GMT</pubDate>
            <atom:updated>2025-05-17T08:33:45.059Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>The best way to predict the future is to invent it.</blockquote><blockquote>— Alan Kay</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*eOZS9z8va1wGk4Gr1EALeA.jpeg" /><figcaption>This is where it all starts, understanding what needs protecting.</figcaption></figure><p>There’s something powerful about understanding how things break, because in those cracks, you often find how they truly work.</p><p>I’m Nanditha, and this is my entry point into the world of cybersecurity.</p><p>After completing my undergrad in mechatronics and diving deep into IoT systems, I found myself constantly pulled toward the questions no one asked aloud: <em>What happens when the system fails? What if someone makes it fail on purpose?</em> That curiosity eventually became my obsession — and then my roadmap into cybersecurity.</p><p>This blog is my way of sharing what I’ve learned, step-by-step, from someone who wasn’t handed the answers. I’m not here to just say <em>how</em> something works. I’m here to show you <em>how I made it work</em>, <em>why it matters</em>, and how <em>you</em> can do the same, even if you’re just getting started.</p><p>Over the past several months, I’ve worked hands-on with platforms like DVWA, Kali Linux, Wireshark, and Metasploit, exploring real-world web vulnerabilities and system flaws. My approach is detailed, visual, and tutorial-oriented — not just what, but <em>why</em>, <em>where</em>, and <em>how</em> each step leads to impact.</p><p>Of course, everything I demonstrate is performed in a controlled, ethical lab environment because in cybersecurity, understanding how to break systems goes hand-in-hand with the responsibility of using that knowledge to protect them. I encourage all readers to treat this domain with the same respect.</p><p>My audience? Anyone who wants to learn. Whether you’re a curious beginner, an aspiring ethical hacker, or someone pivoting into tech — this space is open to you. You don’t need a perfect setup or a fancy degree. Just curiosity, consistency, and the courage to try, fail, and try again.</p><p>This isn’t just about vulnerabilities and exploits. It’s about control. Understanding. Power through knowledge. And the discipline it takes to walk the ethical path when you know how to do damage.</p><p>If that resonates with you, stay with me.</p><p>Because this is only the beginning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edb811607092" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>