Skip to main content

🛡️ The IoT Network Malware Classifier 🚀 is an advanced solution tackling security concerns in IoT, employing deep learning for precise malware detection in network traffic.

Project description

🛡️ IoT Network Malware Classifier with Deep Learning Neural Network Architecture 🚀

Welcome to the IoT Network Malware Classifier, an advanced solution crafted to tackle the evolving security threats within the realm of the Internet of Things (IoT). As the proliferation of interconnected devices continues to surge within IoT networks, the need for robust cybersecurity measures becomes increasingly paramount.

In today's digital landscape, where IoT devices permeate various aspects of our lives, safeguarding these interconnected ecosystems is no longer a choice but a necessity. Malicious actors are constantly devising new methods to exploit vulnerabilities within IoT networks, posing significant risks to data privacy, system integrity, and overall network security.

Built upon cutting-edge Deep Learning Neural Network architecture, this classifier leverages the power of artificial intelligence to analyze and categorize network traffic with unparalleled precision and efficiency. By harnessing the capabilities of machine learning algorithms, this solution adapts to the dynamic nature of malware threats, providing proactive defense mechanisms to mitigate potential risks.

Don't hesitate to review the Jupyter Notebook attached, you could go through the intricate process of training and constructing the machine learning model using the renowned Keras framework. From data preprocessing and model design to training and evaluation, each step encapsulates the essence of project's commitment to delivering state-of-the-art cybersecurity solutions for the IoT landscape. 🛡️🔒

🙏🙏 I would like to extend my gratitude to Stratosphere Laboratory for providing the labeled dataset with malicious and benign IoT network traffic. This dataset was created as part of the Avast AIC laboratory with the funding of Avast Software.

Sebastian Garcia, Agustin Parmisano, & Maria Jose Erquiaga. (2020). IoT-23: A labeled dataset with malicious and benign IoT network traffic (Version 1.0.0) [Data set]. Zenodo. http://doi.org/10.5281/zenodo.4743746

GitHub PyPI License

🌟 Key Features:

  • Precise Classification: Utilizes Deep Learning models for accurate classification of malware in network traffic data.
  • Efficiency: Implements optimized algorithms for fast and efficient processing of large volumes of data.
  • Scalability: Designed to handle large data flows in high-demand IoT environments.
  • Ease of Use: Offers an intuitive and straightforward interface for seamless integration and use across different applications and platforms.

With the IoT Network Malware Classifier, organizations can bolster their cybersecurity posture by identifying and mitigating malware threats in their IoT networks proactively and effectively. 🌐🔒

Installation 🚀

You can easily install VehicleDetectionTracker using pip:

pip install IoTNetworkMalwareClassifier

How IoT Network Malware Classifier Works 🛠️

The IoT Network Malware Classifier employs a multi-step process to preprocess the data before training the neural network model:

  1. Data Cleaning 🧹:

    • Features with a high percentage of missing values are discarded to ensure data integrity and prevent biased model training.
    • High-cardinality features that do not contribute significantly to generalized prediction are also removed to streamline the preprocessing pipeline.
  2. Data Encoding and Scaling 📊:

    • Categorical features are encoded using techniques like label encoding to convert them into numerical representations suitable for model training.
    • Numerical features are scaled to a common range using techniques like standardization to ensure uniformity and improve convergence during model training.
  3. Neural Network Architecture 🧠:

    • The classifier utilizes a deep neural network architecture comprising input, hidden, and output layers.
    • Input Layer: Accommodates the preprocessed features of the network traffic data.
    • Hidden Layers: Multiple dense layers with activation functions (e.g., ReLU) and dropout regularization capture intricate data patterns while preventing overfitting.
    • Output Layer: Produces probabilities for different malware classes using a softmax activation function, facilitating multi-class classification.
  4. Dropout Regularization 🚫:

    • Dropout layers are strategically incorporated after each batch normalization layer in the model architecture.
    • Dropout: Randomly deactivates a fraction of neurons during training iterations, preventing overfitting and promoting the generalization capability of the model.
  5. Model Compilation 📋:

    • The model is compiled with the Adam optimizer, categorical cross-entropy loss function, and evaluation metrics including accuracy and precision.
    • Benefits: The incorporation of dropout regularization aids in preventing overfitting and enhancing the generalization performance of the model on unseen data.

By leveraging these preprocessing techniques and a carefully designed neural network architecture, the IoT Network Malware Classifier achieves precise and efficient malware classification, contributing to enhanced cybersecurity in IoT environments. 🛡️🔒

Example to make predictions on IoT-related network data

The code demonstrates how to utilize the MalwareClassifier class to make predictions on IoT-related network data. Here's a breakdown of the steps:

  • Importing the classifier: The MalwareClassifier class is imported from the classifier module within the IoTNetworkMalwareClassifier package.
  • Example data: Example data is defined as a list of dictionaries. Each dictionary represents a network data record, with various features such as IP addresses, ports, protocols, etc.
  • Performing predictions: A prediction is made using the predict() method of the classifier. This method takes the input data and returns a list of dictionaries containing the predicted labels and scores for each prediction.
  • Printing results: The prediction results are printed to the console.
# Create an instance of the IoT Network Malware Classifier
from IoTNetworkMalwareClassifier.classifier import MalwareClassifier

classifier = MalwareClassifier()

# Example data
data = [{
    'id.orig_h': '192.168.1.195',
    'id.orig_p': 37120,
    'id.resp_h': '102.165.48.81',
    'id.resp_p': 17769,
    'proto': 'tcp',
    'conn_state': 'RSTR',
    'history': 'ShAdfDr',
    'orig_pkts': 10,
    'orig_ip_bytes': 1572,
    'resp_pkts': 8,
    'resp_ip_bytes': 540
},
{
    'id.orig_h': '192.168.1.1',
    'id.orig_p': 47805,
    'id.resp_h': '192.168.1.195',
    'id.resp_p': 22,
    'proto': 'tcp',
    'conn_state': 'SF',
    'history': 'DdAaFf',
    'orig_pkts': 400,
    'orig_ip_bytes': 26336,
    'resp_pkts': 268,
    'resp_ip_bytes': 36368
},
{
    'id.orig_h': '192.168.1.195',
    'id.orig_p': 123,
    'id.resp_h': '82.113.53.40',
    'id.resp_p': 123,
    'proto': 'udp',
    'conn_state': 'S0',
    'history': 'D',
    'orig_pkts': 1,
    'orig_ip_bytes': 76,
    'resp_pkts': 0,
    'resp_ip_bytes': 0
},
{
    'id.orig_h': '192.168.1.195',
    'id.orig_p': 37122,
    'id.resp_h': '102.165.48.81',
    'id.resp_p': 17769,
    'proto': 'tcp',
    'conn_state': 'RSTR',
    'history': 'ShAdfDr',
    'orig_pkts': 10,
    'orig_ip_bytes': 1572,
    'resp_pkts': 8,
    'resp_ip_bytes': 540
},
{
    'id.orig_h': '192.168.1.195',
    'id.orig_p': 123,
    'id.resp_h': '212.111.30.190',
    'id.resp_p': 123,
    'proto': 'udp',
    'conn_state': 'SF',
    'history': 'Dd',
    'orig_pkts': 2,
    'orig_ip_bytes': 152,
    'resp_pkts': 2,
    'resp_ip_bytes': 152
}]

# Perform prediction
predictions = classifier.predict(data)
print(predictions)

The prediction results are presented in the form of a list of dictionaries. Each dictionary contains the predicted label and associated scores for each class. Here's a detailed explanation of the fields in each results dictionary:

  • result: The predicted label for the corresponding data record.
  • scores: A dictionary containing the scores for each class. The keys are the class labels, and the values are the scores associated with those classes.

The scores represent the probability of the data record belonging to each class. The higher the score, the greater the classifier's confidence in the prediction for that class. Each score is formatted as a decimal number with a precision of 10 decimals.

For example, in the first data record, it is predicted to be "Malicious C&C" with a score of 0.7948055267, indicating high confidence in the prediction.

This results format facilitates understanding of the predictions made by the malware classifier and allows for decision-making based on confidence in those predictions. 🧠

[
    {
        'result': 'Malicious   C&C',
        'scores': {
            'Benign': '0.1896078140',
            'Malicious': '0.0008148123',
            'Malicious   C&C': '0.7948055267',
            'Malicious   DDoS': '0.0147715705',
            'Malicious   PartOfAHorizontalPortScan': '0.0000003306'
        }
    },
    {
        'result': 'Malicious   DDoS',
        'scores': {
            'Benign': '0.3036604226',
            'Malicious': '0.1889142990',
            'Malicious   C&C': '0.0181397330',
            'Malicious   DDoS': '0.4892515838',
            'Malicious   PartOfAHorizontalPortScan': '0.0000339999'
        }
    },
    {
        'result': 'Benign',
        'scores': {
            'Benign': '0.9999802113',
            'Malicious': '0.0000042536',
            'Malicious   C&C': '0.0000123474',
            'Malicious   DDoS': '0.0000030778',
            'Malicious   PartOfAHorizontalPortScan': '0.0000000000'
        }
    },
    {
        'result': 'Malicious   C&C',
        'scores': {
            'Benign': '0.1895969808',
            'Malicious': '0.0008148027',
            'Malicious   C&C': '0.7948169112',
            'Malicious   DDoS': '0.0147710536',
            'Malicious   PartOfAHorizontalPortScan': '0.0000003306'
        }
    },
    {
        'result': 'Benign',
        'scores': {
            'Benign': '0.9999989271',
            'Malicious': '0.0000000269',
            'Malicious   C&C': '0.0000009888',
            'Malicious   DDoS': '0.0000001118',
            'Malicious   PartOfAHorizontalPortScan': '0.0000000000'
        }
    }
]

License 📜

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments:

I extend my sincere gratitude to the Stratosphere Laboratory for providing the labeled dataset with malicious and benign IoT network traffic. This dataset has served as a crucial starting point for developing the machine learning model. The dataset includes labels that explain the linkages between flows connected with harmful or possibly malicious activity, providing invaluable insights for network malware researchers and analysts. Special thanks to Agustin Parmisano, Sebastian Garcia, and Maria Jose Erquiaga for their contributions to the dataset, made available on January 22th, and for their ongoing efforts to advance cybersecurity research.

The dataset used in this project is available here and can also be found on the Stratosphere Laboratory website.

Sebastian Garcia, Agustin Parmisano, & Maria Jose Erquiaga. (2020). IoT-23: A labeled dataset with malicious and benign IoT network traffic (Version 1.0.0) [Data set]. Zenodo. http://doi.org/10.5281/zenodo.4743746

Contribution

Contributions to IoTNetworkMalwareClassifier are highly encouraged! If you're interested in adding new features, resolving bugs, or enhancing the project's functionality, please feel free to submit pull requests.

Get in Touch 📬

IoTNetworkMalwareClassifier is developed and maintained by Sergio Sánchez Sánchez (Dream Software). Special thanks to the open-source community and the contributors who have made this project possible. If you have any questions, feedback, or suggestions, feel free to reach out at dreamsoftware92@gmail.com.

¡Happy coding! 🚀

GitHub PyPI

Visitors Count

Please Share & Star the repository to keep me motivated.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iotnetworkmalwareclassifier-0.0.20.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

File details

Details for the file iotnetworkmalwareclassifier-0.0.20.tar.gz.

File metadata

File hashes

Hashes for iotnetworkmalwareclassifier-0.0.20.tar.gz
Algorithm Hash digest
SHA256 8f054a4f3010d81925d1a24907920a3690d692ad1316ee5052c5a2667659c7b4
MD5 00edf8a02426ea9d491e1b6e5f28a181
BLAKE2b-256 f0e3214a14d630c9de9fba8b19d02aef51cf244075cfb99b0853458929689437

See more details on using hashes here.

File details

Details for the file IoTNetworkMalwareClassifier-0.0.20-py3-none-any.whl.

File metadata

File hashes

Hashes for IoTNetworkMalwareClassifier-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 0c9e8fc2c7756d18780df2dc189af956d8a5f19ef2d902048db23cd4e6abcbbd
MD5 b72059ea7dd74b334758f050d4cbfce3
BLAKE2b-256 4a69bd45e835064e2eee6f7fedab5416aed0fa96ff1785dc4d4df5349a184589

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page