FLAP: Federated Learning with Attack and Privacy Awareness