Botnets take advantage of the vulnerabilities in the device‐to‐device (D2D) communication in the Internet of Things (IoT) systems. The infect devices may become part of the command and control mechanism of Botnets. These infected devices may forget control commands to remain undetected. State‐of‐the‐art control models for botnets based on how devices are infected and patched in IoT systems while dealing with Botnets assume that the rate at which IoT devices forget the control commands (forgetting rate) is constant and known. These control models ignore the possible variability of the forgetting rate, which may enable bots to operate without being detected. This research fills this gap by proposing a modeling‐based strategy that considers the changes in equipment states and repair speed when the forgetting rate is variable. In this regard, first, based on the state‐of‐the‐art botnets control model, the effect of variation in the forgetting rate is analyzed. After that, an improved strategy is proposed for the botnets control model when the forgetting rate is unknown. Finally, the experimental evaluation of the proposed strategy is performed that proves the correctness of the proposed control strategy.