A Recurrent Neural Network Approach for Detecting and Mitigating Denial of Service (DoS) and Man in the Middle (MitM) Attacks in Cyberspace
Abstract
The hazards presented by sophisticated cyber threats, especially Denial of Service (DoS) and Man in the Middle (MitM) assaults, which continue to be among the most disruptive to network stability, confidentiality, and integrity, have increased due to the rapid rise of cyberspace. Due to their heavy reliance on static or signature-based machine learning techniques, traditional intrusion detection systems (IDS) frequently fall short in terms of accuracy and real-time flexibility to changing attack patterns. This study offers a Modified Recurrent Neural Network (MRNN) framework intended to more effectively identify and mitigate DoS and MitM attacks in order to overcome these drawbacks. To capture the temporal and sequential properties of network traffic, the study uses benchmark datasets like CICIDS-2017 and CSE-CIC-IDS-2018 and applies stringent pre-processing and feature extraction techniques. In order to improve scalability, decrease false positives, and increase classification accuracy, the MRNN model incorporates optimal parameters and architectural improvements over traditional RNN, LSTM, and GRU structures. The system's ability to discriminate between malicious and valid traffic in real time and to initiate automated mitigation responses, such as IP blocking and session termination, is demonstrated through experimental evaluation in a simulated network environment. According to the results, the suggested RNN performs better than baseline detection models in terms of robustness against encrypted or high-volume communication and reaction time. It also performs best in terms of high Precision=0.997, Recall=0.985, F1=0.991, Support=332), MitM (Precision=0.982, Recall=0.997, F1=0.990, Support=335 and Normal Precision=0.997, Recall=0.994, F1=0.995, Support=333. These numerical values indicate balanced, near-optimal performance across the three classes with only tiny class-specific differences; in particular, MitM shows slightly higher recall but slightly lower precision relative to DoS, indicating a small trade-off between missed attacks and false alarms. In addition to its technical contributions, the study provides enterprises, network administrators, and legislators with useful information for strengthening Cyber Security infrastructures. This study adds to the growing body of knowledge on intrusion detection by developing AI-driven security mechanisms and offers a scalable way to counteract two of the most harmful and persistent assault vectors in cyberspace.
Keywords:
Detection System, DoS Attack, MitM Attack, Deep Learning, RNN ModelDownloads
ACCESSES
Published
Issue
Section
License
Copyright (c) 2025 Sajo, A., Sarjiyus, O. (Author)

This work is licensed under a Creative Commons Attribution 4.0 International License.










