Bombyx mori nucleopolyhedrovirus (BmNPV) is a pathogen that causes severe disease in silkworms. In a previous study, we demonstrated that by using the CRISPR/Cas9 system to disrupt the BmNPV ie-1 and me53 genes, transgenic silkworms showed resistance to BmNPV infection. Here, we used the same strategy to simultaneously target lef8 and lef9, which are essential for BmNPV replication. A PCR assay confirmed that double-stranded breaks were induced in viral DNA at targeted sequences in BmNPV-infected transgenic silkworms that expressed small guide RNAs (sgRNAs) and Cas9. Bioassays and qPCR showed that replication of BmNPV and mortality were significantly reduced in the transgenic silkworms in comparison with the control groups. Microscopy showed degradation of midgut cells in the BmNPV-infected wild type silkworms, but not in the transgenic silkworms. These results demonstrated that transgenic silkworms using the CRISPR/Cas9 system to disrupt BmNPV lef8 and lef9 genes could successfully prevent BmNPV infection. Our research not only provides more alternative targets for the CRISPR antiviral system, but also aims to provide new ideas for the application of virus infection research and the control of insect pests.