Cyclophosphamide (CTX) is a broad-spectrum alkylated antitumor drug. It is clinically used in the treatment of a variety of cancers, and renal toxicity is one of the adverse reactions after long-term or repeated use, which not only limits the therapeutic effect of CTX, but also increases the probability of kidney lesions. The total flavonoids of Epimedium stem and leaf (EBF) and Icariin (ICA) are the main medicinal components of Epimedium, and ICA is one of the main active substances in EBF. Modern pharmacological studies have shown that EBF has a variety of biological activities such as improving osteoporosis, promoting cell proliferation, antioxidant and anti-inflammatory properties, etc. However, few studies have been conducted on the nephrotoxicity caused by optimized CTX extraction, and protein-ligand binding has not been involved. This research, through the response surface optimization extraction of EBF, obtained the best extraction conditions: ethanol concentration was 60%, solid-liquid ratio of 25:1, ultrasonic time was about 25 min. Combined with mass spectrometry (MS) analysis, EBF contained ICA, ichopidin A, ichopidin B, ichopidin C, and other components. In this study, we adopted a computational chemistry method called molecular docking, and the results show that Icariin was well bound to the antioxidant target proteins KEAP1 and NRF2, and the anti-inflammatory target proteins COX-2 and NF-κB, with free binding energies of -9.8 kcal/mol, -11.0 kcal/mol, -10.0 kcal/mol, and -8.1 kcal/mol, respectively. To study the protective effect of EBF on the nephrotoxicity of CTX, 40 male Kunming mice (weight 18 ± 22) were injected with CTX (80 mg/kg) for 7 days to establish the nephrotoxicity model and were treated with EBF (50 mg/kg, 100 mg/kg) for 8 days by gavage. After CTX administration, MDA, BUN, Cre, and IL-6 levels in serum increased, MDA increased in kidney, GPT/ALT and IL-6 increased in liver, and IL-6 increased in spleen and was significant ((p < 0.05 or (p < 0.01)). Histopathological observation showed that renal cortex glomerular atrophy necrosis, medullary inflammatory cell infiltration, and other lesions. After administration of EBF, CTX-induced increase in serum level of related indexes was reduced, and MDA in kidney, GPT/ALT and IL-6 in liver, and IL-6 in spleen were increased. At the same time, histopathological findings showed that the necrosis of medullary and corticorenal tubular epithelium was relieved at EBF (50 mg/kg) dose compared with the CTX group, and the glomerular tubular necrosis gradually became normal at EBF (100 mg/kg) dose. Western blot analysis of Keap1 and Nrf2 protein expression in kidney tissue showed that compared with model CTX group, the drug administration group could alleviate the high expression of Keap1 protein and low expression of Nrf2 protein in kidney tissue. Conclusion: After the optimal extraction of total flavonoids from the stems and leaves of Epimedium, the molecular docking technique combined with animal experiments suggested that the effective component of the total flavonoids of Epimedium might activate the Keap1-Nrf2 signaling pathway after treatment to reduce the inflammation and oxidative stress of kidney tissue, so as to reduce kidney damage and improve kidney function. Therefore, EBF may become a new natural protective agent for CTX chemotherapy in the future.