Added scan-analyze to Interactive Tutorial

This commit is contained in:
Daniel Xie 2017-05-24 18:23:28 -05:00
parent 84eb295527
commit 0fd5323d52
4 changed files with 49 additions and 8 deletions

@ -4,10 +4,12 @@
padding-top: 10px; padding-top: 10px;
padding-left: 10px; padding-left: 10px;
height: 100%; height: 100%;
width: 99%;
} }
#work-in-progress-text { #work-in-progress-text {
color: #66ff33; color: #66ff33;
width: 70%;
} }
#work-in-progress-cancel-button { #work-in-progress-cancel-button {

@ -150,7 +150,7 @@ CONSTANTS = {
"rm Delete a script/program from the machine. (WARNING: Permanent)<br>" + "rm Delete a script/program from the machine. (WARNING: Permanent)<br>" +
"run [script/program] Execute a program or a script<br>" + "run [script/program] Execute a program or a script<br>" +
"scan Displays all available network connections<br>" + "scan Displays all available network connections<br>" +
"scan-analyze Displays hacking-related information for all available network connections<br>" + "scan-analyze [depth] Displays hacking-related information for all servers up to <i>depth</i> nodes away<br>" +
"sudov Shows whether or not you have root access on this computer<br>" + "sudov Shows whether or not you have root access on this computer<br>" +
"tail [script] Display script logs (logs contain details about active scripts)<br>" + "tail [script] Display script logs (logs contain details about active scripts)<br>" +
"top Display all running scripts and their RAM usage<br>", "top Display all running scripts and their RAM usage<br>",

@ -8,6 +8,8 @@ iTutorialSteps = {
TerminalHelp: "Using the help command to display all options in terminal", TerminalHelp: "Using the help command to display all options in terminal",
TerminalLs: "Use the ls command to show all programs/scripts. Right now we have NUKE.exe", TerminalLs: "Use the ls command to show all programs/scripts. Right now we have NUKE.exe",
TerminalScan: "Using the scan command to display all available connections", TerminalScan: "Using the scan command to display all available connections",
TerminalScanAnalyze1: "Use the scan-analyze command to show hacking related information",
TerminalScanAnalyze2: "Use the scan-analyze command with a depth of 3",
TerminalConnect: "Using the telnet/connect command to connect to another server", TerminalConnect: "Using the telnet/connect command to connect to another server",
TerminalAnalyze: "Use the analyze command to display details about this server", TerminalAnalyze: "Use the analyze command to display details about this server",
TerminalNuke: "Use the NUKE Program to gain root access to a server", TerminalNuke: "Use the NUKE Program to gain root access to a server",
@ -155,13 +157,29 @@ function iTutorialEvaluateStep() {
"the 'scan' command. "); "the 'scan' command. ");
//next step triggered by terminal command //next step triggered by terminal command
break; break;
case iTutorialSteps.TerminalConnect: case iTutorialSteps.TerminalScanAnalyze1:
iTutorialSetText("The 'scan' command shows all available network connections. In other words, " + iTutorialSetText("The 'scan' command shows all available network connections. In other words, " +
"it displays a list of all servers that can be connected to from your " + "it displays a list of all servers that can be connected to from your " +
"current machine. A server is identified by either its IP or its hostname. <br><br> " + "current machine. A server is identified by either its IP or its hostname. <br><br> " +
"To connect to a machine, use the 'connect [ip/hostname]' command. You can type in " + "That's great and all, but there's so many servers. Which one should you go to? " +
"The 'scan-analyze' command gives some more detailed information about servers on the " +
"network. Try it now");
//next step triggered by terminal command
break;
case iTutorialSteps.TerminalScanAnalyze2:
iTutorialSetText("You just ran 'scan-analyze' with a depth of one. This command shows more detailed " +
"information about each server that you can connect to (servers that are a distance of " +
"one node away). <br><br> It is also possible to run 'scan-analyze' with " +
"a higher depth. Let's try a depth of two with the following command: 'scan-analyze 2'.")
//next step triggered by terminal command
break;
case iTutorialSteps.TerminalConnect:
iTutorialSetText("Now you can see information about all servers that are up to two nodes away, as well " +
"as figure out how to connect to those servers through the network. You can only connect to " +
"a server that is one node away. To connect to a machine, use the 'connect [ip/hostname]' command. You can type in " +
"the ip or the hostname, but dont use both.<br><br>" + "the ip or the hostname, but dont use both.<br><br>" +
"Let's try this now by connecting to the 'foodnstuff' server (connect foodnstuff)"); "From the results of the 'scan-analyze' command, we can see that the 'foodnstuff' server is " +
"only one node away. Let's connect so it now using: 'connect foodnstuff'");
//next step triggered by terminal command //next step triggered by terminal command
break; break;
case iTutorialSteps.TerminalAnalyze: case iTutorialSteps.TerminalAnalyze:
@ -228,7 +246,7 @@ function iTutorialEvaluateStep() {
"}<br><br> " + "}<br><br> " +
"For anyone with basic programming experience, this code should be straightforward. " + "For anyone with basic programming experience, this code should be straightforward. " +
"This script will continuously hack the 'foodnstuff' server. <br><br>" + "This script will continuously hack the 'foodnstuff' server. <br><br>" +
"To save and close the script editor, press the button in the top right, or press ctrl + b."); "To save and close the script editor, press the button in the bottom left, or press ctrl + b.");
//next step triggered in saveAndCloseScriptEditor() (Script.js) //next step triggered in saveAndCloseScriptEditor() (Script.js)
break; break;
case iTutorialSteps.TerminalFree: case iTutorialSteps.TerminalFree:
@ -406,6 +424,14 @@ function iTutorialNextStep() {
iTutorialEvaluateStep(); iTutorialEvaluateStep();
break; break;
case iTutorialSteps.TerminalScan: case iTutorialSteps.TerminalScan:
currITutorialStep = iTutorialSteps.TerminalScanAnalyze1;
iTutorialEvaluateStep();
break;
case iTutorialSteps.TerminalScanAnalyze1:
currITutorialStep = iTutorialSteps.TerminalScanAnalyze2;
iTutorialEvaluateStep();
break;
case iTutorialSteps.TerminalScanAnalyze2:
currITutorialStep = iTutorialSteps.TerminalConnect; currITutorialStep = iTutorialSteps.TerminalConnect;
iTutorialEvaluateStep(); iTutorialEvaluateStep();
break; break;

@ -387,10 +387,23 @@ var Terminal = {
iTutorialNextStep(); iTutorialNextStep();
} else {post("Bad command. Please follow the tutorial");} } else {post("Bad command. Please follow the tutorial");}
break; break;
case iTutorialSteps.TerminalScanAnalyze1:
if (commandArray.length == 1 && commandArray[0] == "scan-analyze") {
Terminal.executeScanAnalyzeCommand(1);
iTutorialNextStep();
} else {post("Bad command. Please follow the tutorial");}
break;
case iTutorialSteps.TerminalScanAnalyze2:
if (commandArray.length == 2 && commandArray[0] == "scan-analyze" &&
commandArray[1] == "2") {
Terminal.executeScanAnalyzeCommand(2);
iTutorialNextStep();
} else {post("Bad command. Please follow the tutorial");}
break;
break;
case iTutorialSteps.TerminalConnect: case iTutorialSteps.TerminalConnect:
if (commandArray.length == 2) { if (commandArray.length == 2) {
if ((commandArray[0] == "connect" || commandArray[0] == "telnet") && if ((commandArray[0] == "connect") &&
(commandArray[1] == "foodnstuff" || commandArray[1] == foodnstuffServ.ip)) { (commandArray[1] == "foodnstuff" || commandArray[1] == foodnstuffServ.ip)) {
Player.getCurrentServer().isConnectedTo = false; Player.getCurrentServer().isConnectedTo = false;
Player.currentServer = foodnstuffServ.ip; Player.currentServer = foodnstuffServ.ip;