| Literature DB >> 36015924 |
Mohammed Awad1, Salam Fraihat2, Khouloud Salameh1, Aneesa Al Redhaei1.
Abstract
The past few years have witnessed a substantial increase in cyberattacks on Internet of Things (IoT) devices and their networks. Such attacks pose a significant threat to organizational security and user privacy. Utilizing Machine Learning (ML) in Intrusion Detection Systems (NIDS) has proven advantageous in countering novel zero-day attacks. However, the performance of such systems relies on several factors, one of which is prediction time. Processing speed in anomaly-based NIDS depends on a few elements, including the number of features fed to the ML model. NetFlow, a networking industry-standard protocol, offers many features that can be used to predict malicious attacks accurately. This paper examines NetFlow features and assesses their suitability in classifying network traffic. Our paper presents a model that detects attacks with (98-100%) accuracy using as few as 13 features. This study was conducted using a large dataset of over 16 million records released in 2021.Entities:
Keywords: Internet of Things; Network Intrusion Detection System; cyber security; feature selection; machine learning
Mesh:
Year: 2022 PMID: 36015924 PMCID: PMC9412997 DOI: 10.3390/s22166164
Source DB: PubMed Journal: Sensors (Basel) ISSN: 1424-8220 Impact factor: 3.847
Breakdown of the dataset classes.
| Count | Class |
|---|---|
| Benign | 6,099,469 |
| Backdoor | 16,809 |
| Denial of Service (DoS) | 712,609 |
| Distributed Denial of Service (DDoS) | 2,026,234 |
| Injection | 684,465 |
| Man in the Middle (MITM) | 1,153,323 |
| Password | 16,809 |
| Ransomware | 3425 |
| Scanning | 3,781,419 |
| Cross-site Scripting (XSS) | 2,455,020 |
NF-ToN-IoT-v2 features.
| Feature | Description |
|---|---|
| IPV4_SRC_ADDR | IPv4 source address |
| IPV4_DST_ADDR | IPv4 destination address |
| L4_SRC_PORT | IPv4 source port number |
| L4_DST_PORT | IPv4 destination port number |
| PROTOCOL | IP protocol identifier byte |
| L7_PROTO | Layer 7 protocol (numeric) |
| IN_BYTES | Incoming number of bytes |
| OUT_BYTES | Outgoing number of bytes |
| IN_PKTS | Incoming number of packets |
| OUT_PKTS | Outgoing number of packets |
| FLOW_DURATION_MILLISECONDS | Flow duration in milliseconds |
| TCP_FLAGS | Cumulative of all TCP flags |
| CLIENT_TCP_FLAGS | Cumulative of all client TCP flags |
| SERVER_TCP_FLAGS | Cumulative of all server TCP flags |
| DURATION_IN Client | to Server stream duration (msec) |
| DURATION_OUT | Client to Server stream duration (msec) |
| MIN_TTL | Min flow TTL |
| MAX_TTL | Max flow TTL |
| LONGEST_FLOW_PKT | Longest packet (bytes) of the flow |
| SHORTEST_FLOW_PKT | Shortest packet (bytes) of the flow |
| MIN_IP_PKT_LEN | Len of the smallest flow IP packet observed |
| MAX_IP_PKT_LEN | Len of the largest flow IP packet observed |
| SRC_TO_DST_SECOND_BYTES | Src to dst Bytes/sec |
| DST_TO_SRC_SECOND_BYTES | Dst to src Bytes/sec |
| RETRANSMITTED_IN_BYTES | Number of retransmitted TCP flow bytes (src->dst) |
| RETRANSMITTED_IN_PKTS | Number of retransmitted TCP flow packets (src->dst) |
| RETRANSMITTED_OUT_BYTES | Number of retransmitted TCP flow bytes (dst->src) |
| RETRANSMITTED_OUT_PKTS | Number of retransmitted TCP flow packets (dst->src) |
| SRC_TO_DST_AVG_THROUGHPUT | Src to dst average thpt (bps) |
| DST_TO_SRC_AVG_THROUGHPUT | Dst to src average thpt (bps) |
| NUM_PKTS_UP_TO_128_BYTES | Packets whose IP size ≤ 128 |
| NUM_PKTS_128_TO_256_BYTES | Packets whose IP size > 128 and ≤256 |
| NUM_PKTS_256_TO_512_BYTES | Packets whose IP size > 256 and ≤512 |
| NUM_PKTS_512_TO_1024_BYTES | Packets whose IP size > 512 and ≤1024 |
| NUM_PKTS_1024_TO_1514_BYTES | Packets whose IP size > 1024 and ≤1514 |
| TCP_WIN_MAX_IN | Max TCP Window (src->dst) |
| TCP_WIN_MAX_OUT | Max TCP Window (dst->src) |
| ICMP_TYPE | ICMP Type × 256 + ICMP code |
| ICMP_IPV4_TYPE | ICMP Type |
| DNS_QUERY_ID | DNS query transaction Id |
| DNS_QUERY_TYPE | DNS query type (e.g., 1 = A, 2 = NS.) |
| DNS_TTL_ANSWER | TTL of the first A record (if any) |
| FTP_COMMAND_RET_CODE | FTP client command return code |
Figure 1The architecture of the proposed system.
Figure 2The correlation matrix between the 43 features.
Figure 3The feature importance for the multi-classification process.
Figure 4The feature importance for the bi-classification process.
Figure 5Confusion matrix for NF-ToN-IoT-v2 Bi-classification process.
Figure 6Confusion matrix for NF-ToN-IoT-v2 multi-classification process.
Feature importance performance for binary-classification Using DT.
| Class | All Features | Importance ≥ 0.02 | Importance ≥ Median (0.0096) | Importance ≥ Mean (0.0232) | Best 8 Features |
|---|---|---|---|---|---|
| F1-score | F1-score | F1-score | F1-score | F1-score | |
| 0. Benign | 0.99 | 0.99 | 0.99 | 0.99 | 0.96 |
| 1. Attack | 1.00 | 1.00 | 1.00 | 1.00 | 0.98 |
| Weighted avg | 1.00 | 1.00 | 1.00 | 1.00 | 0.97 |
| Final # of features used | 43 (none removed) | Top 14 features | Top 22 features | Top 13 features | Top 8 features |
1 from SRC_TO_DST_SECOND_BYTES to CLIENT_TCP_FLAGS; 2 from SRC_TO_DST_SECOND_BYTES to NUM_PKTS_UP_TO_128_BYTES; 3 from SRC_TO_DST_SECOND_BYTES to SHORTEST_FLOW_PKT—Adopted approach; 4 from SRC_TO_DST_SECOND_BYTES to IP4_DST_ADDR.
Feature importance performance for multi-classification Using DT.
| Class | All Features | Importance ≥ 0.02 | Importance ≥ 0.01 | Importance ≥ Median (0.0107) | Importance ≥ Mean (0.232) |
|---|---|---|---|---|---|
| 2-6 | F1-score | F1-score | F1-score | F1-score | F1-score |
| 0. Benign | 0.99 | 1.00 | 0.99 | 0.99 | 0.99 |
| 1. Backdoor | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 |
| 2. DoS | 0.99 | 0.99 | 0.99 | 0.99 | 0.98 |
| 3. DDoS | 0.89 | 0.80 | 0.89 | 0.89 | 0.77 |
| 4. Injection | 0.91 | 0.92 | 0.91 | 0.91 | 0.91 |
| 5. MITM | 0.55 | 0.60 | 0.55 | 0.55 | 0.58 |
| 6. Password | 0.97 | 0.97 | 0.97 | 0.97 | 0.97 |
| 7. Ransomware | 0.97 | 0.98 | 0.97 | 0.98 | 0.98 |
| 8. Scanning | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 |
| 9. XSS | 0.95 | 0.94 | 0.95 | 0.95 | 0.93 |
| Weighted avg | 0.98 | 0.98 | 0.98 | 0.98 | 0.98 |
| Final # of features used | 43 (none removed) | Top 18 features | Top 23 features | Top 22 features | Top 17 features |
Binary classification using features with importance ≥ mean (top 13 features).
| DT | RF | XGB | NB | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Class | PR | RC | F1-Score | PR | RC | F1-Score | PR | RC | F1-Score | PR | RC | F1-Score |
| 0. Benign | 1.00 | 0.99 | 0.99 | 1.00 | 0.99 | 1.00 | 0.98 | 0.97 | 0.97 | 0.93 | 0.04 | 0.07 |
| 1. Attack | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 0.98 | 0.99 | 0.98 | 0.62 | 1.00 | 0.76 |
| Weighted avg | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 0.98 | 0.98 | 0.98 | 0.74 | 0.62 | 0.50 |
| Accuracy | 1.00 | 1.00 | 0.98 | 0.62 | ||||||||
Multi-classification using features with importance ≥ mean (top 17 features).
| DT | RF | XGB | NB | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Class | PR | RC | F1-Score | PR | RC | F1-Score | PR | RC | F1-Score | PR | RC | F1-Score |
| 0. Benign | 0.99 | 1.00 | 0.99 | 1.00 | 1.00 | 1.00 | 0.96 | 0.98 | 0.97 | 0.98 | 0.01 | 0.03 |
| 1. Backdoor | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 0.99 | 0.99 | 1.00 | 0.97 | 0.99 |
| 2. DoS | 0.98 | 0.98 | 0.98 | 0.98 | 0.98 | 0.98 | 0.93 | 0.97 | 0.95 | 0.85 | 0.48 | 0.61 |
| 3. DDoS | 0.77 | 0.78 | 0.77 | 0.78 | 0.78 | 0.78 | 0.85 | 0.81 | 0.83 | 0.42 | 0.56 | 0.48 |
| 4. Injection | 0.91 | 0.91 | 0.91 | 0.93 | 0.91 | 0.92 | 0.85 | 0.64 | 0.73 | 0.32 | 0.21 | 0.25 |
| 5. MITM | 0.58 | 0.58 | 0.58 | 0.59 | 0.59 | 0.59 | 0.94 | 0.44 | 0.60 | 0.06 | 0.00 | 0.01 |
| 6. Password | 0.97 | 0.97 | 0.97 | 0.97 | 0.97 | 0.97 | 0.87 | 0.89 | 0.88 | 0.47 | 0.80 | 0.59 |
| 7. Ransomware | 0.99 | 0.98 | 0.98 | 0.99 | 0.99 | 0.99 | 0.95 | 0.78 | 0.85 | 0.00 | 0.16 | 0.01 |
| 8. Scanning | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 1.00 | 0.97 | 0.95 | 0.96 | 0.39 | 0.98 | 0.56 |
| 9. XSS | 0.94 | 0.93 | 0.93 | 0.93 | 0.95 | 0.94 | 0.88 | 0.94 | 0.91 | 0.61 | 0.72 | 0.66 |
| Weighted avg | 0.98 | 0.98 | 0.98 | 0.98 | 0.98 | 0.98 | 0.94 | 0.94 | 0.94 | 0.71 | 0.45 | 0.35 |
| Accuracy | 0.98 | 0.98 | 0.94 | 0.45 | ||||||||
Figure 7Prediction time for bi-classification and multi-classification using DT model.
Comparison between the proposed method performance and state-of-the-art method using NF-ToN-IoT-v2.
| Output Class | Measure | Sarhan et al. [ | Proposed Method |
|---|---|---|---|
| Feature Set | 43 | 13 | |
| Binary Classification Begin vs. Attack | Accuracy | 99.64% | 100% |
| F1-score | 1.00 | 1.00 | |
| Dimensionality Reduction rate | - | 70% | |
| Feature Set | 43 | 17 | |
| Multi-Classification Classes 0-9 | Accuracy | 98.05% | 98% |
| F1-score | 0.98 | 0.98 | |
| Dimensionality Reduction rate | - | 60% |