Security of Wireless sensor network (WSN) becomes a very important issue with the rapid development of WSN that is vulnerable to a wide range of attacks due to deployment in the hostile environment and having limited resources. Intrusion detection system is one of the major and efficient defensive methods against attacks in WSN. A particularly devastating attack is selective reporting, where an intruded node forces to transfer important data inside the network to the other node. The other attacks are also important to detect. These attacks are outsider attack and blackhole attack. Blackhole attack occurs when the receiver waits more than the stipulated time to receive the data from its previous node. Outsider attack occurs when the node from outside the network tries to connect to the network. The project aims to detect these attacks and also prevent its adverse effects on the system.