Botnet is created basically by infecting a large number of computers with malware and turning them into slave computers for the bot-herder. This malware can infiltrate a computer system in a number of ways, such as a trojan inside an email attachment, a web browser vulnerability, or drive-by downloads.