Skip to content

This is a Malware Detection ML model made using Random Forest Algorithm

License

Notifications You must be signed in to change notification settings

Kunal-Attri/Malware-Detection-ML-Model

Repository files navigation

Malware-Detection-ML-Model

Demo: Youtube

Try at: Streamlit

  • This is a Python program to train Malware Detection ML Model and check if a given file is a probable MALWARE or not!
  • It uses Random Forest algorithm for training the ML model.
  • I have implemented it in 2 ways:
    • CLI app
    • Streamlit app

NOTE: Don't run any files inside malwares folder, as these are actual malwares taken from GitHub.

Requirements (installable via pip)

What I used?

  1. Scikit-learn - Scikit-learn (formerly scikits.learn and also known as sklearn) is a free software machine learning library for the Python programming language.
    • RandomForestClassifier
    • ExtraTreesClassifier
  2. Malware Dataset - The raw data here was obtained from the malware security partner of Meraz'18 - Annual Techno Cultural festival of IIT Bhilai, the said raw data constituted malware and legitimate files.
  3. Streamlit - for GUI - Streamlit is an open-source app framework for Machine Learning and Data Science teams.
  4. Flask - for distributed system - Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. It has no database abstraction layer, form validation, or any other components where pre-existing third-party libraries provide common functions.

How to run the program?

  1. Download this GitHub repository

    • Either Clone the repository
       git clone https://github.com/Kunal-Attri/Malware-Detection-ML-Model.git
      
    • Or download and extract the zip archive of the repository.
  2. Download & Install requirements

    • Ensure that you have Python 3 installed.
    • Open terminal in the Repository folder on your local machine.
    • Run the following command to install requirements.
       pip3 install -r requirements.txt
      
  3. Run CLI app

    • Get a file to check for probable malware, and run:
      python3 main.py [FILENAME]
      
    • Expected Interface


  4. Run Streamlit app

    • Try on web app here.
    • or run locally by:
      streamlit run streamlit_app.py
      
    • Expected Interface


References