Rootkits are a type of malware that can be used to gain unauthorized access to a computer system. While rootkits are not specifically illegal, they can be used for illegal purposes such as data theft, identity theft, and destruction of data.