A method of treating a subject at risk for having a virus infection, by administering to the subject a prophylactically effective amount of a composition comprising a vector encoding a CRISPR-associated endonuclease and at least two guide RNAs, wherein the guide RNAs are complementary to two target sequences spanning from the 5′- to 3′-LTRs of the sequence in the virus, and preventing a retroviral infection.