Wireless sensor networks are networks consisting of nodes with sensors to monitor physical or environmental conditions. Since nodes in wireless sensor networks have limited transmission capabilities, packets are generally transmitted to the destination node through several immediate nodes. However, if a malicious node is present on a route through which packets are forwarded, attackers can deliver selective forwarding attacks by simply dropping packets. Selective forwarding attacks can be serious threats on many applications including networks for military surveillance and health-care monitoring. Previous countermeasures to selective forwarding attacks cannot identify malicious nodes or require time synchronization. In this paper, we present a detecting scheme which identifies malicious nodes delivering selective forwarding attacks without the need for time synchronization. Our scheme also provides security against sinkhole attacks where attackers try to attract more traffic to malicious nodes.