Wireless sensor networks is emerging technology these days. There is very wide range of uses of this technology, from military purpose to medical purpose. The sensor are small and compact and can be deployed anywhere. These sensors are low in cost. So it performs important tasks for low cost. They can be deployed in hundreds to some thousands in quantity. This makes wireless sensor networks prone to different types of attacks. One of them is Node Replication attack. In this attack the attacker takes the Id of one legitimate node and make replica of it and place those node inside network. As sometimes the sensor transfers confidential data so it is important to protect it from these types of attacks. Different algorithms are developed to detect these replicated nodes. In this article we are proposing a detection algorithm that can be used to detect replication attack. This algorithm is named ND-RED(Neighbor Division-Randomize Efficient Distributed) Algorithm.