Wireless sensor networks (WSNs) are not like traditional networks in terms of their characteristics. Unlike WSN, in classic networks, networking mechanisms have decision-making power with reference to the management of an incoming packet only based on its internet protocol (IP) destination address. Assailant nodes can activate a denial of service (DoS) attack after entering the network. This research work focuses on tracing these collusive nodes by applying a trust-based scheme. The trust-based scheme includes measuring the degree of trust among all nodes. Nodes with minimum trust are designated as malicious nodes. Trust is measured based on the overall packets transferred during the time slot allotted. The node forwarding maximal packets and exploiting minimal assists will be tagged as malicious. The nascent architecture was deployed in NS2, and the outcomes were analysed based on particular performance metrics. To calculate trust, the overall packets forwarded by nodes in the allotted slot were considered. The node that transmits the largest number of packets and uses negligible assets was declared a vindictive node. This task implementation presents the approach in the NS2 software and analyses the results based on certain metrics.