A perfect rootkit embeds itself within the kernel (before your operating system), so it can operate with full permissions without restriction, and better yet, hide itself.
It's malware, but more sophisticated than your average malware due to its ability to manipulate the OS by embedding itself within the kernel.