add "tor.js" and "programs.js". use `minimist` for "main.js" argument parsing.

[?]
Apr 25, 2020, 8:04 PM
HLC2L3NJJSZLGSQ7JN6CTRE4YALVPLQSADZP3MDNLGB7BWPPH22QC

Dependencies

  • [2] 7SRULDRF minor refactoring.
  • [3] 4ACCU75N improve and refactor scheduling logic.
  • [4] 6MBUKAG6 remove unneeded functions and comments. update readme.
  • [5] CJBGAILA add optional `--target` parameter for `main.js`. update `README.md`.
  • [6] RWMZ7DVL split and refactor various logics. update "README.md".
  • [7] NC66CZ5J rename certain variables that had the same names as ns functions to prevent the RAM checker from triggering.
  • [8] SLSWBNYT added ram utilisation logic to `ram.js` and `servers.js`. split and refactored redundant code into separate library files.
  • [9] 3NFCZ6IP fixed the ram utilisation logic. added flags to `main.js` that can prevent the execution of helpers.
  • [10] YXH7ERRN fixed bug that prevented helper scripts running if the "home" server does not have RAM bigger than the rest of the rooted servers.
  • [11] NQ22FUSW add more options to `main.js`. update `README.md`.
  • [*] 2BKHJI2S init

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
    [3.10628][2.2587:2620]()
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  • replacement in bin/main.js at line 53
    [3.2789][2.2621:2654]()
    ================================
    [3.2789]
    [3.2359]
    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
    [3.2382][3.3577:4027]()
    // returns the index of the scripts array which matches the filename input
    const 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;
    [3.2382]
    [3.4027]
    // options
    const 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) {
    // options
    case "c":
    // fall-through
    case "check-delay":
    float_period_check_seconds = argument_value;
    break;
    case "d":
    // fall-through
    case "job-delay":
    float_padding_seconds = argument_value;
    break;
    case "i":
    // fall-through
    case "target":
    string_server_target = argument_value;
    break;
    case "j":
    // fall-through
    case "job-cap":
    integer_job_cap = argument_value;
    break;
    case "n":
    // fall-through
    case "server-name":
    string_servers_bought_name = argument_value;
    break;
    case "p":
    // fall-through
    case "precision":
    float_precision = argument_value;
    break;
    case "r":
    // fall-through
    case "ram-utilisation":
    float_ram_utilisation_threshold = argument_value;
    break;
    case "s":
    // fall-through
    case "steal-cap":
    float_steal_cap = argument_value;
    break;
  • replacement in bin/main.js at line 107
    [3.4041][3.4041:4046](),[3.4046][3.1989:2210](),[3.2382][3.1989:2210]()
    };
    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;
    [3.4041]
    [3.2006]
    }
    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
    [3.2012][3.2211:2344](),[3.2344][3.4047:4079](),[3.4079][2.2655:2852]()
    const string_argument = array_arguments[0];
    const string_argument_value = array_arguments[1];
    switch (string_argument) {
    // flags
    case "-a":
    // fall-through
    case "--no-ram":
    array_arguments.splice(0, 1);
    array_helpers.splice(integer_get_index_of_file(array_helpers, string_helper_file_ram), 1);
    break;
    [3.2012]
    [3.4286]
    ];
  • replacement in bin/main.js at line 137
    [3.4287][3.4287:4391]()
    case "-e":
    // fall-through
    case "--no-servers":
    array_arguments.splice(0, 1);
    [3.4287]
    [3.4391]
    // flags
    for (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
    [3.4494][3.4494:4613]()
    break;
    case "-b":
    // fall-through
    case "--no-botnet":
    array_arguments.splice(0, 1);
    [3.4494]
    [3.4613]
    }
    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;
    // options
    case "-c":
    // fall-through
    case "--check-delay":
    float_period_check_seconds = string_argument_value;
    array_arguments.splice(0, 2);
    break;
    case "-d":
    // fall-through
    case "--job-delay":
    float_padding_seconds = string_argument_value;
    array_arguments.splice(0, 2);
    break;
    case "-i":
    // fall-through
    case "--target":
    string_server_target = string_argument_value;
    array_arguments.splice(0, 2);
    break;
    case "-j":
    // fall-through
    case "--job-cap":
    integer_job_cap = string_argument_value;
    array_arguments.splice(0, 2);
    break;
    case "-n":
    // fall-through
    case "--server-name":
    string_servers_bought_name = string_argument_value;
    array_arguments.splice(0, 2);
    break;
    case "-p":
    // fall-through
    case "--precision":
    float_precision = string_argument_value;
    array_arguments.splice(0, 2);
    break;
    case "-r":
    // fall-through
    case "--ram-utilisation":
    float_ram_utilisation_threshold = string_argument_value;
    array_arguments.splice(0, 2);
    break;
    case "-s":
    // fall-through
    case "--steal-cap":
    float_steal_cap = string_argument_value;
    array_arguments.splice(0, 2);
    break;
    default:
    throw new Error(`Unknown argument: ${string_argument}.`);
    [3.4715]
    [3.2332]
    }
  • edit in bin/main.js at line 188
    [3.2272]
    [3.2272]
    // returns the index of the scripts array which matches the filename input
    const 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][3.7131:7167](),[3.7131][3.7131:7167]()
    };
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    [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.
    [3.3289]
    [3.44800]
    ### "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
    [3.3499]
    [3.3315]
    * \* = SF-4 Required for this to properly function.
  • edit in README.md at line 72
    [3.7685]
    [3.4856]
    `-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
    [3.4930][3.7686:7766]()
    `run main.js --job-cap 4000 -i "harakiri-sushi" -r 0.7 -s 0.5 -a --no-botnet`
    [3.4930]
    [3.4988]
    `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
    [3.4989][3.7767:8158]()
    * 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.
    [3.4989]
    [3.5163]
    * 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.