As a result of the inherent weaknesses of the wireless medium, ad hoc networks are susceptible to a broad variety of threats and assaults. As a direct consequence of this, intrusion detection, as well as security, privacy, and authentication in ad-hoc networks, have developed into a primary focus of the current study. This body of research aims to identify the dangers posed by a variety of assaults that are often seen in wireless ad-hoc networks and provide strategies to counteract those dangers. The Black hole assault, Wormhole attack, Selective Forwarding attack, Sybil attack, and Denial-of-Service attack are the specific topics covered in this proposed work. In this paper, we describe a trust-based safe routing protocol with the goal of mitigating the interference of black hole nodes while routing in mobile ad-hoc networks. The overall performance of the network is negatively impacted when there are black hole nodes in the route that routing takes. As a result, we have developed a routing protocol that reduces the likelihood that packets would be lost because of black hole nodes. This routing system has been subjected to experimental testing to guarantee that the most secure path will be selected for the delivery of packets between a source and a destination. The invasion of wormholes into wireless networks results in the segmentation of the network as well as a disorder in the routing. As a result, we provide an effective approach for locating wormholes by using ordinal multi-dimensional scaling and round-trip duration in wireless ad hoc networks with either sparse or dense topologies. Wormholes that are linked by both short-route and long-path wormhole linkages may be found using the approach that was given. To guarantee that this ad hoc network does not include any wormholes that go unnoticed, this method is subjected to experimental testing. To fight against selective forwarding attacks in wireless ad-hoc networks, we have developed three different techniques. The first method is an incentive-based algorithm that makes use of a reward-punishment system to drive cooperation among three nodes for forwarding messages in crowded ad-hoc networks. A unique adversarial model has been developed by our team, and inside it, three distinct types of nodes and the activities they participate in are specified. We have demonstrated that the proposed method that is based on incentives prevents nodes from adopting individualistic behaviour, which ensures cooperation in the process of packet forwarding. In the second algorithm, a game theoretic model is proposed that uses non-cooperative game theory to ensure that intermediate nodes in resource-constrained ad-hoc networks faithfully forward packets.