DDoS attacks, which target a network as a whole, are the most common name for these kinds of attacks. The attacks make use of weak spots in the authorised group's website framework, for example, to get unauthorised access to sensitive information. The author of the current study used a legacy KDD dataset in his or her research. If you want to know where DDoS attacks stand right now, you need to use the most recent available dataset. In this research, we employ a machine learning technique to classify and forecast DDoS assault types. The classification methods Random Forest and XGBoost were utilised for this purpose. A comprehensive paradigm for DDoS attack prediction was provided in this study. The suggested work makes use of a Python simulator built on top of the UNWS-np-15 dataset, which was obtained from the GitHub source. Following the implementation of the machine learning models, a confusion matrix was created to evaluate the accuracy of the predictions. For the initial categorization, the Random Forest method achieved an impressive 89% in both Precision (PR) and Recall (RE). Our proposed model has an Accuracy (AC) of 89%, which is excellent and more than sufficient. Both Precision (PR) and Recall (RE) for the XGBoost algorithm hover around 90% in the second classification. Our proposed model has an Accuracy (AC) of 90% on average. We found that the accuracy of defect assessment was significantly increased, from around 85% to 79%, when compared to prior study.