Files
bitburner-src/markdown/bitburner.darknet.connecttosession.md
2026-03-19 21:07:43 -07:00

1.7 KiB

Home > bitburner > Darknet > connectToSession

Darknet.connectToSession() method

Attempts to connect to a target darkweb server that you have previously authenticated on. Unlike authenticate, connectToSession can be used to get a session on servers at any distance.

If successful, grants the script a session, allowing it to scp() files to that target. It also allows starting scripts with exec() on that target, if the target is directly connected to the server that the script is running on, or has a backdoor or stasis link.

If unsuccessful, more detail may be able to be gathered by using heartbleed() to look at the resulting logs on the server.

Note that the session granted is only for the current script instance (by PID) - other running scripts will need to use connectToSession with the correct password to also get a session with the target server.

Signature:

connectToSession(host: string, password: string): DarknetResult;

Parameters

Parameter

Type

Description

host

string

Hostname/IP of the target server to connect to existing session

password

string

The server's password, to verify the session

Returns:

DarknetResult

A DarknetResult object

Remarks

RAM cost: 0.05 GB