Skip to content

Directedchari0t/ShieldX-Defender

Repository files navigation

πŸ›‘οΈ ShieldX-Defender

GitHub Workflow Status GitHub License Python Version

Overview

ShieldX-Defender is a Python-based antivirus scanner that integrates real-time file monitoring with YARA rule-based scanning and known malware hash detection. Designed for both security enthusiasts and developers, it provides robust protection against malicious files while offering a user-friendly web dashboard for monitoring.

✨ Features

  • πŸ•΅οΈ Real-Time Monitoring: Auto-scans files in specified directories
  • βš”οΈ YARA Rule Engine: Custom malware detection using YARA rules
  • πŸ”’ Hash-Based Detection: SHA256 comparison against known malware database
  • πŸ“Š Web Dashboard: Real-time scan results via Flask interface
  • 🚨 Suspicious File Alerts: Flags executables/ZIPs/risky file types
  • πŸ–₯️ Cross-Platform: Works on Linux, Windows, and macOS

πŸš€ Installation

Prerequisites

  • Python 3.8+
  • libmagic (for file type detection):
    # Linux (Debian/Ubuntu)
    sudo apt-get install libmagic1
    
    # macOS
    brew install libmagic
    
    # Windows (via Chocolatey)
    choco install libmagic

Steps

Clone the repository:

 git clone https://github.com/Directedchari0t/ShieldX-Defender.git
 cd ShieldX-Defender

πŸ–₯️ Usage

Basic Command:

```bash
  # Monitor the default directory (Downloads)
  python3 antivirus.py  

Custom Monitoring:

  # Monitor a custom directory and change the dashboard port
  python3 antivirus.py --monitor /path/to/directory --port 8080

Web Dashboard:

"After starting the tool, access the dashboard at http://localhost:6969 to view real-time scan results."

CLI Options Table:

  Flag                     Description                          Default

--monitor<PATH>            Directory to monitor                 ~/Downloads

--port <NUM>               Web dashboard port                    6969

--verbose                  Enable detailed logging               False

Project Structure

Directory Tree:

  ShieldX-Defender/
  β”œβ”€β”€ core/               # Core logic (scanning, monitoring)
  β”œβ”€β”€ web/                # Flask-based dashboard
  β”œβ”€β”€ data/               # YARA rules and malware hashes
  β”œβ”€β”€ tests/              # Unit/integration tests
  └── requirements.txt    # Python dependencies

File Descriptions:

  - `core/scanner.py`: Implements file scanning using YARA and hash checks.
  - `web/dashboard.py`: Runs the Flask server for the web interface.
  - `data/yara_rules/`: Store custom YARA rules here (e.g., `ransomware.yar`).

πŸ› οΈ Troubleshooting

Common Errors & Fixes:

### "Magic Library Not Found"
  Install `libmagic` for your OS:
  ```bash
  # Ubuntu/Debian
  sudo apt-get install libmagic1

"YARA Rules Not Loading"

Verify file permissions:

  chmod 644 data/yara_rules/*.yar

Ensure YARA files are in data/yara_rules/ and have .yar extensions.

Validate rule syntax:

  yara data/yara_rules/exploits.yar test_file.exe

Web Dashboard Not Accessible

1.Allow firewall access for port 6969

2.Check for port conflicts

πŸ“Έ Screenshots

Web Dashboard

Dashboard Preview

Malware Alert

Alert Example

🀝 Contributing

Fork the repository

Create a feature branch:

  git checkout -b feature/amazing-feature

Commit changes:

  git commit -m "Add amazing feature"

Push to branch:

  git push origin feature/amazing-feature

Open a Pull Request

πŸ“œ License

Distributed under the MIT License - see the LICENSE file for details.

Contact

If you have any questions, feel free to reach out:

You can also open an issue or pull request if you encounter any bugs or would like to contribute.

About

A Python-based antivirus scanner with real-time file monitoring and YARA rule integration

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors