A method for detecting variants of malicious code using a neural network comprising an input layer which includes a two-dimensional matrix, a hidden layer which includes a plurality of layers including a plurality of operations, wherein any one of operation results of any one of the plurality of layers is provided to and used in an operation of a subsequent layer as an input by giving weights, and an output layer which includes a plurality of nodes, the method for detecting variants of malicious code comprising:
- inputting input data including one-dimensional binary codes to a data converter;
- generating pixels by dividing the one-dimensional binary codes by the data converter, and converting, by the data converter, the binary codes of the data into an image having the same ratio as a row-column ratio of the matrix using the generated pixels;
- and
- detecting suspicious data by a detector and transmitting the detected suspicious data from the detector to the neural network as an input of the suspicious data;
- extracting features of the malicious code included in the suspicious data using the neural network, and
- detecting a category of the malicious code included in the suspicious data according to the features of the malicious code.