This early phase 1 clinical trial tests whether ketoconazole, an antifungal drug, can penetrate primary glioma brain tumors through the blood-brain barrier at levels sufficient to disrupt tumor growth, based on preclinical studies targeting glucose metabolism. Gliomas, especially aggressive high-grade types (WHO grades III-IV), have limited treatments like surgery, radiation, or chemotherapy. Patients with low- or high-grade gliomas will receive single or repeated low doses of ketoconazole before scheduled surgery, tailored to their health and procedure timing. During surgery, drug levels will be measured in tumor tissue and plasma. Results will guide future trials exploring azole drugs as glioma therapies.