Internet has experienced significant development. Increasing devices connected to internet makes security against cyber attacks a critical issue, thus creates opportunities for cyber attackers, one form of those attack is botnets. In Indonesia, Botnets is the highest traffic anomalies in 2022 by BSSN. High number of attacks because detecting botnet can be challenging, difficulty of detecting attacks and low level of detection accuracy means that normal data sometimes considered an attack, so choosing method that can handle this is very important. Machine learning algorithms are able to study network data traffic and identify suspicious activity, this makes machine learning an effective method. Machine learning based on feature selection has an accuracy of above 90% in detecting DDoS attacks on datasets and machine learning algorithms are also able to detect attack data and normal data. Thus, in this research machine learning algorithms such as K-Nearest Neighbors, Support Vector Machine and Naive Bayes will be applied to dataset containing botnet and normal data to explore how machine learning algorithms can effectively detect botnet attack patterns and normal data. This research compares the performance of commonly used machine learning algorithms to find which one effective for detecting botnet attacks in existing datasets.