Git Product home page Git Product 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

aima-python icon aima-python

Python implementation of algorithms from Russell And Norvig's "Artificial Intelligence - A Modern Approach"

blog icon blog

Build a Jekyll blog in minutes, without touching the command line.

cribdrag icon cribdrag

cribdrag - an interactive crib dragging tool for cryptanalysis on ciphertext generated with reused or predictable stream cipher keys

ctf_archive icon ctf_archive

Hosting awesome cryptography CTF challenges for more than just a weekend

deadpool icon deadpool

Repository of various public white-box cryptographic implementations and their practical attacks.

dfa-on-aes icon dfa-on-aes

Implementation of Differential Fault Attack on AES128

dpa-on-aes icon dpa-on-aes

Implementation of Differential Power Analysis (DPA) and Correlation Power Analysis (CPA) attacks on AES-128

gmp icon gmp

A prebuilt GMP module for Android

gmptest icon gmptest

A proof of concept Android app used to validate the pre-compiled GMP binaries

mult32 icon mult32

Multiplying two 32-bit numbers using only 32-bit variables

nids-dl icon nids-dl

A real-time system capable of capturing network traffic and detecting intrusion by an AI model

parallelcomputing icon parallelcomputing

This repository contains my exercises and project in the course Parallel Computing

smart-light-project icon smart-light-project

This is the project I did in the Global Project Based Learning (gPBL) program with Japanese students. The system uses a motion sensor to automatically control the light, and make sure the security also.

sqatt-aes icon sqatt-aes

Implementation of Square Attack on 4-round and 5-round AES-128

tiny-bignum-c icon tiny-bignum-c

Small portable multiple-precision unsigned integer arithmetic in C

tracer icon tracer

Set of Dynamic Binary Instrumentation and visualization tools for execution traces.

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.