Malware behavior characteristic visualization method based on characteristic types and medium

By extracting multiple features of malware and performing visualization processing, the problem that traditional analysis methods are difficult to detect modern malware is solved, and the intuitive display and efficient analysis of malware behavior patterns are achieved.

CN120763927APending Publication Date: 2025-10-10XUANCHENG VOCATIONAL & TECH COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510923422.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

Traditional malware analysis methods rely on static or dynamic analysis, which makes it difficult to effectively detect the diversity and complexity of modern malware. Signature-based detection technologies, in particular, face challenges and are unable to effectively identify highly variant malware.

Method used

By extracting the malware's PE header, string, byte sequence, and control flow graph features, combined with dimensionality reduction and clustering algorithms, these features are mapped into a two-dimensional space and visualized using heat maps, bar charts, scatter plots, etc., to show the differences and commonalities of malware.

Benefits of technology

It enables rapid identification and analysis of malware, improves the accuracy and efficiency of analysis, and helps researchers identify similarities and differences between samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120763927A_ABST
    Figure CN120763927A_ABST
Patent Text Reader

Abstract

The invention discloses a malicious software behavior feature visualization method based on feature types. The method comprises the following steps: extracting various features of malicious software; performing feature processing on each feature of the malicious software by adopting a corresponding processing mode; and carrying out visualization on each type of processed features. The method has the advantages that researchers can be helped to quickly identify similarity and difference between samples in the malicious software analysis process by integrating visualization modes of different types of features, so that the accuracy and efficiency of malicious software analysis are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security, and in particular to a method and medium for visualizing malware behavior characteristics based on feature types. Background Art

[0002] With the rapid development of the internet, the types and volume of malware have increased exponentially. Malware not only poses serious risks to personal computers and servers but has also become a major cybersecurity threat to businesses and government agencies. The diversity, stealth, and complexity of malware pose significant challenges to traditional signature-based detection techniques. Modern malware behavior is not limited to simple forms like viruses and Trojans. Many malware employ advanced mutation techniques, making it difficult to effectively detect using simple signature matching.

[0003] Therefore, malware behavioral analysis has become a crucial research method in the current field of cybersecurity. Traditional malware analysis methods typically rely on static or dynamic analysis techniques, which often have limitations. For example, static analysis typically focuses solely on file characteristics, while dynamic analysis is limited to the malware's execution environment. Summary of the Invention

[0004] The purpose of the present invention is to overcome the shortcomings of the existing technology and provide a method for visualizing the main behavioral characteristics of malware based on different feature types. By effectively combining multiple features and displaying the differences and commonalities of malware through visualization methods, a more comprehensive, intuitive and effective malware analysis solution is provided for malware.

[0005] To achieve the above objectives, the present invention adopts a technical solution: a method for visualizing malware behavior characteristics based on feature types, comprising the following steps:

[0006] Extract multiple characteristics of malware;

[0007] Use corresponding processing methods to process each feature of malware;

[0008] Visualize the processed features.

[0009] The various malware features extracted include PE Header and string features, byte sequence features, and control flow graphs.

[0010] Extract and visualize malware PE header and string features: Extract PE header and string features from malware samples, construct a feature matrix, use dimensionality reduction techniques or clustering algorithms to map the features into a two-dimensional space, and visualize the similarities and differences between samples through color, bar width, or point distribution to help identify malware behavior patterns.

[0011] Extracting and visualizing the malware's PE Header and string features involves the following steps:

[0012] (1) Feature extraction: For each malware sample, extract its PE Header feature set and string feature set. Each feature in the PE Header and each string in the string feature set are represented as discretized features of the sample.

[0013] (2) Feature matrix construction: For all samples, construct the feature matrix X∈R n×(m+k) The first m columns of the matrix represent the features of the PE Header, and the last k columns represent the string features. Each row of the matrix represents a malware sample, and each column represents a feature.

[0014] (3) Dimensionality reduction and visualization: Use dimensionality reduction algorithms to reduce the feature matrix and obtain a representation in two-dimensional space; use heat maps and bar charts for visualization to reflect the characteristic differences between malware samples through color depth, bar width, and / or point distribution;

[0015] (4) Clustering and analysis: Classify samples through clustering algorithms to obtain behavioral feature maps of different categories of malware, thereby distinguishing and identifying the behavioral feature differences between different malware families.

[0016] Extracting and visualizing byte sequence features involves preprocessing the byte sequence of malware samples, segmenting the byte sequence into subsequences using a sliding window, and then mapping the byte sequence features into a two-dimensional space through dimensionality reduction technology after feature extraction. Scatter plots and heat map visualization methods are then used to display the intensity, frequency, and distribution of the byte sequence features.

[0017] Extracting byte sequence features and visualizing them also includes the following steps:

[0018] (1) Byte sequence preprocessing and feature extraction: For the byte sequence of malware, the byte sequence is divided into multiple subsequences using the sliding window method. The length of each subsequence is L, and feature extraction is performed on each subsequence.

[0019] (2) Feature matrix construction: The extracted byte sequence features are converted into a feature matrix, in which each row represents the feature vector of a byte subsequence;

[0020] (3) Dimensionality reduction and visualization: Use dimensionality reduction technology to map the high-order feature matrix into a two-dimensional space and visualize the feature distribution of the byte node sequence through hotspots and scatter plots.

[0021] Extracting and visualizing the control flow graph includes: extracting the control flow graph of the malware, mapping the nodes and edges of the graph into a two-dimensional space using a graph layout algorithm, and visualizing the control flow structure of the malware through color, size, and shape to help identify control flow differences between malware samples or families.

[0022] Extracting and visualizing the control flow graph includes the following steps:

[0023] (1) Control flow graph extraction and layout: For each malware program, extract its control flow graph, where nodes represent basic blocks or functions; edges represent control flow transfer relationships. Use force-directed layout or hierarchical layout algorithms to map nodes into a two-dimensional space and optimize the spatial layout between nodes.

[0024] (2) Edge visualization: Map each edge as a line between two nodes in the graph; use different colors, thicknesses, or arrows to indicate edge weights or type characteristics;

[0025] (3) Final visualization graph: Through the layout and attributes of nodes and edges, a visualization image is finally generated to show the control flow structure and differences of malware.

[0026] A computer storage medium stores a computer program, which implements the visualization method when executed by a processor.

[0027] The advantage of the present invention is that it can help researchers quickly identify similarities and differences between samples during malware analysis by integrating different types of features into a visualization method, thereby improving the accuracy and efficiency of malware analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The following is a brief description of the contents and symbols in the drawings of the present invention:

[0029] Figure 1 This is a schematic diagram of the discrete class data visualization method based on PE Header and Strings of the present invention.

[0030] Figure 2 Schematic diagram of the sequence data visualization method based on byte sequence of the present invention

[0031] Figure 3 Schematic diagram of the graph data visualization method based on the control flow graph (CFG) of the present invention. DETAILED DESCRIPTION

[0032] The specific implementation of the present invention will be further explained in detail below by describing the best embodiment with reference to the accompanying drawings.

[0033] This solution effectively combines multiple features of malware and visualizes them separately, thereby achieving the identification and analysis of malware and providing a basis for accurate malware identification. By constructing three different malware feature visualization paths: PE Header and string features (discrete class), byte sequence features (sequence class), and control flow graph CFG (graph structure class), the key features of malware are presented from three perspectives: static structure, underlying behavior, and execution logic. These visualization methods are not mutually exclusive, but complementary. Each malware sample S can be mapped to three corresponding visualization graphs:

[0034] V i =g i (S),i=1,2,3

[0035] Among them, g1 represents the discrete feature visualization mapping, g2 represents the byte sequence visualization mapping, and g3 represents the control flow graph mapping.

[0036] In two-dimensional space, visualization graphics have the following properties:

[0037] If two samples S i ,S j With similar malicious behavior, the two-dimensional mapping The distance D(z i ,z j ) is smaller.

[0038] If separable clusters are formed, this means the method can be used for sample attribution or family identification.

[0039] In this implementation, the malware behavior feature visualization method based on feature type includes the following steps:

[0040] Extract multiple characteristics of malware;

[0041] Use corresponding processing methods to process each feature of malware;

[0042] Visualize the processed features.

[0043] The various malware features extracted include PE headers and string features, byte sequence features, and control flow graphs. We design corresponding processing and visualization methods for each feature, enabling multiple visualization solutions for malware. These solutions can identify malware differences and features, enabling more effective and intuitive malware analysis.

[0044] Targeting PE Header and string features, byte sequence features, and control flow Figure 3 Three visualization schemes are designed for each feature:

[0045] 1. Visualization of discrete class data based on PE Header and Strings:

[0046] Extract PE header features and string features from malware samples, construct a feature matrix, use dimensionality reduction techniques or clustering algorithms to map the features into a two-dimensional space, and visualize the similarities and differences between samples through color, bar width, or point distribution to help identify malware behavior patterns.

[0047] The specific steps include:

[0048] (1) Feature extraction: For each malware sample S i , extract its PE Header feature set string feature set H i ={h i1 , h i2 ,…h im} and string feature set T i ={t i1 , t i2 ,…t ik}, each feature h in the PE Header im and string feature t ik Each string in is represented as a discretized feature of the sample;

[0049] Feature extraction tools are used to extract features such as PE headers and strings, and optimizations are made in feature quantization encoding:

[0050] For sample S i The feature set:

[0051] H i ={h i1 ,...,h im},T i ={t i1 ,...,t ik}

[0052] At the same time, the feature importance weighted encoding function φ is introduced to perform frequency weighting, TF-IDF encoding or context aggregation on features:

[0053] φ(h ij )=Count(h ij )w j ,φ(t ij )=TF-IDF(t ij )

[0054] Count(h ij ) is a frequency function, indicating the feature h ij In sample S i The number of occurrences in . is the set of all PE Header fields in the sample, then

[0055]

[0056] Where 1(·) is an indicator function, which takes the value 1 when the condition in the brackets is met, and 0 otherwise.

[0057] w j is the global feature importance weight, which represents the weight of the jth PE Header feature in distinguishing malicious samples in the entire sample set. This value can be determined by statistics in the training sample, such as information gain, mutual information, or standard deviation:

[0058]

[0059] in represents the mean of the jth feature in all samples.

[0060] For string feature t ij , its encoding method uses the TF-IDF (TermFrequency-Inverse Document Frequency) method commonly used in natural language processing, and is defined as follows:

[0061] φ(tij)=TF(t ij )·IDF(t ij )

[0062] TF(t ij ) represents the string t ij In sample S i The frequency of occurrence in is defined as:

[0063]

[0064] where fij For string t ij In sample S i The denominator is the total number of occurrences of all strings in the sample.

[0065] IDF(t ij ) represents the inverse document frequency of the string in all samples, which is used to reduce the interference of the string that is prevalent in most samples on the model. It is defined as:

[0066]

[0067] where |{i|t ij ∈T i}| indicates how many samples contain the string feature. The denominator is added by 1 to avoid the denominator being zero.

[0068] Through the above two encoding functions φ(h ij ) and φ(t ij ), the structure field features and string features can be uniformly converted into real number form and form a unified feature vector

[0069]

[0070] This feature vector can be subsequently input into dimensionality reduction, clustering or classification models to achieve visual expression and intelligent identification of malware behavior. In particular, by introducing the weight term w j Together with the sparsity control term IDF, the present invention can automatically suppress the interference of non-discriminative redundant features, significantly improving the sensitivity to key behavioral features and the generalization ability of the model.

[0071] Thus constructing a unified vector form:

[0072] X i =[φ(hi1),...,φ(him),φ(ti1),...,φ(tik)] T

[0073] This structure is more comparable and measurable, and is conducive to unified visual modeling.

[0074] (2) Feature matrix construction: For all samples, construct the feature matrix X∈Rn ×( m+k ) ; The first m columns of the matrix represent the features of the PE Header, and the last k columns represent the string features. Each row of the matrix represents a malware sample, and each column represents a feature. n is the number of malware samples; m is the dimension of the PE Header feature, and k is the dimension of the string feature.

[0075] (3) Dimensionality reduction and visualization: Use dimensionality reduction algorithms to reduce the dimension of the feature matrix and obtain a representation in two-dimensional space. Use dimensionality reduction algorithms such as principal component analysis (PCA) and t-SNE to perform dimensionality reduction processing; use heat maps and bar charts for visualization, and reflect the characteristic differences between malware samples through color depth, bar width, and / or point distribution;

[0076] The present invention modifies PCA and t-SNE by adding a local density guidance mechanism, so that the clustering results are clearer and more separable in two-dimensional space.

[0077] The density function is defined as follows:

[0078]

[0079] ρ i : represents sample x i The local density in the feature space, the larger the value, the higher the density of samples around the sample;

[0080] ·∑ j≠i : represents the sum of all sample index j that is not equal to i, ensuring that the sample itself is not considered;

[0081] ●‖x i -x j ‖ 2 : is the square of the Euclidean distance, indicating sample x i with x j distance in feature space;

[0082] σ: The bandwidth parameter of the kernel function, which controls the sensitivity of distance to density. The smaller the value, the more emphasis is placed on local neighbors.

[0083] ·exp(·): is an exponential function used to map distance to similarity or "neighborhood strength".

[0084] The calculated density value ρ i It is further introduced into t-SNE as a similarity distribution weight to construct a density-aware probability distribution:

[0085]

[0086] ●P ij : represents sample x i with x j Weighted similarity probability in high-dimensional space;

[0087] ●Molecular part ρ i ·exp(-‖x i -x j ‖ 2 / 2σ 2) represents the similarity value weighted by the density of sample x i ;

[0088] ● The denominator is the weighted similarity sum of all sample pairs (x k , x l ), which is normalized so that ∑ i≠j P ij = 1;

[0089] ● ‖x k -x l ‖ 2 : represents the squared Euclidean distance between any sample pair;

[0090] ● ρ k : represents the local density of sample x k , which is used to give different importance to each sample pair. By this method, dense samples are more concentrated, improving the robustness of malicious sample clustering identification.

[0091] In the visualization of heat maps or bar charts, the visualization is constructed using a heat map, which includes:

[0092] The heat map is formalized as a color-coded graph of the feature matrix, constructed as follows:

[0093]

[0094] Where color_scale is a linear or piecewise normalization mapping function that maps feature values to color depth.

[0095] X ij represents the encoding result of the i-th malware sample in the j-th feature dimension, which is derived from the feature matrix

[0096] · n represents the number of samples (i.e., the number of malware);

[0097] ● d represents the total feature dimension, which usually includes multiple sources (such as PE Header, Strings, byte statistics, control flow graph structure features, etc.);

[0098] · X ij is the numerical representation of the j-th feature of sample S i , which can be frequency count, TF-IDF weight, information entropy, or clustered label, etc.

[0099] The function color(X ij ) maps the real value X ij to a normalized value in the interval [0, 1] and corresponds to a color value in the color space. For example:

[0100]

[0101] The results of the above mapping can be further rendered on the heat map using color coding (such as grayscale value, red and blue gradient, HSV color space, etc.). Indicates the color depth of the pixel corresponding to the i-th row and j-th column of the image, which intuitively reflects the performance difference of the sample in the corresponding feature dimension.

[0102] Heat maps enable bidirectional comparative analysis of sample (row) and feature (column) dimensions, allowing intuitive observation of the response patterns of different samples to key features. They are particularly suitable for visual feature analysis of static malware.

[0103] (4) Clustering and Analysis: Using a clustering algorithm (K-means), samples are classified to obtain behavioral feature maps of different malware categories, thereby helping researchers distinguish and identify behavioral feature differences between different malware families. The K-means algorithm used in this paper is an improved version that introduces feature weighting, and the objective function is updated to:

[0104]

[0105] J: represents the total objective loss function of the K-means clustering algorithm. The smaller its value, the better the clustering effect.

[0106] n: represents the total number of samples, i.e., there are m malware samples in total;

[0107] K: represents the number of cluster centers, which is equivalent to the number of cluster categories;

[0108] d: represents the number of feature dimensions of each sample (i.e. each sample is a d-dimensional vector);

[0109] i: represents the sample index, i=1,2,...,n;

[0110] j: represents the cluster center index, j = 1, 2, ..., K;

[0111] l: represents the feature dimension index, l = 1, 2, ..., d;

[0112] x il : represents the eigenvalue of the i-th sample in the l-th dimension;

[0113] μ jl : represents the center coordinate value of the j-th cluster center in the l-th dimension;

[0114] w l: is the feature importance weight of the lth dimension, used to emphasize the discriminative ability of certain feature dimension in clustering; the weight can be obtained by information gain, variance selection, etc., and its typical normalized form is:

[0115]

[0116] where Var(x ·l ) represents the variance of all samples on the lth feature, x .l′ represents the value vector of the lth feature dimension (i.e., the lth column) in all n samples, which is essentially the lth column of the feature matrix X, i.e., the value set of all samples on the lth feature dimension.

[0117] represents assigning the sample x i to the nearest cluster center μ j , and calculating its weighted Euclidean distance.

[0118] The optimization process of the objective function is to find a set of cluster centers μ1, μ2,…, μ K , so that the weighted distance squared sum of all samples to the nearest center is minimized. Unlike the traditional K-means method, the present application improves the sensitivity of the clustering algorithm to high importance features in the malware recognition task by introducing feature weights w l , avoiding the interference of redundant or weak features on the clustering results. This method avoids the problem of K-means sensitivity to initial points, improving the classification accuracy and stability.

[0119] In the present scheme:

[0120] ● Discrete class features satisfy the K-means vector space assumption and can be clustered.

[0121] · Sequence class features are in the form of matrix or tensor with high dimension and strong structure, which is not suitable for K-means.

[0122] ● The CFG represented by the graph structure is G=(V,E), which belongs to the graph space and needs to use graph matching or graph embedding algorithms.

[0123] Therefore, only the visualization results of PE Header+Strings class features are suitable for K-means classification clustering.

[0124] 2. Sequence class data visualization based on byte sequence:

[0125] The malware sample's byte sequence is preprocessed by using a sliding window to segment the byte sequence into subsequences. After feature extraction, the byte sequence features are mapped to a two-dimensional space using dimensionality reduction techniques. The intensity, frequency, and distribution of the byte sequence features are then visualized using scatter plots and heat maps. The specific steps are as follows:

[0126] (1) Byte sequence preprocessing and feature extraction: For the malware byte sequence S = {s1, s2, ..., s k}, the byte sequence is divided into multiple subsequences {S1, S2, ..., S k}, each subsequence S i The length of L is used to extract features from each sub-byte sequence, including frequency statistics, one-hot encoding, etc.

[0127] This invention combines byte pattern recognition with entropy weighting to extract more semantic features based on byte sequences. By introducing entropy as a feature of byte sequences, the diversity and randomness of byte sequences are taken into account, thereby enhancing the fine-grained recognition capability of malware samples:

[0128] ①Byte sequence segmentation: Assume that the malware byte sequence is S={s1,s2,…,s n}, we first split it into multiple subsequences S by the sliding window method i ={s i1 ,s i2 ,…,s il}, each subsequence has a length of l.

[0129] ② Feature extraction: For each subsequence S i , we use frequency statistics and entropy weighted feature extraction, where f j is the frequency of byte j in the subsequence, and the entropy value e i It represents the diversity of subsequences and is calculated as follows:

[0130]

[0131] in:

[0132] S: represents a byte sequence, which is an ordered sequence of symbols of length l extracted from the malware sample;

[0133] s j : Indicates the jth byte symbol in the sequence S, usually an integer value s j ∈0,1,...,255, here we use lowercase letter s j , representing a single byte value.

[0134] We count each byte value s j The relative frequency of occurrence in the entire sequence is denoted as f j , defined as follows:

[0135]

[0136] in:

[0137] count(s j ):Indicates the function count on the byte value s j Count the number of occurrences in sequence S, that is:

[0138]

[0139] Where 1(·) is an indicator function, which takes the value 1 if the condition is met and 0 otherwise;

[0140] l: indicates the total length of the byte sequence S;

[0141] f j : That is, the normalized frequency (component of the frequency vector) of the jth byte value (ranging from 0 to 255) in the sequence;

[0142] The range of byte values ​​j is usually j=0, 1, ..., d-1, where d=256, ie the total number of all possible byte values.

[0143] When getting the frequency f of each byte j After that, we further calculate the Shannon Entropy of the sequence as the overall information complexity measure. It is defined as follows:

[0144]

[0145] in:

[0146] e i : represents the byte sequence entropy value of the i-th malware sample, which is a scalar feature;

[0147] d: represents the number of possible byte values, usually d = 256;

[0148] log(·): represents the natural logarithm or the logarithm with base 2 (the base must be indicated in the instructions for actual calculations);

[0149] If some f j = 0, the corresponding item is considered to be 0 in the implementation (because ).

[0150] The entropy value e iDescribes the degree of discreteness of byte distribution. A higher value indicates a more complex byte sequence and a greater entropy, usually reflecting a malicious sample with a high degree of compression or obfuscation. A lower entropy value indicates a simpler sequence structure with more repetitions, making it easier to identify.

[0151] Finally, the feature vector of each subsequence is:

[0152] ψ(S i )=[f1,f2,...,f d ,e i ]

[0153] where f1, f2, ..., f d is the frequency vector, e i is the entropy value, which as a whole constitutes the complete feature representation of each subsequence.

[0154] (2) Feature matrix construction: Convert the extracted byte sequence features into a feature matrix X∈R K×1 ,In the feature matrix, each row represents the feature vector of a byte subsequence;

[0155] (3) Dimensionality reduction and visualization: Use dimensionality reduction techniques (PCA, t-SNE) to map the high-order feature matrix into a two-dimensional space and visualize the feature distribution of the byte node sequence through hotspots and scatter plots.

[0156] The present invention introduces a local weighted dimensionality reduction algorithm, combines the local density between features, and adjusts the adjacency relationship of samples to better preserve the semantic relationship between malware samples.

[0157] ① Local density weighting: First, we perform byte sequence feature matrix Perform local density weighting and define the local density as:

[0158]

[0159] Among them, ρ i Represents sample S i The local density, x i is the characteristic vector of the sample, σ is the smoothing parameter;

[0160] ② Weighted similarity calculation: Next, calculate the weighted similarity matrix W:

[0161]

[0162] ③ Dimensionality reduction mapping: Use algorithms such as t-SNE or UMAP (Uniform Manifold Approximation and Projection) and adopt a weighted similarity matrix to optimize the dimensionality reduction process, so as to better preserve the local structure and the relationship between samples.

[0163] The present invention uses dynamic heat map construction and adaptive heat map mapping, combined with dimensionality-reduced two-dimensional data, to better demonstrate the dynamic behavior and frequency patterns of byte sequences.

[0164] ① Heat map construction: Assume that our two-dimensional representation after dimensionality reduction is Each sample corresponds to a z i =(z i1 ,z i2 ) point, we define the color value of the heat map as:

[0165]

[0166] where φ norm is a normalization function that maps feature values ​​to color depth. Different samples will form different color distributions in the heat map, making it easier to observe the behavior patterns of malware.

[0167] ② Adaptive heat map: Through adaptive color mapping, the frequency of features is associated with the entropy value:

[0168]

[0169] This makes frequently occurring byte patterns more prominent in the graph, helping to reveal clusters of malware signatures.

[0170] 3. Graph data visualization based on control flow graph CFG

[0171] By extracting the malware's control flow graph and mapping the graph's nodes and edges into a two-dimensional space using a graph layout algorithm, the malware's control flow structure is visualized through color, size, and shape to help identify control flow differences between malware samples or families. Specifically, the method includes the following steps: The innovative feature extraction method of this invention improves on traditional methods by employing an improved version of graph-based local topology analysis and graph embedding, capable of capturing more fine-grained malware control flow features. The specific method is as follows:

[0172] ①Subgraph matching and pattern recognition

[0173] For the malware control flow graph G = (V, E), each node v i and edge (v i ,v j ) contain specific execution logic information. To extract higher-level behavioral features, we introduced local subgraph matching technology, matching repeated subgraphs within malware against pre-defined patterns. Each malware's control flow graph exhibits certain common substructures (such as specific loop structures and conditional branches). Using subgraph isomorphism matching algorithms, we were able to extract typical control flow patterns for each malware.

[0174] Mathematically expressed as:

[0175] in is a characteristic subgraph of malware i, and a subgraph isomorphism algorithm is used to extract common structures related to known malware families.

[0176] ②Adaptive graph feature extraction:

[0177] To avoid traditional methods that rely solely on node or edge degrees, we introduced an adaptive graph convolutional network (GCN) to extract features from malware control flow graphs. Unlike traditional GCNs, our graph convolution incorporates adaptive weights based on the control flow graph's structure. These weights are dynamically adjusted based on edge direction, data flow, node function (basic block or function), and control flow complexity.

[0178] The graph convolution update formula is:

[0179]

[0180] in Represents the feature vector of the i-th node (i.e. basic block) in the control flow graph after the k-th layer of graph convolution, with a dimension of d;

[0181] ●k: represents the layer index of the graph convolutional network, starting from 1, Usually the initial input feature of the node;

[0182] N(i): represents the set of adjacent nodes in the graph that are directly connected to node i, i.e., the set of neighboring nodes of the i-th node. It is the local neighborhood that controls the dependencies in the graph structure.

[0183] j∈N(i): indicates that during the feature propagation process, all adjacent nodes j of the i-th node will be traversed;

[0184] · Represents the feature vector of adjacent node j after graph convolution in the previous layer (k-1 layer); represents the edge weight from node j to node i, which is used to measure the influence of node j on the feature propagation of node i;

[0185] ●In the present invention, w ij It can be adaptively set based on calculation methods such as static frequency of control flow edges, execution jump probability, basic block call frequency, etc.

[0186] ● It represents the residual feature or bias term of the i-th node, which is usually the original input feature of the node (such as the number of basic block instructions, branch type, jump target, etc.), and is used to prevent the local feature information from being completely covered during feature propagation.

[0187] This formula indicates that in the k-th layer of graph convolution, the new feature vector hi of each node i (k) is the weight w of all its neighbor node features (previous layer) ij The weighted linear superposition result, plus the node's own eigenvector f i This is a typical “message passing mechanism” that can integrate the contextual semantics in the control flow graph structure through feature propagation between neighbors.

[0188] where w ij is the weight adjusted based on the control flow complexity, f i is node v i The initial characteristics of the code (such as code length, branch complexity, etc.).

[0189] (1) Control flow graph extraction and layout: For each malware program, extract its control flow graph (G = (V, E)), where V represents a node set, including all basic blocks or function units in the control flow graph. E represents an edge set, representing the control flow transfer relationship in the control flow graph, and the direction of the edge represents the order of program execution. i Represents a basic block or function; edge ((v i , v j )) represents the control flow transfer relationship, maps the nodes to the two-dimensional space and optimizes the spatial layout between nodes through force-directed layout or hierarchical layout algorithm;

[0190] The present invention improves existing graph embedding and dimensionality reduction methods, especially by introducing structural adaptive weights of control flow graphs in the graph embedding and dimensionality reduction process, thereby being able to more accurately reflect the behavioral patterns in malware control flows.

[0191] ① Adaptive graph embedding: Traditional graph embedding methods (such as node2vec) usually embed based on simple adjacency relationships of nodes. The innovation proposed in this paper is to dynamically adjust the weights in the embedding process. Specifically, by using the edge weights W in the graph convolutional network (GCN), ij With adaptive feature extraction, we provide each node with more refined structural information when embedding, thereby generating more accurate node embeddings.

[0192] Adaptive Dimensionality Reduction Algorithm: Building on traditional dimensionality reduction methods (such as PCA or t-SNE), this paper incorporates adaptive dimensionality reduction based on control flow structures. By dynamically adjusting the adjacency matrix during the dimensionality reduction process and combining edge weights with control flow complexity information, it can more accurately embed high-dimensional control flow graphs into a two-dimensional space, thereby helping to better demonstrate malware behavior patterns.

[0193] The dimensionality reduction process can be expressed as:

[0194] Z = t-SNE(GCN(G,H))

[0195] in: Represents the sample embedding matrix after dimensionality reduction, each row is the coordinate of the i-th malware sample in two-dimensional space, which is used for the final visualization;

[0196] t-SNE(·): represents a nonlinear dimensionality reduction function, namely t-distributed Stochastic Neighbor Embedding, which is specifically designed to map high-dimensional features to a low-dimensional space (such as two-dimensional) while preserving their local structure.

[0197] GCN(·): represents a graph convolutional network operation, which is used to learn high-dimensional embedding vectors from the input graph structure and its node features;

[0198] G = (V, E): represents the control flow graph (CFG) of the malware sample,

[0199] in:

[0200] ●V: is a set of nodes, representing basic blocks or functions in the program;

[0201] ●E: is a set of edges, representing the transfer paths between control flows;

[0202] ● is the original feature matrix of all nodes in the control flow graph. The rows represent nodes and the columns are the feature dimensions of each node. Common features include the number of instructions, jump type, logic complexity, etc.

[0203] ● represents the embedding matrix extracted from the control flow graph G and node features H by the graph convolutional network, with dimension d′, where n is the number of malware samples (i.e., the control flow graph of each sample is compressed into an embedding vector);

[0204] ●The entire expression means: first input the control flow graph into the graph convolutional network to extract structured behavioral features, and then project the extracted high-dimensional embedding into two-dimensional space through the t-SNE algorithm for subsequent visualization of heat maps, scatter plots, or cluster maps.

[0205] Among them, H is the feature vector of the node, which is obtained after updating through the adaptive graph convolutional network (GCN) and finally reduced in dimension through t-SNE to obtain a two-dimensional representation

[0206] (2) Edge visualization: visualize each edge ((v i , v j )) is mapped as a line between two nodes in the graph; different colors, thicknesses, or arrows are used to indicate edge weights or type characteristics;

[0207] (3) Final visualization graph: Through the layout and attributes of nodes and edges, a visualization image is finally generated to show the control flow structure and differences of malware.

[0208] The present invention can help researchers quickly identify similarities and differences between samples during malware analysis by integrating the visualization of different types of features, thereby improving the accuracy and efficiency of malware analysis.

[0209] This embodiment further provides a computer storage medium, in which a computer program is stored. When the computer program is executed by a processor, the visualization method in the above embodiment is implemented, thereby achieving visual analysis of malware.

[0210] This solution comprehensively visualizes malware behavioral characteristics through multi-dimensional analysis and visualization, helping researchers identify and understand malware behavior patterns, thereby improving detection and protection efficiency. By extracting multiple features from malware samples, including PE headers, byte sequences, and control flow graphs, and leveraging dimensionality reduction and clustering techniques, we present these features in a unified visualization. This makes complex data information intuitive and simplifies the analysis process for researchers.

[0211] The adoption of this solution has the following technical effects:

[0212] 1. The multi-type feature extraction module achieves comprehensive feature coverage of malware and prepares basic data for subsequent dimensionality reduction and visualization.

[0213] 2. The dimensionality reduction module reduces high-dimensional feature matrices to two or three dimensions through methods such as PCA and t-SNE, making them easier to process and visualize, making features intuitive and simplifying data analysis.

[0214] 3. The clustering module applies methods such as K-means to classify samples, discover different types of malware patterns and represent them.

[0215] 4. The visualization module presents clustering results intuitively, helping to quickly identify different types of malware and their behavior patterns, thereby improving analysis accuracy and efficiency.

[0216] This solution provides a method for visualizing the main behavioral characteristics of malware based on different feature types. It extracts PE header features, string features, byte sequence features, and control flow graph features from malware samples, and uses dimensionality reduction or clustering techniques to map these high-dimensional features into a two-dimensional space. These features are then visualized through heat maps, bar charts, scatter plots, colors, bar widths, point distributions, node and edge distributions, etc., helping researchers intuitively identify the differences and commonalities between different malware samples. The specific workflow includes: first, extracting the PE Header features and string features of each malware sample, constructing a feature matrix containing these features, then reducing the dimension of the feature matrix and mapping it to a two-dimensional space through dimensionality reduction algorithms such as PCA and t-SNE, and using heat maps and bar charts to display the feature differences between samples; then, performing sliding window segmentation on the malware's byte sequence and extracting features to form a feature matrix, and then mapping the byte sequence features to a two-dimensional space through dimensionality reduction technology, using scatter plots, heat maps and other methods to display the intensity, frequency and distribution of the byte sequence features, thereby helping to identify the commonalities and differences between samples; finally, extracting the malware's control flow graph and using force-directed layout or hierarchical layout algorithms to map its nodes and edges to a two-dimensional space, visually displaying the control flow structure and differences through color, size, shape and other methods, and finally generating detailed visualization graphics, providing a more comprehensive, intuitive and effective malware analysis tool, significantly improving the accuracy and efficiency of malware analysis.

[0217] Obviously, the specific implementation of the present invention is not limited to the above-mentioned methods. As long as various non-substantial improvements are made using the method concept and technical solution of the present invention, they are all within the scope of protection of the present invention.

Claims

1. A malware behavior feature visualization method based on feature type, characterized by: The steps include: Extract multiple characteristics of malware; Use corresponding processing methods to process each feature of malware; Visualize each feature after processing.

2. The method for visualizing malware behavior characteristics based on feature type according to claim 1, characterized in that: The various malware features extracted include PE Header and string features, byte sequence features, and control flow graphs.

3. The method for visualizing malware behavior characteristics based on feature type according to claim 2, wherein: Extract and visualize malware PE header and string features: Extract PE header and string features from malware samples, construct a feature matrix, use dimensionality reduction techniques or clustering algorithms to map the features into a two-dimensional space, and visualize the similarities and differences between samples through color, bar width, or point distribution to help identify malware behavior patterns.

4. The method for visualizing malware behavior characteristics based on feature type according to claim 3, wherein: Extracting and visualizing the malware's PE Header and string features involves the following steps: (1) Feature extraction: For each malware sample, extract its PE Header feature set and string feature set. Each feature in the PE Header and each string in the string feature set are represented as discretized features of the sample. (2) Feature matrix construction: For all samples, construct the feature matrix X∈R n×(m+k) ; The first m columns of the matrix represent the features of PEHeader, and the last k columns represent the string features. Each row of the matrix represents a malware sample, and each column represents a feature. (3) Dimensionality reduction and visualization: Use dimensionality reduction algorithms to reduce the feature matrix and obtain a representation in two-dimensional space; use heat maps and bar charts for visualization to reflect the characteristic differences between malware samples through color depth, bar width, and / or point distribution; (4) Clustering and analysis: Classify samples through clustering algorithms to obtain behavioral feature maps of different categories of malware, thereby distinguishing and identifying the behavioral feature differences between different malware families.

5. The method for visualizing malware behavior characteristics based on feature type according to claim 1, wherein: Extracting and visualizing byte sequence features involves preprocessing the byte sequence of malware samples, segmenting the byte sequence into subsequences using a sliding window, and then mapping the byte sequence features into a two-dimensional space through dimensionality reduction technology after feature extraction. Scatter plots and heat map visualization methods are then used to display the intensity, frequency, and distribution of the byte sequence features.

6. The method for visualizing malware behavior characteristics based on feature type according to claim 5, characterized in that: Extracting byte sequence features and visualizing them also includes the following steps: (1) Byte sequence preprocessing and feature extraction: For the byte sequence of malware, the byte sequence is divided into multiple subsequences using the sliding window method. The length of each subsequence is L, and feature extraction is performed on each subsequence. (2) Feature matrix construction: The extracted byte sequence features are converted into a feature matrix, in which each row represents the feature vector of a byte subsequence; (3) Dimensionality reduction and visualization: Use dimensionality reduction technology to map the high-order feature matrix into a two-dimensional space and visualize the feature distribution of the byte node sequence through hotspots and scatter plots.

7. The method for visualizing malware behavior characteristics based on feature type according to claim 1, wherein: Extracting and visualizing the control flow graph includes: extracting the control flow graph of the malware, mapping the nodes and edges of the graph into a two-dimensional space using a graph layout algorithm, and visualizing the control flow structure of the malware through color, size, and shape to help identify control flow differences between malware samples or families.

8. The method for visualizing malware behavior characteristics based on feature type according to claim 7, wherein: Extracting and visualizing the control flow graph includes the following steps: (1) Control flow graph extraction and layout: For each malware program, extract its control flow graph, where nodes represent basic blocks or functions; edges represent control flow transfer relationships. Use force-directed layout or hierarchical layout algorithms to map nodes into a two-dimensional space and optimize the spatial layout between nodes. (2) Edge visualization: Map each edge as a line between two nodes in the graph; use different colors, thicknesses, or arrows to indicate edge weights or type characteristics; (3) Final visualization graph: Through the layout and attributes of nodes and edges, a visualization image is finally generated to show the control flow structure and differences of malware.

9. A computer storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the visualization method according to any one of claims 1 to 8.