Hackers are often categorized as white hat, black hat, and gray hat hackers. White hat hackers are lawful, ethical hackers, while black hat hackers are the opposite—criminal and often malicious. Gray hat hackers are an in-between type that ventures into both areas.