Research Article

An Automatic Planning-Based Attack Path Discovery Approach from IT to OT Networks

Algorithm 3

Attack graph generation in a multithreading manner.
Input: number of threads thread_num
Output: attack graph AG; adding exploit and attack edges in a graph database
(1)create an empty attack graph AG
(2)get domain.pddl and problem.pddl via GENERATE PDDL FILE (domain_temp, problem_temp, hg)
(3)get all subgraphs from GENERATE SUBGRAPHS (G, subg_size)
(4)create threads pool threads_pool and set maxim workers corresponding to thread_num
(5)foreach subgraph in subgraphs do
(6) modify problem.pddl and domain.pddl based on subgraph
(7) create a thread and bind it to enumerate attack paths using a planner
(8) submit this thread to threads_pool
(9)while True do
(10) check the status of threads in threads_pool
(11)if all tasks in threads_pool have done do
(12)  break
(13)generate subag from paths returned from each thread and merge them into AG
(14)get ag_edges from AG
(15)create attack and exploit edges in a graph database according to ag_edges