<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: AnasRm01</title>
    <description>The latest articles on DEV Community by AnasRm01 (@anasrm01).</description>
    <link>https://dev.to/anasrm01</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3760818%2F86a05e1c-ff17-44bd-a35e-3bc95b554b7b.jpg</url>
      <title>DEV Community: AnasRm01</title>
      <link>https://dev.to/anasrm01</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anasrm01"/>
    <language>en</language>
    <item>
      <title>How Attackers Use Extension Spoofing and How I Built a Tool to Stop Them</title>
      <dc:creator>AnasRm01</dc:creator>
      <pubDate>Mon, 09 Feb 2026 01:02:44 +0000</pubDate>
      <link>https://dev.to/anasrm01/how-attackers-use-extension-spoofing-and-how-i-built-a-tool-to-stop-them-34g3</link>
      <guid>https://dev.to/anasrm01/how-attackers-use-extension-spoofing-and-how-i-built-a-tool-to-stop-them-34g3</guid>
      <description>&lt;p&gt;I got tired of seeing ransomware slip through because attackers just rename malware.exe to invoice.pdf. So I built a tool that validates file extensions against magic numbers in real-time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What it does:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Monitors file creation/modification using inotify (Linux) or watchdog (Windows)&lt;/li&gt;
&lt;li&gt;Checks if invoice.pdf is actually a PDF (magic number validation)&lt;/li&gt;
&lt;li&gt;Quarantines mismatched files automatically&lt;/li&gt;
&lt;li&gt;Outputs SIEM-ready JSON logs (Splunk/ELK/Wazuh compatible)&lt;/li&gt;
&lt;li&gt;SHA256 hashing + user attribution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why I built this:&lt;/strong&gt;&lt;br&gt;
During a recent IR engagement, we found ransomware that got past AV by being renamed to .docx. A simple magic number check would've caught it immediately.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install (one command):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Linux&lt;/span&gt;
curl &lt;span class="nt"&gt;-sSL&lt;/span&gt; https://raw.githubusercontent.com/AnasRm01/file-validator/main/install.sh | &lt;span class="nb"&gt;sudo &lt;/span&gt;bash

&lt;span class="c"&gt;# Windows  &lt;/span&gt;
&lt;span class="c"&gt;# Download and run install-windows.bat&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Use cases I'm seeing:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web server upload directories (/var/www/uploads)&lt;/li&gt;
&lt;li&gt;Shared network drives&lt;/li&gt;
&lt;li&gt;Employee Downloads folders&lt;/li&gt;
&lt;li&gt;Compliance logging (PCI-DSS requires FIM)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Performance:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&amp;lt;10MB RAM, &amp;lt;1% CPU&lt;/li&gt;
&lt;li&gt;Event-driven (not scanning loops)&lt;/li&gt;
&lt;li&gt;Tested on CentOS, Ubuntu, Windows 10/11&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/AnasRm01/file-validator" rel="noopener noreferrer"&gt;https://github.com/AnasRm01/file-validator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open to feedback! What other file types should I add?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>linux</category>
      <category>monitoring</category>
    </item>
  </channel>
</rss>
