add "tor.js" and "programs.js". use `minimist` for "main.js" argument parsing.
[?]
Apr 25, 2020, 8:04 PM
HLC2L3NJJSZLGSQ7JN6CTRE4YALVPLQSADZP3MDNLGB7BWPPH22QCDependencies
- [2]
7SRULDRFminor refactoring. - [3]
4ACCU75Nimprove and refactor scheduling logic. - [4]
6MBUKAG6remove unneeded functions and comments. update readme. - [5]
CJBGAILAadd optional `--target` parameter for `main.js`. update `README.md`. - [6]
RWMZ7DVLsplit and refactor various logics. update "README.md". - [7]
NC66CZ5Jrename certain variables that had the same names as ns functions to prevent the RAM checker from triggering. - [8]
SLSWBNYTadded ram utilisation logic to `ram.js` and `servers.js`. split and refactored redundant code into separate library files. - [9]
3NFCZ6IPfixed the ram utilisation logic. added flags to `main.js` that can prevent the execution of helpers. - [10]
YXH7ERRNfixed bug that prevented helper scripts running if the "home" server does not have RAM bigger than the rest of the rooted servers. - [11]
NQ22FUSWadd more options to `main.js`. update `README.md`. - [*]
2BKHJI2Sinit
Change contents
- edit in bin/main.js at line 26[13.3793781][3.1988]
import {object_parse}from "lib_minimist.js"; - edit in bin/main.js at line 50
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - replacement in bin/main.js at line 53
================================const string_helper_file_tor = "tor.js";const string_helper_file_programs = "programs.js";const string_helper_file_botnet = "botnet.js"; - replacement in bin/main.js at line 58
// returns the index of the scripts array which matches the filename inputconst integer_get_index_of_file = function(array_scripts, string_file) {for (let integer_indices_0 = 0; integer_indices_0 < array_scripts.length; ++integer_indices_0) {const object_script = array_scripts[integer_indices_0];const string_script_file = object_script.file;if (string_script_file === string_file) {return integer_indices_0;// optionsconst object_arguments = object_parse(ns.args);for (const string_argument in object_arguments) {if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {// optionscase "c":// fall-throughcase "check-delay":float_period_check_seconds = argument_value;break;case "d":// fall-throughcase "job-delay":float_padding_seconds = argument_value;break;case "i":// fall-throughcase "target":string_server_target = argument_value;break;case "j":// fall-throughcase "job-cap":integer_job_cap = argument_value;break;case "n":// fall-throughcase "server-name":string_servers_bought_name = argument_value;break;case "p":// fall-throughcase "precision":float_precision = argument_value;break;case "r":// fall-throughcase "ram-utilisation":float_ram_utilisation_threshold = argument_value;break;case "s":// fall-throughcase "steal-cap":float_steal_cap = argument_value;break; - replacement in bin/main.js at line 107
};let array_arguments = Array.from(ns.args);let boolean_end_loop_arguments = false;while (!boolean_end_loop_arguments) {if (array_arguments.length === 0) {boolean_end_loop_arguments = true;break;}let array_helpers = [{file: string_helper_file_ram,threads: 1,args: [float_period_check_seconds, float_ram_utilisation_threshold]},{file: string_helper_file_servers,threads: 1,args: [float_period_check_seconds, string_servers_bought_name, float_ram_utilisation_threshold]},{file: string_helper_file_tor,threads: 1,args: [float_period_check_seconds]},{file: string_helper_file_programs,threads: 1,args: [float_period_check_seconds, ["BruteSSH.exe", "FTPCrack.exe", "relaySMTP.exe", "HTTPWorm.exe", "SQLInject.exe", "DeepscanV1.exe", "DeepscanV2.exe", "Autolink.exe"]]},{file: string_helper_file_botnet,threads: 1,args: [float_period_check_seconds] - replacement in bin/main.js at line 135
const string_argument = array_arguments[0];const string_argument_value = array_arguments[1];switch (string_argument) {// flagscase "-a":// fall-throughcase "--no-ram":array_arguments.splice(0, 1);array_helpers.splice(integer_get_index_of_file(array_helpers, string_helper_file_ram), 1);break;]; - replacement in bin/main.js at line 137
case "-e":// fall-throughcase "--no-servers":array_arguments.splice(0, 1);// flagsfor (const string_argument in object_arguments) {if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];if ((string_argument === "a" && argument_value) ||(string_argument === "ram" && !argument_value)) {array_helpers.splice(integer_get_index_of_file(array_helpers, string_helper_file_ram), 1);}if ((string_argument === "e" && argument_value) ||(string_argument === "servers" && !argument_value)) { - replacement in bin/main.js at line 152
break;case "-b":// fall-throughcase "--no-botnet":array_arguments.splice(0, 1);}if ((string_argument === "o" && argument_value) ||(string_argument === "tor" && !argument_value)) {array_helpers.splice(integer_get_index_of_file(array_helpers, string_helper_file_tor), 1);}if ((string_argument === "g" && argument_value) ||(string_argument === "programs" && !argument_value)) {array_helpers.splice(integer_get_index_of_file(array_helpers, string_helper_file_programs), 1);}if ((string_argument === "b" && argument_value) ||(string_argument === "botnet" && !argument_value)) { - replacement in bin/main.js at line 170[3.4715]→[3.4715:4748](∅→∅),[3.4748]→[3.2344:3378](∅→∅),[3.2344]→[3.2344:3378](∅→∅),[3.3378]→[3.10629:10818](∅→∅),[3.10818]→[3.3378:3626](∅→∅),[3.3378]→[3.3378:3626](∅→∅)
break;// optionscase "-c":// fall-throughcase "--check-delay":float_period_check_seconds = string_argument_value;array_arguments.splice(0, 2);break;case "-d":// fall-throughcase "--job-delay":float_padding_seconds = string_argument_value;array_arguments.splice(0, 2);break;case "-i":// fall-throughcase "--target":string_server_target = string_argument_value;array_arguments.splice(0, 2);break;case "-j":// fall-throughcase "--job-cap":integer_job_cap = string_argument_value;array_arguments.splice(0, 2);break;case "-n":// fall-throughcase "--server-name":string_servers_bought_name = string_argument_value;array_arguments.splice(0, 2);break;case "-p":// fall-throughcase "--precision":float_precision = string_argument_value;array_arguments.splice(0, 2);break;case "-r":// fall-throughcase "--ram-utilisation":float_ram_utilisation_threshold = string_argument_value;array_arguments.splice(0, 2);break;case "-s":// fall-throughcase "--steal-cap":float_steal_cap = string_argument_value;array_arguments.splice(0, 2);break;default:throw new Error(`Unknown argument: ${string_argument}.`);} - edit in bin/main.js at line 188
// returns the index of the scripts array which matches the filename inputconst integer_get_index_of_file = function(array_scripts, string_file) {for (let integer_indices_0 = 0; integer_indices_0 < array_scripts.length; ++integer_indices_0) {const object_script = array_scripts[integer_indices_0];const string_script_file = object_script.file;if (string_script_file === string_file) {return integer_indices_0;}}}; - replacement in bin/main.js at line 977
};<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[2.4578]}; - replacement in README.md at line 10[3.3289]→[3.7175:7221](∅→∅),[3.7221]→[3.11527:11620](∅→∅),[3.11527]→[3.11527:11620](∅→∅),[3.11620]→[3.44607:44800](∅→∅),[3.44607]→[3.44607:44800](∅→∅)
### "main.js" (8.85 [+6.6] [+8.85] [+2.2] GB)* Run the helper scripts "ram.js", "servers.js" and "botnet.js" that should, respectively:* Upgrade your home server's RAM (you need to uncomment some code and have SF-4).* Buy and replace old servers whenever appropriate.* Try to exploit and root servers if possible.### "main.js" (8.85 GB)* Run the helper scripts "ram.js"\* (6.6 GB), "servers.js" (8.85 GB), "tor.js"\* (3.8 GB), "programs.js"\* (3.7 GB) and "botnet.js" (2.2 GB) that should attempt to, respectively:* Upgrade your home server's RAM.* Buy and replace old servers when appropriate.* Buy a TOR Router.* Buy programs from the dark web.* Exploit and root servers. - edit in README.md at line 21
* \* = SF-4 Required for this to properly function. - edit in README.md at line 72
`-g, --no-programs`* Prevents the "programs.js" script from being started which is responsible for buying programs from the "darkweb" server.`-o, --no-tor`* Prevents the "tor.js" script from being started which is responsible for buyinh a TOR Router. - replacement in README.md at line 85
`run main.js --job-cap 4000 -i "harakiri-sushi" -r 0.7 -s 0.5 -a --no-botnet``run main.js --job-cap 4000 -i "harakiri-sushi" -r 0.7 --steal-cap=0.5 -ao --no-botnet` - replacement in README.md at line 87
* Runs the script with up to 4000 jobs, targetting "harakiri-sushi", only upgrading/replacing servers when at least 0.7 of your network's total RAM is being used, and stealing only up to 50% of harakiri-sushi's cash per "hack.js" job that finishes executing, whilst the remaining variables are set to defaults. The "ram.js" and "botnet.js" helper scripts are also prevented from starting.* Runs the script with up to 4000 jobs, targetting "harakiri-sushi", only upgrading/replacing servers when at least 0.7 of your network's total RAM is being used, and stealing only up to 50% of harakiri-sushi's cash per "hack.js" job that finishes executing, whilst the remaining variables are set to defaults. The "ram.js", "tor.js" and "botnet.js" helper scripts are also prevented from starting.