A comparative study of cyberattacks