A Wireless ad-hoc network is a temporary network set up by wireless mobile computers (or nodes) moving arbitrary in the places that have no network infrastructure. Since the nodes communicate with each other, they cooperate by forwarding data packets to other nodes in the network. Thus the nodes find a path to the destination node using routing protocols. However, due to security vulnerabilities of the routing protocols, wireless ad-hoc networks are unprotected to attacks of the malicious nodes. One of these attacks is the Black Hole Attack against network integrity absorbing all the packets in the network. Since the data packets do not reach the destination node on account of this attack, data loss will occur. There are lots of detection and defense mechanisms to eliminate the intruder that carry out the black hole attack. In this thesis, we simulated the black hole attack in various wireless ad-hoc network scenarios and have tried to find a response system in simulations.Similarly, another attack is Gray Hole Attack against network integrity which absorbs all data packets in the network In this thesis, we simulated the gray hole attack in various wireless ad-hoc network scenarios