Hacknet-Extension-Tutorial


Hacknet-Extension-Tutorial / Content
ChronoVert  ·  2025-10-25

Nodes.md

Nodes

基本信息

Nodes,节点,是Hacknet中重要的一部分,玩家电脑,DHS,任务数据库,eos设备都属于Nodes
一个Nodes的结构大概如下:

 1<?xml version = "1.0" encoding = "UTF-8" ?>
 2<Computer id="advExamplePC" 
 3          name="Extension Example PC" 
 4          ip="167.194.132.7"
 5          security="2"
 6          allowsDefaultBootModule="false"
 7          icon="chip" 
 8          type="1" > 
 9    <adminPass pass="password" />
10    <account username="Matt" password="testpass" type="ALL" />
11    <ports>21, 22, 25, 80, 1433, 104, 6881, 443, 192, 554</ports>
12    <portsForCrack val="0" />
13    <trace time="5678" />
14    <admin type="fast" resetPassword="false" isSuper="false"/> 
15    <dlink target="advExamplePC2" />
16    <file path="home" name="Test_File.txt">This is a test file in the home directory</file>
17</Computer>

PS:第一行用于指定xml的版本和编码,在本教程中忽略,虽然在Node中不写这一行好像没有什么影响,但我们仍然建议写上这一行

我们可以看到,一个Node由<Computer>开始,并在该标签中指定一些属性,由</Computer>结束

Computer标签可以指定的属性有:

allowsDefaultBootModule

每个Node可以有一个或多个(或没有)daemon,daemon实现了如DHS,白名单,任务数据库这样的在Node上运行的程序

我们在游玩Hacknet本体或DLC时,总是一连接Node就会自动显示它的daemon(如啃得鸡服务器,CSEC任务数据库等)

该属性就用来控制这种特性,当allowsDefaultBootModule被指定为true时,玩家一旦连接该Node就会显示该Node所定义的最后一个daemon

若该属性被指定为false,则连接到该Node时会显示该节点的信息概览(登录,扫描系统,查看文件系统,扫描网络)而不会自动转到该Node所运行的daemon

icon

节点的icon可以有:

DLC专属:

这里还有一些描述不太清楚的,附上图片:

DLCLaptop

DLCPC1

DLCPC2:

DLCServer:

security

Node的security指定Node的安全等级

在没有覆写Node的属性时:
当security为1-3时,仅需破解端口即可入侵
当security为4或以上时,会自动添加:自动重置密码,代理和防火墙
可以重定义这些属性

其他属性

<Computer></Computer> 中可以定义Node的其他属性

下面是关于其他属性的详细信息:

adminPass

1<adminPass pass="password" />

硬编码该Node的管理员密码
pass : 管理员密码

account

1<account username="Matt" password="testpass" type="ALL" />

为该Node额外添加一个帐号,可以通过重复定义该属性添加多个帐号
username : 添加的帐号名
password : 添加的帐号密码
type : 帐号类型

帐号类型有:

你可以使用对应的数字或者直接填写类型来定义帐号类型

ports

1<ports>21, 22, 25, 80, 1433, 104, 6881, 443, 192, 554</ports>

定义该Node开放的端口

端口在<port></port> 中定义,以英文逗号隔开,空格可以省略

默认情况下,可用的端口有:

proxy

1<proxy time="2" />

为该Node定义代理,覆盖security的自带代理
time : 过载所需时间,乘以30为实际过载所需秒数,设置为-1禁用代理

portsForCrack

1<portsForCrack val="0" />

定义Node破解所需端口数
val : 破解所需的端口数,设置为101以上会启用EnSec(那个红条,无法porthack的)

firewall

1<firewall level="6" solution="Scypio" additionalTime="1.0"/>

定义Node的防火墙属性,可以覆盖security的自带代理
level : 防火墙等级,即破解口令的字符数量,设置为-1禁用防火墙
solution : 破解口令
additionalTime : 可选参数,分析每一级需要的时间,单位为秒

admin

1<admin type="fast" resetPassword="false" isSuper="false"/> 

用于实现玩家断开时重置代理,端口等特性
type : 管理员类型
resetPassword : 是否在断开时重置密码
isSuper : 是否为超级管理员

可用的管理员类型有:

示例:

1<admin type="fast" resetPassword="true" isSuper="true"/>

断开连接后立即重置管理员密码

1<admin type="progress"/>

在玩家非管理员状态下,断开连接后重置所有入侵状态,建议一般节点定义此属性

1<admin type="none"/>

不使用该特性,可以用来禁用由security大于等于4带来的自动重置特性

portRemap

1<portRemap>web=1234,22=2</portRemap>

端口映射,即实现类似DLC中端口非默认的效果
<portRemap></portRemap> 中定义,以原端口=目标端口定义,英文逗号隔开

原端口既可以写端口号,也可以是端口名称

如本例中,将web服务器端口重定向为1234,将22端口重定向为2

可用的端口名称有:

tracker

1<tracker />

为该Node启用被动追踪

被动追踪,指若玩家在该Node上留下了下载或删除文件的日志,就会受到AI自动攻击(forkbomb)

若存在CSEC_Member的flag,则玩家会受到类似CCC黑客小队的红屏攻击

dlink

1<dlink target="advExamplePC2" />

定义该Node被scan后可以扫出的节点,可以通过重复定义该属性添加多个可以扫描到的节点

target : 连接的节点ID

positionNear

1<positionNear target="advExamplePC2" position="1" total="3" extraDistance="0.1" force="false"/>

定义该Node距离其他某个Node的距离
//FIXME

file

1<file path="home" name="Test_File.txt">This is a test file in the home directory</file>

在该Node中添加文件

path : 文件路径
name : 文件名

<file></file> 标签中定义文件内容

PS:文件内容支持多行,可以使用自替换占位符

customthemefile

1<customthemefile path="sys" name="Custom_x-server.sys" themePath="Themes/SecondaryTheme.xml"/>

向Node中添加自定义的主题文件(x-server.sys)
path : 主题文件的存放路径
name : 主题文件名
themePath : 该自定义主题的定义在扩展根目录的相对路径

encryptedFile

1<encryptedFile path="home" name="asdf2.dec" ip="192.168.1.1" header="This is the header" pass="password">
2    This is an encrypted file referenced in ExampleMission.xml
3  </encryptedFile>

向Node中添加DEC加密文件
path : 加密文件路径
name : 加密文件名
ip : DECHead.exe扫出的头信息IP
header : DECHead.exe扫出的头信息
pass : 可选属性,定义该文件的密码

可在<encryptedFile></encryptedFile> 中添加加密文件内容,可使用自替换占位符

eosDevice

 1<eosDevice name="Deliliah's ePhone 4S" id="eosIntroPhone" icon="ePhone2" empty="true" passOverride="notAlpine">
 2    <note>TestNote
 3More text</note>
 4    <note>Note filenames
 5Note filenames are generated automatically by taking the first line of the file
 6(in this case "Note Filenames") and replacing spaces with underscores.</note>
 7    <mail username="test@jmail.com" pass="thisIstheaccountpass" />
 8    <mail username="test2@jmail.com" pass="YouCanHaveLotsOfThese" />
 9    <file path="eos/test" name="crackedFile.txt">This is mostly useful for jailbroken phones</file>
10  </eosDevice>

为该Node添加连接的eos设备,可以通过重复定义该属性添加多个eos设备

name : eos设备名
id : eos设备ID,相当于节点ID
icon : eos设备图标,和节点图标定义一致
empty : 是否生成垃圾文件
passOverride : 可选属性,重新定义该eos设备的管理员密码(默认为alpine)

可在<eosDevice></eosDevice> 中定义该eos设备的属性

eos设备可以定义的属性有:

note

1<note>TestNote
2More text</note>

添加笔记(/eos/Note中)
第一行为笔记的标题(在/eos/Note中的文件名)
从第二行开始为笔记正文

mail

1<mail username="test@jmail.com" pass="thisIstheaccountpass" />

添加邮箱帐号,重复定义以添加多个邮箱帐号
username : 邮箱地址
pass : 邮箱密码
PS:仍需要在目标邮件服务器中添加邮箱帐号

file

用法与普通Node相同,省略

Daemons

Daemons(守护进程)为在Node上运行的各种程序
原版中的通用医疗和国际学术数据库等,本质上只是普通的Node,只是添加了Daemon来实现效果

mailServer

 1<mailServer name="Example Mail Server" color="50,237,212" generateJunk="true">
 2    <email recipient="mailGuy" sender="Sender Guy" subject="Adding an email!">
 3This is how you add emails to the mail server - logging in with someone's account
 4will show these just like the way the player gets emails.
 5    </email>
 6    <email recipient="mailGuy" sender="Spam" subject="amazing features">
 7You can have as many of these as you want
 8    </email>
 9    <email recipient="Matt" sender="Spam" subject="amazing features">
10Different users too
11    </email>
12</mailServer>

邮件服务器
name : 显示的邮件服务器名
color : 邮件服务器主题色的rgb表示
generateJunk : 是否生成垃圾邮件

该Daemon可以定义的属性有:

email

1<email recipient="Matt" sender="Spam" subject="amazing features">
2Different users too
3</email>

往邮件服务器中存储邮件
recipient : 接收者
sender : 发送者
subject : 标题
标签值为邮件内容

IRCDaemon

1<IRCDaemon name="IRC Chat" themeColor="215,218,51"      needsLogin="false">
2        <user name="Bit" color="239,30,30" />
3        <user name="Channel" color="31,0,232" />
4        <post user="Bit">I am DEAD</post>
5</IRCDaemon>

类似kaguya的DHS服务器,但是没有任务系统 name : IRC的名字 themeColor : IRC的主题颜色 needsLogin : 访问IRC是否需要登录?

user

1<user name="Bit" color="239,30,30" />

主要用于给特定的用户名定义颜色

post

1<post user="Bit">I am DEAD</post>

给IRC服务器添加一条聊天记录 user : 用户名

uploadServerDaemon

1<uploadServerDaemon name="Upload Dropbox" folder="Drop" 
2                      needsAuth="false" color="204,116,212"/>

类似CSEC的上传服务器
name : 显示的上传服务器名
folder : 文件上传到的目录
needsAuth : 是否需要取得管理员权限才能上传文件
color : 上传服务器主题色的rgb表示

addWebServer

1<addWebServer name="Website Server"
2                url="Web/ExampleWebsite/ExampleWebsite.html" />

类似Entech的网站服务器
name : 在网页界面现实的网站名
url : 显示的网页在扩展的相对路径

deathRowDatabase

1<deathRowDatabase />

死亡人员数据库
数据从扩展的People目录中读取

academicDatabase

1<academicDatabase />

国际学术数据库
数据从扩展的People目录中读取

ispSystem

1<ispSystem />

ISP数据库

messageBoard

1<messageBoard name="Custom Board Name!">
2    <thread>Docs/MessageBoardThreads/ExampleThread1.txt</thread>
3    <thread>Docs/MessageBoardThreads/ExampleThread2.txt</thread>
4  </messageBoard>

类似/el论坛的论坛
name : 显示的论坛名

该Daemon可用的属性有:

thread

1<thread>Docs/MessageBoardThreads/ExampleThread2.txt</thread>

往该论坛中添加信息
标签值为要显示的数据在扩展的相对路径
关于显示数据的格式,请参阅Docs

MedicalDatabase

1<MedicalDatabase />

通用医疗数据库
数据从扩展的People目录中读取

HeartMonitor

1<HeartMonitor patient="J_Stalvern"/>

心脏起搏器
patient : 佩戴者的名字,可通过指定flag<Name>:DEAD(不加尖括号)来使佩戴者死亡

PointClicker

1<PointClicker />

PointClicker

SongChangerDaemon

1<SongChangerDaemon /> 

类似Hacknet原版最后制作组与花絮的换歌Daemon

variableMissionListingServer

1<variableMissionListingServer name="example listing server" iconPath="Logo.png" articleFolderPath="Docs/ListingServerArticles" color="120,200,2" assigner="false" public="false" title="This is the rendered title of the server"/>

类似Slashbot和Kellis帮助服务器的新闻服务器
name : 显示的新闻服务器名
iconPath : 显示的图标在扩展的相对路径
articleFolderPath : 存储新闻的目录在扩展的相对路径(PS:新闻以mission的格式存储)
color : 新闻服务器主题色的rgb表示
assigner : 是否将新闻当作任务处理(参考Entopy任务服务器)
public : 是否需要登录才能查看内容(参考Entopy任务服务器,false为需要,true为不需要)
title : 新闻服务器显示的标题

missionHubServer

1<missionHubServer groupName="ExTech" serviceName="Example Tech Contract Hub" missionFolderPath="Missions/Misc" themeColor="200,10,10" lineColor="255,80,80" backgroundColor="20,20,20" allowAbandon="false"/>

类似CSEC的任务数据库
groupName : 任务组名
serviceName : 显示的数据库名
missionFolderPath : 任务目录在扩展的相对路径
themeColor : 数据库主题色的rgb表示
lineColor : 数据库下边冒出的一排线的颜色的rgb表示
backgroundColor : 数据库背景色的rgb表示

CreditsDaemon

1<CreditsDaemon Title="intro Extension Ending Credits" ButtonText="Complete" ConditionalActionSetToRunOnButtonPressPath="Actions/CreditsRunActions.xml"/>

鸣谢服务器,一般用于扩展结束后的Credit节点
Title : 显示的标题
ButtonText : 初次连接到服务器时显示的按钮文字(点了后才会显示鸣谢名单)
ConditionalActionSetToRunOnButtonPressPath : 在按了按钮后执行的Action在扩展的相对路径,若不需要可以不写该属性

FastActionHost

1<FastActionHost />

FastActionHost支持
当为Node添加该Daemon后,该Node可以指定为可以延迟的Action的DelayHost
注:请尽量使用在扩展中不出现的节点作为DelayHost