In the last few decades, Intrusion Detection System (IDS), in particular, machine learningbased anomaly detection, has gained importance over Signature Detection Systems (SDSs) in the novel attacks detection. Herein, a novel approach called T-Distributed Stochastic Neighbour Embedding and Random Forest Algorithm (T-SNERF) is presented for the classification of cyber-attacks. The approach consists of three different steps. First, the examination of feature correlations is provided. Second, the T-Distributed Stochastic Neighbour Embedding (T-SNE) data dimensional reduction technique is used. Third, Random Forest (RF) technique is utilised to evaluate the complications in the accuracy and False-Positive Rate (FPR). The proposed approach has been tested on various well-known datasets, namely, UNSW-NB 15, CICIDS-2017, and phishing datasets. The proposed novel approach achieved significant results compared with existing approaches, achieving 100% accuracy, and 0% FPR for the UNSW-NB15 dataset, and achieving high accuracy rates, up to 99.7878%, and 99.7044%, for CICIDS-2017 and Phishing datasets respectively. This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited.