In the contemporary era of unprecedented innovations such as the Internet of Things (IoT), modern applications cannot be imagined without the presence of a wireless sensor network (WSN). Nodes in WSN use neighbor discovery (ND) protocols to have necessary communication among the nodes. The neighbor discovery process is crucial as it is to be done with energy efficiency and minimize discovery latency and maximum percentage of neighbors discovered. The current ND approaches that are indirect in nature are categorized into methods of removal of active slots from wake-up schedules and intelligent addition of new slots. This work develops a lightweight intrusion detection system (IDS) based on two machine learning approaches, namely, feature selection and feature classification, in order to improve the security of the Internet of Things (IoT) while transferring medical data through a cloud platform. In order to take advantage of the comparatively cheap processing cost of the filter-based technique, the feature selection was carried out. The two methods are found to have certain drawbacks. The first category disturbs the original integrity of wake-up schedules leading to reduced chances of discovering new nodes in WSN as neighbors. When the second category is followed, it may have inefficient slots in the wake-up schedules leading to performance degradation. Therefore, the motivation behind the work in this paper is that by combining the two categories, it is possible to reap the benefits of both and get rid of the limitations of both. Making a hybrid is achieved by introducing virtual nodes that help maximize performance by ensuring the original integrity of wake-up schedules and adding efficient active slots. Thus, a Hybrid Approach to Neighbor Discovery (HAND) protocol is realized in WSN. The simulation study revealed that HAND outperforms the existing indirect ND models.