Skip to content

A Next.js 14 application that leverages machine learning models to detect malicious code in uploaded files, featuring a FastAPI backend.

License

Notifications You must be signed in to change notification settings

TDevUIT/IE105-Malicious-Code-Scanner

Repository files navigation

QR code scan

Malicious Code Scanner

A Next.js 14 application that leverages machine learning models to detect malicious code in uploaded files, featuring a FastAPI backend.


Introduction

The Malicious Code Scanner is a robust web app developed using Next.js and FastAPI, designed to enable users to upload files in various formats and scan for potential malicious code. It features a user-friendly, dashboard-like UI for selecting models, monitoring upload progress, and displaying scan results. This tool is ideal for developers and security teams needing quick, reliable file safety assessments using custom AI/ML models.

How It Works

The Python/FastAPI backend handles the AI/ML models, seamlessly integrated with the Next.js frontend through /api/ endpoints. File uploads trigger model-based scans, with results presented in a structured dashboard format.

The integration is facilitated through next.config.js rewrites, routing requests to /api/py/:path* directly to FastAPI.

Locally, the FastAPI server runs at 127.0.0.1:8000, while in production, it operates as serverless Python functions on Vercel.

Demo

Explore the live demo here: Malicious Code Scanner

Deploy Your Own

Clone & deploy it to Vercel in one click:

Deploy with Vercel

Developing Locally

Set up the repository with:

npx create-next-app malicious-code-scanner --example "https://github.com/vanthaita/IE105-Malicious-Code-Scanner.git"

Getting Started

1. Set up a virtual environment

python3 -m venv venv
source venv/bin/activate

2. Install dependencies

For the frontend, run:

npm install
# or
yarn
# or
pnpm install

For the backend, install Python packages listed in requirements.txt.

3. Run the development server

Start the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Access the app at http://localhost:3000, with the FastAPI backend running at http://127.0.0.1:8000. Update the port in package.json and next.config.js as needed.

Key Features

  • File Uploads: Supports PDF and other common file formats.
  • Model Selection: Allows users to choose from multiple models (in .h5 format) for scanning.
  • Progress & Results Display: Visualize scan progress and results in a dashboard format with graphical displays.

Learn More

For further resources, check out:

We welcome your feedback and contributions via our GitHub repository!

About

A Next.js 14 application that leverages machine learning models to detect malicious code in uploaded files, featuring a FastAPI backend.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published