In a previous work [Physica A: Statistical Mechanics and its Applications 545(2020) 123609], an integer-order model for the spreading of malicious code on wireless sensor networks was introduced and analyzed. Global asymptotic stability (GAS) of a disease-endemic equilibrium (DEE) point was only partially resolved under some technical hypotheses. In the present work, we use a simple approach, which is based on a suitable family of Lyapunov functions in combination with characteristics of Volterra-Lyapunov stable matrices, to establish the GAS of the DEE point. Consequently, a simple and easily-verified condition for the DEE point to be globally asymptotically stable is obtained.In addition, we generalize the integer-order model by considering it in the context of the Caputo fractional derivative. Then, the proposed approach is utilized to analyze the GAS of the fractional-order model. The result is that the GAS of the DEE point of the fractional-order model is also established. Therefore, the advantage of the present approach is shown.Finally, the theoretical findings are supported by numerical and illustrative examples, which indicate that the numerical results are consistent with the theoretical ones.