Apollo 18

In December 1974, the crew of the cancelled Apollo 18 mission is informed that it will now proceed as a top secret Department of Defense (DoD) mission disguised as a satellite launch. Commander Nathan Walker, Lieutenant Colonel John Grey, and Captain Ben Anderson are launched toward the Moon to place detectors to alert the United States of any impending ICBM attacks from the USSR.
Grey remains in orbit aboard the Freedom command module while Walker and Anderson land on the moon in the lunar module Liberty. While planting one of the detectors, the pair take moon rock samples. After returning to Liberty, the pair hear noises outside and a camera captures a small rock moving nearby. Houston claims the noises are interference from the ICBM detectors. Anderson finds a rock sample on the floor of Liberty despite having secured the samples. During further lunar exploration they discover footprints that lead them to a bloodstained, functioning Soviet LK lander, and a dead cosmonaut in a nearby crater. Walker queries Houston about the Soviet presence, but he is told only to continue with the mission.
The following day the pair find that the flag they had planted is missing. Their mission complete, the crew prepares to leave, but the launch is aborted when Liberty suffers violent shaking. An inspection reveals extensive damage to Liberty and non-human tracks that Walker cites as evidence of extraterrestrial life. Walker feels something moving inside his spacesuit and is horrified as a spider-like creature crawls across the inside of his helmet. Walker disappears from view and Anderson finds him unconscious outside of Liberty. Walker later denies the events. A wound is discovered on Walker's chest; Anderson removes a moon rock embedded within him. The pair find themselves unable to contact Houston or Grey due to increased levels of interference from an unknown source.
Anderson speculates that the true intention of the ICBM warning devices is to monitor the aliens, and that the devices are the source of the interference, only to discover something has destroyed them when they attempt to switch them off. Walker shows signs of a developing infection and he becomes increasingly paranoid. The mission cameras capture the rock samples moving around in the interior of Liberty, revealing that the aliens are camouflaged as moon rocks. Increasingly delusional, Walker attempts to destroy the cameras within Liberty, but he accidentally damages the system controls, causing Liberty to depressurize. Realizing the Soviet LK is their only source of oxygen, the pair travel towards the LK lander in their lunar rover. Walker causes the vehicle to crash as he runs away, believing he should not leave the moon because of the risk of spreading the infection to Earth.
Anderson awakens and tracks Walker to the crater where they found the cosmonaut. Walker is pulled into the crater by the creatures. Anderson gives chase, but he is confronted by the aliens, and flees to the Soviet LK. Anderson uses its radio to contact USSR Mission Control who connect him to the Department of Defence. The deputy secretary informs Anderson that they cannot allow him to return to Earth, admitting they are aware of the situation and incorrectly believe he is also infected. Anderson manages to contact Grey and they make arrangements for Anderson to return to Freedom. Anderson prepares the lander for launch, but Walker arrives, revealing he had survived the alien encounter earlier. However, he is now completely psychotic and demands to be let in. When Anderson refuses to let him in, he tries to break the lander's window with a hammer. But before Walker can enter the vehicle, he is attacked by a swarm of the creatures, which cause his head to explode, killing him.
Anderson launches, but the DoD warns Grey that Anderson is infected and orders him to abort the rescue or communication will be cut off, without which the CSM will be unable to return to Earth. The lander's engines shut off as it enters orbit, and it is in free fall. Small rocks within the craft float in the air, some of which reveal themselves to be alien creatures. Anderson is attacked and actually infected by the creatures, preventing him from controlling the vehicle. Grey tells Anderson that he is moving too fast as the LK crashes into Freedom killing them both. The space footage ends abruptly.
The footage cuts to before the pilots' mission, showing them having a barbecue with friends and family. The "official" fate of the astronauts is given, describing them as having died in various accidents that left their bodies unrecoverable. An epilogue explains that many of the rock samples returned from the previous Apollo missions are now missing.

Question: How does Anderson become infected?
Answer: Anderson is attack by the alien creatures