#2706 - Updates to Terminal Processing notebook to highlight utility function and improve formatting

This commit is contained in:
Charlie Crane
2024-07-30 16:58:40 +01:00
parent 0ed61ec79b
commit 06ac127f6b

View File

@@ -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()"
]
},