From 06ac127f6bc90acbf40c7b4fb3b19248f9f95e65 Mon Sep 17 00:00:00 2001 From: Charlie Crane Date: Tue, 30 Jul 2024 16:58:40 +0100 Subject: [PATCH] #2706 - Updates to Terminal Processing notebook to highlight utility function and improve formatting --- .../notebooks/Terminal-Processing.ipynb | 45 +++++++++++++++---- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/src/primaite/notebooks/Terminal-Processing.ipynb b/src/primaite/notebooks/Terminal-Processing.ipynb index 4cb962ca..c9321b01 100644 --- a/src/primaite/notebooks/Terminal-Processing.ipynb +++ b/src/primaite/notebooks/Terminal-Processing.ipynb @@ -63,19 +63,33 @@ "computer_a: Computer = network.get_node_by_hostname(\"node_a\")\n", "terminal_a: Terminal = computer_a.software_manager.software.get(\"Terminal\")\n", "computer_b: Computer = network.get_node_by_hostname(\"node_b\")\n", + "terminal_b: Terminal = computer_b.software_manager.software.get(\"Terminal\")\n", "\n", - "# The below can be un-commented when UserSessionManager is implemented. Will need to login before sending any SSH commands\n", - "# to remote.\n", - "# terminal_a.login(username=\"admin\", password=\"Admin123!\", ip_address=computer_b.network_interface[1].ip_address)" + "# Login to the remote (node_b) from local (node_a)\n", + "terminal_a.login(username=\"admin\", password=\"Admin123!\", ip_address=computer_b.network_interface[1].ip_address)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "The Terminal can be used to install new software. The code block below demonstrates how the Terminal class allows the user of `terminal_a`, on `computer_a`, to send a command to `computer_b` to install the `RansomwareScript` application. \n", - "\n", - "Once ran and the command sent, the `RansomwareScript` can be seen in the list of applications on the `node_b Software Manager`. " + "You can view all remote connections to a terminal through use of the `show()` method" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "terminal_b.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The Terminal can be used to install new software. The code block below demonstrates how the Terminal class allows the user of `terminal_a`, on `computer_a`, to send a command to `computer_b` to install the `RansomwareScript` application. \n" ] }, { @@ -97,8 +111,23 @@ " target_ip_address=computer_b.network_interface[1].ip_address,\n", ")\n", "\n", - "terminal_a.send(payload=payload, dest_ip_address=computer_b.network_interface[1].ip_address)\n", - "\n", + "# Send commmand to install RansomwareScript\n", + "terminal_a.send(payload=payload, dest_ip_address=computer_b.network_interface[1].ip_address)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The `RansomwareScript` can then be seen in the list of applications on the `node_b Software Manager`. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "computer_b.software_manager.show()" ] },