Because of the headway of data and correspondence advances, the utilization of Internet of Things (IoT) gadgets has expanded dramatically. In the improvement of IoT, WSN plays out a crucial part and involves easy keen gadgets for data gathering. In any case, such savvy gadgets have requirements regarding calculation, preparing, memory, and energy assets. Alongside such requirements, the major difficulties for WSN is to accomplish dependability with the security of communicated information in a weak climate alongside pernicious hubs. This paper intends to build up an Anomalous intrusion detection protocol (AIDP) and Intrusion Prevention Protocol (IPP) for interruption evasion in IoT dependent on WSN to expand the organization's time frame and information reliability. Right off the bat, the proposed convention makes dissimilar energy-efficient groups dependent on the natural characteristics of hubs. Also, in view of the (k, n) limit related Shamir mystery sharing plan, the unwavering quality also, the security of the tangible data within the base station (BS) and group head are accomplished. The proposed security conspires demonstrates a trivial answer to adapt to interruptions produced by malignant hubs. The trial results utilizing the organization test system (NS-2) show that the proposed directing convention accomplished improvement as far as organization lifetime, end to end delay as 24%, packet delay ratio as 30%, when contrasted and the current work under unique organization geographies.