1
0
mirror of https://gitlab.com/MisterBiggs/bitburner-scripts.git synced 2025-08-03 12:01:32 +00:00
Files
Bitburner-Scripts/scripts/spider.js
2021-12-16 22:38:12 -07:00

86 lines
1.7 KiB
JavaScript

script = "advhack.script";
servers = scan();
nuked = ["darkweb", "home"];
i = 0;
while (i < servers.length) {
if (servers[i] == "darkweb") {
i++;
continue;
}
while (getHackingLevel() < getServerRequiredHackingLevel(servers[i])) {
sleep(20000);
}
scp(script, servers[i]);
if (getServerNumPortsRequired(servers[i])) {
while (!fileExists("BruteSSH.exe")) {
sleep(20000);
}
brutessh(servers[i]);
}
nuke(servers[i]);
threads = Math.max(
1,
Math.floor(getServerMaxRam(servers[i]) / getScriptRam(script))
);
exec(script, servers[i], threads);
nuked.push(servers[i]);
tprint(servers[i], " added to botnet with ", threads, " threads");
++i;
}
tprint("===Basic Servers Finished===");
while (true) {
tonuke = [];
i = 0;
while (i < nuked.length) {
n = scan(nuked[i]);
j = 0;
while (j < n.length) {
if (!nuked.includes(n[j])) {
tonuke.push(n[j]);
}
j++;
}
i++;
}
i = 0;
while (i < tonuke.length) {
if (getServerNumPortsRequired(tonuke[i]) > 3) {
i++;
continue;
}
if (getHackingLevel() < getServerRequiredHackingLevel(tonuke[i])) {
i++;
continue;
}
brutessh(tonuke[i]);
ftpcrack(tonuke[i]);
ftpcrack(tonuke[i]);
nuke(tonuke[i]);
scp(script, tonuke[i]);
//Execute our scripts on the target server
threads = Math.max(
1,
Math.floor(getServerMaxRam(tonuke[i]) / getScriptRam(script))
);
exec(script, tonuke[i], threads);
nuked.push(tonuke[i]);
tprint(tonuke[i], " added to botnet with ", threads, " threads");
i++;
}
sleep(20000);
}
tprint("===== SPIDER FINISHED =====");