## 1 Introduction
A Black Hole node might enter the network invisibly due to the open medium and dynamic topology of MANETs and remain there indefinitely. During the route discovery phase, the emergence of Black Hole nodes is a common occurrence. It is initially unknown whether the receiver can reach the source node via a feasible route. The path between the source and destination nodes is found when intermediary systems obtain a Route Request (RREQ) message [12; 13; 14; 15]. A Gray Hole assault is a sort of distributed service denial assault that is an extension of a Black Hole assault in nature. It is referred to as a partial packet dropping technique because it loses only the data packets that are targeted during transmission. Gray nodes are not harmful nodes at first since they act in the same way as regular nodes  
Figure 1: Basic structure of VANETs. during the process of path discovery. When it comes to MANETs, detecting Gray Hole nodes might be a difficult process, since during the route selection procedure, they do not communicate the right sequence number. They eventually transform into hostile nodes when data packets are delivered from the source over an extended length of time to the target node [16; 17; 18; 19; 20]. We present a strategy termed dual attack detection for Black and gray node [3] in order to detect and isolate rogue nodes from VANETs. In the beginning, Dual attack Detection for Black and Gray hole attacks (DDBG) used Connected Dominating Set (CDS) technology to create tiny groups of nodes within the network. Second, the DDBG chooses the intrusion detection system (IDS) component set of tiny CDS node groups that have sufficient power and do not belong to the blacklist. The third stage selects an IDS node with maximum energy in the IDS set. The IDS node needs to be a node of trust. The IDS node then regularly transmits status packets to detect the malicious node in the IDS set. If the behavior of any node is suspected of being malicious, the IDS node sends a block message to alert all nodes. All nodes will then terminate contact with the specific malicious node. Unlike previous works, we present a neural network-based intelligent system for the detection and prevention of rushed Black and Gray Hole attacks. The following are the contributions of this study:  
* Using the linked dominant set (CDS) approach, we present a detection method for harmful Black Holes and Gray Holes using the nodes for intrusion detection. When used in dense networks, the proposed method is also effective in distinguishing hostile nodes, particularly those that use clever Gray Hole attacks. * We use neural networks for efficient detection of attacks that results in better throughput as compared to conventional schemes. * Comprehensive experimental results reveal that the proposed approach is an effective strategy for Black and Gray Hole attack identification compared with the state-of-the-art techniques. The rest of the article is summarized as follows. Prior research work is discussed in Section 2. System models and methodology used in this work are presented in Section 3. Proposed techniques and algorithms are presented in Section 4. Section 5 outlines the simulation scenario and experimental results. Conclusions and future work are discussed in Section 6.