Detecting malicious activities with user-agent-based profiles