The importance of information security, especially in network environments, has increased as a result of the expanding volume of data stored in computer systems. The categorization of data instances into two classes using binary classification, a fundamental machine learning activity, facilitates efficient decision-making and risk assessment. The performance of standard classifiers, logistic regression, Gaussian NB, and support vector machine (SVM) is compared with that of CatBoost, a gradient boosting-based classifier known for handling categorical variables and reducing overfitting. The NSL-KDD dataset is used for the evaluation. Results show that CatBoost performs better than conventional classifiers, with higher accuracy, precision, and recall. CatBoost's ability to classify network connections accurately is demonstrated by its training and testing accuracy results, which surpass 97%. Furthermore, its high true positive rate and low false positive rate attest to its competence in accurately identifying network threats.