The proliferation of computer viruses has escalated in recent years, posing threats not only to individuals’ safety and property but also to societal well-being. Consequently, effectively curtailing virus spread has become an urgent imperative. To address this issue, our paper introduces a new virus propagation model and associated control strategy. First, diverging from conventional approaches in network virus literature, we propose a susceptible-latent-breaking-out-recovered-susceptible (SLBRS) virus propagation model tailored to the topological characteristics of scale-free networks, thus comprehensively incorporating network structure’s impact on virus propagation. Second, we analyze the model’s foundational properties, derive the basic reproduction number, and demonstrate the existence and global asymptotic stability of disease-free equilibrium. Finally, leveraging global stability of the model at the disease-free equilibrium, we integrate the target immunization strategy (TIS) and the acquaintance immunization strategy (AIS) to devise an optimal control strategy. The paper’s findings offer fresh insights into disease-free equilibrium existence and stability, furnishing a more dependable approach to curbing network virus dissemination. The simulation results demonstrate the persistent presence of network viruses in the absence of control measures and the instability of the disease-free equilibrium. However, effective control is achieved after implementing immunization measures.