Skip to content

Originally created for my senior project, this repository has been forked to serve as my personal copy, allowing me to expand and enhance it as I see fit.

Notifications You must be signed in to change notification settings

JUNKJACKZACK/pytorch-network-analyzer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PyTorch Network Analyzer

Getting Started

1. Prerequisites

  • Ensure you have Git installed. Download it from git-scm.com.

2. Cloning the Project

Clone the repository using Git Bash or command line:

git clone https://github.com/nmsu-senior-project/pytorch-network-analyzer.git

3. Setting Up Python Environment

Navigate to the project directory and create a Python virtual environment:

cd pytorch-network-analyzer
python -m venv venv

Activate the virtual environment:

  • Windows:
    source venv/Scripts/activate
  • Linux:
    source venv/bin/activate

4. Installing Dependencies

Install required Python libraries:

pip install scapy mysql-connector-python

5. Setting Up MySQL Server

  • Download and install MySQL from dev.mysql.com.
  • Create a local MySQL server. Use tools like DBeaver for GUI management or command line for manual setup.

MySQL Command-Line Interface (CLI) Setup on Windows

Adding MySQL to PATH Environment Variable

  1. Find your MySQL Installation Directory (e.g., C:\Program Files\MySQL\MySQL Server 8.0\bin).
  2. Add MySQL to PATH:
    • Press Win + X and select System.
    • Click on Advanced system settings -> Environment Variables.
    • Under System variables, edit Path and add your MySQL bin directory.
    • Restart Command Prompt to apply changes.

Verifying MySQL Installation

Open a new Command Prompt window and verify MySQL is recognized:

mysql -u root -p

MySQL Database and User Creation Commands

MySQL Commands

Setting Up Database Credentials

Create a credentials.txt file in the analyzer directory with MySQL user credentials:

db_user:user1
db_pass:password1
db_user:user2
db_pass:password2
db_user:user3
db_pass:password3

Project Overview

Purpose

The project aims to develop a PyTorch-based deep learning model to analyze network traffic and detect common threat behaviors, enhancing cybersecurity measures.

Workflow

  1. Data Processing and Baseline Creation:

    • Process packet traffic from PCAP files.
    • Store baselines in MySQL for device network activity.
  2. Threat Analysis Using PyTorch:

    • Train a model to monitor and alert on unusual activities.

Future Goals

  • Automate batch processing of PCAP files.
  • Enhance PCAP file management for deeper analysis.
  • Develop a Django web interface for model visualization.

Summary

This project combines baseline data with PyTorch's capabilities to provide robust network security management tools, detecting and addressing potential threats effectively.

About

Originally created for my senior project, this repository has been forked to serve as my personal copy, allowing me to expand and enhance it as I see fit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%