
Day 12 — I Built a File Safety Checker in Python (and Accidentally Learned How Malware Tricks Humans)
A simple cybersecurity tool that turned into a lesson about trust, psychology, and why file extensions lie. The Moment That Started It A friend of mine once received a file through chat. The name looked harmless: invoice_march.pdf.exe He almost opened it. Almost. That single moment stuck in my head. Not because malware is advanced… but because it didn’t need to be . The attack relied on something much simpler: Human assumptions. We don’t read filenames carefully. We pattern-match. We see pdf → brain says document → double-click. So I wondered: Can I build a small tool that warns people before they open something dangerous? I thought it would take a day. It turned into one of my favorite cybersecurity Python projects. Where It Started (7 Lines) My first version was painfully simple: dangerous = [ " .exe " , " .bat " , " .cmd " , " .scr " , " .js " , " .vbs " , " .msi " ] filename = input ( " Enter file name: " ). lower () if any ( filename . endswith ( ext ) for ext in dangerous ): prin
Continue reading on Dev.to Beginners
Opens in a new tab



