Skip to main content

Command Palette

Search for a command to run...

Building PatchPulse - A Windows Vulnerability Scanner That Actually Works!

Published
5 min read
Building PatchPulse - A Windows Vulnerability Scanner That Actually Works!
I

I am a Computer network engineering student at the University of Malawi. I like sharing what I learn.

Ever wondered if your computer is secretly harboring vulnerable software that hackers could exploit? I did too, so I built PatchPulse to find out!

Github

The "Aha!" Moment

Picture this: You're sitting at your computer, feeling pretty secure with your antivirus running and Windows updates installed. But what about that random PDF reader you installed months ago? Or that media player you forgot existed? These forgotten applications could be ticking time bombs waiting for cybercriminals to exploit.

That's exactly the problem that sparked PatchPulse - a Django-powered web application that scans your Windows system for installed software and cross-references it with the National Vulnerability Database (NVD) to identify potential security risks.

The Tech Stack Adventure

Why Django? Because Python is Beautiful!

I chose Django as the backbone for several reasons:

  • Rapid Development: Django's "batteries included" philosophy meant I could focus on the core functionality rather than reinventing the wheel

  • Robust ORM: Perfect for managing complex relationships between applications, CVEs, and vulnerability matches

  • Built-in Admin Interface: Great for debugging and data management during development

  • Security Features: Django's security features aligned perfectly with a security-focused application

The Supporting Cast

  • PowerShell: For digging into Windows registry to find installed applications

  • NVD API: The treasure trove of vulnerability data from the National Institute of Standards and Technology

  • Bootstrap 5: Because nobody has time for ugly interfaces

  • Python's packaging library: The unsung hero that makes version comparison actually work

Under the Hood: How PatchPulse Works

Step 1: The Great Application Hunt

The journey begins with a PowerShell command that dives deep into the Windows registry:

Get-ItemProperty HKLM:Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*

This magical incantation extracts:

  • Application names

  • Version numbers

  • Publishers

  • Installation dates

The beauty here is that we're accessing the same registry keys that Windows uses for its "Add/Remove Programs" feature, ensuring we get accurate, system-level data.

Step 2: The CVE Detective Work

Once we have our list of applications, the real detective work begins. For each application (focusing on popular software to avoid API rate limits), PatchPulse:

  1. Queries the NVD API using the application name as a keyword

  2. Filters relevant CVEs by checking if the application name appears in the vulnerability description

  3. Extracts critical information like CVSS scores, severity levels, and publication dates

Step 3: The Version Comparison Magic

Here's where things get interesting. Not all vulnerabilities affect all versions of software. The original challenge was parsing human-readable CVE descriptions like:

  • "Adobe Creative Cloud Desktop Application before 3.6.0.244"

  • "Versions 4.4.1.298 and earlier"

  • "Version 5.1 (and earlier)"

I developed a sophisticated version comparison system that:

def compare_versions(installed_version, vulnerable_version_info):
    # Normalize version strings
    # Parse various CVE description patterns
    # Use Python's packaging library for accurate version comparison
    # Return True only if the installed version is actually vulnerable

This prevents the nightmare scenario of false positives - imagine getting panicked about a "vulnerable" application when you're actually running a newer, patched version!

Step 4: The Data Symphony

PatchPulse uses three main Django models that work in harmony:

  • InstalledApp: Stores information about each discovered application

  • CVEVulnerability: Caches CVE data from the NVD API

  • VulnerabilityMatch: Links vulnerable applications to their specific CVEs

This design allows for efficient querying and prevents redundant API calls - because nobody likes waiting for the same CVE data to be fetched repeatedly.

The User Experience Journey

Dashboard: Your Security Command Center

The dashboard provides a bird's-eye view of your system's security posture. Clean, modern Bootstrap styling ensures the interface is both functional and visually appealing.

Scanning Interface: Where the Magic Happens

The scanning page features:

  • Real-time progress indicators (because waiting is more bearable when you know what's happening)

  • Vulnerability severity color coding (red for critical, yellow for medium, green for low)

  • Detailed vulnerability descriptions with direct links to official CVE entries

Results That Actually Make Sense

Instead of overwhelming users with technical jargon, PatchPulse presents results in human-readable format:

  • Clear application names and versions

  • Plain-English vulnerability descriptions

  • Actionable recommendations

The Challenges That Made Me Stronger

Challenge 1: The False Positive Nightmare

Initially, PatchPulse was flagging everything as vulnerable because I wasn't comparing versions properly. Applications with newer versions were being marked as vulnerable to CVEs that only affected older versions.

Solution: Implemented robust version parsing and comparison logic using Python's packaging library.

Challenge 2: API Rate Limiting

The NVD API has rate limits, and scanning hundreds of applications could quickly exceed them.

Solution: Implemented smart filtering to only scan popular software packages and added caching mechanisms.

Challenge 3: PowerShell Output Parsing

Windows registry data comes in various formats, and PowerShell output can be inconsistent.

Solution: Added robust error handling and JSON parsing with fallbacks for edge cases.

Lessons Learned and Pro Tips

  1. Start Simple, Iterate Fast: I began with basic app scanning and gradually added vulnerability checking and version comparison.

  2. Error Handling is Your Best Friend: Network requests fail, APIs return unexpected data, and PowerShell commands can behave differently across Windows versions.

  3. User Experience Matters: A security tool is only as good as people's willingness to use it. Investing time in a clean, intuitive interface pays dividends.

  4. Testing is Non-Negotiable: I created a test endpoint specifically for version comparison logic - it saved countless hours of debugging.

The Future is Bright

PatchPulse is now open-source and ready for the community to extend and improve. Potential future enhancements include:

  • Automated remediation suggestions

  • Scheduled scanning

  • Integration with patch management systems

  • Support for Linux and macOS

  • Advanced filtering and reporting features

Want to Try It Yourself?

The complete source code is available on GitHub, including detailed setup instructions and API key configuration. Whether you're a security enthusiast, a Django developer, or just someone who wants to understand their system better, PatchPulse offers valuable insights into the world of vulnerability management.

Remember: Building security tools isn't just about the code - it's about empowering people to make informed decisions about their digital safety.

Have you built any security tools recently? I'd love to hear about your experiences in the comments! And if you try PatchPulse, let me know what vulnerabilities you discover - you might be surprised!

If you found this blog post helpful, consider starring the PatchPulse repository on GitHub and sharing your own security tool building experiences!

More from this blog

N

Numnet | Networking, Cybersecurity & Tech Made Simple

9 posts

Numnet is a blog sharing simple, practical tips on networking, cybersecurity, and tech for students, builders, and small businesses.