With no dwindling in the use of wireless communication and a corresponding speedy proliferation of research in mobile technology, Mobile Adhoc Network (MANET) have been widely used for various applications such as military crisis operations and emergency rescue operations. The infrastructure-less nature and the dynamic topology features of MANET makes these networks highly vulnerable to various security issues like exploiting vulnerabilities of routing protocols and injecting harmful packets in the network etc. These threats deteriorate causes severe damage to the network. The challenge is how to prevent these security threats in MANETs. Based on AODV protocol, propose a detection scheme called the Cooperative Detection Scheme (CDS), which aims at detecting and preventing affected nodes launching gray hole/collaborative black hole attacks in MANETs.