Skip to main content

A machine learning/AI based approach to protecting your devices against ddos attacks

Project description

deepdos

Description

Welcome to deepdos, the python program written to monitor and potentially secure your network from ddos attacks! While not currently utilizing deep learning to classify packets, deepdos currently utilizes logistic regression in order to classify packets and has so far been trained on 200,000 packets from all sorts of DDOS attacks and normal traffic setup. This project couldn't have been done without the help of the Canadian Institute for Cybersecurity with providing both the original flow dataset and tool to create flow csvs from .pcap files. Their site and all resources have been linked at the bottom.

Goals

Short term goals

  • Add LR test metrics on startup
  • Update LR to use better data for better performance
  • Add command line interface

Long term goals

  • Convert Logistic regression model to a neural network
  • Support both macos and Linux (potentially Windows as well if pcap is easy)
  • Add ddos mitigation/firewall rule support

How to run/setup

Running from scratch

deepdos is currently only available on linux, but can simply be run by these two commands:

# clone repo
git clone https://github.com/C3NZ/deepdos

# Install dependencies and setup the projects virtual environment
source bash/setup.sh

# Execute the script (Needs sudo in order to execute both tcpdump and iptables)
python3 main.py -h

This will load you into a virtualenv with all of the dependencies installed and ready to use.

To remove all of the dependencies after you're done using the tool, you can simply run:

source bash/remove.sh

and then remove the folder from your computer :)

This will immediately start creating necessary folders, capturing packets, and then identifying the traffic that is being exchanged in and out of your current computer.

This also assumes that you have java installed for the program to execute the CICFlowMeter jar file.

Installing with pip

Linux

sudo apt install libpcap-dev python3-dev python3-setuptools
pip3 install deepdos

Macos

brew install libpcap
pip3 install deepdos

Usage

usage: main.py [-h] [-i INTERFACE] [-n NAUGHTY_COUNT] [--find-interface]
               [--firewall FIREWALL] [--model-type MODEL_TYPE]

Welcome to deepdos, the machine learning/ai based ddos analysis/mitigation
service

optional arguments:
  -h, --help            show this help message and exit
  -i INTERFACE          [REQUIRES SUDO] The network interface for deepdos to
                        listen to (default: None)
  -n NAUGHTY_COUNT      The amount of malicious flows that can come from a
                        given address (default: 10)
  --find-interface      List all of your devices network interfaces. Good if
                        you don't know what interfaces your device has
                        (default: False)
  --firewall FIREWALL   [REQUIRES SUDO] Turn on firewall mode for the given
                        system. linux for Linux systems and macos for mac (Not
                        yet supported) (default: None)
  --model-type MODEL_TYPE
                        The model that you would like to use for classifying
                        the data (default: lr-stable-0.9.0.pickle)
usage: src [-h] [-i INTERFACE] [-n NAUGHTY_COUNT] [--find-interface]
           [--firewall FIREWALL] [--model-type MODEL_TYPE]

How to deploy

You can deploy this on your own machine, but production use will come in the future.

Live deployments

This will be on pypi soon :)

How to contribute

Fork the current repository and then make the changes that you'd like to said fork. Upon adding features, fixing bugs, or whatever modifications you've made to the project, issue a pull request to this repository containing the changes that you've made and I will evaluate them before taking further action. This process may take anywhere from 3-7 days depending on the scope of the changes made, my schedule, and any other variable factors.

Resources

UNB datasets

CICnetflowmeter

CIC License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepdos-0.9.95.tar.gz (16.3 MB view details)

Uploaded Source

Built Distribution

deepdos-0.9.95-py3-none-any.whl (16.4 MB view details)

Uploaded Python 3

File details

Details for the file deepdos-0.9.95.tar.gz.

File metadata

  • Download URL: deepdos-0.9.95.tar.gz
  • Upload date:
  • Size: 16.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for deepdos-0.9.95.tar.gz
Algorithm Hash digest
SHA256 c75a676a366e0c1d83fbf227ee268c102335a366f808e24462d12468131a38ee
MD5 b2a8db126699f997466a2715e2a80949
BLAKE2b-256 cd8861f813ad9c023e980b68b859c7390b5c9301b86d410ce80c9fa03f8eabb5

See more details on using hashes here.

File details

Details for the file deepdos-0.9.95-py3-none-any.whl.

File metadata

  • Download URL: deepdos-0.9.95-py3-none-any.whl
  • Upload date:
  • Size: 16.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for deepdos-0.9.95-py3-none-any.whl
Algorithm Hash digest
SHA256 51abf578b2d85282f7bc653e871349e22df3632c2d276f53a1c6636c53258d10
MD5 a5830d6e7c6443eff539601d0ded8f73
BLAKE2b-256 d073deaae711db0077a4e27d79eec9ca0ed9643a09867ced6f8c1d1dd8b4522d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page