Modeling botnets and epidemic malware