Cybercrime is an increasing threat that occurs while exploring the internet. Cybercrime is committed by cybercriminals who exploit the web's vulnerability by inserting malicious software to access systems that belong to web service users. It is detrimental to users, therefore detecting malicious websites is necessary to minimize cybercrime. This research aims to improve the effectiveness of detecting malicious websites by applying the Logistic Regression algorithm. The selection of Logistic Regression is based on its ability to perform binary classification, which is important for distinguishing between benign and potentially malicious websites. This research emphasizes a preprocessing stage that has been deeply optimized. Data cleaning, dataset balancing, and feature mapping are enhanced to improve detection accuracy. Hybrid sampling addresses data imbalance, ensuring the model is trained with representative data from both classes. Experimental results show that the Logistic Regression implementation achieves an excellent level of accuracy. The developed model recorded an accuracy of 92.60% without cross-validation, which increased to 92.71% with 5-fold cross-validation. The novelty of this research lies in the significant increase in accuracy compared to previous methods, demonstrating the potential to improve protection against malicious website threats in an increasingly complex and risky digital environment. This research makes an important contribution to the development of digital security detection technologies to address the ever-growing challenges of cybercrime.