コンテンツにスキップ
ライオットビット

ライオットビット

  • 家
  • ニュース
  • ガイド
  • ビデオガイド
  • パッチノート
  • 不正行為を報告する
  • 検索フォームを切り替え
ビットバーナー

ビットバーナー – Root Accessor Script

ポストする 12/29/2021 に Crunchynut コメントはありません の上 ビットバーナー – Root Accessor Script
  • タイトル: ビットバーナー
  • 発売日:
  • 開発者:
  • 出版社:
Bitburner に関する情報はまだ不完全です. これを使用してゲームの詳細を記入するのにご協力ください。 お問い合わせフォーム.

Attempts to gain root access to all servers and present them in an easy-to-see and use format.

概要

This script gets all servers, opens all ports possible, and attempts to gain root access, all while presenting the user with easy-to-read and useful information.

使用方法

Create each script below and paste the code appropriately.

Run the script!

コマンド:

run RootAccessor.ns

Runs the script against all servers. Displays results.

run RootAccessor.ns -h

brings up the help menu for the script. The script does not process any further if it contains “-h” as an argument.

run RootAccessor.ns -s

lists all servers with root access as a space-separated list if users want to utilize them as arguments in other scripts.

run RootAccessor.ns joesguns n00dles max-hardware

attempts to gain root access on target servers (each argument is a server name).

run RootAccessor.ns joesguns n00dles max-hardware -s
run RootAccessor.ns -s joesguns n00dles max-hardware
run RootAccessor.ns joesguns n00dles -s max-hardware

“-s” can be added as an argument at any time.

RootAccessor.ns Script

Create a new script with whatever name you’d like. I called mine “RootAccessor.ns”. Paste the below code into it. It contains 3 functions that make up the entire script.

/** @param {NS} ns **/
import {allServers} から "./lib-getServers.ns";

非同期関数メインのエクスポート(ns) {
	var approved = [];
	var deniedhack = [];
	var deniedports = [];
	var denied = [];
	var other = [];
	var files = [0, 0, 0, 0, 0];
	var maxPorts = 0;

	//suppress all default log messages
	ns.tail(); ns.disableLog('全て'); ns.clearLog();

	//check for help argument.
	もし (ns.args.includes("-h")) {ヘルプ(ns); 戻る;}
	ns.print("For script help use argument '-h' ");
	
	ns.print("Executing...");
	
	//process argument calls
	var target = [];
	もし (ns.args.length > 0) {
		もし (ns.args[0] === "-s") {
			target = await allServers(ns);
		} それ以外 {
			target = ns.args;
		}
	} それ以外 {
		target = await allServers(ns);
	}

	//check max ports available to open
	if (ns.file存在します("BruteSSH.exe"))  {ファイル[0] = 1; maxPorts++; ns.print("BruteSSH.exe file exists");}  それ以外 {ns.print("BruteSSH.exe not found");}
	もし (ns.file存在します("FTPCrack.exe"))  {ファイル[1] = 1; maxPorts++; ns.print("FTPCrack.exe file exists");}  それ以外 {ns.print("FTPCrack.exe not found");}
	もし (ns.file存在します("relaySMTP.exe")) {ファイル[2] = 1; maxPorts++; ns.print("relaySMTP.exe file exists");} それ以外 {ns.print("relaySMTP.exe not found");}
	もし (ns.file存在します("HTTPWorm.exe"))  {ファイル[3] = 1; maxPorts++; ns.print("HTTPWorm.exe file exists");}  それ以外 {ns.print("HTTPWorm.exe not found");}
	もし (ns.file存在します("SQLInject.exe")) {ファイル[4] = 1; maxPorts++; ns.print("SQLInject.exe file exists");} それ以外 {ns.print("SQLInject.exe not found");}
	ns.print("Maximum ports able to open: [" + maxPorts + "]\n");

	//open all ports and attempt root access
	for (const n of target) {
		もし (ns.serverExists(n)) {
			const serverHackLvl = ns.getServerRequiredHackingLevel(n);
			const playerHackingLvl = ns.getHackingLevel();
			
			もし (playerHackingLvl >= serverHackLvl) {
				もし (ファイル[0]) { ns.ブルーテッシュ(n); }
				もし (ファイル[1]) { ns.ftpcrack(n); }
				もし (ファイル[2]) { ns.relaysmtp(n);}
				もし (ファイル[3]) { ns.httpworm(n); }
				もし (ファイル[4]) { ns.sqlinject(n);}

				gainRootAccess(n, maxPorts, approved, deniedports, denied, other, ns);

			} それ以外 {
				denied.push(n);
				deniedhack.push("[DENIED] - hack level too low [" + playerHackingLvl + '/' + serverHackLvl + "] ために " + n);
			}
		}
	}

	//output results
	if (deniedhack.length>0) ns.print(deniedhack.join("\n"));
	もし (deniedports.length>0) ns.print(deniedports.join("\n"));
	もし (other.length>0) ns.print("[ALREADY ACQUIRED ROOT ACCESS] ために " + other.join("\n[ALREADY ACQUIRED ROOT ACCESS] ために "));
	もし (approved.length>0) ns.print("[ROOT ACCESS APPROVED] ために " + approved.join("\n[ROOT ACCESS APPROVED] ために "));

	もし (ns.args.includes("-s")) {
		ns.print("Copiable list of rooted servers:\n" + approved.join(" ") + other.join(" "));
	}
}

function gainRootAccess(サーバ, portCount, approved, deniedports, denied, other, ns) {
	もし (!ns.hasRootAccess(サーバ)) {
		もし (portCount >= ns.getServerNumPortsRequired(サーバ)) {
			ns.核(サーバ);
			approved.push(サーバ);
		} それ以外 {
			denied.push(サーバ);
			deniedports.push("[ROOT ACCESS DENIED] ために " + サーバ + " - Not enough open PORTS");
		}
	} それ以外 {
		other.push(サーバ);
	}
}

function help(ns) {
	const text = [
		"<========================HELP=====================>\n",
		"- Script takes in [N] arguments or none at all.",
		"  [N]: server names that you wish to be rooted.",
		"  例えば: run rootAccessor.ns n00dles joesguns zer0\n",
		"- No args will attempt root access on all servers\n",
		"- include argument '-s' as an argument to print",
		"  copiable list of all rooted servers\n",
		"<=================================================>"
		];
	ns.print(text.join("\n"));
}

lib-getServers.ns Script

Create a new script named “lib-getServers.ns” and paste the below helper function.

/** @param {NS} ns **/

export function allServers(ns, removePurchased=true) {
	もし (removePurchased) var pservs = ns.getPurchasedServers();
	const nodes = new Set;
	function dfs(ノード) {
		nodes.add(ノード);
		ために (const neighbor of ns.scan(ノード)) {
			もし (removePurchased) {
				もし (!pservs.includes(neighbor)) {
					もし (!nodes.has(neighbor)) {
						dfs(neighbor);
					}
				}
			} それ以外 {
				もし (!nodes.has(neighbor)) {
					dfs(neighbor);
				}
			}
		}
	}
	dfs("家");
	戻る [...ノード];
}

これが今日私たちがこの目的で共有するすべてです ビットバーナー ガイド. このガイドは元々、次の者によって作成および執筆されました。 Crunchynut. このガイドを更新できなかった場合, これに従って最新のアップデートを見つけることができます リンク.

このサイトのコンテンツがあなたの権利を侵害していると思われる場合, あなたの知的財産権を含む, お問い合わせフォームを使用してすぐにご連絡ください.
ガイド タグ:ビットバーナー

ポストナビゲーション

前の投稿: Railroad Corporation – How to Make Easy Money
次の投稿: ビットバーナー – How to Scan Every Server

返信を残す 返信をキャンセル

あなたのメールアドレスは公開されません. 必須フィールドにマークが付いています *

  • タイトル: ビットバーナー
  • 発売日:
  • 開発者:
  • 出版社:
Bitburner に関する情報はまだ不完全です. これを使用してゲームの詳細を記入するのにご協力ください。 お問い合わせフォーム.

免責事項

引用されたすべてのコンテンツはそれぞれの情報源から得られています. 当社があなたのコンテンツを許可なく使用したと思われる場合, 必ずご連絡ください。真剣に対応させていただきます.
  • 私たちに関しては
  • お問い合わせ
  • プライバシーポリシー
  • 利用規約

著作権 © 2025 ライオットビット.

搭載 プレスブックニュース ワードプレスのテーマ