Network analysis and threat protection