A virus has infected computers used by pilots who fly US drones, recording every keystroke made by the pilots as they remotely fly drones over warzones, including Afghanistan.

Wired magazine reported the virus has infected the computers at the Creech air force base in Nevada.

Wired said magazine reported that the spyware has resisted efforts to remove it from computers. The report added that the virus was first detected about two weeks ago by the military’s Host-Based Security System.

However, the virus has not thwarted missions flown remotely over Afghanistan, Wired said. It also said that there are no reports that classified data was stolen. It is unknown whether the virus was part of a directed attack or accidentally infected the networks, the report said.

The Air Force refused to disclose more details, saying it could help hackers.

"We keep wiping it off, and it keeps coming back," Wired quoted a source as saying. "We think it’s benign. But we just don’t know."