Security is a significant issue in this world and is given several dimensions by varying circumstances. Among different security areas, cyber security can be claimed to have one of the most important places in new circumstances of this world. In this study, two virtual honeynets were designed in two different laboratories to help study unknown attacks. Other scientific datasets were also used for this purpose. Imbalanced data always cause problems for network datasets and reduce the efficiency for the prediction of minority classes. To cope with this problem, ensemble learning methods were applied in order to detect net-work attacks, and most specifically, unknown attacks, while taking advantage of different techniques and action model learning. Statistical analysis was used as the research method in order to measure the reliability and validity of the findings. Finally, statistical techniques and tests were applied to show that the algorithm designed by weighted voting that is based on the genetic algorithm has a better performance than other twelve classifiers. According to the Fisher's criterion, the proposed approach was in the first place in the actual laboratory context and in the second place in the standard data set.