# Research on Power Cyber-Physical Cross-Domain Attack Paths Based on Graph Knowledge
## 3 Method for Constructing Attack Graph of Electric Power Cyber-Physical Fusion System
### Attack Graph Building Process  
The construction process of the hierarchical attack graph of the power information-physical fusion system is shown in Figure 3:  
Step 1: Create attack graph G. The attack targets are abstracted into root nodes, power secondary equipment node failures and transient stable node disturbances are abstracted into intermediate nodes, and various cyber-physical cross-domain attacks are abstracted into leaf nodes. Then, add all root nodes, intermediate nodes, and leaf nodes to the set V, create all feasible directed edges between each vertex and add them to the set A, and complete the construction of the attack graph G.  
Step 2: Attack graph layering. Using the method in [20], add all leaf nodes with in-degree 0 to the first-level set L\({}_{1}\), L\({}_{1}\) = X. Traverse all the vertices with directed edges in the set L\({}_{1}\), and form the second level set L\({}_{2}\) with them. By analogy, the traversal stops at the last layer set L\({}_{n}\), L\({}_{n}\) = Y, n is the depth of G, and it is specified that the intersection between different layer sets is an empty set. Step 3: Calculate the vulnerability factor \(c_{i}\) of each vertex. The vulnerability factor \(c_{i}\) of vertex \(v_{i}\) in the l-th layer of the attack graph is jointly determined by the vertex out-degree, in-degree, and node betweenness. As shown in Formula (2), \(1\in[1,n]\). \[c_{i}=(I_{i}^{+}+I_{i}^{-})\cdot\alpha_{i}\cdot\beta_{i}+b_{i} \tag{2}\]  
Figure 3: Hierarchical attack graph construction process of power cyber-physical fusion system. The meaning and calculation method of each variable in Formula (2) are explained as follows:  
1. \(\mathrm{b_{i}}\) is the betweenness of node \(\mathrm{i}\), which represents the ratio of the number of shortest paths passing through node \(\mathrm{i}\) to the total number of shortest paths in the shortest path from leaf node \(\mathrm{j}\) to attack target root node \(\mathrm{k}\) of various attacks. The betweenness of a node is defined in Formula (3): \[\mathrm{b_{i}}=\sum_{j\
eq k}\frac{\delta_{\mathrm{jk}}(i)}{\delta_{jk}}\] (3)  
\(\delta_{\mathrm{jk}}\) is the number of shortest paths from node \(\mathrm{j}\) to node \(\mathrm{k}\), and \(\delta_{\mathrm{jk}}(i)\) is the number of shortest paths from node \(\mathrm{j}\) to node \(\mathrm{k}\) passing through node \(\mathrm{i}\). 2. \(\mathrm{I_{i}^{+}}\) and \(\mathrm{I_{i}^{-}}\) respectively represent the degree probability distribution of each vertex in the upper layer \(\mathrm{L_{l+1}}\) and lower layer \(\mathrm{L_{l-1}}\) of the set \(\mathrm{L}\) layer corresponding to the vertex \(\mathrm{v_{i}}\), as shown in Formula (4). In Formula (4), \(\mathrm{T(L_{l+1})}\) and \(\mathrm{T(L_{l-1})}\) represent the number of vertices contained in the \(\mathrm{L_{l+1}}\) and \(\mathrm{L_{l-1}}\) layers respectively. Here, the source set \(\mathrm{X}\) is composed of all leaf nodes with in-degree 0, and the collection set \(\mathrm{Y}\) is composed of all root nodes with out-degree 0. Therefore, \(\mathrm{I_{i}^{-}}\) of the vertices in the source set \(\mathrm{X}\) and \(\mathrm{I_{i}^{+}}\) of the vertices in the sink set \(\mathrm{Y}\) are 0. \[\mathrm{I_{i}^{+}}=\frac{d_{\mathrm{G}}^{+}(v_{i})}{T(L_{l+1})},\;\mathrm{I_{i }^{-}}=\frac{d_{\mathrm{G}}^{-}(v_{i})}{T(L_{l-1})}\] (4)
3. \(\alpha_{\mathrm{i}}\) indicates whether vertex \(\mathrm{v_{i}}\) will trigger each vertex in vertex set \(\mathrm{L_{l+1}}\) under different external conditions, as shown in Formula (5): \[\alpha_{\mathrm{i}}=\sum_{k=1}^{s}P_{\mathrm{k}}\cdot R_{\mathrm{k}},\sum_{k=1 }^{s}p_{k}=1,\;\mathrm{k}\;\in\;[1,\;s]\] (5) where \(\mathrm{s}\) is the total number of external condition categories, \(P_{\mathrm{k}}\) represents the occurrence probability of the kth external condition, and \(R_{\mathrm{k}}\) represents whether the attack path through vertex \(\mathrm{v_{i}}\) can affect the vertices in the next layer set \(\mathrm{L_{l+1}}\) when the kth external condition occurs.