<?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 sagar gupta on Medium]]></title>
        <description><![CDATA[Stories by sagar gupta on Medium]]></description>
        <link>https://medium.com/@sagarsec?source=rss-a3918f76b64e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RpnxlTn3pdknoQc9Nw_wDw.jpeg</url>
            <title>Stories by sagar gupta on Medium</title>
            <link>https://medium.com/@sagarsec?source=rss-a3918f76b64e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 15:11:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sagarsec/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[️‍♂️ How to Detect Lookalike Domains and Phishing Websites Targeting Your Brand]]></title>
            <link>https://sagarsec.medium.com/%EF%B8%8F-%EF%B8%8F-how-to-detect-lookalike-domains-and-phishing-websites-targeting-your-brand-e913702e27e1?source=rss-a3918f76b64e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e913702e27e1</guid>
            <category><![CDATA[open-source-tools]]></category>
            <category><![CDATA[phishing-awareness]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[threat-intelligence]]></category>
            <category><![CDATA[digital-brand-protection]]></category>
            <dc:creator><![CDATA[sagar gupta]]></dc:creator>
            <pubDate>Fri, 31 Oct 2025 10:26:14 GMT</pubDate>
            <atom:updated>2025-10-31T10:26:14.278Z</atom:updated>
            <content:encoded><![CDATA[<h3>⚠️ Disclaimer</h3><p>The domains and screenshots shown in this article are based on <strong>publicly reported phishing pages</strong> that impersonate Amazon.<br> This post is for <strong>educational and awareness purposes only</strong>.<br> No private data, company systems, or proprietary insights were used.</p><p><strong>🔍 Introduction</strong></p><p>In the last few years, phishing and brand impersonation attacks have evolved far beyond fake emails.<br> Fraudsters now <strong>clone entire websites</strong>, register <strong>lookalike domains</strong>, and even use <strong>Google Ads</strong> to appear legitimate — all to trick users into sharing credentials or making payments.</p><p>For small businesses and startups, these attacks can cause serious damage: account takeovers, financial fraud, and a loss of customer trust.<br> The good news? You don’t need expensive enterprise software to detect them — you can do it with a few smart OSINT techniques and free tools. Let’s walk through how.</p><h3>What Are Lookalike Domains?</h3><p>Lookalike (or <em>typosquatted</em>) domains are slightly altered versions of a legitimate brand’s domain name.<br> Attackers rely on visual similarity or user error — replacing one character, adding a hyphen, or using another TLD.</p><p><strong>Examples:</strong></p><pre>amazon.com         → Legitimate  <br>amaz0n-login.com   → Uses zero instead of “o”  <br>my-amazon.co       → Alternate TLD  <br>amazon-verification.net → Fake verification portal<br><br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M2IBUlfZJupC1m5ui4CfwA.png" /><figcaption><a href="https://www.amazon.in/">https://www.amazon.in/</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TPdKbhSR-0mfpv00o-3miw.png" /><figcaption><a href="https://amazon-clone-peach-eta.vercel.app/">https://amazon-clone-peach-eta.vercel.app/</a></figcaption></figure><p>These subtle variations trick users — especially when combined with cloned branding and valid SSL certificates.</p><p><strong>🧰 Step-by-Step: Detecting Lookalike Domains</strong></p><h4>1️⃣ Enumerate Suspicious Domains</h4><p>Use <strong>dnstwist</strong> to generate and check registered permutations:</p><pre>dnstwist --registered amazon.com</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NHHLg2VXJkTXOYd59FRS1Q.png" /><figcaption><a href="https://dnstwist.it/">https://dnstwist.it/</a></figcaption></figure><p>It lists possible typo domains and their DNS/IP data.</p><p><strong>2️⃣ Examine Live Pages</strong></p><p>Scan the suspicious domains using <strong>opensource tools</strong>:</p><p><strong>Example search:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*OZCTu_SB4AlIKdohQkaYVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r0Cv3txlXUoLpKY4OgZkeA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LfxMPtERH_K2jp8Q-w_Efg.png" /></figure><p><strong>🧠 Determine If It’s a Mirror</strong></p><p>A cloned phishing site usually copies HTML, CSS, and logos directly from the real Amazon page.<br> You can detect this by measuring <strong>textual</strong> and <strong>visual</strong> similarity.</p><p><strong>🔹 HTML Similarity (Python example)</strong></p><pre>from difflib import SequenceMatcher<br><br>def similarity(a, b):<br>    return SequenceMatcher(None, a, b).ratio()<br><br>score = similarity(html_amazon, html_suspect)<br>if score &gt; 0.85:<br>    print(&quot;Likely mirrored site detected!&quot;)pt</pre><p><strong>🔹 Visual Comparison via Image Hash</strong></p><pre>from PIL import Image<br>import imagehash<br><br>hash1 = imagehash.phash(Image.open(&quot;amazon_original.png&quot;))<br>hash2 = imagehash.phash(Image.open(&quot;suspect_clone.png&quot;))<br><br>if abs(hash1 - hash2) &lt; 10:<br>    print(&quot;Visual match – possible phishing clone&quot;)</pre><h3>⚙️ Scoring and Prioritization</h3><p>You can assign simple weights to prioritize investigations:</p><pre>| Indicator             | Description                       | Score |<br>| --------------------- | --------------------------------- | ----- |<br>| Domain similarity ≤ 2 | e.g. “amaz0n.com”                 | +25   |<br>| Login form detected   | `&lt;input type=&quot;password&quot;&gt;` present | +15   |<br>| Favicon hash matches  | Same as amazon.com                | +20   |<br>| SSL CN mismatch       | Cert issued to random entity      | +10   |<br>| Hosting in risky ASN  | Cheap VPS / bulletproof host      | +10   |</pre><p>≥ 60 points → treat as confirmed phishing clone (Threshold will be differ a for every brand)</p><h3>🤖 Automating Detection</h3><p>Combine these checks into a daily job that:</p><ol><li>Runs <strong>dnstwist</strong></li><li>Queries <strong>opensource </strong>tools API</li><li>Captures screenshots with Playwright</li><li>Compares against baseline fingerprints</li><li>Sends email alerts</li></ol><p>Result → Continuous early-warning system for brand impersonation.</p><p><strong>💡 Why Affordable Brand Protection Matters</strong></p><p>Attackers increasingly exploit trusted logos to bypass user caution.<br> Even a single fake Amazon page can collect thousands of credentials before takedown.<br> By running proactive domain monitoring, small security teams and researchers can:</p><ul><li>Identify phishing before it spreads</li><li>Alert hosting providers</li><li>Contribute to public feeds like PhishTank or URLScan</li></ul><p>You don’t need enterprise DRP budgets to make an impact — just OSINT and consistency.</p><h3>🧠 Final Thoughts</h3><p>Brand impersonation is no longer a rare event — it’s a daily threat.<br> The faster you detect clones, the less impact attackers have.<br> And with open-source tools and a little automation, you don’t have to wait for enterprise-grade budgets to get started.</p><p>Stay tuned — my next post will cover explore all <strong>opensource tools.</strong></p><h3>💬 Connect with Me</h3><blockquote><em>I’m </em><strong><em>Sagar Gupta</em></strong><em>, </em>Proven information security analyst with experience in identifying, investigating, and mitigating cyber threats to organizations. Skilled at digital brand protection, analyzing logs, get insights, and collaborating with opensource tools teams to protect networks and critical data.</blockquote><blockquote><em>Follow me on Medium for more threat-hunting guides, or connect via </em><a href="https://www.linkedin.com/in/sagar-gupta-b28a51ba/"><em>LinkedIn</em></a></blockquote><p>cybersecurity, phishing, osint, brand-protection, threat-hunting, digital-risk</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e913702e27e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bypassing AV: How C# Compiler Choice Impacts Detection]]></title>
            <link>https://sagarsec.medium.com/bypassing-av-how-c-compiler-choice-impacts-detection-400251380eaa?source=rss-a3918f76b64e------2</link>
            <guid isPermaLink="false">https://medium.com/p/400251380eaa</guid>
            <category><![CDATA[antivirus-bypass]]></category>
            <category><![CDATA[av-bypass]]></category>
            <category><![CDATA[cyber-security-services]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[redteam-tool]]></category>
            <dc:creator><![CDATA[sagar gupta]]></dc:creator>
            <pubDate>Tue, 08 Apr 2025 14:56:08 GMT</pubDate>
            <atom:updated>2025-04-08T14:56:08.855Z</atom:updated>
            <content:encoded><![CDATA[<p>Did you know your choice of C# compiler can be the difference between triggering Microsoft Defender or silently slipping past it? In this blog, we explore how compiling with .NET Framework (csc.exe) vs. the modern dotnet SDK can dramatically change AV detection outcomes—and how you can use this to your advantage during red team engagements.</p><h3>Introduction</h3><p>Antivirus evasion is a cornerstone of successful red teaming and offensive security. While payload encryption, AMSI bypasses, and process injection techniques often take the spotlight, there’s a stealth trick that’s often overlooked: <strong>your compiler choice</strong>.</p><p>In this blog, we’ll explore how switching from the legacy .NET Framework compiler to the modern dotnet build tool can help you avoid triggering Anti virus’s. We&#39;ll walk through a hands-on test, explain why the behavior differs, and outline how red teams can leverage this knowledge.</p><h3>Experimental Setup</h3><p>To demonstrate this behavior, we created a simple C# shellcode loader. Here’s what it does:</p><ul><li>Decrypts XOR-encrypted shellcode</li><li>Allocates memory using VirtualAllocEx</li><li>Injects the shellcode into a suspended process (notepad.exe)</li></ul><pre>bool result = CreateProcess(null, &quot;C:\\Windows\\System32\\notepad.exe&quot;, IntPtr.Zero, IntPtr.Zero,false, 0x4, IntPtr.Zero, null, ref si, out pi);</pre><ul><li>Triggers execution via CreateRemoteThread</li></ul><pre>IntPtr hThread = CreateRemoteThread(pi.hProcess, IntPtr.Zero, 0, addr, IntPtr.Zero, 0, IntPtr.Zero);Console.WriteLine(&quot;[+] Remote thread started: &quot; + hThread);</pre><p>The loader was tested on a Windows 11 machine with <strong>Microsoft Defender enabled</strong>.</p><p>We compiled the exact same code using two methods:</p><h3>Method 1: .NET Framework (csc.exe)</h3><pre>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /platform:x64 /out:injector.exe Program.c</pre><h3>Method 2: Modern .NET SDK (dotnet build)</h3><pre>dotnet build -c Release</pre><h3>Observations</h3><h3>Detection with .NET Framework (csc.exe)</h3><p>As soon as we ran the binary compiled with csc.exe, Microsoft Defender flagged it as malicious:</p><ul><li>Immediate quarantine or deletion.</li><li>Defender triggered on both execution and (in some cases) on compilation.</li><li>Alerts were consistent across systems.</li></ul><p>Uploaded binary to Virus total:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eyKVnE8VtW3RWnMlNAXydA.png" /><figcaption>Virustotal Result When Compiled with csc.exe</figcaption></figure><h3>Evasion with dotnet build</h3><p>The same loader compiled with dotnet build bypassed Defender entirely:</p><ul><li>No warnings or alerts</li><li>Shellcode executed successfully.</li></ul><p>We further tested it with this publish command to make it portable:</p><pre>dotnet publish -r win-x64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true --self-contained true</pre><p>The self-contained executable maintained the same evasion capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HTvYViykY0VJNA3LjJkqCQ.png" /><figcaption>Virus total Result when compiled with dotnet build</figcaption></figure><h3>Why the Detection Difference?</h3><p>Let’s break it down:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*_DeLEo1CFWFHouSnAJumTw.png" /><figcaption>Difference Between csc.exe and dotnet build</figcaption></figure><p>This makes dotnet build binaries less likely to be immediately flagged—especially when paired with encryption, obfuscation, or process injection.</p><h3>Red Team Tactics: What You Should Do</h3><p>If you’re developing C# payloads:</p><p>✅ <strong>Use </strong>dotnet build over csc.exe for initial payload compilation.<br>✅ <strong>Publish as a self-contained app</strong> for stealth and portability.<br>✅ <strong>XOR/encrypt your shellcode</strong>, and optionally split or obfuscate it.<br>✅ <strong>Use process injection</strong> rather than in-process execution.<br>✅ <strong>Add delays</strong>, sleep loops, or junk code to thwart sandboxing.</p><p>If you’re defending:</p><p>🛡️ Look for suspicious usage of VirtualAllocEx, WriteProcessMemory, CreateRemoteThread.<br>🛡️ Monitor process injection even from seemingly safe dotnet apps.<br>🛡️ Apply memory scanning and post-execution behavioral analysis.</p><h3>Conclusion</h3><p>Sometimes the best way to bypass antivirus isn’t to rewrite your code — it’s to recompile it differently. As shown in this post, the choice between csc.exe and dotnet build can dramatically impact detection. By leveraging the modern .NET SDK, red teamers gain a stealth advantage with minimal effort. But defenders, take note: this isn’t a bypass forever-behavioral monitoring, sandboxing, and memory scanning are your best countermeasures.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=400251380eaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>