The correct answer is A. Towards the wall at its upper end.
The force of friction acts in the direction opposite to the relative motion of the two surfaces in contact. In this case, the ladder is not moving relative to the wall, so the force of friction acts towards the wall.
Option B is incorrect because the force of friction would act away from the wall if the ladder were moving towards the wall. Option C is incorrect because the force of friction would act upwards if the ladder were falling over. Option D is incorrect because the force of friction would act downwards if the ladder were being lifted up.