GithubHelp home page GithubHelp logo

lchang1977 / ids-sdn-test-framework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from antonsuba/ids-sdn-test-framework

0.0 1.0 0.0 20.42 MB

Testing framework for IDS built using SDN

License: MIT License

Python 99.59% Shell 0.41%

ids-sdn-test-framework's Introduction

IDS SDN Test Framework

Setup

  1. Clone repository into Mininet VM home directory

  2. Copy contents of pox_components into ~/pox/ext, along with other POX components you want to use

  3. For training models, place the folder containing the training dataset inside ml_ids/training_data

  4. For validating models, place the folder containing the validation dataset inside ml_ids/validation_data

  5. Place your custom model training and validation scripts inside the ml_ids folder

  6. If you have your own models, you may place them inside ml_ids/ids_models

  7. Place PCAP files inside the pcap folder

  8. If you have your own Python modules for the internal and external network generation, you may place them inside network/internal_network and network/external_network respectively

  9. Place your custom test case scripts inside the test_cases folder

  10. Configure framework using the provided config file: config/config.yml

  11. Place an attack_hosts.txt file inside the config folder that contains the total number of hosts in the first line, and the attack host IP addresses for the next succeeding lines

Usage

The framework must have been set up and configured accordingly before it can be used.

Training Models

Run this command in the terminal:

python tool.py train

Validating Models

Run this command in the terminal:

python tool.py validate

Generating Test Network

  1. Start POX one terminal.

  2. In another terminal, run this command:

    python tool.py createnetwork

Running Tests

The steps are the same with generating the test network, except that several parameters are passed to the createnetwork command.

Run:

python tool.py createnetwork exectest TestCase1 TestCase2  # TestCase3, ...

where the parameters after exectest are the names of the test case classes found in the test_cases folder.

Results of the tests can be found in results/ids_test_results.txt

Creating Custom Test Cases

Making your own test cases is easy. Just create a class that inherits from the TestCase object in test_cases/test_case.py. Simply override the

def _exec_test(self, targets, int_hosts, ext_hosts, int_switches, ext_switches, int_routers, ext_routers)

method and execute your tests there.

Parameter Description
targets List of target hosts
int_hosts List of internal hosts
ext_hosts List of external hosts
int_switches List of internal switches
ext_switches List of external switches
int_routers List of internal routers
ext_routers List of external routers

See the provided ddos.py test case for reference.

Creating Custom Networks

Create a class in either the internal_network or external_network that implements this method:

def create_topo(self, topo, main_switch, mac_ip_list)

The framework then uses this module as the basis of the network topology

Parameter Description
topo Mininet topo object
main_switch Name of main connecting switch. Serves as bridge both networks
mac_ip_list Dictionary of mac ip pairs

Router configuration is done by implementing:

def configure_router(self, routers)
Parameter Description
routers List of all router nodes in the network

Other Tools

Scripts

  1. The scripts/extract_attack_hosts.py script allows you to generate the attack_scripts.txt file automatically. Just modify it to use your training dataset.

  2. The scripts/extract_ip_mac.sh script produces the MAC-IP address pairs, given a PCAP file. Just run the script with the PCAP file as the first parameter.

ids-sdn-test-framework's People

Contributors

antonsuba avatar kurt-bautista avatar

Watchers

 avatar

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.