|
|
|
|
@@ -51,7 +51,7 @@
|
|
|
|
|
" - ref: CustomC2Agent\n",
|
|
|
|
|
" team: RED\n",
|
|
|
|
|
" type: ProxyAgent\n",
|
|
|
|
|
" observation_space: null\n",
|
|
|
|
|
"\n",
|
|
|
|
|
" action_space:\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" nodes:\n",
|
|
|
|
|
@@ -73,15 +73,15 @@
|
|
|
|
|
" - 0.0.0.1\n",
|
|
|
|
|
" action_map:\n",
|
|
|
|
|
" 0:\n",
|
|
|
|
|
" action: DONOTHING\n",
|
|
|
|
|
" action: do_nothing\n",
|
|
|
|
|
" options: {}\n",
|
|
|
|
|
" 1:\n",
|
|
|
|
|
" action: NODE_APPLICATION_INSTALL\n",
|
|
|
|
|
" action: node_application_install\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 0\n",
|
|
|
|
|
" application_name: C2Beacon\n",
|
|
|
|
|
" 2:\n",
|
|
|
|
|
" action: CONFIGURE_C2_BEACON\n",
|
|
|
|
|
" action: configure_c2_beacon\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 0\n",
|
|
|
|
|
" config:\n",
|
|
|
|
|
@@ -90,7 +90,7 @@
|
|
|
|
|
" masquerade_protocol:\n",
|
|
|
|
|
" masquerade_port:\n",
|
|
|
|
|
" 3:\n",
|
|
|
|
|
" action: NODE_APPLICATION_EXECUTE\n",
|
|
|
|
|
" action: node_application_execute\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 0\n",
|
|
|
|
|
" application_id: 0\n",
|
|
|
|
|
@@ -109,14 +109,14 @@
|
|
|
|
|
" - install\n",
|
|
|
|
|
" - RansomwareScript\n",
|
|
|
|
|
" 5:\n",
|
|
|
|
|
" action: C2_SERVER_RANSOMWARE_CONFIGURE\n",
|
|
|
|
|
" action: c2_server_ransomware_configure\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 1\n",
|
|
|
|
|
" config:\n",
|
|
|
|
|
" server_ip_address: 192.168.1.14\n",
|
|
|
|
|
" payload: ENCRYPT\n",
|
|
|
|
|
" 6:\n",
|
|
|
|
|
" action: C2_SERVER_DATA_EXFILTRATE\n",
|
|
|
|
|
" action: c2_server_data_exfiltrate\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 1\n",
|
|
|
|
|
" target_file_name: \"database.db\"\n",
|
|
|
|
|
@@ -128,11 +128,11 @@
|
|
|
|
|
" password: admin\n",
|
|
|
|
|
"\n",
|
|
|
|
|
" 7:\n",
|
|
|
|
|
" action: C2_SERVER_RANSOMWARE_LAUNCH\n",
|
|
|
|
|
" action: c2_server_ransomware_launch\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 1\n",
|
|
|
|
|
" 8:\n",
|
|
|
|
|
" action: CONFIGURE_C2_BEACON\n",
|
|
|
|
|
" action: configure_c2_beacon\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 0\n",
|
|
|
|
|
" config:\n",
|
|
|
|
|
@@ -141,7 +141,7 @@
|
|
|
|
|
" masquerade_protocol: TCP\n",
|
|
|
|
|
" masquerade_port: DNS\n",
|
|
|
|
|
" 9:\n",
|
|
|
|
|
" action: CONFIGURE_C2_BEACON\n",
|
|
|
|
|
" action: configure_c2_beacon\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 0\n",
|
|
|
|
|
" config:\n",
|
|
|
|
|
@@ -213,7 +213,7 @@
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### **Command and Control** | C2 Beacon Actions | NODE_APPLICATION_INSTALL\n",
|
|
|
|
|
"### **Command and Control** | C2 Beacon Actions | node_application_install\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"The custom proxy red agent defined at the start of this notebook has been configured to install the C2 Beacon as action ``1`` in it's action map. \n",
|
|
|
|
|
"\n",
|
|
|
|
|
@@ -230,7 +230,7 @@
|
|
|
|
|
" ...\n",
|
|
|
|
|
" action_map:\n",
|
|
|
|
|
" 1:\n",
|
|
|
|
|
" action: NODE_APPLICATION_INSTALL \n",
|
|
|
|
|
" action: node_application_install \n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 0 # Index 0 at the node list.\n",
|
|
|
|
|
" application_name: C2Beacon\n",
|
|
|
|
|
@@ -252,7 +252,7 @@
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### **Command and Control** | C2 Beacon Actions | CONFIGURE_C2_BEACON \n",
|
|
|
|
|
"### **Command and Control** | C2 Beacon Actions | configure_c2_beacon \n",
|
|
|
|
|
"\n",
|
|
|
|
|
"The custom proxy red agent defined at the start of this notebook can configure the C2 Beacon via action ``2`` in it's action map. \n",
|
|
|
|
|
"\n",
|
|
|
|
|
@@ -268,7 +268,7 @@
|
|
|
|
|
" action_map:\n",
|
|
|
|
|
" ...\n",
|
|
|
|
|
" 2:\n",
|
|
|
|
|
" action: CONFIGURE_C2_BEACON\n",
|
|
|
|
|
" action: configure_c2_beacon\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 0 # Node Index\n",
|
|
|
|
|
" config: # Further information about these config options can be found at the bottom of this notebook.\n",
|
|
|
|
|
@@ -295,9 +295,9 @@
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### **Command and Control** | C2 Beacon Actions | NODE_APPLICATION_EXECUTE\n",
|
|
|
|
|
"### **Command and Control** | C2 Beacon Actions | node_application_execute\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"The final action is ``NODE_APPLICATION_EXECUTE`` which is used to establish a connection for the C2 application. This action can be called by the Red Agent via action ``3`` in it's action map. \n",
|
|
|
|
|
"The final action is ``node_application_execute`` which is used to establish a connection for the C2 application. This action can be called by the Red Agent via action ``3`` in it's action map. \n",
|
|
|
|
|
"\n",
|
|
|
|
|
"The yaml snippet below shows all the relevant agent options for this action:\n",
|
|
|
|
|
"\n",
|
|
|
|
|
@@ -313,7 +313,7 @@
|
|
|
|
|
" action_map:\n",
|
|
|
|
|
" ...\n",
|
|
|
|
|
" 3:\n",
|
|
|
|
|
" action: NODE_APPLICATION_EXECUTE\n",
|
|
|
|
|
" action: node_application_execute\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 0\n",
|
|
|
|
|
" application_id: 0\n",
|
|
|
|
|
@@ -416,7 +416,7 @@
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### **Command and Control** | C2 Server Actions | C2_SERVER_RANSOMWARE_CONFIGURE\n",
|
|
|
|
|
"### **Command and Control** | C2 Server Actions | c2_server_ransomware_configure\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"Another action the C2 Server grants is the ability for a Red Agent to configure the RansomwareScript via the C2 Server rather than the note directly.\n",
|
|
|
|
|
"\n",
|
|
|
|
|
@@ -435,7 +435,7 @@
|
|
|
|
|
" ...\n",
|
|
|
|
|
" action_map:\n",
|
|
|
|
|
" 5:\n",
|
|
|
|
|
" action: C2_SERVER_RANSOMWARE_CONFIG\n",
|
|
|
|
|
" action: c2_server_ransomware_configure\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 1\n",
|
|
|
|
|
" config:\n",
|
|
|
|
|
@@ -468,9 +468,9 @@
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### **Command and Control** | C2 Server Actions | C2_SERVER_DATA_EXFILTRATE\n",
|
|
|
|
|
"### **Command and Control** | C2 Server Actions | c2_server_data_exfiltrate\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"The second to last action available is the ``C2_SERVER_DATA_EXFILTRATE`` which is indexed as action ``6`` in the action map.\n",
|
|
|
|
|
"The second to last action available is the ``c2_server_data_exfiltrate`` which is indexed as action ``6`` in the action map.\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"This action can be used to exfiltrate a target file on a remote node to the C2 Beacon and the C2 Server's host file system via the ``FTP`` services.\n",
|
|
|
|
|
"\n",
|
|
|
|
|
@@ -487,7 +487,7 @@
|
|
|
|
|
" ...\n",
|
|
|
|
|
" action_map:\n",
|
|
|
|
|
" 6:\n",
|
|
|
|
|
" action: C2_SERVER_DATA_EXFILTRATE\n",
|
|
|
|
|
" action: c2_server_data_exfiltrate\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 1\n",
|
|
|
|
|
" target_file_name: \"database.db\"\n",
|
|
|
|
|
@@ -534,9 +534,9 @@
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"### **Command and Control** | C2 Server Actions | C2_SERVER_RANSOMWARE_LAUNCH\n",
|
|
|
|
|
"### **Command and Control** | C2 Server Actions | c2_server_ransomware_launch\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"Finally, the last available action is for the C2_SERVER_RANSOMWARE_LAUNCH to start the ransomware script installed on the same node as the C2 beacon.\n",
|
|
|
|
|
"Finally, the last available action is for the c2_server_ransomware_launch to start the ransomware script installed on the same node as the C2 beacon.\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"This action is indexed as action ``7``.\n",
|
|
|
|
|
"\n",
|
|
|
|
|
@@ -553,7 +553,7 @@
|
|
|
|
|
" ...\n",
|
|
|
|
|
" action_map:\n",
|
|
|
|
|
" 7:\n",
|
|
|
|
|
" action: C2_SERVER_RANSOMWARE_LAUNCH\n",
|
|
|
|
|
" action: c2_server_ransomware_launch\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 1\n",
|
|
|
|
|
"```\n"
|
|
|
|
|
@@ -682,19 +682,19 @@
|
|
|
|
|
" action_space:\n",
|
|
|
|
|
" action_map:\n",
|
|
|
|
|
" 0:\n",
|
|
|
|
|
" action: DONOTHING\n",
|
|
|
|
|
" action: do_nothing\n",
|
|
|
|
|
" options: {}\n",
|
|
|
|
|
" 1:\n",
|
|
|
|
|
" action: NODE_APPLICATION_REMOVE\n",
|
|
|
|
|
" action: node_application_remove\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 0\n",
|
|
|
|
|
" application_name: C2Beacon\n",
|
|
|
|
|
" 2:\n",
|
|
|
|
|
" action: NODE_SHUTDOWN\n",
|
|
|
|
|
" action: node_shutdown\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 0\n",
|
|
|
|
|
" 3:\n",
|
|
|
|
|
" action: ROUTER_ACL_ADDRULE\n",
|
|
|
|
|
" action: router_acl_add_rule\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" target_router: router_1\n",
|
|
|
|
|
" position: 1\n",
|
|
|
|
|
@@ -1079,7 +1079,7 @@
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"The code cell below uses the custom blue agent defined at the start of this section perform a NODE_APPLICATION_REMOVE on the C2 beacon:"
|
|
|
|
|
"The code cell below uses the custom blue agent defined at the start of this section perform a node_application_remove on the C2 beacon:"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
@@ -1088,7 +1088,7 @@
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"# Using CAOS ACTION: NODE_APPLICATION_REMOVE & capturing the OBS\n",
|
|
|
|
|
"# Using CAOS ACTION: node_application_remove & capturing the OBS\n",
|
|
|
|
|
"post_blue_action_obs, _, _, _, _ = blue_env.step(1)"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
@@ -1174,7 +1174,7 @@
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"The code cell below uses the custom blue agent defined at the start of this section to perform a ``NODE_SHUT_DOWN`` action on the web server."
|
|
|
|
|
"The code cell below uses the custom blue agent defined at the start of this section to perform a ``node_shut_down`` action on the web server."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
@@ -1183,7 +1183,7 @@
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"# Using CAOS ACTION: NODE_SHUT_DOWN & capturing the OBS\n",
|
|
|
|
|
"# Using CAOS ACTION: node_shut_down & capturing the OBS\n",
|
|
|
|
|
"post_blue_action_obs, _, _, _, _ = blue_env.step(2)"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
@@ -1264,7 +1264,7 @@
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"The code cell below uses the custom blue agent defined at the start of this section to perform a ROUTER_ACL_ADDRULE on router 1."
|
|
|
|
|
"The code cell below uses the custom blue agent defined at the start of this section to perform a router_acl_add_rule on router 1."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
@@ -1273,7 +1273,7 @@
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"# Using CAOS ACTION: ROUTER_ACL_ADDRULE & capturing the OBS\n",
|
|
|
|
|
"# Using CAOS ACTION: router_acl_add_rule & capturing the OBS\n",
|
|
|
|
|
"post_blue_action_obs, _, _, _, _ = blue_env.step(3)"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
@@ -1387,11 +1387,11 @@
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"source": [
|
|
|
|
|
"As demonstrated earlier, red agents can use the ``CONFIGURE_C2_BEACON`` action to configure these settings mid episode through the configuration options:\n",
|
|
|
|
|
"As demonstrated earlier, red agents can use the ``configure_c2_beacon`` action to configure these settings mid episode through the configuration options:\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"``` YAML\n",
|
|
|
|
|
"...\n",
|
|
|
|
|
" action: CONFIGURE_C2_BEACON\n",
|
|
|
|
|
" action: configure_c2_beacon\n",
|
|
|
|
|
" options:\n",
|
|
|
|
|
" node_id: 0\n",
|
|
|
|
|
" config:\n",
|
|
|
|
|
|