GithubHelp home page GithubHelp logo

Overview

In this project, we build a real-time system which is able to capture network intrusion and then predict its type of attack by an AI model.

alt text

Author

  • Viet-Sang Nguyen
  • Phuong-Hoa Nguyen
  • Ngoc-Nhat-Huyen Tran

Commands to run real-time system

Download execute file of Kafka

sudo ./install.sh

Start zookeeper.

Kafka server needs this one. It will run on localhost, port 2181

kafka_2.13-2.4.1/bin/zookeeper-server-start.sh kafka_2.13-2.4.1/config/zookeeper.properties

Start Kafka server.

It will run on localhost, port 9092. When we publish messages to this server through producers, messages will be stored on /tmp/kafka-logs/

kafka_2.13-2.4.1/bin/kafka-server-start.sh kafka_2.13-2.4.1/config/server.properties

Install Snort on Mac

brew install snort

Configuration for Snort

Snort needs a config file (snort.config) and a folder to store log. Normally, they are stored in /etc/snort/snort.config and /var/logs/snort.

In this project, we store them in folder snort and use the full paths to point where they are.

snort.config

In this file, we point to the file rules/icmp.rules

include rules/icmp.rules

Rules

We write some rules to capture packets in config file. In this example, sort will alert all ping packets.

alert icmp any any -> any any (msg:"ICMP Packet"; sid:477; rev:3;)

Start snort to capture packes

snort -A console -q -c ~/.../src/snort/snort.config -b -i en0 -L ~/.../src/snort/logs/log.pcap

ping to somewhere to test snort

ping google.com

Run producer to send pcap logs to kafka.

python3 producer_pcap.py

Run consumer of spark

This consumer retrieves pcaps from kafka, then transform to readable data thanks to Zeek. After that, KDD99 data is generated by spark. TensorFlow models then predict whether data is normal or attacked. The results are sent back to kafka.

python3 consumer_spark.py

Run consumer of warning

This consumer retrieves and shows predicted data from kafka

python3 consumer_warning.py

Notice: all commands should be run from NIDS-DL-Project folder

Commands to train AI model

Pre-process data

python3 dl_src/preprocessing.py

Train

python3 dl_src/train.py

Test

python3 dl_src/test.py

Viet Sang Nguyen's Projects

Viet Sang Nguyen doesn’t have any public repositories yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.