Real Time Intrusion Detection System for IoT Networks using Random Forest
The project contains a full stack web app created with React front end and Django back end. It is an Intrusion Detection system which detects attacks in real time that occur within the IoT network in consideration.
Steps to install and run the application:
-
Ensure you have python 3.6.9, node v12.16.0, npm 6.14.5, apache 2.4.29.
-
Clone the repo and cd to be-project
cd be-project
- Create virtual environment for backend development
virtualenv env
- Activate the virtual environment
source env/bin/activate
- Install backend dependencies present in requirements.txt
pip3 install -r requirements.txt
- Install frontend dependencies present in package.json
npm i
- Build production folder of the front end
npm run build
- Setup data base with backend
python3 manage.py migrate
- Setup apache2 server – install apache2 or xampp and copy the ids folder in the web server directory. If you’ve installed xampp, you need to find the htdocs dir. If you’ve installed apache2, run this command from be-project dir.
cd be-project
sudo cp ids /var/www/html/ -r
- Run backend + build server
python3 manage.py runserver 0.0.0.0:8000
- To Simulate the node (if actual node is not used)
python3 home/node_simulator.py
- The shell script for tshark is in the home folder of be-project. Before you run it, you’ll have to replace s3rbeproj with your computer’s password.
cd home
./tshark_shell_script.sh
Make sure the script has permissions to execute. If not, run
cd home
chmod -v +x tshark_shell_script.sh
- Kill all instances of tshark The shell script for kill_all_tshark is in the home folder of be-project. Before you run it, you’ll have to replace s3rbeproj with your computer’s password.
cd home
./kill_all_tshark.sh
Make sure the script has permissions to execute. If not, run
cd home
chmod -v +x kill_all_tshark.sh
- Testing
React Jest Testing
npm test
Django Selenium Testing
python3 manage.py test home.tests
For selenium testing, Make sure the script addGeckoToUsrBin has permissions to execute. If not, run
cd home
chmod -v +x addGeckoToUsrBin.sh
Important notes
For your own data collection please follow the steps specified in the Thesis , I’d suggest you to read theis completely before running the project.
TODO
Use standard dataset to train model , Decrease false positive rate