The increasing applications of wireless sensor networks in home, office, military, health, traffic, environment, industrial, etc., have exposed them to many harmful attacks especially on the identity of the nodes like spoofing. The traditional systems use complex cryptographic techniques, spatial signatures, RSSI values, etc. to deal with these spoofing attacks. They suffer from the disadvantages of overhead, high power consumption, bandwidth and other resources available along with high costs of implementation. In this work, a method named Attack Detection and Localization Scheme (ADLS) to detect and localize the multiple identity-based attacks like spoofing has been proposed. An improved algorithm for hashing has also been proposed that is named as Effective Hashing Technique (EHT).The main objective of this work is providing secure environment, free of intruders that masquerade the identity of legitimate nodes of a wireless sensor network especially deployed for the purpose of some real time crucial applications like Wireless Home Security, military, traffic etc.