Artificial Intelligence for Cybersecurity: Threats, Attacks and Mitigation