Five Palestinians, three of them teenagers, have been shot dead after trying to attack Israeli security forces, Israeli officials say.