We present an analysis of virus spread in wireless sensor networks (WSNs) through a modified susceptible-infective (SI) epidemic model. In a traditional SI model, once a sensor node is attacked by a virus, the infective node can spread the virus to its neighboring nodes, which further spread the virus to their neighbors; the process continues until the whole network fails. To overcome this weakness, we propose a modified SI model by leveraging the sleep mode of WSNs for the virus spread control. The modified SI model can improve the network anti-virus capability without causing any extra hardware effort and signaling overhead. We derive the explicit solutions for the modified SI model, which can capture both the spatial and temporal dynamics of the virus spread process. Numerical results are presented to validate our analysis.