A class imbalance problem is a problem in which the number of majority class and minority class varies greatly. In this article, we propose an oversampling method using GA and k-Nearest Neighbors (kNN) to deal with a network intrusion, a class imbalance problem. We use GA as the main algorithm and use a kNN as its fitness function. We compare the proposed method with a very popular oversampling technique which is a SMOTE family. The experimental results show that the proposed method provides better Accuracy, Precision, and F-measure values than a SMOTE family in almost all datasets with almost all classifiers. Moreover, in some datasets with some classifiers, the proposed method also gives a better Recall value than a SMOTE family as well. This is because the proposed method can generate new intruders in a more independent area than a SMOTE family.