aptClient
A aptClient
object can be obtained by using include_lib. The classID
used for this object is "aptclientLib"
.
add_repo(repository: string, port: number = 1542
): "Unknown error: Unable to access to local computer""/etc/apt/sources.txt does not exist""${repository} it is already added to sources.txt""/etc/apt/sources.txt content is malformed."
copyInserts a repository address into the "/etc/apt/sources.txt"
file. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
. On success, it will return an empty string
. In case of failure, it will return a string
with an error message.
aptClient = include_lib("/lib/aptclient.so")
result = aptClient.add_repo("177.202.15.132")
if result == "" then
print "Addition successful!"
else
print "Error while adding: " + result
end if
check_upgrade(filepath: string
): "No internet access.""Remote host is down""Unable to find service ${service}""Invalid target service port configuration.""connection rejected: port forward removed by admin""Unable to connect: missing ${library}""Unable to connect: invalid ${library}""Unexpected library found. Not a valid ${library} library.""Unknown error""Fatal error: ${filepath} corrupted!""Kernel panic: missing ${filepath} file!""Graphics error: ${filepath} not found!""Fatal error: ${filepath} not found!""Connection refused. Address unreachable""Connection refused. The target is behind a firewall.""ip address not found""can't connect: the remote server has been temporarily disabled due to non-payment""can't connect: port ${port} not found""can't connect: port closed""can't connect: There is no active machine behind the port ${port}""can't connect: service not found behind the port ${port}""Unknown error: Unable to access to local computer""apt_check_upgrade: No internet access.""/etc/apt/aptcache.bin not found. Launch apt with the update option to refresh the file""package name can not be empty""${filepath} does not exist in this filesystem""${serviceDBFile} does not exist in the server""apt folder content does not exist in the server""${filepath} does not exist in the server""${serviceDBFile} file content is malformed in the server""/etc/apt/aptcache.bin content is malformed. Launch apt with the update option to refresh the file""${filepath} not found in the server"10
copyChecks if there is a newer version of the program or library in the repository. If the provided filepath value is anything other than a string
, this method will return null
. On success, it will return a number
, which can be either zero or one. Zero indicates that there is no new version, while one indicates that there is a new version available. In case of failure, it will return a string containing an error message.
aptClient = include_lib("/lib/aptclient.so")
result = aptClient.check_upgrade("/bin/rshell_interface")
if result == 0 then
print "Program doesnt need an update!"
else if result == 1 then
print "Program does need an update!"
else
print "Error while checking version: " + result
end if
del_repo(repository: string
): "Unknown error: Unable to access to local computer""/etc/apt/sources.txt does not exist""${repository} not found in sources.txt""/etc/apt/sources.txt content is malformed."
copyDeletes a repository address from the "/etc/apt/sources.txt"
file. If the provided repository value is anything other than a string
, this method will return null
. On success, it will return an empty string
. In case of failure, it will return a string
with an error message.
aptClient = include_lib("/lib/aptclient.so")
result = aptClient.del_repo("177.202.15.132")
if result == "" then
print "Deletion successful!"
else
print "Error while deleting: " + result
end if
install(package: string, customPath: string = ""
): "unknown error""Invalid path""${filepath} not found""permission denied""permission denied. ${filename} is protected""The copy can not be made. Reached maximum number of files in a folder""The copy can not be made. Reached maximum limit""No internet access.""Remote host is down""Unable to find service ${service}""Invalid target service port configuration.""connection rejected: port forward removed by admin""Unable to connect: missing ${library}""Unable to connect: invalid ${library}""Unexpected library found. Not a valid ${library} library.""Unknown error""can't connect: invalid or missing kernel_router.so in the target router""can't connect: unexpected library found. Not a valid kernel_router.so library in the target router.""Connection refused. Address unreachable""Connection refused. The target is behind a firewall.""Fatal error: ${filepath} corrupted!""Kernel panic: missing ${filepath} file!""Graphics error: ${filepath} not found!""Fatal error: ${filepath} not found!""ip address not found""can't connect: the remote server has been temporarily disabled due to non-payment""can't connect: port ${port} not found""can't connect: port closed""can't connect: There is no active machine behind the port ${port}""can't connect: service not found behind the port ${port}""Unknown error: Unable to access to local computer""apt_install: No internet access.""/etc/apt/aptcache.bin not found. Launch apt with the update option to refresh the file""package name can not be empty""There is not enough free space on the hard disk.""${customPath} not found.""${serviceDBFile} does not exist in the server""apt folder content does not exist in the server""${package} does not exist in the server""/etc/apt/aptcache.bin content is malformed. Launch apt with the update option to refresh the file""${package} not found in the server"1
copyInstalls a program or library from a remote repository listed in "/etc/apt/sources.txt"
. If no path is specified, the program installs in "/lib"
if it is a library or in "/bin"
otherwise. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
. On success, this method will return a number
with the value one. In case of failure, it will return a string
containing an error message.
aptClient = include_lib("/lib/aptclient.so")
result = aptClient.install("rshell_interface")
if result == 1 then
print "Installed program successful!"
else
print "Error while installing: " + result
end if
search(search: string
): "Unknown error: Unable to access to local computer""/etc/apt/aptcache.bin not found. Launch apt with the update option to refresh the file""${search} not found in any repository""/etc/apt/aptcache.bin content is malformed. Launch apt with the update option to refresh the file"
copySearch specifically looks for a package in any of the repositories listed in "/etc/apt/sources.txt"
. If the provided search value is anything other than a string
, this method will return null
. On success, it will return a string
containing all packages that partially match the provided search value. On failure, it will return a string
with various error messages.
aptClient = include_lib("/lib/aptclient.so")
packages = aptClient.search(".so")
packageList = packages.split(char(10) + char(10))
for packageItem in packageList
entry = packageItem.split(char(10))
if entry.len != 2 then
print "something wrong in: " + entry
continue
end if
packageName = entry[0]
packageDescription = entry[1]
print "Title: <b>" + packageName + "</b>"
print "Description: <i>" + packageDescription + "</i>"
print "----------------------------"
end for
show(repository: string
): "Unknown error: Unable to access to local computer""/etc/apt/aptcache.bin not found. Launch apt with the update option to refresh the file""${repository} repository not found""/etc/apt/aptcache.bin content is malformed. Launch apt with the update option to refresh the file"
copyShow displays all the packages available in a repository. The repository must be listed in the "/etc/apt/sources.txt"
file. If the provided repository value is anything other than a string
, this method will return null
. If it cannot find a repository, it will return various error messages. On success, it will return a string
containing all packages and their descriptions, with each entry separated by a newline.
aptClient = include_lib("/lib/aptclient.so")
packages = aptClient.show("177.202.15.132")
packageList = packages.split(char(10) + char(10))
packageList.pop // remove last empty item
for packageItem in packageList
entry = packageItem.split(char(10))
packageName = entry[0]
packageDescription = entry[1]
print "Title: <b>" + packageName + "</b>"
print "Description: <i>" + packageDescription + "</i>"
print "----------------------------"
end for
update(): "Unknown error: Unable to access to local computer""apt_update: No internet access.""${source} repository not found""/etc/apt/sources.txt content is malformed"0
copyUpdate refreshes the list of available packages after adding a new repository in "/etc/apt/sources.txt"
, or if the remote repository has updated its information in "/server/conf/repod.conf"
. If the update is successful, an empty string
will be returned. In case of failure, a string
with an error message will be returned. If for some reason the "/etc/apt/sources.txt"
is malformed this method will return a number with the value zero.
aptClient = include_lib("/lib/aptclient.so")
result = aptClient.update
if result == "" then
print "Update successful!"
else
print "Error while updating: " + result
end if
blockchain
A blockchain
object can be obtained by using include_lib. The classID
used for this object is "blockchainLib"
.
amount_mined(coinName: string
): "Unknown error: Unable to access to local computer""amount_mined: No internet access.""amount_mined: Coin does not exist."
copyReturns a number
representing the total amount of mined coins. In case of an error, it will return a string
with the details. If the provided coinName is anything other than a string
, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
mined = blockchain.amount_mined("test")
if typeof(mined) == "string" then
exit "Couldnt get amount mined due to: " + mined
end if
print "Your mined amount is " + mined
coin_price(coinName: string
): "Unknown error: Unable to access to local computer""coin_price: No internet access.""coin_price: Coin does not exist."
copyReturns a number
representing the current unit value of the cryptocurrency. In case of an error, a string
with the error details will be returned. If the provided coinName
is anything other than a string
, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
price = blockchain.coin_price("test")
if typeof(price) == "string" then
exit "Couldnt get coin price due to: " + price
end if
print "Your coin price is " + price
create_wallet(user: string, password: string
): "Error: Wallet user already exists.""Error: Only one wallet per player allowed.""Unknown error: Unable to access to local computer""create_wallet: No internet access.""Error: only alphanumeric allowed as name and password""create_wallet: name and password cannot exceed the 16 character limit.""Error: It is necessary to have a bank account to be able to create a wallet."
copyCreates a wallet
and returns a wallet
object on success, which can be used to manage cryptocurrencies. In case of an error, it will return a string
with the details. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = blockchain.create_wallet("test", "test")
if typeof(wallet) == "string" then
print "Wallet creation failed due to: " + wallet
else
print "Wallet creation was successful!"
end if
delete_coin(coinName: string, user: string, password: string
): "Error: ${coinname} does not exist""Error: incorrect user/password""Unknown error: Unable to access to local computer""delete_coin: No internet access."1
copyRemoves a cryptocurrency from the world. The credentials used in the creation of the cryptocurrency are required. On success, it will return a number
with the value one. On failure, it will return a string
containing details. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
result = blockchain.delete_coin("test", "test", "test")
if typeof(result) == "string" then
exit "Couldnt delete coin due to: " + result
end if
print "Coin got deleted"
get_coin(coinName: string, user: string, password: string
): "Unknown error: Unable to access to local computer""get_coin: No internet access.""get_coin: Incorrect user/password"
copyReturns a coin
object used to manage the currency. In case of an error, it will return a string
with the details. If any of the provided parameters deviate from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
if typeof(coin) != "coin" then
exit "Couldnt get coin object due to: " + coin
end if
print "Your coin address is " + coin.get_address
get_coin_name(user: string, password: string
): "Unknown error: Unable to access to local computer""get_coin_name: No internet access.""get_coin_name: Incorrect user/password""get_coin_name: No currency has been found"
copyReturns a string
with the name of the coin owned by the player. In case of an error, it returns a string
with details. If any provided parameters deviate from the defined signature, this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coinName = blockchain.get_coin_name("test", "test")
if not coinName.matches("^[A-Z]+$") then
exit "Couldnt get coin name due to: " + coinName
end if
print "The name of the coin you're owning is " + coinName
login_wallet(user: string, password: string
): "Unknown error: Unable to access to local computer""login_wallet: No internet access.""login_wallet: Account not found or incorrect password"
copyReturns a wallet
object on success. In case of an error, it will return a string
indicating the reason. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = blockchain.login_wallet("test", "test")
if typeof(wallet) == "string" then
print "Login failed due to: " + wallet
else
print "Login was successful!"
end if
show_history(coinName: string
): map<number,list<any>>orstringornull
"Unknown error: Unable to access to local computer""show_history: No internet access."
copyReturns a map
with the latest changes in the value of a specific cryptocurrency. The key of the map
is an index represented by a number
. The value is a list
, where index 0 is the historical price of the coin and index 1 is the date when the price change occurred. If the provided coinName
is anything other than a string
or if no coin exists with this name, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
history = blockchain.show_history("test")
if typeof(history) == "string" then
exit "Couldnt fetch history due to: " + history
else if history == null then
exit "There doesnt seem to be a coin"
end if
for entry in history.values
price = entry[0]
date = entry[1]
print "The price on " + date + " was " + price
end for
class
A class or object is a map
with a special __isa
entry that points to the parent. This is set automatically when you use the new
operator.
Shape = { "sides": 0 }
Square = new Shape
Square.sides = 4
x = new Square
print(x.sides) // 4
coin
A coin
object can be obtained by using get_coin. The classID
used for this object is "coin"
.
create_subwallet(walletID: string, pin: string, subWalletUser: string, subWalletPass: string
): "Error: Wallet does not exists.""Error: Coin does not exist.""Error: This username already exists""Error: Incorrect PIN""Error: only a maximum of 10 subwallets per coin is allowed.""Unknown error: Unable to access to local computer""error: No internet access."1
copyRegisters a new account in the coin
that can be used to manage services such as stores. It is necessary to provide the PIN of the owner's wallet
that wants to register. In case of success, the method will return a number
with the value one. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
. In case of an error, a string
with the details is returned.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
wallet = blockchain.login_wallet("test", "test")
result = coin.create_subwallet("test", wallet.get_pin, "test", "test")
if typeof(result) == "string" then
exit "Failed to create subwallet due to: " + result
end if
print "Successfully created subwallet!"
get_address(): "Error: ${coinName} does not exist""Unknown error: Unable to access to local computer""error: No internet access."
copyReturns the configured address that will be shown to users who do not have the currency, indicating where they have to register. In case of an error, it returns a string
with details.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
result = coin.get_address
if not is_valid_ip(result) then
exit "Failed to get address due to: " + result
end if
print "address: " + result
get_cycle_mining(): "Unknown error: Unable to access to local computer""error: No internet access."
copyReturns a number
representing the defined interval in which each user receives a coin reward when mining. In case of failure, the method will return a string
with details.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
result = coin.get_cycle_mining
if typeof(result) == "string" then
exit "Failed getting cyclic mining value due to: " + result
end if
print "cyclic mining value: " + result
get_mined_coins(): "Unknown error: Unable to access to local computer""error: No internet access."
copyReturns a number
representing the amount of coins that have been mined so far. In case of an error, it returns a string
with details.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
result = coin.get_mined_coins
if typeof(result) == "string" then
exit "Failed to get mined coins due to: " + result
end if
print "mined coins: " + result
get_reward(): "Unknown error: Unable to access to local computer""error: No internet access."
copyReturns a number
representing the amount of coins that will be received as a reward after each mining cycle. In case of failure, the method will return a string
with details.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
result = coin.get_reward
if typeof(result) == "string" then
exit "Failed getting reward value due to: " + result
end if
print "reward value: " + result
get_subwallet(subWalletUser: string
): "Unknown error: Unable to access to local computer""error: No internet access.""get_subwallet: The account does not exist"
copyReturns a subWallet
object on success. In case of error, it returns a string
with the details. If the provided subWalletUser
is not a string
, this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
result = coin.get_subwallet("test")
if typeof(result) == "string" then
exit "Failed to get subwallet due to: " + result
end if
print "Successfully received subwallet!"
get_subwallets(): "Unknown error: Unable to access to local computer""error: No internet access."
copyReturns a list
where each item is a subWallet
object, including all the accounts registered in the cryptocurrency. In case of error, it returns a string
with the details.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
result = coin.get_subwallets
if typeof(result) == "string" then
exit "Failed to get subwallets due to: " + result
end if
for subwallet in result
print subwallet.get_user + " has " + subwallet.get_balance + " coins"
end for
reset_password(newPassword: string
): "Error: coin does not exist""Error: Only the account owner can change the password""Unknown error: Unable to access to local computer""error: No internet access.""reset_password: only alphanumeric characters are allowed as password""reset_password: name and password cannot exceed the 16 character limit."1
copyResets the password of the coin. It returns a number
with the value one if resetting was successful; otherwise, it will return a string
.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
result = coin.reset_password("test")
if typeof(result) == "string" then
exit "Failed to reset password due to: " + result
end if
print "Successfully reset password"
set_address(address: string
): "Error: ${coinName} does not exist""Unknown error: Unable to access to local computer""error: No internet access.""set_address: address ${address}not found"1
copyConfigures a valid address that will be shown to users who do not have the currency, indicating where to register. In case of an error, it returns a string
with the details. In case of success, a number
with a value of one will be returned. If the provided address is not a string
, this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
result = coin.set_address("12.12.12.12")
if typeof(result) == "string" then
exit "Failed to set address due to: " + result
end if
print "Successfully set address!"
set_cycle_mining(rateHours: number = 3
): "Unknown error: Unable to access to local computer""error: No internet access.""the mining cycle cannot exceed the maximum of 2160 hours""the mining cycle cannot be less than 1 hour"1
copyDefines the interval (in-game hours) in which each user receives a coin reward when mining. The interval cannot be lower than 1 and not higher than 2160. If the provided rateHours
is not a number
, this method will return null
. On success, it will return a number
with the value one. In case of failure, the method will return a string
with details.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
result = coin.set_cycle_mining(20)
if result == 1 then
print "Successful updated mining interval"
else
print "Failed updating mining interval"
end if
set_reward(coinAmount: number = 1
): "Unknown error: Unable to access to local computer""error: No internet access.""Error: The reward cannot be less than 1 coin""Error: Coin does not exist"1
copyAssigns the reward that miners will receive after each mining cycle. The reward value has to be above one. If the provided coinAmount
is not a number
, this method will return null
. On success, it will return a number
with the value one. In case of failure, the method will return a string
with details.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
result = coin.set_reward(-1)
if typeof(result) == "string" then
exit "Failed setting reward due to: " + result
end if
print "Successfully set reward!"
transaction(subWalletOrig: string, subWalletDest: string, valAmount: number
): "Error: coin does not exist""Error: ${subWalletOrig} not found""Error: ${subWalletDest} not found""Error: wallet ${subWalletOrig} does not exist""Error: target wallet does not exist""${subWalletOrig} need to be registered in ${coinName} to be able to receive this coin.""Error: subwallet ${subWalletDest} does not have coins in the selected currency""Error: insufficient funds to complete the transaction""Unknown error: Unable to access to local computer""error: No internet access.""Error: amount value cannot be less than 1"1
copyFacilitates a transaction of the currency between the indicated subwallets. In case of an error, a string
with the details is returned. In case of success, a number
with a value of one will be returned. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
result = coin.transaction("test", "test2", 20)
if typeof(result) == "string" then
exit "Failed transaction due to: " + result
end if
print "Successfully transfered!"
computer
A computer
object can be obtained by either using host_computer or overflow. The classID
used for this object is "computer"
.
File(path: string
):
copyReturns a file
located at the path provided in the arguments. The path can be either relative or absolute. It's important to note that any file
object can represent a folder as well. If the provided path cannot be resolved, meaning that no file or folder exists, this method will return null
. Providing any other type than string
or an empty value for the path will result in an error, interrupting the script execution.
filePath = "/etc/passwd"
file = get_shell.host_computer.File(filePath)
if file != null then
print(file.get_content)
else
print("File at given path " + filePath + " does not exist.")
end if
active_net_card():
copyReturns a string
which contains either the keyword "WIFI"
or "ETHERNET"
depending on the connection type your computer is currently using.
hostComputer = get_shell.host_computer
netCard = hostComputer.active_net_card
print("Connected by: " + netCard)
change_password(username: string, password: string
): "Error: only alphanumeric allowed as password.""Error: the password cannot exceed the limit of 15 characters.""Denied. Only root user can execute this command.""user ${username} does not exist"1
copyChanges the password of an existing user on the computer
. Root access is necessary to successfully change the password. Passwords can only include alphanumeric characters and cannot exceed 15 characters. If the password change fails, this method will return a string
containing information on why it failed. If the change succeeds, it will return a number
with the value one. If the provided username is empty, an error will be thrown, preventing any further script execution. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
hostComputer = get_shell("root", "test").host_computer
changeResult = hostComputer.change_password("test", "newPassword")
if typeof(changeResult) == "string" then
print("There was an error when changing the password: " + changeResult)
else
print("Password got successfully changed.")
end if
close_program(pid: number
): "Permission denied. PID ${pid} belongs to user <b>${username}</b>""Permission denied. Process protected.""Unable to close this process. The process belongs to this script."10
copyCloses a program associated with the provided PID. You can see the list
of active programs by either using show_procs
or typing ps into your terminal. To close a program, you need to either be the owner of the running process or root. If closing the program fails, this method will return a string
containing details. On success, it will return a number
with the value one. If there is no process with the provided PID, this method will return a number
with the value zero. If the provided PID is anything other than a number
, this method will return null
.
hostComputer = get_shell("root", "test").host_computer
processes = hostComputer.show_procs.split(char(10))[1:]
pid = processes[1].split(" ")[1]
closeResult = hostComputer.close_program(pid.to_int)
if typeof(closeResult) == "string" then
print("There was an error when closing a program: " + closeResult)
else
print("Program with pid " + pid + " got successfully closed.")
end if
connect_ethernet(netDevice: string, address: string, gateway: string
): "Error: Ethernet card not connected to the network""Unable to find ISP network to connect using Ethernet card""can't connect: the home network has been temporarily disabled due to non-payment""Error: the gateway cannot be the same device to connect""Error: gateway ${gateway} does not exist in the network""Error: address ${address} is already in use.""Unknown error: The current IP ${localIp} does not exist in this network""Error: unable to run command on routers/switches""connect_ethernet: permission denied. Guest users can not execute this method""Error: Invalid IP address""Error: invalid gateway""Error: the IP address and the gateway must belong to the same subnet""connect_ethernet: Network device not found""connect_ethernet: Only ethernet cards are supported"
copySets up a new IP address on the computer through the Ethernet connection. It's not possible to set up a new IP address while being logged in as a guest. On failure, this method will either return a string
with details or null
. On success, it will return an empty string
. If any of the provided parameters have a type that deviates from the defined signature or the computer is not connected to the internet, an error will be thrown, preventing any further script execution.
hostComputer = get_shell.host_computer
connectionResult = hostComputer.connect_ethernet("eth0", "192.168.0.4", get_router.local_ip)
if typeof(connectionResult) == "string" then
print("There was an error while connecting: " + connectionResult)
else
print("Connected successfully.")
end if
connect_wifi(netDevice: string, bssid: string, essid: string, password: string
): "connect_wifi: permission denied. Guest users can not execute this method""connect_wifi: Network device not found""connect_wifi: Only wifi cards are supported""Can't connect. Incorrect password.""Can't connect. Router not found.""can't connect: the remote server has been temporarily disabled due to non-payment""Can't connect. Target is out of reach."1
copyConnects to the indicated Wi-Fi network. It's not possible to connect to a new Wi-Fi while being logged in as a guest. If connecting to a new Wi-Fi fails, this method will return a string
containing details. On success, it will return a number
with the value one. Wi-Fi networks can be found via wifi_networks
or by typing iwlist as a command in the terminal. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
hostComputer = get_shell.host_computer
networks = hostComputer.wifi_networks
firstNetwork = networks[0].split(" ")
BSSID = firstNetwork[0]
ESSID = firstNetwork[2]
connectionResult = hostComputer.connect_wifi("wlan0", BSSID, ESSID, "wifi-password")
if typeof(connectionResult) == "string" then
print("There was an error while connecting to new Wifi: " + connectionResult)
else
print("Connected to new Wifi successfully.")
end if
create_folder(path: string, folder: string = "newFolder"
): "Unknown error.""Error: empty destination path""Error: only alphanumeric allowed as folder name.""Error: name cannot exceed the limit of 128 characters.""permission denied""${filename} file exists""Can't create folder. Reached maximum limit""The copy can not be made. Reached maximum number of files in a folder""The maximum number of subfolders has been exceeded""create_folder: path too large""Error: invalid path"1
copyCreates a folder at the path provided in the arguments. There are certain limitations to creating a folder: the folder name has to be alphanumeric and below 128 characters. Creation will fail if there is already a folder in place or if there are lacking permissions. Additionally, there is a folder limit of about 250 in each folder and 3125 folders in the computer overall. In case the folder creation fails, the method will return a string
with details. In case of success, it will return a number
with the value one. Providing any type that deviates from the signature or using this method in an SSH encryption process will cause an error to be thrown, aborting further script execution.
path = "/home/" + active_user + "/Desktop"
hostComputer = get_shell.host_computer
createResult = hostComputer.create_folder(path, "myfolder")
if typeof(createResult) == "string" then
print("There was an error when creating the folder: " + createResult)
else
print("Folder got created at given path " + path)
end if
create_group(username: string, group: string
): "Error: only alphanumeric allowed as user and group names.""Denied. Only root user can execute this command.""Error: user ${username} does not exist."1
copyCreates a new group associated with an existing user on the computer
. Root access is necessary to successfully create a group. There are limitations when creating a group, such as a character limit of 15 and that the group name may only contain alphanumeric characters. If the group creation fails, this method will return a string
containing the cause of failure. On success, it will return a number
with the value one. If the provided arguments are empty or the username exceeds 15 characters, an error will be thrown, interrupting further script execution. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
hostComputer = get_shell("root", "test").host_computer
creationResult = hostComputer.create_group("test", "staff")
if typeof(creationResult) == "string" then
print("There was an error when creating a group: " + creationResult)
else
print("Group got successfully created.")
end if
create_user(usename: string, password: string
): "Error: root user already exists.""Error: can't create guest user. Reserved user.""Error: can't create user. ${username} already exists.""Error: only alphanumeric allowed as user name and password.""Denied. Only root user can execute this command.""Denied. Maximum number of registered users reached."1
copyCreates a user on the computer
with the specified name and password. Root access is necessary to successfully create a user. Both the username and password cannot exceed more than 15 characters and must be alphanumeric. There cannot be more than 15 users created on the same computer
. If the creation fails, this method will return a string
containing the reason for the failure. On success, it will return a number
with the value one. If the provided username is empty or either of the values exceeds 15 characters, an error will be thrown, interrupting further script execution. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
hostComputer = get_shell("root", "test").host_computer
creationResult = hostComputer.create_user("newUser", "123")
if typeof(creationResult) == "string" then
print("There was an error when creating an user: " + creationResult)
else
print("User got successfully created.")
end if
delete_group(username: string, group: string
): "Denied. Only root user can execute this command.""Error: user ${username} does not exist.""Error: group ${group} not found in user ${username}"1
copyDeletes an existing group associated with an existing user on the computer
. Root access is necessary to successfully delete a group. If the group deletion fails, this method will return a string
containing the cause of failure. On success, it will return a number
with the value one. If either of the provided values is empty, an error will be thrown, preventing further script execution. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
hostComputer = get_shell("root", "test").host_computer
deletionResult = hostComputer.delete_group("test", "staff")
if typeof(deletionResult) == "string" then
print("There was an error when deleting a group: " + deletionResult)
else
print("Group got successfully deleted.")
end if
delete_user(username: string, removeHome: number = 0
): "Denied. Only root user can execute this command.""can't delete user. ${username} does not exist""the root user can't be deleted.""sorry, at the moment that account can't be deleted.""user ${username} not found."1
copyDeletes the indicated user from the computer
. It can optionally delete the user's home folder as well, although by default the home folder will not be deleted. Root access is necessary to successfully delete a user. Keep in mind that you cannot delete the root user. If the deletion fails, this method will return a string
containing the cause of failure. On success, it will return a number
with the value one. If the provided username is empty, an error will be thrown, interrupting further script execution. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
hostComputer = get_shell("root", "test").host_computer
deletionResult = hostComputer.delete_user("test", true)
if typeof(deletionResult) == "string" then
print("There was an error when deleting an user: " + deletionResult)
else
print("User got successfully deleted.")
end if
get_name():
copyReturns the hostname of the machine.
computerName = get_shell.host_computer.get_name
print("The name of your machine is " + computerName)
get_ports():
copyReturns a list
of port
s on the computer
that are active.
router = get_router
ports = get_shell.host_computer.get_ports
for port in ports
print("Info: " + router.port_info(port))
end for
groups(username: string
): "Error: user ${username} does not exist."
copyReturns a string
containing groups associated with an existing user on the computer
. If the user does not exist, a string
with an error message will be returned. If the provided username is empty, an error will be thrown, preventing further script execution. If the provided username is anything other than a string
, this method will return null
.
hostComputer = get_shell("root", "test").host_computer
hostComputer.create_group("root", "staff")
groups = hostComputer.groups("root")
listOfGroups = groups.split(char(10))
print(listOfGroups)
is_network_active(): 01
copyReturns a number
with either the value one or zero. If the computer
has internet access, the value will be one. If there is no internet access, it will return zero instead.
hostComputer = get_shell.host_computer
if hostComputer.is_network_active then
print("You're connected.")
else
print("You're not connected.")
end if
local_ip():
copyReturns a string
with the local IP address of the computer
.
localIp = get_shell.host_computer.local_ip
print("Local ip:" + localIp)
network_devices():
copyReturns a string
containing information about all network devices available on the computer
. Each item includes details about the interface name, chipset, and whether monitoring support is enabled.
hostComputer = get_shell.host_computer
devices = hostComputer.network_devices
deviceList = devices.split(char(10))
for item in deviceList
print(item)
end for
network_gateway():
copyReturns a string
with the gateway IP address configured on the computer.
hostComputer = get_shell.host_computer
gatewayIp = hostComputer.network_gateway
print("Gateway IP: " + gatewayIp)
public_ip():
copyReturns a string
with the public IP address of the computer
.
publicIp = get_shell.host_computer.public_ip
print("Public ip:" + publicIp)
show_procs():
copyReturns a string
with an overview of all active processes on the computer
, including information about the user, PID, CPU, memory, and command. Using this method in an SSH encryption process will cause an error to be thrown, preventing any further script execution.
hostComputer = get_shell.host_computer
procs = hostComputer.show_procs
list = procs.split(char(10))[1:]
processes = []
for item in list
parsedItem = item.split(" ")
process = {}
process.user = parsedItem[0]
process.pid = parsedItem[1]
process.cpu = parsedItem[2]
process.mem = parsedItem[3]
process.command = parsedItem[4]
processes.push(process)
end for
print(processes)
touch(path: string, fileName: string
): "Can't create file. Unknown error""Can't create file. Reached maximum limit""Invalid path""Can't create file ${pathFolderDest}/${filename}. Permission denied""There is not enough free space on the hard disk.""The copy can not be made. Reached maximum number of files in a folder""Error: invalid path""Error: nameFile must be string""Error: only alphanumeric allowed as file name.""Error: name cannot exceed the limit of 128 characters.""touch: path too large""The file already exists"1
copyCreates an empty text file
at the provided path. Certain limitations apply to file creation: the file
name must be alphanumeric and below 128 characters. Creation will fail if there is already a file
in place or if permissions are lacking. Additionally, there is a file limit of about 250 in each folder and 3125 files in the computer overall. In case of success, it returns a number
with the value one. In case of failure, it returns a string
with details. Using this method in an SSH encryption process will cause an error to be thrown, preventing any further script execution.
path = "/home/" + active_user + "/Desktop"
hostComputer = get_shell.host_computer
createResult = hostComputer.touch(path, "myFile.txt")
if typeof(createResult) == "string" then
print("There was an error when creating the file: " + createResult)
else
print("File got created at given path " + path)
end if
wifi_networks(netDevice: string
):
copyReturns a list
of the Wi-Fi networks that are available for the provided interface. Each item in the list
is a string
containing information on the BSSID, PWR, and ESSID. If no matching netDevice can be found, this method will return null
. If the active network card is not a Wi-Fi card, an error will be thrown, preventing any further script execution.
hostComputer = get_shell("root", "test").host_computer
networks = hostComputer.wifi_networks("wlan0")
result = []
for network in networks
parsedItem = network.split(" ")
item = {}
item.BSSID = parsedItem[0]
item.PWR = parsedItem[1]
item.ESSID = parsedItem[2]
result.push(item)
end for
print(result)
crypto
A crypto
object can be obtained by using include_lib. The classID
used for this object is "cryptoLib"
.
aircrack(path: string
):
copyReturns a string
containing the password based on the file which was generated via aireplay. In case of failure, it will return null
instead. If the provided path is empty, an error will be thrown, interrupting the script execution.
crypto = include_lib("/lib/crypto.so")
networks = get_shell.host_computer.wifi_networks("wlan0")
firstNetwork = networks[1].split(" ")
bssid = firstNetwork[0]
pwr = firstNetwork[1][:-1].to_int
essid = firstNetwork[2]
aireplayResult = crypto.aireplay(bssid, essid, 300000 / pwr)
if (aireplayResult == null) then
result = crypto.aircrack(home_dir + "/file.cap")
print(result)
end if
aireplay(bssid: string, essid: string, maxAcks: number = -1
): "Error: wifi card is disabled""router not found!""Can't connect. Target is out of reach.""aireplay: no wifi card found with monitor mode enabled"
copyUsed to inject frames on wireless interfaces. Once the command with "Control+C"
is stopped, it will save the captured information in a text file called "file.cap"
in the path where the terminal is currently located. Alternatively, a maximum of captured acks
can be specified for the command to stop automatically, saving the "file.cap"
file as described above. To figure out how many ACKs are required, you can use the following formula: "300000 / (Power + 15)"
. If there is an error, a string
will be returned with the message indicating the problem. On success, it will return null
, it is advised though to verify that the capture file actually exists. In case any of the provided values deviate from the signature types or bssid/essid is empty, an error will be thrown preventing any further script execution.
crypto = include_lib("/lib/crypto.so")
networks = get_shell.host_computer.wifi_networks("wlan0")
for index in range(0, networks.len - 1)
print(index + ".) " + networks[index])
end for
selectedIndex = user_input("Select Wifi: ").to_int
if (typeof(selectedIndex) == "string" or selectedIndex < 0 or selectedIndex > networks.len - 1) then
exit("Wrong index!")
end if
parsed = networks[selectedIndex].split(" ")
bssid = parsed[0]
pwr = parsed[1][:-1].to_int
essid = parsed[2]
potentialAcks = 300000 / (pwr + 15)
crypto.aireplay(bssid, essid, potentialAcks)
wifiPassword = crypto.aircrack("/home/" + active_user + "/file.cap")
print("Wifi password for " + essid + " is " + wifiPassword)
airmon(option: string, device: string
): "Error: wifi card is disabled""airmon: monitor mode can only be activated on wifi cards""airmon: monitor mode is not supported by the chipset of this network card."01
copyEnables or disables the monitor mode of a network device. The options
parameter can only be "start"
or "stop"
. Monitor mode can only be enabled on Wifi cards. If it wasn't possible to enable or disable the monitor mode, this method will return either a number
with the value zero or a string
with details. In case of success, it will return a number
with the value one.
crypto = include_lib("/lib/crypto.so")
airmonResult = crypto.airmon("start", "wlan0")
if typeof(airmonResult) == "string" then
print("There was an error while switching monitoring mode: " + airmonResult)
else
print("Monitoring mode switched successfully.")
end if
decipher(encPass: string
):
copyReturns a decrypted password via the provided password MD5 hash. Keep in mind that this method is not decrypting a password but rather checking for existing passwords within the game world with a matching MD5 hash. So in case a password does not exist in the game world, the decryption will fail. On failure, this method will return null
. Using this method in an SSH encryption process will cause an error to be thrown, aborting further script execution.
crypto = include_lib("/lib/crypto.so")
hostComputer = get_shell("root", "test").host_computer
passwdContent = hostComputer.File("/etc/passwd").get_content
firstAccount = passwdContent.split(char(10))[0]
parsed = firstAccount.split(":")
username = parsed[0]
passwordHash = parsed[1]
password = crypto.decipher(passwordHash)
print("User: " + username)
print("Password: " + password)
smtp_user_list(ip: string, port: number
): list<string>orstringornull
"invalid IP address""host is down""host doesn't exist""ip address not found""port ${port} not found""invalid target service""service not found""Error: Invalid ip address"
copyReturns a list
of the existing users on the computer
where the SMTP service is running. If these users also have an email account registered on the SMTP server, it will be indicated in the list
. SMTP services are usually running on port 25
. In case of failure, this method will return a string
containing the cause. If any of the provided values deviate from the signature types, this method will return null
.
crypto = include_lib("/lib/crypto.so")
print(crypto.smtp_user_list("192.168.0.4", 25))
ctfEvent
A ctfEvent
object can be obtained by using get_ctf. The classID
used for this object is "ctfEvent"
.
get_creator_name():
copyReturns string
with the name of the CTF event creator.
get_description():
copyReturns string
with the CTF event description.
get_mail_content():
copyReturns string
with the mail content of the CTF event.
get_template():
copyReturns string
with the CTF event template.
player_success(): 01
copyReturns number
with the value one if the CTF event got completed successfully. Otherwise this method will return a number
with the value zero.
debugLibrary
A debugLibrary
object can be acquired by using debug_tools. The classID
used for this object is "debugLibrary"
.
apply_patch(path: string
): "error: file not found""error: The file to apply the patch cannot be binary""error: The patch code is not correct.""The patch had already been applied.""The patch has been applied correctly."
copyApplies a patch containing corrected code to the specified text file at the provided path. Returns a string
with the result of the operation. If the path argument is not a string
this method will return null
.
metax = include_lib("/lib/metaxploit.so")
metaLib = metax.load("/lib/init.so")
debugLib = metaLib.debug_tools("test", "test")
print("Path result: " + debugLib.apply_patch("/etc/passwd"))
payload(memZone: string, pathFile: string = ""
): stringorlist<map<any,any>>ornull
"Error: The file must be a library""Error: The library is patched against this vulnerability.""Failed: No vulnerabilities have been found in the specified memory area.""Error acquiring partial object file. Unable to access to resource: ${pathFile}"
copyReturns a list
containing a single partial computer
object if zero-day vulnerabilities are detected within the specified memory zone. If a file path is provided, a partial file
object associated with this path will also be included in the list
. Additionally, if this file is a library, its corresponding metaLib
object is added to the returned list
. In case of an error, a string
with details is returned. Providing arguments that deviate from the defined signature will result in null
.
metax = include_lib("/lib/metaxploit.so")
metaLib = metax.load("/lib/init.so")
debugLib = metaLib.debug_tools("test", "test")
result = debugLib.payload("0x7A69F4C3")
if typeof(result) == "list" and result.len > 0 then
print("Successfully executed payload!")
end if
scan(): "error: file not found""No potential issues have been found""Potential problems have been found in the following code:
${callengeDescription}"
copyScans the library in debug mode to identify potential code errors that may lead to vulnerabilities. If issues are detected, the relevant code snippets are printed. In case of an error, a string
containing the error message is returned.
metax = include_lib("/lib/metaxploit.so")
metaLib = metax.load("/lib/init.so")
debugLib = metaLib.debug_tools("test", "test")
print("Debug Library result: " + debugLib.scan)
unit_testing(errorLines: list<number>
): "error: file not found""Test failed: No potential issues have been found""Starting testing in selected lines...
${methods}
New vulnerability found: ${vulnerability}""Test failed: No errors have been found in one or more of the provided lines, or not all lines with errors have been provided."
copyConducts automated tests on the specified lines of code. If potential vulnerabilities are detected due to errors in these lines, this method will print partial objects that could be obtained by exploiting the vulnerability, along with the affected memory zone and detailed vulnerability information. In case of failure, this function returns a string
with an error message. If the error lines
argument is not a list
, the method will return null
.
metax = include_lib("/lib/metaxploit.so")
metaLib = metax.load("/lib/init.so")
debugLib = metaLib.debug_tools("test", "test")
print("Unit test results: " + debugLib.unit_testing([1, 2, 3]))
file
A file
object can be acquired by either using File or overflow. The classID
used for this object is "file"
.
allow_import():
copyReturns a number
. If the file is binary and can be imported by other scripts, the value will be one; otherwise, the value will be zero. In case the file gets deleted, this method will cause a crash.
hostComputer = get_shell.host_computer
lsBinary = hostComputer.File("/bin/ls")
print("File can be imported: " + lsBinary.allow_import)
chmod(perms: string = "", isRecursive: number = 0
): "permission denied""permission denied. File protected.""Wrong format.""${path} not found"
copyModifies the file
permissions. Optionally, these permissions can also be applied recursively. The format for applying permissions is as follows: "[references][operator][modes]"
. The references type is defined through three possible types: user "u"
, group "g"
, and other "o"
. The operator is used to define if permissions get added "+"
or removed "-"
. There are three different modes that can be modified: read "r"
, write "w"
, and execute "x"
. So, for example, "o-wrx"
would remove all possible permissions for others. To add all permissions for others again, "o+wrx"
would be used. In case the modification fails, this method will return a string
containing information about the reason. Otherwise, an empty string
is returned. In case any type other than number
is used for the isRecursive
parameter, an error will be thrown preventing further script execution.
hostComputer = get_shell("root", "test").host_computer
rootFolder = hostComputer.File("/bin")
oldPermissions = rootFolder.permissions
rootFolder.chmod("o-wrx", true)
newPermissions = rootFolder.permissions
print("Old permissions: " + oldPermissions)
print("New permissions: " + newPermissions)
copy(path: string = "", name: string = ""
): "Unknown error""Error: Invalid path""${sourceFilepath} not found""${destinationParentPath} not found""permission denied""There is not enough free space on the hard disk.""permission denied. ${filename} is protected.""A file cannot overwrite a folder or vice versa""The copy can not be made. Reached maximum number of files in a folder""The copy can not be made. Reached maximum limit""Error: only alphanumeric allowed as newname"1
copyCopies the file
to the provided path. Files can only be copied if the user has read and write permissions or is root. The new filename has to be below 128 characters and alphanumeric. After success, this method will return a number
with the value one. Otherwise, it will return a string
containing information about the reason for failure. If any of the parameter types deviate from the method signature, this method is used within an SSH encryption process, the new name exceeds 128 characters, or the path is too long, an error will be thrown, causing an interruption of script execution. In case the current file gets deleted, this method will return null
.
hostComputer = get_shell("root", "test").host_computer
passwdFile = hostComputer.File("/etc/passwd")
copyResult = passwdFile.copy("/etc/", "duplicate")
if typeof(copyResult) == "string" then
print("There was an error while copying file: " + copyResult)
else
print("File got copied successfully.")
end if
delete(): "file not found: ${path}""permission denied""permission denied. File protected.""unknown error :/"
copyDelete the current file. To delete files, write permissions are required or being root. In case of failure, a string
with details will be returned. Otherwise, an empty string
gets returned. Please note that deleting a file will leave a log entry.
hostComputer = get_shell.host_computer
lsBinary = hostComputer.File("/bin/ls")
deletionResult = lsBinary.delete
if typeof(deletionResult) == "string" and deletionResult.len > 0 then
print("There was an error while deleting a file: " + deletionResult)
else
print("File got deleted successfully.")
end if
get_content(): "Error: can't find the computer of this file""can't open ${filepath}. Binary file."
copyReturns a string
representing the content of the file. To read a file, the user requires read access or being root. Note that you cannot read a binary file. In case of failure, null
will be returned. If this method is used within an SSH encryption process, an error will be thrown, preventing any further script execution.
hostComputer = get_shell("root", "test").host_computer
passwdFile = hostComputer.File("/etc/passwd")
print("File content: " + passwdFile.get_content)
get_files():
copyReturns a list
of files. In case the current entity is a file instead of a folder this method will return null
, so it is advisable to first use the is_folder
function before calling this method. In case the current folder gets deleted this method will return null
as well.
hostComputer = get_shell.host_computer
binFolder = hostComputer.File("/bin")
files = binFolder.get_files
for file in files
print(file.path)
end for
get_folders():
copyReturns a list
of folders. In case the current entity is a file instead of a folder this method will return null
, so it is advisable to first use the is_folder
function before calling this method. In case the current folder gets deleted this method will return null
as well.
hostComputer = get_shell.host_computer
binFolder = hostComputer.File("/home")
folders = binFolder.get_folders
for folder in folders
print(folder.path)
end for
group():
copyReturns a string
with the name of the group to which this file belongs. Group permissions get applied to whoever is the owner of a file. In case the current file gets deleted, this method will return null
.
hostComputer = get_shell.host_computer
lsBinary = hostComputer.File("/bin/ls")
print("File is related to following group: " + lsBinary.group)
has_permission(perms: string = ""
): 10
copyReturns a number
indicating if the user who launched the script has the requested permissions. One will indicate that the user has the correct permissions. In case permissions are lacking, the value will be zero. There are three different permission types: read "r"
, write "w"
, and execute "x"
. In case the file gets deleted, this method will return null
instead.
hostComputer = get_shell.host_computer
lsBinary = hostComputer.File("/bin/ls")
print("Is able to execute ls: " + lsBinary.has_permission("x"))
is_binary(): 10
copyReturns a number
. If the file is a binary, the value will be one; otherwise, it will be zero. In case the file gets deleted, this method will return null
instead.
hostComputer = get_shell.host_computer
lsBinary = hostComputer.File("/bin/ls")
print("File is a binary: " + lsBinary.is_binary)
is_folder(): 10
copyReturns a number
. The value is one if the file is a folder, zero otherwise. In case the file gets deleted this method will return null
instead.
hostComputer = get_shell.host_computer
etcFolder = hostComputer.File("/etc")
print("Is a folder: " + etcFolder.is_folder)
is_symlink(): 10
copyReturns a number
. If the file is a symlink, the value will be one; otherwise, it will be zero. In case the file gets deleted, this method will return null
instead.
hostComputer = get_shell.host_computer
lsBinary = hostComputer.File("/bin/ls")
print("File is a symlink: " + lsBinary.is_symlink)
move(path: string = "", fileName: string = ""
): "Unknown error""Error: Invalid path""${sourceFilepath} not found""${destinationParentPath} not found""permission denied""There is not enough free space on the hard disk.""permission denied. ${filename} is protected.""A file cannot overwrite a folder or vice versa""The copy can not be made. Reached maximum number of files in a folder""The copy can not be made. Reached maximum limit""Error: only alphanumeric allowed as newname"1
copyMoves the file
to the provided path. Files can only be moved if the user has read and write permissions or is root. The new filename has to be below 128 characters and alphanumeric. After success, this method will return a number
with the value one. Otherwise, this method will return a string
with details. If any of the parameter types deviate from the method signature, this method is used within an SSH encryption process, the new name exceeds 128 characters, or the path is too long, an error will be thrown, causing an interruption of script execution. In case the current file gets deleted, this method will return null
.
hostComputer = get_shell("root", "test").host_computer
passwdFile = hostComputer.File("/etc/passwd")
moveResult = passwdFile.move("/root/", "newFileName")
if typeof(moveResult) == "string" then
print("There was an error while moving file: " + moveResult)
else
print("File got moved successfully.")
end if
name():
copyReturns a string
with the name of the file. In case the file gets deleted this method will return null
instead.
hostComputer = get_shell.host_computer
passwdFile = hostComputer.File("/etc/passwd")
print("Filename: " + passwdFile.name)
owner():
copyReturns a string
with the name of the file owner. User permissions get applied to whoever is the owner of a file. In case the current file gets deleted, this method will return null
.
hostComputer = get_shell.host_computer
lsBinary = hostComputer.File("/bin/ls")
print("Owner of ls is: " + lsBinary.owner)
parent():
copyReturns the parent folder of the current file or folder. In case there is no parent folder null
will be returned instead. In case the file gets deleted this method will return null
as well.
hostComputer = get_shell.host_computer
etcFolder = hostComputer.File("/etc")
print("Parent path: " + etcFolder.parent.path)
path(symlinkOrigPath: number = 0
):
copyReturns a string
containing the file path. If the file is a symlink, the optional symlinkOrigPath
argument can be set to return the original path of the linked file instead. If the file has been deleted, this method will still return the path it had prior to deletion.
hostComputer = get_shell.host_computer
passwdFile = hostComputer.File("/etc/passwd")
print("File location: " + passwdFile.path)
permissions():
copyReturns a string
with the current file permissions. In case the current file gets deleted, this method will return null
. The format for this permissions string
is as follows: "[fileType][wrx](u)[wrx](g)[wrx](o)"
. The file type is either "d"
in case it's a directory or "-"
. The user type gets defined through three possible types: user "u"
, group "g"
, and other "o"
. There are three different permission types: read "r"
, write "w"
, and execute "x"
. An example of a string
returned by this method would be "-rwxr-xr-x"
. Taking the latter as an example, the following things become clear:
- The provided file is not a directory.
- The user has full access.
- The group and others have almost all permissions besides writing.
hostComputer = get_shell.host_computer
binFolder = hostComputer.File("/bin")
permissions = binFolder.permissions
fileType = permissions[0]
permissionsForUser = permissions[1:4]
permissionsForGroup = permissions[4:7]
permissionsForOther = permissions[7:10]
print("File type: " + fileType)
print("User permissions: " + permissionsForUser)
print("Group permissions: " + permissionsForGroup)
print("Other permissions: " + permissionsForOther)
rename(name: string = ""
): "Unknown error""${filepath} not found""Error: name cannot exceed the limit of 128 characters.""permission denied""permission denied. File protected""There is already a file with that name, please choose another one.""Error: only alphanumeric allowed as newname"0
copyRename the file with the name provided. Files can only be renamed if the user has write permissions or is root. The new filename has to be below 128 characters and alphanumeric. On failure, this method will return a string
with details. Otherwise, this method will return an empty string. If this method is used within an SSH encryption process, an error will be thrown, causing the script execution to be interrupted. In case the provided name is null
, this method will return a number
with the value zero.
hostComputer = get_shell("root", "test").host_computer
passwdFile = hostComputer.File("/etc/passwd")
renameResult = passwdFile.rename("renamed")
if typeof(renameResult) == "string" then
print("There was an error while renaming file: " + renameResult)
else
print("File got renamed successfully.")
end if
set_content(content: string = ""
): "I can't save the file. The maximum of 160,000 characters has been exceeded.""set_content: unable to use this method in encryption configuration""can't open ${filepath}. Binary file."1
copySaves text into a file
. The content will not get appended to the file
; therefore, existing content will be overridden. To set new content, the user requires write permissions or being root. Keep in mind that text files cannot exceed the character limit of 160,000. In case setting the content was successful, a number
with the value one will be returned. Otherwise, a string
with details will be returned. If this method is used within an SSH encryption process, an error will be thrown, preventing any further script execution. If the provided content is null
or permissions are lacking, this method will return a number
with the value zero. In case the file gets deleted this method will return null
.
hostComputer = get_shell("root", "test").host_computer
passwdFile = hostComputer.File("/etc/passwd")
setResult = passwdFile.set_content("moo")
if typeof(setResult) == "string" then
print("There was an error while setting file content: " + setResult)
else if setResult == 0 then
print("Unable to set content of file!")
else
print("File content got changed successfully.")
end if
set_group(group: string = "", recursive: number = 0
): "Permission denied"
copyChange the group related to this file. Optionally the group can get applied recursively. The group name cannot exceed 15 characters. Additionally either write permissions or being root is required. In case of failure, a string
with details. On success, an empty string
gets returned. In case the current file gets deleted or the passed group is not a string
, this method will return null
. If the passed group value is empty, the group value is longer than 15 characters, or the passed recursive value deviates from its original type, an error will be thrown, preventing further script execution.
hostComputer = get_shell.host_computer
lsBinary = hostComputer.File("/bin/ls")
ownerResult = lsBinary.set_group("root")
if typeof(ownerResult) == "string" then
print("There was an error while changing group: " + ownerResult)
else
print("File group changed successfully.")
end if
set_owner(owner: string = "", recursive: number = 0
): "Permission denied"
copyChange the owner of this file. Optionally the owner can get applied recursively. The owner's name cannot exceed 15 characters. Additionally either write permissions or being root is required. In case of failure a string
gets returned containing the cause. Otherwise an empty string
gets returned. In case the current file gets deleted or the passed owner value is not a string
, this method will return null
. If the passed owner value is empty, the owner value is longer than 15 characters, or the passed recursive value deviates from its original type, an error will be thrown, interrupting further script execution.
hostComputer = get_shell.host_computer
lsBinary = hostComputer.File("/bin/ls")
ownerResult = lsBinary.set_owner("root")
if typeof(ownerResult) == "string" then
print("There was an error while changing owner: " + ownerResult)
else
print("File owner changed successfully.")
end if
size():
copyReturns a string
with the size of the file in bytes. There is no correlation between file size and actual file content. Instead, the file size is depending on the name of the file. In case the current file gets deleted, this method will return null
.
hostComputer = get_shell.host_computer
lsBinary = hostComputer.File("/bin/ls")
size = lsBinary.size
if size.to_int > 1000 then
print("File size is bigger than 1000 bytes.")
else
print("File size is below 1000 bytes.")
end if
symlink(path: string = "", newName: string = ""
): "Can't create file. Unknown error""Can't create file. Reached maximum limit""Invalid path""Can't create file ${pathFolderDest}/${filename}. Permission denied""There is not enough free space on the hard disk.""The copy can not be made. Reached maximum number of files in a folder""Unknown error.""Error: empty destination path""Error: only alphanumeric allowed as folder name.""Error: name cannot exceed the limit of 128 characters.""permission denied""${filename} file exists""Can't create folder. Reached maximum limit""The maximum number of subfolders has been exceeded""Error: only alphanumeric allowed as newname""Error: invalid path""The file already exists"1
copyCreates a symlink to the specified path. Symlinks can only be created if the user has write permissions or is root. The new filename must be alphanumeric and under 128 characters. Upon success, this method returns a number
with the value one. On failure, it returns a string
with details. If any parameters deviate from the method signature, if used within an SSH encryption process, if the new name exceeds 128 characters, or if the path is too long, an error will be thrown, interrupting script execution. If the current file is deleted, this method will return null
.
hostComputer = get_shell("root", "test").host_computer
lsFile = hostComputer.File("/bin/ls")
symResult = lsFile.symlink("/bin", "alternativeLS")
if typeof(symResult) == "string" then
print("There was an error while creating symlink: " + symResult)
else
print("Symlink got created successfully.")
end if
ftpShell
The FTP shell
behaves just like the ssh shell
and can be acquired by using connect_service and using the service type "ftp"
. The classID
used for this object is "ftpshell"
. The port used for FTP is usually 21
.
host_computer():
copyReturns a computer
related to the shell
.
shell = get_shell
ftpShell = shell.connect_service("172.8.0.5", 21, "test", "test", "ftp")
ftpComputer = ftpShell.host_computer
print("FTP public ip: " + ftpComputer.public_ip)
put(sourceFile: string, destinationFolder: string, remoteShell: shell
): "unknown error""Invalid path""${filepath} not found""permission denied""permission denied. ${filename} is protected""The copy can not be made. Reached maximum number of files in a folder""The copy can not be made. Reached maximum limit""${sourceFile} not found""${destinationFolder} not found""${destinationFolder} it's not a folder"1
copySend a file
to the computer
related to the provided shell
. You require permission to read the file
on the computer
from which you are uploading and write permissions in the folder of the computer
you are trying to upload to. In case of failure, this method will return a string
with the cause. Otherwise, a number
with the value one gets returned. If any of the passed arguments deviates from the types of the method signature, null
will be returned. In case the string
for sourceFile or destinationFolder is empty, an error will be thrown, preventing further script execution.
shell = get_shell
ftpShell = shell.connect_service("172.8.0.5", 21, "test", "test", "ftp")
putResult = ftpShell.put("/bin/ls", "/etc/", shell)
if typeof(putResult) == "string" then
print("There was an error while sending file: " + putResult)
else
print("File got sent successfully.")
end if
start_terminal():
copyLaunches an active terminal. The terminal's color will change, displaying the IP of the connected shell. Script execution will be stopped upon starting a new terminal, unless this is called from another script that was executed via shell.launch
. In that case, you will enter the shell after closing your root-level script within that terminal window. Using this method within an SSH encryption process will cause an error to be thrown, preventing further script execution.
shell = get_shell
ftpShell = shell.connect_service("172.8.0.5", 21, "test", "test", "ftp")
ftpShell.start_terminal
function
Create a function
with "function()"
, including parameters with optional default values. Assign the result to a variable. Invoke by using that variable. Use @
to reference a function without invoking.
triple = function(n=1)
return n * 3
end function
print triple // 3
print triple(5) // 15
f = @triple
print f(5)
general
Use if
blocks to do different things depending on some condition. Include zero or more else if
blocks and one optional else
block. Use a while
block to loop as long as a condition is true. A for
loop can loop over any list
, including ones easily created with the range
function. The break
statement jumps out of a while
or for
loop. The continue
statement jumps to the top of the loop, skipping the rest of the current iteration.
// if block
if 2+2 == 4 then
print "math works!"
else if pi > 3 then
print "pi is tasty"
else if "a" < "b" then
print "I can sort"
else
print "last chance"
end if
// while loop
s = "Spam"
while s.len < 50
s = s + ", spam"
end while
print s + " and spam!"
// for loop
for i in range(10, 1)
print i + "..."
end for
print "Liftoff!"
File(self: computer, path: string
):
copyReturns a file
located at the path provided in the arguments. The path can be either relative or absolute. Keep in mind that any file
object can be a folder as well. If the provided path cannot be resolved, meaning that no file or folder exists, this method will return null
. Providing any other type than string
or the value being empty for the path will result in an error thrown interrupting the script execution. If an invalid computer
object is passed, this method will return null
.
filePath = "/etc/passwd"
file = File(host_computer(get_shell), filePath)
if file != null then
print(file.get_content)
else
print("File at given path " + filePath + " does not exist.")
end if
abs(value: number = 0
):
copyReturns the absolute value of number
.
a = 1
b = 5
difference = abs(a - b)
print("Difference between a and b is: " + difference)
acos(value: number = 0
):
copyReturns the inverse cosine (in radians) of a number
.
adjacent = 8
hypotenuse = 10
calcAngle = acos(adjacent / hypotenuse)
print("Angle: " + calcAngle)
active_net_card(self: computer
):
copyReturns a string
which contains either the keyword "WIFI"
or "ETHERNET"
depending on which connection type your computer
is connected by. In case an invalid computer
object gets passed, this method will return null
.
computer = host_computer(get_shell)
netCard = active_net_card(computer)
print("Connected by: " + netCard)
active_user():
copyReturns a string
with the name of the user who is executing the current script.
print("Current active user: " + active_user)
add_repo(self: aptClient, repository: string, port: number = 1542
): "Unknown error: Unable to access to local computer""/etc/apt/sources.txt does not exist""${repository} it is already added to sources.txt""/etc/apt/sources.txt content is malformed."
copyAdds a repository address to the "/etc/apt/sources.txt"
file. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
. On success, it will return an empty string
. In case of failure, it will return a string
with an error message.
aptClient = include_lib("/lib/aptclient.so")
result = add_repo(aptClient, "177.202.15.132")
if result == "" then
print "Addition successful!"
else
print "Error while adding: " + result
end if
aircrack(self: crypto, path: string
):
copyReturns a string
containing the password based on the file which was generated via aireplay. In case of failure, it will return null
instead. If the provided path is empty, an error will be thrown, interrupting the script execution.
crypto = include_lib("/lib/crypto.so")
networks = wifi_networks(host_computer(get_shell), "wlan0")
firstNetwork = networks[1].split(" ")
bssid = firstNetwork[0]
pwr = firstNetwork[1][:-1].to_int
essid = firstNetwork[2]
aireplayResult = aireplay(crypto, bssid, essid, 300000 / pwr + 15)
if (aireplayResult == null) then
result = aircrack(crypto, home_dir + "/file.cap")
print(result)
end if
aireplay(self: crypto, bssid: string, essid: string, maxAcks: number = -1
): "Error: wifi card is disabled""router not found!""Can't connect. Target is out of reach.""aireplay: no wifi card found with monitor mode enabled"
copyUsed to inject frames on wireless interfaces. Once the command with "Control+C"
is stopped, it will save the captured information in a text file called "file.cap"
in the path where the terminal is currently located. Alternatively, a maximum of captured acks
can be specified for the command to stop automatically, saving the "file.cap"
file as described above. To figure out how many ACKs are required, you can use the following formula: "300000 / (Power + 15)"
. If there is an error, a string
will be returned with the message indicating the problem. On success, it will return null
. It is advised though to verify that the capture file actually exists. If the passed crypto
object is invalid, it will return null
as well. In case any of the provided values deviate from the signature types or bssid/essid is empty, an error will be thrown preventing any further script execution.
crypto = include_lib("/lib/crypto.so")
networks = wifi_networks(host_computer(get_shell), "wlan0")
for index in range(0, networks.len - 1)
print(index + ".) " + networks[index])
end for
selectedIndex = user_input("Select Wifi: ").to_int
if (typeof(selectedIndex) == "string" or selectedIndex < 0 or selectedIndex > networks.len - 1) then
exit("Wrong index!")
end if
parsed = networks[selectedIndex].split(" ")
bssid = parsed[0]
pwr = parsed[1][:-1].to_int
essid = parsed[2]
potentialAcks = 300000 / (pwr + 15)
aireplaycrypto, bssid, essid, potentialAcks)
wifiPassword = aircrack(crypto, "/home/" + active_user + "/file.cap")
print("Wifi password for " + essid + " is " + wifiPassword)
airmon(self: crypto, option: string, device: string
): "Error: wifi card is disabled""airmon: monitor mode can only be activated on wifi cards""airmon: monitor mode is not supported by the chipset of this network card."01
copyEnables or disables the monitor mode of a network device. The options
parameter can only be "start"
or "stop"
. Monitor mode can only be enabled on Wifi cards. If it wasn't possible to enable or disable the monitor mode, this method will return either a number
with the value zero or a string
with details. In case of success, it will return a number
with the value one.
crypto = include_lib("/lib/crypto.so")
airmonResult = airmon(crypto, "start", "wlan0")
if typeof(airmonResult) == "string" then
print("There was an error while switching monitoring mode: " + airmonResult)
else
print("Monitoring mode switched successfully.")
end if
allow_import(self: file
):
copyReturns a number
. If the file is binary and can be imported by other scripts, the value will be one; otherwise, the value will be zero. In case the file gets deleted, this method will cause a crash. If an invalid file
object gets passed, this method will return null
instead.
computer = host_computer(get_shell)
lsBinary = File(computer, "/bin/ls")
print("File can be imported: " + allow_import(lsBinary))
amount_mined(self: blockchain, coinName: string
): "Unknown error: Unable to access to local computer""amount_mined: No internet access.""amount_mined: Coin does not exist."
copyReturns a number
representing the total amount of mined coins. In case of an error, it will return a string with details. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
mined = amount_mined(blockchain, "test")
if typeof(mined) == "string" then
exit "Couldnt get amount mined due to: " + mined
end if
print "Your mined amount is " + mined
apply_patch(self: debugLibrary, path: string
): "error: file not found""error: The file to apply the patch cannot be binary""error: The patch code is not correct.""The patch had already been applied.""The patch has been applied correctly."
copyApplies a patch containing corrected code to the specified text file at the provided path. Returns a string
with the result of the operation. If any of the provided values deviates from the defined types in the method signature, this method will return null
.
metax = include_lib("/lib/metaxploit.so")
metaLib = load(metax, "/lib/init.so")
debugLib = debug_tools(metaLib, "test", "test")
print("Path result: " + apply_patch(debugLib, "/etc/passwd"))
asin(value: number = 0
):
copyReturns the inverse sine (in radians) of a number
.
opposite = 6
hypotenuse = 10
calcAngle = acos(opposite / hypotenuse)
print("Angle: " + calcAngle)
atan(y: number = 0, x: number = 1
):
copyReturns the inverse tangent (in radians) of a number
.
opposite = 8
hypotenuse = 10
calcAngle = atan(opposite / hypotenuse)
print("Angle: " + calcAngle)
bitAnd(a: number = 0, b: number = 0
):
copyPerforms a bitwise AND for the provided values. Returns a number
. Warning: If either operand is >= 0x80000000
, it'll always return 0.
print("Result of bitwise AND: " + bitAnd(1, 2))
bitOr(a: number = 0, b: number = 0
):
copyPerforms a bitwise OR for the provided values. Returns a number
. Warning: If either operand is >= 0x80000000
, it'll always return 0.
print("Result of bitwise OR: " + bitOr(1, 2))
bitXor(a: number = 0, b: number = 0
):
copyPerforms a bitwise XOR for the provided values. Returns a number
. Warning: If either operand is >= 0x80000000
, it'll always return 0.
print("Result of bitwise XOR: " + bitXor(1, 2))
bitwise(operator: string, left: number, right: number
):
copyReturns a number
by performing bitwise operations. Supported operators are: "~"
, "&"
, "|"
, "^"
, "<<"
, ">>"
, ">>>"
. In case you want to use the tilde operator you only need to provide the operator and the left argument. If any of the required arguments is null
this method will return null
. Warning: If either operand is >= 0x80000000
, it'll always returns 0.
num = params[0].to_int
isOdd = bitwise("&", num, 1) == 1
if isOdd then
print("Number is odd.")
else
print("Number is even.")
end if
bssid_name(self: router
):
copyReturns a string
with the BSSID value of the router. In case the passed object is not a router
this method will return null
.
router = get_router
bssid = bssid_name(router)
print("BSSID: " + bssid)
build(self: shell, pathSource: string, pathBinary: string, allowImport: number = 0
): "pathSource and programName can't be empty""Invalid shell""Unknown error: Unable to access to local computer""Can't find ${pathSource}""Can't find ${pathBinary}""Can't access to ${pathSource}. Permission denied.""Can't build ${pathSource}. Binary file""Can't create binary in ${pathBinary}. Permission denied.""Can't build ${pathSource}. Invalid extension.""Can't compile. Source code is empty"
copyCompiles a plain code file provided in the arguments to a binary. On success, the new binary will be available under the provided build folder. The binary name will be the same as the source file just without the file extension. Optionally, an allowImport flag can be set which enables the use of import_code
on the binary. All provided paths must be absolute. Returns an empty string on success. On failure, it will return a string containing details about the reason for failure. In case any provided values deviate from the defined signature a runtime exception will be thrown.
shell = get_shell
computer = host_computer(shell)
touch(computer, home_dir, "test.src")
set_content(File(computer, home_dir + "/test.src"), "print(""hello world"")")
buildResult = build(shell, home_dir + "/test.src", home_dir + "/Desktop")
if buildResult != "" then
print("There was an error while compiling: " + buildResult)
else
print("File has been compiled.")
end if
buy_coin(self: wallet, coinName: string, coinAmount: number, unitPrice: number, subwalletUser: string
): "Error: Coin ${coinName} does not exist""Error: Wallet does not exist""You need to be registered in ${coinName} to be able to buy this coin.""Subwallet ${subwalletID} does not exist""Purchase failed: It is necessary to create a bank account to make transactions""Purchase failed: Insufficient money in the bank. Required $${price}""Error: You already have a pending sale. Cancel it to create a new purchase.""Error: You already have a pending purchase. Cancel it to create a new purchase.""Not enough sellers found. Transaction is pending until a seller is found.""A partial transaction has occurred. The data of your offer has been updated""Unknown error: Unable to access to local computer""No internet access.""sell_coin: coin amount and proposed price cannot be 0."1
copyPublishes a purchase offer indicating the number of coins you wish to buy and the price ($) per unit you are willing to pay. The purchase will be finalized if there is any sale offer with a price less than or equal to the one proposed in the purchase. If there is no eligible offer to sell at that time, the offer to buy will remain publicly visible until a new offer to sell satisfies the requirements. If the publication has been successful, a number
with the value one is returned. In case of error, a string
with the details is returned. Any deviation from the method signature will result in a runtime exception preventing further script execution.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
result = buy_coin(wallet, "test", 100, 20, "test")
if result == 1 then
print "Sucessfully created purchase offer!"
else
print "Failed: " + result
end if
camera_link_system(self: trafficNet
): "Unknown error: Unable to access to local computer""error: No internet access.""error: This device is not registered on any police network"1
copyAccesses the traffic camera system, opening a window with controls to switch between different cameras. If the window opens successfully, this method returns a number
with the value one. In case of an error, it returns a string
with details. If an invalid traffic net object gets passed this method will return null
.
libTraffic = include_lib("/lib/libtrafficnet.so")
linkSystemResult = camera_link_system(libTraffic)
if linkSystemResult == 1 then
print("Initiated camera broadcast!")
end if
cancel_pending_trade(self: wallet, coinName: string
): "Unknown error: Unable to access to local computer""No internet access.""No pending trades found"
copyCancel any pending offer of a certain coin. On success, an empty string
will be returned. On failure, a string
with an error message will be returned. Any deviation from the method signature will result in null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
if cancel_pending_trade(wallet, "test") == "" then
print "Trade got canceled!"
end if
ceil(value: number = 0
):
copyReturns number
rounded up to the integer value of the provided number
.
price = 25.43467
upperPrice = ceil(price * 100) / 100
print("Upper price: " + upperPrice)
change_password(self: computer, user: string, pass: string
): "Error: only alphanumeric allowed as password.""Error: the password cannot exceed the limit of 15 characters.""Denied. Only root user can execute this command.""user ${username} does not exist"1
copyChanges the password of an existing user on the computer
. Root permissions are necessary for successful password changes. Passwords can only include alphanumeric characters and cannot exceed 15 characters. If the password change fails, this method will return a string
containing information on why it failed. If the change succeeds, it will return a number
with the value one. If the provided username is empty, an error will be thrown, preventing any further script execution. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
computer = host_computer(get_shell("root", "test"))
changeResult = change_password(computer, "test", "newPassword")
if typeof(changeResult) == "string" then
print("There was an error when changing the password: " + changeResult)
else
print("Password got successfully changed.")
end if
char(value: number = 65
):
copyReturns the UTF-16 character string
related to the provided unicode number
. The provided number
needs to be between 0 and 65535. Any number
which is outside this range will cause the script to throw a runtime error. Beware when passing non-ASCII values to intrinsics as they will likely get re-encoded as UTF-8. For example, md5(char(255))
will actually return the hash of the two-byte sequence 0xC3
0xBF
.
key = user_input("Press a key!", false, true)
isA = key == char(97)
if isA then
print("You pressed A.")
else
print("You did not press A.")
end if
check_password(self: subWallet, password: string
): "Unknown error: Unable to access to local computer""No internet access.""login_subwallet: the account does not exist."10
copyReturns a number
with the value one if the credentials are correct, otherwise, the value is zero. For some cases, this method will return a string
with an error message. If an object is passed that is not a subWallet
, this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
password = user_input("SubWallet password:", true)
if subWallet.check_password(password) == 1 then
print "Password is correct!"
end if
check_upgrade(self: aptClient, filePath: string
): "No internet access.""Remote host is down""Unable to find service ${service}""Invalid target service port configuration.""connection rejected: port forward removed by admin""Unable to connect: missing ${library}""Unable to connect: invalid ${library}""Unexpected library found. Not a valid ${library} library.""Unknown error""Fatal error: ${filepath} corrupted!""Kernel panic: missing ${filepath} file!""Graphics error: ${filepath} not found!""Fatal error: ${filepath} not found!""Connection refused. Address unreachable""Connection refused. The target is behind a firewall.""ip address not found""can't connect: the remote server has been temporarily disabled due to non-payment""can't connect: port ${port} not found""can't connect: port closed""can't connect: There is no active machine behind the port ${port}""can't connect: service not found behind the port ${port}""Unknown error: Unable to access to local computer""apt_check_upgrade: No internet access.""/etc/apt/aptcache.bin not found. Launch apt with the update option to refresh the file""package name can not be empty""${filepath} does not exist in this filesystem""${serviceDBFile} does not exist in the server""apt folder content does not exist in the server""${filepath} does not exist in the server""${serviceDBFile} file content is malformed in the server""/etc/apt/aptcache.bin content is malformed. Launch apt with the update option to refresh the file""${filepath} not found in the server"10
copyVerifies if there is a newer version of the program or library in the repository. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
. On success, it will return a number
, which can be either zero or one. Zero indicates that there is no new version available, while one indicates that there is a new version. In case of failure, it will return a string containing an error message.
aptClient = include_lib("/lib/aptclient.so")
result = check_upgrade(aptClient, "/bin/rshell_interface")
if result == 0 then
print "Program doesnt need an update!"
else if result == 1 then
print "Program does need an update!"
else
print "Error while checking version: " + result
end if
chmod(self: file, perms: string = "", isRecursive: number = 0
): "permission denied""permission denied. File protected.""Wrong format.""${path} not found"
copyModifies the file
permissions. Optionally, these permissions can also be applied recursively. The format for applying permissions is as follows: "[references][operator][modes]"
. The references type is defined through three possible types: user "u"
, group "g"
, and other "o"
. The operator is used to define if permissions get added "+"
or removed "-"
. There are three different modes that can be modified: read "r"
, write "w"
, and execute "x"
. So, for example, "o-wrx"
would remove all possible permissions for others. To add all permissions for others again, "o+wrx"
would be used. In case the modification fails, this method will return a string
containing information about the reason. Otherwise, an empty string
is returned. In case any type other than number
is used for the isRecursive
parameter, an error will be thrown preventing further script execution. If an invalid file
object is passed, this method will return null
.
hostComputer = host_computer(get_shell("root", "test"))
rootFolder = File(hostComputer, "/bin")
oldPermissions = permissions(rootFolder)
chmod(rootFolder, "o-wrx", true)
newPermissions = permissions(rootFolder)
print("Old permissions: " + oldPermissions)
print("New permissions: " + newPermissions)
clear_screen():
copyRemoves any text existing in a Terminal prior to this point. Utilizing this method in an SSH encryption process will trigger an error, halting further script execution.
for i in range(9)
clear_screen
print(("#" * (9 - i)) + ("-" * i))
wait(0.2)
end for
close_program(self: computer, pid: number
): "Permission denied. PID ${pid} belongs to user <b>${username}</b>""Permission denied. Process protected.""Unable to close this process. The process belongs to this script."10
copyCloses a program associated with the provided PID. You can see the list of active programs by either using show_procs
or typing ps
into your terminal. To close a program, you need to be either the owner of the running process or root. In case the closing of a program fails, this method will return a string
containing details. On success, it will return a number
with the value one. If there is no process with the provided PID, this method will return a number
with the value zero. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
computer = host_computer(get_shell("root", "test"))
processes = split(show_procs(computer), char(10))[1:]
pid = split(processes[1], " ")[1]
closeResult = close_program(computer, to_int(pid))
if typeof(closeResult) == "string" then
print("There was an error when closing a program: " + closeResult)
else
print("Program with pid " + pid + " got successfully closed.")
end if
code(value: string
):
copyReturns the Unicode number
of the first character of the string. In case an empty string
is provided the script execution will crash.
key = user_input("Press a key!", false, true)
isA = key.code == 97
if isA then
print("You pressed A.")
else
print("You did not press A.")
end if
coin_price(self: blockchain
): "Unknown error: Unable to access to local computer""coin_price: No internet access.""coin_price: Coin does not exist."
copyReturns a number
representing the current unit value of the cryptocurrency. In case of an error, it will return a string
with the error details. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
price = coin_price(blockchain, "test8")
if typeof(price) == "string" then
exit "Couldnt get coin price due to: " + price
end if
print "Your coin price is " + price
command_info(commandName: string
): "Unknown info"
copyReturns a string
value of a translation. Translations include commands, documentation and other game-related things. Checkout Grey-Texts for an overview of all available keys. If the provided command name is not a string
or is empty this method will throw an error causing the script to stop.
print(command_info("LS_USAGE"))
connect_ethernet(self: computer, netDevice: string, localIp: string, gateway: string
): "Error: Ethernet card not connected to the network""Unable to find ISP network to connect using Ethernet card""can't connect: the home network has been temporarily disabled due to non-payment""Error: the gateway cannot be the same device to connect""Error: gateway ${gateway} does not exist in the network""Error: address ${address} is already in use.""Unknown error: The current IP ${localIp} does not exist in this network""Error: unable to run command on routers/switches""connect_ethernet: permission denied. Guest users can not execute this method""Error: Invalid IP address""Error: invalid gateway""Error: the IP address and the gateway must belong to the same subnet""connect_ethernet: Network device not found""connect_ethernet: Only ethernet cards are supported"
copySets up a new IP address on the computer
through the ethernet connection. It is not possible to set up a new IP address while being logged in as a guest. On failure, this method will either return a string
with details or null
. On success, it will return an empty string
. If any of the provided parameters have a type that deviates from the defined signature or the computer is not connected to the internet, an error will be thrown preventing any further script execution.
computer = host_computer(get_shell)
connectionResult = connect_ethernet(computer, "eth0", "192.168.0.4", local_ip(get_router))
if typeof(connectionResult) == "string" then
print("There was an error while connecting: " + connectionResult)
else
print("Connected successfully.")
end if
connect_service(self: shell, ip: string, port: number, user: string, password: string, service: string = "ssh"
): shellorftpShellorstringornull
"No internet access.""Remote host is down""Unable to find service ${service}""Invalid target service port configuration.""connection rejected: port forward removed by admin""Unable to connect: missing ${library}""Unable to connect: invalid ${library}""Unexpected library found. Not a valid ${library} library.""Unknown error""ip address not found""can't connect: the remote server has been temporarily disabled due to non-payment""can't connect: port ${port} not found""can't connect: port closed""can't connect: There is no active machine behind the port ${port}""can't connect: service not found behind the port ${port}""Invalid service ID""can't connect: incorrect user/password""Unknown error: Unable to access to local computer""Direct connections cannot be made outside of this network"
copyReturns a shell
if the connection attempt to the provided IP was successful. This method can only connect to ports running an SSH or FTP service. SSH services usually run on port 22 and FTP services usually on port 21. Keep in mind to pass the right service value depending on which service is going to be used. By default, it will use SSH as the service. Please note that connecting will leave a log entry. In case of failure, a string is returned containing details. If any provided arguments deviate from the method signature, if this method is run in an SSH encryption process, or if the computer is not connected to the internet, a runtime exception will be thrown.
shell = get_shell
connectionResult = connect_service(shell, "1.1.1.1", 22, "test", "test")
if typeof(connectionResult) != "shell" then
print("There was an error while connecting: " + connectionResult)
else
print("Connected!")
end if
connect_wifi(self: computer, netDevice: string, bssid: string, essid: string, pass: string
): "connect_wifi: permission denied. Guest users can not execute this method""connect_wifi: Network device not found""connect_wifi: Only wifi cards are supported""Can't connect. Incorrect password.""Can't connect. Router not found.""can't connect: the remote server has been temporarily disabled due to non-payment""Can't connect. Target is out of reach."1
copyConnects to the indicated Wi-Fi network. It is not possible to connect to a new Wi-Fi while being logged in as a guest. If connecting to a new Wi-Fi fails, this method will return a string
containing details. On success, it will return a number
with the value one. Wi-Fi networks can be found via wifi_networks
or by typing iwlist
as a command in the terminal. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
computer = host_computer(get_shell)
networks = wifi_networks(computer)
firstNetwork = networks[0].split(" ")
BSSID = firstNetwork[0]
ESSID = firstNetwork[2]
connectionResult = connect_wifi(host_computer, "wlan0", BSSID, ESSID, "wifi-password")
if typeof(connectionResult) == "string" then
print("There was an error while connecting to new Wifi: " + connectionResult)
else
print("Connected to new Wifi successfully.")
end if
copy(self: file, path: string = "", name: string = ""
): "Unknown error""Error: Invalid path""${sourceFilepath} not found""${destinationParentPath} not found""permission denied""There is not enough free space on the hard disk.""permission denied. ${filename} is protected.""A file cannot overwrite a folder or vice versa""The copy can not be made. Reached maximum number of files in a folder""The copy can not be made. Reached maximum limit""Error: only alphanumeric allowed as newname"1
copyCopies the file
to the provided path. Files can only be copied if the user has read and write permissions or is root. The new filename has to be below 128 characters and alphanumeric. After success, this method will return a number
with the value one. Otherwise, it will return a string
containing information about the reason for failure. If any of the parameter types deviate from the method signature, this method is used within an SSH encryption process, the new name exceeds 128 characters, or the path is too long, an error will be thrown, causing an interruption of script execution. In case the current file gets deleted or an invalid file
object is passed, this method will return null
.
computer = host_computer(get_shell("root", "test"))
passwdFile = File(computer, "/etc/passwd")
copyResult = copy(passwdFile, "/etc/", "duplicate")
if typeof(copyResult) == "string" then
print("There was an error while copying file: " + copyResult)
else
print("File got copied successfully.")
end if
cos(value: number = 0
):
copyReturns the cosine of a number
in radians.
radians = 1
radius = 10
circleX = cos(radians) * radius
print(circleX)
create_folder(self: computer, path: string, folder: string = "newFolder"
): "Unknown error.""Error: empty destination path""Error: only alphanumeric allowed as folder name.""Error: name cannot exceed the limit of 128 characters.""permission denied""${filename} file exists""Can't create folder. Reached maximum limit""The copy can not be made. Reached maximum number of files in a folder""The maximum number of subfolders has been exceeded""create_folder: path too large""Error: invalid path"1
copyCreates a folder at the path provided in the arguments. There are certain limitations when it comes to creating a folder. The folder name has to be alphanumeric and below 128 characters. Creation will fail as well when there is already a folder in place or if there are lacking permissions. Additionally, there is a folder limit of about 250 in each folder and 3125 folders in the computer overall. In case the folder creation fails, the method will return a string
with details. In case of success, it will return a number
with the value one. Providing any type that deviates from the signature or using this method in an SSH encryption process will cause an error to be thrown, aborting further script execution. If an invalid computer
object is passed, this method will return null
.
path = "/home/" + active_user + "/Desktop"
computer = host_computer(get_shell)
createResult = create_folder(computer, path, "myfolder")
if typeof(createResult) == "string" then
print("There was an error when creating the folder: " + createResult)
else
print("Folder got created at given path " + path)
end if
create_group(self: computer, user: string, group: string
): "Error: only alphanumeric allowed as user and group names.""Denied. Only root user can execute this command.""Error: user ${username} does not exist."1
copyCreates a new group associated with an existing user on the computer
. It is necessary to be root to be able to successfully create a group. There are a few limitations when creating a group such as a character limit of 15 and that the group name may only contain alphanumeric characters. In case the group creation fails, this method will return a string
containing the cause of failure. On success, it will return a number
with the value one. In case the provided arguments are empty or the username exceeds 15 characters, an error will be thrown, interrupting further script execution. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
computer = host_computer(get_shell("root", "test"))
creationResult = create_group(computer, "test", "staff")
if typeof(creationResult) == "string" then
print("There was an error when creating a group: " + creationResult)
else
print("Group got successfully created.")
end if
create_subwallet(self: coin, walletID: string, pin: string, subWalletUser: string, subWalletPass: string
): "Error: Wallet does not exists.""Error: Coin does not exist.""Error: This username already exists""Error: Incorrect PIN""Error: only a maximum of 10 subwallets per coin is allowed.""Unknown error: Unable to access to local computer""error: No internet access."1
copyRegisters a new account in the coin
that can be used to manage services such as stores. It is necessary to provide the PIN of the owner's wallet
that wants to register. In case of success, the method will return a number
with the value one. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
. In case of an error, a string
with the details is returned.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
wallet = login_wallet(blockchain, "test", "test")
result = create_subwallet(coin, "test", wallet.get_pin, "test", "test")
if typeof(result) == "string" then
exit "Failed to create subwallet due to: " + result
end if
print "Successfully created subwallet!"
create_user(self: computer, user: string, pass: string
): "Error: root user already exists.""Error: can't create guest user. Reserved user.""Error: can't create user. ${username} already exists.""Error: only alphanumeric allowed as user name and password.""Denied. Only root user can execute this command.""Denied. Maximum number of registered users reached."1
copyCreates a user on the computer
, with the specified name and password. Root permissions are necessary for successful user creation. Neither username nor password can exceed more than 15 characters and both need to be alphanumeric. There cannot be more than 15 users created on the same computer
. In case the creation fails, this method will return a string
containing the reason for the failure. On success, it will return a number
with the value one. If the provided username is empty or either of the values exceeds 15 characters, an error will be thrown, interrupting further script execution. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
computer = host_computer(get_shell("root", "test"))
creationResult = create_user(computer, "newUser", "123")
if typeof(creationResult) == "string" then
print("There was an error when creating an user: " + creationResult)
else
print("User got successfully created.")
end if
create_wallet(self: blockchain, user: string, password: string
): "Error: Wallet user already exists.""Error: Only one wallet per player allowed.""Unknown error: Unable to access to local computer""create_wallet: No internet access.""Error: only alphanumeric allowed as name and password""create_wallet: name and password cannot exceed the 16 character limit.""Error: It is necessary to have a bank account to be able to create a wallet."
copyCreates a wallet
and returns a wallet
object on success, which can be used to manage cryptocurrencies. In case of an error, it will return a string
with the details. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = create_wallet(blockchain, "test", "test")
if typeof(wallet) == "string" then
print "Wallet creation failed due to: " + wallet
else
print "Wallet creation was successful!"
end if
current_date():
copyReturns a string
containing the current date and time. Ingame time passes 15 times as fast as real-time - 4 seconds per in-game minute. The initial time after every wipe will be the 1st of January 2000 at 6:00 AM. Additionally, the game time will not proceed while the server is offline.
- Output schema:
"[day]/[month]/[year] - [hours]:[minutes]"
- Example output:
"27/Jan/2000 - 08:19"
dateStr = current_date
dateSegments = dateStr.split(" - ")
date = dateSegments[0].split("/")
day = date[0]
month = date[1]
year = date[2]
dateTime = dateSegments[1].split(":")
hours = dateTime[0]
minutes = dateTime[1]
print("Current day: " + day)
current_path():
copyReturns a string
containing the path in which script that is currently executed from.
path = current_path
print("PWD: " + path)
- copy
Returns a library in debug mode as a debugLibrary
object. A valid Neurobox engineer's username and password are required to access this mode. If successful, the debugLibrary
object is returned; in case of an error, a string
with details is provided. Passing values that deviate from the defined signature will result in null
.
metax = include_lib("/lib/metaxploit.so")
metaLib = load(metax, "/lib/init.so")
debugLib = debug_tools(metaLib, "test", "test")
if typeof(debugLib) == "debugLibrary" then
print("Received debug libary object!")
end if
decipher(self: crypto, encPass: string
):
copyReturns a decrypted password via the provided password MD5 hash. Keep in mind that this method is not decrypting a password but rather checking for existing passwords within the game world with a matching MD5 hash. So in case a password does not exist in the game world, the decryption will fail. On failure, this method will return null
. Using this method in an SSH encryption process will cause an error to be thrown, aborting further script execution.
crypto = include_lib("/lib/crypto.so")
computer = host_computer(get_shell("root", "test"))
passwdContent = get_content(File(computer, "/etc/passwd"))
firstAccount = passwdContent.split(char(10))[0]
parsed = firstAccount.split(":")
username = parsed[0]
passwordHash = parsed[1]
password = decipher(crypto, passwordHash)
print("User: " + username)
print("Password: " + password)
del_repo(self: aptClient, repository: string
): "Unknown error: Unable to access to local computer""/etc/apt/sources.txt does not exist""${repository} not found in sources.txt""/etc/apt/sources.txt content is malformed."
copyRemoves a repository address from the "/etc/apt/sources.txt"
file. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
. On success, it will return an empty string
. In case of failure, it will return a string
with an error message.
aptClient = include_lib("/lib/aptclient.so")
result = del_repo(aptClient, "177.202.15.132")
if result == "" then
print "Deletion successful!"
else
print "Error while deleting: " + result
end if
delete(self: file
): "file not found: ${path}""permission denied""permission denied. File protected.""unknown error :/"
copyDelete the current file. To delete files, write permissions are required or being root. In case of failure, a string
with details will be returned. Otherwise, an empty string
gets returned. Please note that deleting a file will leave a log entry. In case an invalid file
object gets passed, this method will return null
.
computer = host_computer(get_shell)
lsBinary = File(computer, "/bin/ls")
deletionResult = delete(lsBinary)
if typeof(deletionResult) == "string" and len(deletionResult) > 0 then
print("There was an error while deleting a file: " + deletionResult)
else
print("File got deleted successfully.")
end if
delete_coin(self: blockchain, coinName: string, user: string, password: string
): "Error: ${coinname} does not exist""Error: incorrect user/password""Unknown error: Unable to access to local computer""delete_coin: No internet access."1
copyRemoves a cryptocurrency from the world. It is required to provide the credentials used in the creation of the cryptocurrency. On success, it will return a number
with the value one. On failure, it will return a string
containing details. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
result = delete_coin(blockchain, "test", "test", "test")
if typeof(result) == "string" then
exit "Couldnt delete coin due to: " + result
end if
print "Coin got deleted"
delete_group(self: computer, user: string, group: string
): "Denied. Only root user can execute this command.""Error: user ${username} does not exist.""Error: group ${group} not found in user ${username}"1
copyDeletes an existing group associated with an existing user on the computer
. It is necessary to be root to be able to successfully delete a group. In case the group deletion fails, this method will return a string
containing the cause of failure. On success, it will return number
with the value one. If either of the provided values is empty, an error will be thrown preventing further script execution. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
computer = host_computer(get_shell("root", "test"))
deletionResult = delete_group(computer, "test", "staff")
if typeof(deletionResult) == "string" then
print("There was an error when deleting a group: " + deletionResult)
else
print("Group got successfully deleted.")
end if
delete_mail(self: metaMail, mailId: string
): "Unknown error: Unable to access to local computer""read: No internet access."1
copyDelete the email corresponding to the provided email ID. Returns a number
with the value one if the email removal was successful. Otherwise, a string
with an error message will be returned. If any of the provided values deviate from the method signature, it will return null
.
metaMail = mail_login(user_mail_address, "test")
mails = fetch(metaMail)
results = []
for mail in mails
segments = split(mail, char(10))
mailId = segments[2][8:]
print(delete_mail(metaMail, mailId))
end for
print("Deleted every mail!")
delete_subwallet(self: subWallet
): "Unknown error: Unable to access to local computer""No internet access."10
copyDeletes the account registered in the cryptocurrency. Returns a number
where one indicates successful deletion and zero indicates failure. In case of certain failures, this method may return a string
with details. If an object is passed that is not a subWallet
, this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
result = subWallet.delete
if result == 1 then
print "Subwallet got deleted!"
end if
delete_user(self: computer, user: string, removeHome: number = 0
): "Denied. Only root user can execute this command.""can't delete user. ${username} does not exist""the root user can't be deleted.""sorry, at the moment that account can't be deleted.""user ${username} not found."1
copyDeletes the indicated user from the computer
. It can optionally also delete the home folder related to the user. By default, the home folder will not be deleted. Root permissions are necessary to successfully delete a user. Keep in mind that you cannot delete the root user. In case the deletion fails, this method will return a string
containing the cause of failure. On success, this method will return a number
with the value one. If the provided username is empty, an error will be thrown, interrupting further script execution. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
computer = host_computer(get_shell("root", "test"))
deletionResult = delete_user(computer, "test", true)
if typeof(deletionResult) == "string" then
print("There was an error when deleting an user: " + deletionResult)
else
print("User got successfully deleted.")
end if
device_ports(self: router, ip: string
): "device_ports: ${ip} is unreachable"
copyReturns a list
where each item is an open port
related to the device of the provided LAN IP address. The device needs to be within the network of the router
. In case of failure, this method will return null
or a string
with details. In case an empty ip is provided this method will throw a runtime exception.
router = get_router
devices = devices_lan_ip(router)
for ip in devices
ports = device_ports(router, ip)
openPorts = []
for port in ports
if is_closed(port) then continue
push(openPorts, port)
end for
if (len(openPorts) == 0) then
print(ip + " has no open ports")
else
print(ip + " contains following open ports:")
for port in openPorts
print("|-" + port.port_number)
end for
end if
end for
devices_lan_ip(self: router
):
copyReturns a list
where each item is a string
representing a LAN IP address. All devices are within the network of the router and can be reached by using the ping
method. Some of the devices might be behind a firewall. In case the passed object is not a router
this method will return null
.
router = get_router
devices = devices_lan_ip(router)
for ip in devices
print(ip + " found!")
end for
dump_lib(self: netSession
):
copyReturns the metaLib
associated with the remote service. For example if the metaxpoit
method net_use
was used on a ssh port it will return the metaLib
related to the ssh service. In case the port was zero is will return a metaLib
related to the kernel router. If an invalid netSession
gets passed this method will return null
.
metax = include_lib("/lib/metaxploit.so")
ports = used_ports(get_router("1.1.1.1"))
netSession = net_use(metax, "1.1.1.1", port_number(ports[0]))
metaLib = dump_lib(netSession)
print("Library: " + lib_name(metaLib) + " - " + version(metaLib) + " on port " + port_number(ports[0]))
essid_name(self: router
):
copyReturns a string
with the ESSID value of the router. In case the passed object is not a router
this method will return null
.
router = get_router
essid = essid_name(router)
print("ESSID: " + essid)
exit(message: string = ""
):
copyStops execution of the currently running script. Optionally a message can be provided which will be shown in the Terminal. There is also the possibility of styling output by using TextMeshPro rich-text tags.
while (true)
shouldExit = lower(user_input("Want to exit? (Y/N)"))
if (shouldExit == "y") then
exit("See you!")
end if
end while
fetch(self: metaMail
): list<string>orstringornull
"Unknown error: Unable to access to local computer""fetch: No internet access."
copyReturns a list
where each item is a string
containing mail id, from, subject and a small preview of the content consisting of the first 125 characters. In case of failure a string
with details will be returned. If an invalid metaMail
object gets passed this method will return null
.
metaMail = mail_login(user_mail_address, "test")
mails = fetch(metaMail)
results = []
for mail in mails
segments = split(mail, char(10))
item = {}
item.mailId = segments[2][8:]
item.from = segments[3][6:]
item.subject = segments[4][9:]
item.preview = segments[5:]
push(results, item)
end for
print(results)
firewall_rules(self: router
):
copyReturns a list
where each item is a string
containing a firewall rule. In case the passed object is not a router
this method will return null
.
router = get_router
rules = firewall_rules(router)
print("Firewall rules: " + join(rules, ", "))
floor(value: number = 0
):
copyReturns number
rounded down to the integer value of the provided number
.
price = 25.43467
floored = floor(price * 100) / 100
print("Floored price: " + floored)
- copy
Returns a string
which is the formatted version of the provided text. Keep in mind that TextMeshPro rich-text tags might screw up the output. When using tags consider applying these after formatting. Passing anything other than a string
will result in an empty string
.
text = "FIRST SECOND THIRD
1 2 3"
print(format_columns(text))
funcRef():
copyReturns a map
which enables to extend function references with custom methods.
funcRef.signature = function
return str(@self)
end function
print (@print).signature
get_address(self: coin
): "Error: ${coinName} does not exist""Unknown error: Unable to access to local computer""error: No internet access."
copyReturns the configured address that will be shown to users who do not have the currency, indicating where they have to register. In case of an error, the method will return a string
with details. If an invalid coin object is provided, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
result = get_address(coin)
if not is_valid_ip(result) then
exit "Failed to get address due to: " + result
end if
print "address: " + result
get_balance(self: wallet, coinName: string
): "Unknown error: Unable to access to local computer""No internet access.""Error: wallet does not exist/incorrect credentials.""get_balance: wallet does not have coins in the selected currency"
copyReturns a number
of coins of a given currency. In case of error, a string
with the details is returned. Returns a number
of coins of a given currency. In case of error, a string
with the details is returned. Any deviation from the method signature will result in a null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
for coinName in list_coins(wallet)
print "You have " + get_balance(wallet, coinName) + " coins of the currency """ + coinName + """"
end for
get_balance_subwallet(self: subWallet
): "get_balance: The account does not exist.""Unknown error: Unable to access to local computer""No internet access."
copyReturns a number
of coins of a given currency. In case of error, a string
with the details is returned. In case an object gets passed which is not a subWallet
this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
print "Balance: " + get_balance_subwallet(subWallet)
get_coin(self: blockchain, coinName: string, user: string, password: string
): "Unknown error: Unable to access to local computer""get_coin: No internet access.""get_coin: Incorrect user/password"
copyReturns a coin
object used to manage the currency. In case of an error, it will return a string
with the details. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
if typeof(coin) != "coin" then
exit "Couldnt get coin object due to: " + coin
end if
print "Your coin address is " + get_address(coin)
get_coin_name(self: blockchain, user: string, password: string
): "Unknown error: Unable to access to local computer""get_coin_name: No internet access.""get_coin_name: Incorrect user/password""get_coin_name: No currency has been found"
copyReturns a string
with the name of the coin owned by the player. In case of an error, it will return a string
with the details. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coinName = get_coin_name(blockchain, "test", "test")
if not matches(coinName, "^[A-Z]+$") then
exit "Couldnt get coin name due to: " + coinName
end if
print "The name of the coin you're owning is " + coinName
get_content(self: file
): "Error: can't find the computer of this file""can't open ${filepath}. Binary file."
copyReturns a string
representing the content of the file. To read a file, the user requires read access or being root. Note that you cannot read a binary file. In case of failure, null
will be returned. If this method is used within an SSH encryption process, an error will be thrown, preventing any further script execution.
computer = host_computer(get_shell("root", "test"))
passwdFile = File(computer, "/etc/passwd")
print("File content: " + get_content(passwdFile))
get_creator_name(self: ctfEvent
):
copyReturns a string
with the name of the CTF event creator. If the provided ctfEvent
object is invalid or missing, this method will return null
.
get_credentials_info(self: trafficNet
): "Unknown error: Unable to access to local computer""error: No internet access.""error: This device is not registered on any police network""${job} ${name}"
copyReturns string which contains job and name of a NPC. If an error occurs, a string
with details is returned. If an invalid trafficNet
object is passed, this method will return null
.
libTraffic = include_lib("/lib/libtrafficnet.so")
print(get_credentials_info(libTraffic))
get_ctf(user: string, password: string, eventName: string
): "get_ctf: user and password cannot be null""get_ctf: user or password incorrect"
copyReturns ctfEvent
object if there is one available. In case of failure this method will return a string
with details.
get_custom_object():
copyReturns map
which is shared throughout script execution. Can be helpful if it desired to pass or receive values when using launch
. Using this method in a SSH encryption process will cause an error to be thrown preventing further script execution.
get_custom_object.shouldEndScript = false
while (get_custom_object.shouldEndScript)
print("Waiting...")
wait(2)
end while
get_cycle_mining(self: coin
): "Unknown error: Unable to access to local computer""error: No internet access."
copyReturns a number
representing the defined interval in which each user receives a coin reward when mining. In case of failure, the method will return a string
with details. If an invalid coin object is provided, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
result = get_cycle_mining(coin)
if typeof(result) == "string" then
exit "Failed getting cyclic mining value due to: " + result
end if
print "cyclic mining value: " + result
get_description(self: ctfEvent
):
copyReturns a string
with the CTF event description. If the provided ctfEvent
object is invalid or missing, this method will return null
.
get_files(self: file
):
copyReturns a list
of files. In case the current entity is a file instead of a folder this method will return null
, so it is advisable to first use the is_folder
function before calling this method. In case the current folder gets deleted or an invalid file
object gets passed, this method will return null
as well.
computer = host_computer(get_shell)
binFolder = File(computer, "/bin")
files = get_files(binFolder)
for file in files
print(file.path)
end for
get_folders(self: file
):
copyReturns a list
of folders. In case the current entity is a file instead of a folder this method will return null
, so it is advisable to first use the is_folder
function before calling this method. In case the current folder gets deleted or an invalid file
object gets passed, this method will return null
as well.
computer = host_computer(get_shell)
binFolder = File(computer, "/home")
folders = get_folders(binFolder)
for folder in folders
print(folder.path)
end for
get_global_offers(self: wallet, coinName: string
): stringormap<string,list<any>>ornull
"Unknown error: Unable to access to local computer""No internet access."
copyReturns a map
with all the offers made by any player of a given currency. The key of the map
represents the WalletID of the player who has made the offer, and the value of the map
is a list
where index 0 represents the type of offer with a string
(Buy/Sell), index 1 represents the amount to sell or buy, and index 2 represents the price per unit. In case of failure, this method returns a string
with details. Any deviation from the method signature will result in null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
for item in get_global_offers(wallet, "test")
walletId = item.key
trade = item.value
isBuying = trade[0] == "Buy"
quantity = trade[1]
unitPrice = trade[2]
print "-" * 10
print "<b>" + walletId + "</b>"
if isBuying then
print "<color=green>Is buying</color>"
else
print "<color=yellow>Is selling</color>"
end if
print quantity + " coins with a unit price of " + unitPrice
end for
get_info(self: subWallet
): "Error: ${coinName} does not exist""Error: ${subWalletUser} does not exist""Error: main wallet linked to ${subWalletUser} does not exist anymore""Error: Coin ${coinName}does not exist in the Wallet user""Unknown error: Unable to access to local computer""No internet access."
copyReturns a string
with the information stored by the coin creator. If an object is passed that is not a subWallet
, this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
print "Subwallet info: " + subWallet.get_info
get_lan_ip(self: port
):
copyReturns a string
containing the local IP address of the computer to which the port is pointing. In case the passed object is not a port
this method will return null
.
router = get_router
ports = used_ports(router)
for port in ports
print("Port " + port_number(port) + " is pointed to " + get_lan_ip(port) + "!")
end for
get_mail_content(self: ctfEvent
):
copyReturns a string
with the mail content of the CTF event. If the provided ctfEvent
object is invalid or missing, this method will return null
.
get_mined_coins(self: coin
): "Unknown error: Unable to access to local computer""error: No internet access."
copyReturns a number
representing the amount of coins that have been mined so far. In case of an error, the method will return a string
with details. If an invalid coin object is provided, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
result = get_mined_coins(coin)
if typeof(result) == "string" then
exit "Failed to get mined coins due to: " + result
end if
print "mined coins: " + result
get_name(self: computer
): "Unknown"
copyReturns the hostname of the machine. If an invalid computer
object is passed, this method will return a string
containing "Unknown"
.
computerName = get_name(host_computer(get_shell))
print("The name of your machine is " + computerName)
get_num_conn_gateway(self: netSession
):
copyReturns the number of devices using this router as a gateway. If you obtained your netSession
from a computer, it will fetch and return the value from its gateway router. If an invalid netSession
gets passed this method will return null
.
metax = include_lib("/lib/metaxploit.so")
ports = used_ports(get_router("1.1.1.1"))
netSession = net_use(metax, "1.1.1.1", port_number(ports[0]))
print("Gateway clients: " + get_num_conn_gateway(netSession))
get_num_portforward(self: netSession
):
copyReturns the number of ports forwarded by this router. If you obtained your netSession
from a computer, it will fetch and return the value from its gateway router. If an invalid netSession
gets passed this method will return null
.
metax = include_lib("/lib/metaxploit.so")
ports = used_ports(get_router("1.1.1.1"))
netSession = net_use(metax, "1.1.1.1", port_number(ports[0]))
print("Port forwards: " + get_num_portforward(netSession))
get_num_users(self: netSession
):
copyReturns the number of user accounts on the system. If an invalid netSession
gets passed this method will return null
.
metax = include_lib("/lib/metaxploit.so")
ports = used_ports(get_router("1.1.1.1"))
netSession = net_use(metax, "1.1.1.1", port_number(ports[0]))
print("User accounts: " + get_num_users(netSession))
get_pending_trade(self: wallet, coinName: string
): "Unknown error: Unable to access to local computer""No internet access.""No pending trades found"
copyReturns a list
with the pending sale or purchase offer of this wallet for a certain currency. Index 0 of the list
represents the type of offer with a string
(Buy/Sell), index 1 represents the quantity to be sold or bought, and index 2 represents the price per unit. On failure, this method will return a string
with details. Any deviation from the method signature will result in a null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
result = get_pending_trade(wallet, "test")
isBuying = result[0] == "Buy"
quantity = result[1]
unitPrice = result[2]
currentBalance = get_balance(wallet, "test")
if isBuying then
print "After buying was successful your balance will be " + (quantity * unitPrice + currentBalance)
else
print "After selling was successful your balance will be " + (currentBalance - quantity * unitPrice)
end if
get_pin(self: wallet
): "Unknown error: Unable to access to local computer""No internet access."
copyReturns a string
with a PIN that refreshes every few minutes. This PIN is used to obtain an account in cryptocurrency services. If the passed value is not a wallet
this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
myShell = get_shell
myComputer = host_computer(myShell)
wallet = login_wallet(blockchain, "test", "test")
touch(myComputer, "/root", "pin_launch.src")
myFile = File(myComputer, "/root/pin_launch.src")
set_content(myFile, "
blockchain = include_lib(""/lib/blockchain.so"")
myShell = get_shell
myComputer = host_computer(myShell)
wallet = login_wallet(blockchain, ""test"", ""test"")
if params[0] == get_pin(wallet) then
get_custom_object.secret = ""The answer is 42""
else
get_custom_object.secret = ""The answer is 10053""
end if
")
build(myShell, "/root/pin_launch.src", "/root")
delete(myFile)
launch(myShell, "/root/pin_launch", get_pin(wallet))
print "The secret: " + get_custom_object.secret
get_ports(self: computer
):
copyReturns a list
of port
s on the computer
which are active. If an invalid computer
object is passed, this method will return null
.
router = get_router
ports = get_ports(host_computer(get_shell))
for port in ports
print("Info: " + router.port_info(port))
end for
get_reward(self: coin
): "Unknown error: Unable to access to local computer""error: No internet access."
copyReturns a number
representing the amount of coins that will be received as a reward after each mining cycle. In case of failure, the method will return a string
with details. If an invalid coin object is provided, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
result = get_reward(coin)
if typeof(result) == "string" then
exit "Failed getting reward value due to: " + result
end if
print "reward value: " + result
get_router(ipAddress: string = ""
):
copyReturns by default the router
to which the executing computer is connected to. Optionally an IP address can be provided. In case of failure null
is returned. If there is no active internet connection, this method will throw an error, interrupting further script execution.
router = get_router
if router.local_ip == get_shell.host_computer.network_gateway then
print("Router is equal to network gateway.")
else
print("Router is not equal to network gateway.")
end if
get_shell(user: string = "", pass: string = ""
):
copyReturns the shell
that is executing the current script. Optionally, a username and password can be provided, allowing the use of a shell with other user privileges. If the username or password does not match an existing user or if the provided values deviate from the defined signature, this method will return null
.
shell = get_shell("root", "test")
if shell == null then
print("Couldn't obtain root shell.")
else
print("Obtained root shell.")
end if
get_subwallet(self: coin, subWalletUser: string
): "Unknown error: Unable to access to local computer""error: No internet access.""get_subwallet: The account does not exist"
copyReturns a subWallet
object on success. In case of error, it returns a string
with the details. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
result = get_subwallet(coin, "test")
if typeof(result) == "string" then
exit "Failed to get subwallet due to: " + result
end if
print "Successfully received subwallet!"
get_subwallets(self: coin
): stringorlist<subWallet>ornull
"Unknown error: Unable to access to local computer""error: No internet access."
copyReturns a list
where each item is a subWallet
object, including all the accounts registered in the cryptocurrency. In case of error, it returns a string
with the details. If an invalid coin object is provided, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
result = get_subwallets(coin)
if typeof(result) == "string" then
exit "Failed to get subwallets due to: " + result
end if
for subwallet in result
print get_user(subwallet) + " has " + get_balance_subwallet(subwallet) + " coins"
end for
get_switch(ipAddress: string
):
copyReturns the switch on the local network whose IP address matches, otherwise it returns null
.
router = get_switch("192.168.0.2)
print("IP address of switch: " + router.local_ip)
get_template(self: ctfEvent
):
copyReturns a string
with the CTF event template. If the provided ctfEvent
object is invalid or missing, this method will return null
.
get_user(self: subWallet
): "Unknown error: Unable to access to local computer""No internet access."
copyReturns a string
with the username associated with this subwallet. On failure, this method returns a string
with an error message. If an object is passed that is not a subWallet
, this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
print "Subwallet user: " + subWallet.get_user
group(self: file
):
copyReturns a string
with the name of the group to which this file belongs. Group permissions get applied to whoever is the owner of a file. In case the current file gets deleted or an invalid file
object gets passed, this method will return null
.
computer = host_computer(get_shell)
lsBinary = File(computer, "/bin/ls")
print("File is related to following group: " + group(lsBinary))
groups(self: computer, user: string
):
copyReturns a string
containing groups associated with an existing user on the computer
. In case the user does not exist, a string
will be returned with an error message. If the provided username is empty, an error will be thrown preventing further script execution. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
computer = host_computer(get_shell("root", "test"))
create_group(computer, "root", "staff")
groups = groups(computer, "root")
listOfGroups = groups.split(char(10))
print(listOfGroups)
hasIndex(value: map<any,any>orlist<any>orstring, index: any
): 01
copyVerifies if an index is available within an object. In case of success this method will return a number
with the value one. In case of failure the value will be a zero. This method supports map
s, list
s and string
s. Each passed type may result in different behavior therefore it is advisable to take a look at each of their specific signatures. In case an unsupported value gets passed this method will return null
.
print("List has index: " + hasIndex([1, 2, 3], 2)
has_permission(self: file, perms: string = ""
): 10
copyReturns a number
indicating if the user who launched the script has the requested permissions. One will indicate that the user has the correct permissions. In case permissions are lacking, the value will be zero. There are three different permission types: read "r"
, write "w"
, and execute "x"
. In case the file gets deleted or an invalid file
object gets passed, this method will return null
instead.
computer = host_computer(get_shell)
lsBinary = File(computer, "/bin/ls")
print("Is able to execute ls: " + has_permission(lsBinary, "x"))
hash(value: any
):
copyReturns numeric hash for the provided data. Using this method within a SSH encryption process will cause an error to be thrown causing the script execution to stop.
hashA = hash({ "a": 2, "b": 1 })
hashB = hash({ "b": 1, "a": 2 })
if (hashA == hashB) then
print("Objects are alike!")
else
print("Objects are different!")
end if
home_dir():
copyReturns a string
with the home folder path of the user who is executing the current script.
print("Home dir of current user: " + home_dir)
host_computer(self: shell
):
copyReturns a computer
related to the shell
. If an invalid shell
object gets passed this method will return null
.
shell = get_shell
computer = host_computer(shell)
print("Computer public IP is: " + public_ip(computer))
import_code(path: string
):
copyEnables to import code from different sources into one file. This is useful in case you want to split code into different files and also to avoid any limitation in regards to text file character limits. Note that import_code
requires an absolute path and is called while compiling the file into a binary instead of during runtime. Additionally import_code
cannot be nested. Code can be either imported from plain text files or binaries that have "allow import"
enabled. import_code
is also parsed wherever it is found, not even a
comment will prevent it being evaluated.
//Content of main.src
import_code("/home/user/my_module.src")
print("bye")
//Content of my_module.src
print("hello!")
include_lib(path: string
): cryptoormetaxploitorserviceorblockchainoraptClientorsmartApplianceortrafficNetornull
copyEnables the inclusion of library binaries, which can be used inside your script. If successful, an object related to the provided library will be returned; otherwise, null
is returned. This function is exclusively for importing library binaries. If you want to import custom scripts or binaries into your project, use import_code
instead. Passing anything other than a string
for the path, or leaving the path empty, will cause an error to be thrown, interrupting further script execution.
crypto = include_lib("/lib/crypto.so")
if crypto == null then
print("Crypto library couldn't get imported.")
else
print("Crypto library got imported.")
end if
indexOf(self: list<any>ormap<any,any>orstring, value: any, after?: any
):
copyLookups index of value within map
s, list
s, or string
s. For list
s and string
s, the behavior is very similar. On success, you'll receive a number
representing the found index. On failure, it will return null
. For map
s, it's a bit different since the returned value could be of any type. On failure, it will return null
as well. If a value gets passed that is not supported, this method returns null
.
index = indexOf("test", "e")
print("e is at: " + index)
indexes(self: map<any,any>orlist<any>orstring
):
copyReturns a list
containing all indexes or keys of the passed object. This method supports map
s, list
s, and string
s. The type of each item may vary when using this method on a map
since keys could be any type. The other types will return a list
where each item is a number
. In case a type is passed that is not supported, this method will return null
.
indexesOfStr = indexes("test")
print("Following indexes are available: " + indexesOfStr.join(", "))
insert(object: list<any>orstring, index: number, value: any
):
copyInserts a value into either a list
or a string
. If the method is used on any other data type or the passed index is not a number
, this method throws an error, preventing further script execution.
list = [2, 3, 4]
insert(list, 2, 42)
print("List with inserted item: " + list.join(", "))
install(self: aptClient, package: string, customPath: string = ""
): "unknown error""Invalid path""${filepath} not found""permission denied""permission denied. ${filename} is protected""The copy can not be made. Reached maximum number of files in a folder""The copy can not be made. Reached maximum limit""No internet access.""Remote host is down""Unable to find service ${service}""Invalid target service port configuration.""connection rejected: port forward removed by admin""Unable to connect: missing ${library}""Unable to connect: invalid ${library}""Unexpected library found. Not a valid ${library} library.""Unknown error""can't connect: invalid or missing kernel_router.so in the target router""can't connect: unexpected library found. Not a valid kernel_router.so library in the target router.""Connection refused. Address unreachable""Connection refused. The target is behind a firewall.""Fatal error: ${filepath} corrupted!""Kernel panic: missing ${filepath} file!""Graphics error: ${filepath} not found!""Fatal error: ${filepath} not found!""ip address not found""can't connect: the remote server has been temporarily disabled due to non-payment""can't connect: port ${port} not found""can't connect: port closed""can't connect: There is no active machine behind the port ${port}""can't connect: service not found behind the port ${port}""Unknown error: Unable to access to local computer""apt_install: No internet access.""/etc/apt/aptcache.bin not found. Launch apt with the update option to refresh the file""package name can not be empty""There is not enough free space on the hard disk.""${customPath} not found.""${serviceDBFile} does not exist in the server""apt folder content does not exist in the server""${package} does not exist in the server""/etc/apt/aptcache.bin content is malformed. Launch apt with the update option to refresh the file""${package} not found in the server"1
copyInstalls a program or library from a remote repository listed in "/etc/apt/sources.txt"
. If no path is specified, the program installs in "/lib"
if it is a library or in "/bin"
otherwise. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
. On success, it will return a number
with the value one. In case of failure, it will return a string
containing an error message.
aptClient = include_lib("/lib/aptclient.so")
result = install(aptClient, "rshell_interface")
if result == 1 then
print "Installed program successful!"
else
print "Error while installing: " + result
end if
install_service(self: service
): "Denied. Only root user can install this service."1
copyInstalls the necessary files for the correct functioning of the service and starts it. If the installation is completed successfully, it returns a number
with the value one. In case of an error, it returns a string
with details. If the passed object is not a service
this method will cause a crash.
service = include_lib("/lib/libhttp.so")
result = install_service(service)
if result == 1 then
print "Successfully installed service"
else
print "Service installation failed: " + result
end if
is_any_active_user(self: netSession
): 01
copyReturns a number
. If there is an active user on the system it will be one. Otherwise, it will be zero. If an invalid netSession
gets passed this method will return null
.
metax = include_lib("/lib/metaxploit.so")
ports = used_ports(get_router("1.1.1.1"))
netSession = net_use(metax, "1.1.1.1", port_number(ports[0]))
print("User Active?: " + is_any_active_user(netSession))
is_binary(self: file
): 10
copyReturns a number
. If the file is a binary, the value will be one; otherwise, it will be zero. In case the file gets deleted or an invalid file
object gets passed, this method will return null
instead.
computer = host_computer(get_shell)
lsBinary = File(computer, "/bin/ls")
print("File is a binary: " + is_binary(lsBinary))
is_closed(self: port
): 01
copyReturns a number
, where one indicates that the specified port
is closed and zero indicates that the port is open. In case the passed object is not a port
this method will return null
.
router = get_router
ports = used_ports(router)
for port in ports
state = "open"
if (is_closed(port)) then state = "closed"
print("Port " + port_number(port) + " is " + state + "!")
end for
is_folder(self: file
): 10
copyReturns a number
. The value is one if the file is a folder, zero otherwise. In case the file gets deleted or an invalid file
object is passed, this method will return null
instead.
computer = host_computer(get_shell)
etcFolder = File(computer, "/etc")
print("Is a folder: " + is_folder(etcFolder))
is_lan_ip(ip: string
):
copyReturns a number
. One indicates that the provided IP address is a valid LAN IP address. Otherwise, zero will be returned.
print("Is Lan IP: " + is_lan_ip("192.168.0.1"))
is_match(value: string, pattern: string, regexOptions: string = "none"
): 10
copyUses regular expression to check if a string matches a certain pattern. If it matches, it will return a number
with the value one. If it does not match, the value of the number
will be zero. If any provided arguments deviate from the method signature types, if the pattern is empty, if the provided regexOptions are invalid, or if the regular expression times out, an error will be thrown, preventing further script execution.
myString = "42 as an answer is wrong"
hasWordAtTheEnd = is_match(myString, "\w+$")
print(hasWordAtTheEnd)
is_network_active(self: computer
): 01
copyReturns a number
with either the value one or zero. The value will be one if the computer
has internet access. If there is no internet access, it will return zero instead. In case an invalid computer
object is passed, this method will return null
.
computer = host_computer(get_shell)
if is_network_active(computer) then
print("You're connected.")
else
print("You're not connected.")
end if
is_patched(self: metaLib, getdate: number
): "Error: The file must be a library"01
copyReturns by default a number indicating whether the library has been patched. A value of one indicates that the library has been patched, while zero indicates that it has not. If the getdate parameter is set to true
, the function will return a string
containing the date of the last patch. The data format is as follows: "dd/MM/yyyy"
. Additionally if there is any error the return value will be a string
. Providing values that deviate from the defined signature will cause null
to be returned.
metax = include_lib("/lib/metaxploit.so")
metaLib = load(metax, "/lib/init.so")
isPatchedResult = is_patched(metaLib)
if isPatchedResult == 1 then
print("init.so has been patched!")
end if
is_root_active_user(self: netSession
): 01
copyReturns a number
. If there is an active root on the system it will be one. Otherwise, it will be zero. If an invalid netSession
gets passed this method will return null
.
metax = include_lib("/lib/metaxploit.so")
ports = used_ports(get_router("1.1.1.1"))
netSession = net_use(metax, "1.1.1.1", port_number(ports[0]))
print("Root Active?: " + is_root_active_user(netSession))
is_symlink(self: file
): 10
copyReturns a number
. If the file is a symlink, the value will be one; otherwise, it will be zero. In case the file gets deleted or an invalid file
object gets passed, this method will return null
instead.
computer = host_computer(get_shell)
lsBinary = File(computer, "/bin/ls")
print("File is a symlink: " + is_symlink(lsBinary))
is_valid_ip(ip: string
):
copyReturns a number
. If the provided IP address is valid, its value will be one. Otherwise, its value is zero.
print("Is valid IP: " + is_valid_ip("1.1.1.1"))
join(value: list<any>, delimiter: string = " "
):
copyReturns a concatenated string
containing all stringified values inside the list
. These values will be separated via the provided separator. Passing anything other than a list
will result in the original value being returned. In case the passed list
exceeds 16777215L
items or the delimiter exceeds 128 characters, this method will throw an error, interrupting further script execution.
myList = [42, 1, 3]
print(join(myList, " .-*'*-. "))
kernel_version(self: router
):
copyReturns a string
with the version of the kernel_router.so
library. In case the passed object is not a router
this method will return null
.
router = get_router
version = kernel_version(router)
print("Kernel router version: " + version)
lan_ip(self: computer
):
copyReturns a string
with the local IP address of the computer
. If an invalid computer
object is passed, this method will return null
.
localIp = lan_ip(host_computer(get_shell))
print("Public ip:" + localIp)
lastIndexOf(self: string, searchStr: string
):
copyReturns a number
indicating the last matching index of the provided value inside the string
. If the value does not exist inside the string
, -1
is returned. If any of the provided values deviates from the defined types in the method signature, this method will return null
.
myString = "42 as an answer is wrong"
index = lastIndexOf(myString, "wrong")
if index != -1 then
print("Invalid information spotted at: " + index)
else
print("Information seems valid.")
end if
last_transaction(self: subWallet
): list<list<any>>ornumberorstringornull
"Unknown error: Unable to access to local computer""No internet access."0
copyReturns a list
with the information of the last transaction. Index 0 is a string
with the other subWallet. Index 1 is an integer with the amount. Index 2 is a number
indicating the direction of the transaction (0 for Deposit, 1 for Withdrawal). Index 3 is a string
indicating the date of the transaction. On failure, this method will either return a number
with the value zero or a string
with an error message. If an object is passed that is not a subWallet
, this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
transactionItem = subWallet.last_transaction
destinationAccount = transactionItem[0]
amount = transactionItem[1]
direction = transactionItem[2]
completeDate = transactionItem[3]
if direction == 0 then
print "Received " + amount + " from " + destinationAccount + " got completed at the " + completeDate
else
print "Send " + amount + " to " + destinationAccount + " got completed at the " + completeDate
end if
launch(self: shell, program: string, params: string = ""
): "Invalid shell""Can't find computer"10
copyLaunches the binary located at the provided path. Optionally, parameters can be passed. Returns a number
. If the launch was successful, the value will be one; otherwise, it will be zero. In some cases, a string
will be returned containing an error message. If you need to share variables between a launched script and the current process, consider using get_custom_object
. Note that launching a script is not asynchronous, meaning that the current script will pause its execution until the launched script finishes. This method cannot be used to execute binaries with an EXE extension (GUI interface). If any provided values deviate from the method signature, a runtime exception will be thrown.
shell = get_shell("root", "test")
launch(shell, "/bin/cat", "/etc/passwd")
launch_path():
copyReturns a string
containing the path of the script that was initially executed, meaning that even when using launch
, it will still return the path of the initially executed script.
path = launch_path
print("Script gets executed within: " + parent_path(path))
len(self: list<any>ormap<any,any>orstring
):
copyReturns number
indicating what size the passed object is. In case anything other than a map
, list
or string
gets passed this method will return null
.
length = len("test")
print("Length of string is: " + length)
lib_name(self: metaLib
):
copyReturns a string
containing the name of the library. An example of a name would be "init.so"
. In case an invalid metaLib
object gets passed this method will return null
.
metax = include_lib("/lib/metaxploit.so")
metaLib = load(metax, "/lib/init.so")
print("Name for library is: " + lib_name(metaLib))
list():
copyReturns a map
which enables to extend list types with custom methods.
list.map = function(callback)
newList = []
for item in self
newList.push(callback(item, __item_idx))
end for
return newList
end function
myMapFunction = function(item, index)
print "Mapping value at index: " + index
return item.myValue
end function
print [{ "myValue": 24 }].map(@myMapFunction)
list_coins(self: wallet
): list<string>orstringornull
"Unknown error: Unable to access to local computer""No internet access.""Error: wallet does not exist/incorrect credentials."
copyReturns a list
where each item is a string
with the names of the coins available in the wallet
. On failure this method returns a string
with an error message. If the passed value is not a wallet
this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
print "My wallet is connected to: " + join(list_coins(wallet), ", ")
list_global_coins(self: wallet
): stringorlist<string>ornull
"Unknown error: Unable to access to local computer""No internet access."
copyReturns a list
where each item is a string
containing the names of all the currencies that exist. In case of failure, this method returns a string
with details. If the passed value is not a wallet
this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
print "All existing coins: " join(list_global_coins(wallet), ", ")
load(self: metaxploit, path: string
):
copyReturns a metaLib
object for the provided path to the library binary. Keep in mind that this can only be used on library files. On failure, this method will return null
. If the provided path is empty, this method will throw a runtime exception, preventing further script execution.
metax = include_lib("/lib/metaxploit.so")
libFolder = File(host_computer(get_shell), "/lib")
for file in get_files(libFolder)
metaLib = load(metax, file.path)
print("Library: " + lib_name(metaLib) + " - " + version(metaLib))
end for
local_ip(self: router
):
copyReturns a string
with the local IP address of the router. In case the passed object is not a router
this method will return null
.
router = get_router
localIp = local_ip(router)
print("Local IP: " + localIp)
locate_vehicle(self: trafficNet, licensePlate: string, password: string
): "Error: This user cannot access the global camera system for another 24 hours.""Error: This network has disabled access to the traffic cameras.""error: Workstation not found. Unable to get the credentials info from ${credentials}""error: Incorrect password. Access denied.""Unknown error: Unable to access to local computer""error: No internet access.""error: This device is not registered on any police network""locate_vehicle: License plate not found.""The vehicle could not be located in the camera system at this time."1
copyPerforms a search for the specified license plate to locate the vehicle. If the vehicle is visible on any camera, the viewer will switch to the camera currently displaying it and return a number
with the value one. If the vehicle cannot be located or the license plate is incorrect, a string
indicating the error is returned. If any of the provided values deviates from the defined types in the method signature, this method will return null
.
libTraffic = include_lib("/lib/libtrafficnet.so")
camera_link_system(libTraffic)
vehicleSearchResult = locate_vehicle(libTraffic, "1L2M3N", "pass")
if vehicleSearchResult == 1 then
print("Found vehicle!")
end if
log(value: number = 0, base: number = 10
):
copyReturns the natural logarithm of a number
. By default, the base is 10. Optionally the base can be changed.
a = 2
b = 8
baseLog = log(a) / log(b)
print("Base log is: " + baseLog)
login_wallet(self: blockchain, user: string, password: string
): "Unknown error: Unable to access to local computer""login_wallet: No internet access.""login_wallet: Account not found or incorrect password"
copyReturns a wallet
object on success. In case of an error, it will return a string
indicating the reason. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
if typeof(wallet) == "string" then
print "Login failed due to: " + wallet
else
print "Login was successful!"
end if
lower(self: string
):
copyReturns a string
which is the lowercase transformed version of the provided string
. In case anything other than a string
gets passed this method will return the passed value again.
myString = lower("HELLO WORLD")
print(myString)
mail_login(user: string, pass: string
): "Unable to login into account. Wrong password.""${user} user not found""Unknown error: This email account cannot be obtained.""Unknown error: Unable to access to local computer""login: No internet access."
copyReturns a MetaMail
entity if the login was successful. On failure a string
with details gets returned. In case any of the provided values deviate from the types defined in the signature this method will return null
.
metaMail = mail_login("test@test.com", "test")
if metaMail == null then
print("Loggin failed.")
else
print("You've got mail.")
end if
map():
copyReturns a map
which enables to extend map types with custom methods.
map.extend = function(value)
for item in value
self[item.key] = item.value
end for
return self
end function
test = {"123":123}
test.extend({"bar": "foo"})
print "My extended value: " + test.bar
matches(value: string, pattern: string, regexOptions: string = "none"
):
copyReturns a map
with all search results for the provided regular expression. Each key contains the index and the value contains the matching string
. If any provided arguments deviate from the method signature types, if the pattern is empty, if the provided regexOptions are invalid, or if the regular expression times out, an error will be thrown, preventing further script execution.
myString = "42 as an answer is wrong"
result = matches(myString, "w")
print(result)
md5(value: string
):
copyReturns the MD5 hash string
of the provided string
. Using this method within an SSH encryption process or passing anything other than a string
will cause an error to be thrown, stopping any further script execution.
passwordHash = md5("test")
print("Hash for the password 'test' is " + passwordHash)
mining(self: subWallet
): "Unknown error: Unable to access to local computer""No internet access.""all existing coins of ${coinName} have been mined.""Only one mining process is allowed.""Error: GPU is damaged. Unable to start the mining process.""Error: GPU returned corrupted data while performing floating point tests. Unable to start the mining process.""Hardware error"1
copyStarts the process of mining the cryptocurrency. The process leaves the terminal busy until a coin is mined. On success, this method will return a number
with the value one. On failure, this method will return a string
with details. If an object is passed that is not a subWallet
, this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
while subWallet.mining == 1
print "Mining...", true
print "Balance " + subWallet.get_balance
end while
model(self: smartAppliance
): "Unknown error: Unable to access to local computer""error: No internet access.""error: Device hardware malfunction"
copyReturns a string
with the appliance model ID. If the passed object is not a smartAppliance
this method will return null
.
libSmartapp = include_lib("/lib/libsmartappliance.so")
modelResult = model(libSmartapp)
if modelResult.matches("^[A-Z]+$") then
print("Model is: " + modelResult)
else
print("Model couldn't be determined due to: " + modelResult)
end if
move(self: file, path: string = "", fileName: string = ""
): "Unknown error""Error: Invalid path""${sourceFilepath} not found""${destinationParentPath} not found""permission denied""There is not enough free space on the hard disk.""permission denied. ${filename} is protected.""A file cannot overwrite a folder or vice versa""The copy can not be made. Reached maximum number of files in a folder""The copy can not be made. Reached maximum limit""Error: only alphanumeric allowed as newname"1
copyMoves the file
to the provided path. Files can only be moved if the user has read and write permissions or is root. The new filename has to be below 128 characters and alphanumeric. After success, this method will return a number
with the value one. Otherwise, this method will return a string
with details. If any of the parameter types deviate from the method signature, this method is used within an SSH encryption process, the new name exceeds 128 characters, or the path is too long, an error will be thrown, causing an interruption of script execution. In case the current file gets deleted or an invalid file
object is passed, this method will return null
.
computer = host_computer(get_shell("root", "test"))
passwdFile = File(computer, "/etc/passwd")
moveResult = move(passwdFile, "/root/", "newFileName")
if typeof(moveResult) == "string" then
print("There was an error while moving file: " + moveResult)
else
print("File got moved successfully.")
end if
name(self: file
):
copyReturns a string
with the name of the file. In case the file gets deleted or an invalid file
object gets passed, this method will return null
instead.
computer = host_computer(get_shell)
passwdFile = File(computer, "/etc/passwd")
print("Filename: " + name(passwdFile))
net_use(self: metaxploit, ip: string, port: number = 0
):
copyReturns a netSession
object for the provided IP address and port. Note that if the port is set to zero, it will return a netSession
related to the kernel router. The main purpose of this method is to gain a netSession
and then use dump_lib
to receive a metaLib
object to exploit vulnerabilities. In case of failure, this method will return null
. If this method is used within an SSH encryption process or with disabled internet, or if an invalid target IP is provided, this method will throw a runtime exception.
metax = include_lib("/lib/metaxploit.so")
ports = used_ports(get_router("1.1.1.1"))
for port in ports
netSession = net_use(metax, "1.1.1.1", port_number(port))
metaLib = dump_lib(netSession)
print("Library: " + lib_name(metaLib) + " - " + version(metaLib) + " on port " + port_number(port))
end for
network_devices(self: computer
):
copyReturns a string
containing all network devices available on the computer
, with each item providing information about the interface name, chipset, and whether monitoring support is enabled. If an invalid computer
object is passed, this method will return null
.
computer = host_computer(get_shell)
devices = network_devices(computer)
deviceList = devices.split(char(10))
for item in deviceList
print(item)
end for
network_gateway(self: computer
): "0.0.0.0"
copyReturns a string
with the gateway IP address configured on the computer
. If an invalid computer
object gets passed, this method returns a string
with the value "0.0.0.0"
.
computer = host_computer(get_shell)
gatewayIp = network_gateway(computer)
print("Gateway IP: " + gatewayIp)
nslookup(webAddress: string
): "Not found"
copyReturns the IP address for the provided web address. In case the web address cannot be found a string
gets returned containing the following message: "Not found"
. If the provided web address is not a string
or empty this method will throw an error preventing further script execution.
url = params[0]
print("IP for website is: " + nslookup(url))
number():
copyReturns a map
which enables to extend number types with custom methods.
number.bitwise = function(operator, right)
return bitwise(operator, self, right)
end function
print (1234).bitwise(">>", 1)
overflow(self: metaLib, memoryAddress: string, unsecZone: string, optArgs: string = ""
): stringornumberorshellorcomputerorfileornull
"Exploit failed: the remote server has been temporarily disabled due to non-payment"01
copyExploits vulnerabilities. The returned value can be of various data types. Therefore, using typeof
is advisable. optArgs
are required when changing a password or obtaining a computer
via a router. It should be the desired password or LAN IP, respectively. Change password, traffic light and firewall disable exploits will return a number
, where the value is either one or zero. One indicates success while zero indicates failure. Shell, computer, and file exploits either return an instance of their type or null
. Providing values that deviate from the defined signature will cause a runtime exception to be thrown.
metax = include_lib("/lib/metaxploit.so")
metaLib = load(metax, "/lib/init.so")
scanResult = scan(metax, metaLib)
target = scanResult[0]
scanAddress = scan_address(metax, metaLib, target)
segments = split(scanAddress, "Unsafe check: ")
exploit = null
for segment in segments
hasRequirement = indexOf(segment, "*") != null
if (not hasRequirement) then
labelStart = indexOf(segment, "<b>")
labelEnd = indexOf(segment, "</b>")
exploit = segment[labelStart + 3: labelEnd]
end if
end for
if (exploit) then
print("Exploiting... " + target + ":" + exploit)
print(overflow(metaLib, target, exploit))
else
print("No exploit found with zero requirements")
end if
override_settings(self: smartAppliance, power: number, temperature: number
): "Unknown error: Unable to access to local computer""error: No internet access.""error: Device hardware malfunction""override_settings: denied: The settings are locked for security reasons."1
copyOverrides the power and temperature settings of the appliance. If successful, it returns a number
with the value one; otherwise, it returns a string
detailing the error. If any arguments deviate from the defined signature, this method will return null
.
libSmartapp = include_lib("/lib/libsmartappliance.so")
overrideResult = override_settings(libSmartapp, 1000, 20)
if overrideResult == 1 then
print("Override was successful!")
else
print("Override failed due to: " + overrideResult)
end if
owner(self: file
):
copyReturns a string
with the name of the file owner. User permissions get applied to whoever is the owner of a file. In case the current file gets deleted or an invalid file
object gets passed, this method will return null
.
computer = host_computer(get_shell)
lsBinary = File(computer, "/bin/ls")
print("Owner of ls is: " + owner(lsBinary))
parent(self: file
):
copyReturns the parent folder of the current file or folder. In case there is no parent folder null
will be returned instead. In case the file gets deleted or an invalid file
object gets passed, this method will return null
as well.
computer = host_computer(get_shell)
etcFolder = File(computer, "/etc")
print("Parent path: " + path(parent(etcFolder)))
parent_path(directory: string
):
copyReturns a string
which is the parent path of the provided path. The path provided needs to be properly formatted. If the path is any other type than a string
or is empty, this method will throw an error interrupting further script execution.
print("Is proper parent path: " + (parent_path("/my/test/path") == "/my/test"))
path(self: file, symlinkOrigPath: number = 0
):
copyReturns a string
containing the file path. If the file is a symlink, the optional symlinkOrigPath
argument can be set to return the original path of the linked file instead. If the file has been deleted, this method will still return the path it had prior to deletion. If an invalid file
object is passed, this method will return null
.
computer = host_computer(get_shell)
passwdFile = File(computer, "/etc/passwd")
print("File location: " + path(passwdFile))
payload(self: debugLibrary, memZone: string, pathFile: string = ""
): stringorlist<map<any,any>>ornull
"error: file not found""Error: The file must be a library""Error: The library is patched against this vulnerability.""Failed: No vulnerabilities have been found in the specified memory area.""Error acquiring partial object file. Unable to access to resource: ${pathFile}"
copyReturns a list
containing a single partial computer
object if zero-day vulnerabilities are detected within the specified memory zone. If a file path is provided, a partial file
object associated with this path will also be included in the list
. Additionally, if this file is a library, its corresponding metaLib
object is added to the returned list
. In case of an error, a string
with details is returned. Providing arguments that deviate from the defined signature will result in null
.
metax = include_lib("/lib/metaxploit.so")
metaLib = load(metax, "/lib/init.so")
debugLib = debug_tools(metaLib, "test", "test")
result = payload(debugLib, "0x7A69F4C3")
if typeof(result) == "list" and len(result) > 0 then
print("Successfully executed payload!")
end if
permissions(self: file
):
copyReturns a string
with the current file permissions. In case the current file gets deleted or an invalid file
object gets passed, this method will return null
. The format for this permissions string
is as follows: "[fileType][wrx](u)[wrx](g)[wrx](o)"
. The file type is either "d"
in case it's a directory or "-"
. The user type gets defined through three possible types: user "u"
, group "g"
, and other "o"
. There are three different permission types: read "r"
, write "w"
, and execute "x"
. An example of a string
returned by this method would be "-rwxr-xr-x"
. Taking the latter as an example, the following things become clear:
- The provided file is not a directory.
- The user has full access.
- The group and others have almost all permissions besides writing.
computer = host_computer(get_shell)
binFolder = File(computer, "/bin")
perms = permissions(binFolder)
fileType = perms[0]
permissionsForUser = perms[1:4]
permissionsForGroup = perms[4:7]
permissionsForOther = perms[7:10]
print("File type: " + fileType)
print("User permissions: " + permissionsForUser)
print("Group permissions: " + permissionsForGroup)
print("Other permissions: " + permissionsForOther)
pi():
copyReturns the number
PI to the precision of six.
radius = 10
circumference = 2 * pi * radius
print("Circumference: " + circumference)
ping(self: shell, ip: string
): "ping: invalid ip address"10
copyReturns a number
. If the remote address could be reached the value will be one, zero otherwise. Firewalls do not block ping requests. Passing an invalid ip will cause the method to return a string
with an error message. If any provided arguments deviate from the method signature a runtime exception will be thrown. If the passed object is a map-like object such as computer
or file
but not shell
this method will return null
.
shell = get_shell
isPingable = ping(shell, "1.1.1.1")
if isPingable then
print("Ping was successful!")
else
print("Ping failed!")
end if
ping_port(self: router, port: number
):
copyReturns a port
that is behind the port number
provided. In case the port
does not exist null
gets returned.
router = get_router
ports = used_ports(router)
for port in ports
pingedPort = ping_port(router, port.port_number)
if (pingedPort == null) then continue
print("Pinged " + port_number(pingedPort))
end for
player_success(self: ctfEvent
): 01
copyReturns a number
with the value one if the CTF event was completed successfully. Otherwise, this method will return a number
with the value zero. If the provided ctfEvent
object is invalid or missing, this method will return null
.
pop(self: list<any>ormap<any,any>
):
copyWhen passing a list
to this method, it will return the value at the last index and remove it from the list
. Additionally, if a map
is passed, it will always return the value corresponding to the first matching key and mutate the map
object accordingly. However, passing a map-like object such as file
or computer
will result in an error, interrupting further script execution. If the passed object is empty or is anything other than a map
or list
, the method will return null
.
list = [0, 1, 2, 3, 4, 5]
print("The last item is: " + pop(list))
port_info(self: router, port: port
):
copyReturns a string
with information about the provided port, including details about the running service and its version. For example, the output could be "http 1.0.0"
. If the operation fails, null
will be returned.
router = get_router
ports = used_ports(router)
for port in ports
info = port_info(router, port)
print(info)
end for
port_number(self: port
):
copyReturns the number
which is used for the port. In case the passed object is not a port
this method will return null
.
router = get_router
ports = used_ports(router)
for port in ports
print("Port " + port_number(port) + " is in use!")
end for
print(value: any = "", replaceText: number = 0
):
copyPrint a message on the Terminal. Optionally replacing can be enabled which will replace all previous prints. This can be useful for creating a loading bar for example. There is also the possibility of styling output by using TextMeshPro rich-text tags.
for i in range(9)
print(("#" * (9 - i)) + ("-" * i) , true)
wait(0.2)
end for
program_path():
copyReturns a string
containing the path of the script that is currently executing. It will update when using launch
, which makes it different from launch_path
.
path = program_path
print("Script gets executed within: " + parent_path(path))
public_ip(self: router
):
copyReturns a string
with the public IP address of the router. In case the passed object is not a router
this method will return null
.
router = get_router
publicIp = public_ip(router)
print("Public IP: " + publicIp)
public_ip_pc(self: computer
):
copyReturns a string
with the public IP address of the computer
. If an invalid computer
object is passed, this method will return null
.
publicIp = public_ip_pc(host_computer(get_shell))
print("Public ip:" + publicIp)
pull(self: list<any>ormap<any,any>
):
copyWhen passing a list
to this method, it will return the value at the first index and remove it from the list
. Additionally, if a map
is passed, it will always return the value corresponding to the first matching key and mutate the map
object accordingly. However, passing a map-like object such as file
or computer
will result in an error, interrupting further script execution. If the passed object is empty or is anything other than a map
or list
, the method will return null
.
list = [0, 1, 2, 3, 4, 5]
print("The first item is: " + pull(list))
push(self: list<any>ormap<any,any>, value: any
): list<any>ormap<any,any>ornull
copyAllows pushing a value into an object, supporting map
s and list
s. However, it throws an error if you attempt to push a value into itself or into a map-like object such as a file
, halting further script execution. If you try to push a value into an object that isn't a map
or list
, it returns null
.
list = [0, 1, 2, 3, 4, 5]
push(list, 42)
print("The answer to everything is: " + pop(list))
range(start: number = 0, end: number = 0, inc?: number
):
copyGenerates a list
where each item is a number
. By default, if only one argument is provided, the list starts at the given value and decrements by one for each item. You can optionally define a start and end value, as well as customize the incremental value. However, if the incremental value is zero, or if the list exceeds 16777215L
items, or if start/end is null
, the function will throw a runtime error.
print("Countdown:")
for num in range(10)
print(num)
end for
print("Done!")
read(self: metaMail, mailId: string
): "Unknown error: Unable to access to local computer""fetch: No internet access.""Mail not found"
copyReturns a string
containing the content of a mail related to the provided mail id. The mail id argument can be obtained with fetch
. In case the mail cannot be found this method will return "Mail not found". If any of the provided values deviate from the method signature, it will return null
.
metaMail = mail_login(user_mail_address, "test")
mails = fetch(metaMail)
results = []
for mail in mails
segments = split(mail, char(10))
mailId = segments[2][8:]
print(read(metaMail, mailId))
end for
remove(self: map<any,any>orlist<any>orstring, key: any
): 01
copyDepending on the data type, this function will remove a value in the provided object, potentially mutating the object. This method works with map
s, list
s, and string
s. Each passed type may support different types for the key
argument. For example, using this method on a string would treat the key as a character index. Therefore, it is advised to review the signatures of each type. Passing a key with the type null
may cause an error to be thrown, preventing further script execution. The same will happen if the passed self value deviates from being a map
, list
, or string
.
list = [9, 3, 5, 7]
remove(list, 5)
print("List after removal: " + list.join(", "))
rename(self: file, name: string = ""
): "Unknown error""${filepath} not found""Error: name cannot exceed the limit of 128 characters.""permission denied""permission denied. File protected""There is already a file with that name, please choose another one.""Error: only alphanumeric allowed as newname"0
copyRename the file with the name provided. Files can only be renamed if the user has write permissions or is root. The new filename has to be below 128 characters and alphanumeric. On failure, this method will return a string
with details. Otherwise, this method will return an empty string. If this method is used within an SSH encryption process, an error will be thrown, causing the script execution to be interrupted. In case the provided name is null
or an invalid file
object is passed, this method will return a number
with the value zero.
computer = host_computer(get_shell("root", "test"))
passwdFile = File(computer, "/etc/passwd")
renameResult = rename(passwdFile, "renamed")
if typeof(renameResult) == "string" then
print("There was an error while renaming file: " + renameResult)
else
print("File got renamed successfully.")
end if
replace(value: map<any,any>orlist<any>, oldVal: any, newVal: any, maxCount?: number
):
copyThis function replaces a value within an object and returns the mutated object. Currently, it only supports map
s and list
s. Previously, it also supported string
s, but that functionality has been replaced by replace_regex
. If you use anything other than the supported types, a runtime error will be thrown.
list = [1,2,3,42]
newList = replace(list, 42, 4)
print(newList)
replace_regex(self: string, pattern: string, newValue: string, regexOptions: string = "none"
):
copyReturns a string
with the replaced content by using regular expressions. If any provided arguments deviate from the method signature types, if the pattern is empty, if the provided regexOptions are invalid or if the regular expression times out, an error will be thrown, preventing further script execution.
myString = "42 as an answer is wrong"
newString = replace_regex(myString, "\w+$", "right")
print(newString)
reset_ctf_password(newPassword: string
): "reset_ctf_password: password cannot be null""reset_ctf_password: password can't exceed the maximum limit of 32 characters""reset_ctf_password: password must be alphanumeric""reset_ctf_password: you do not have a registered CTF account"1
copyResets the password of your CTF account. Returns a number
with the value one if resetting was successful; otherwise, it will return a string
containing the reason for failure.
reset_ctf_password("mysafepassword")
reset_password(self: wallet, newPassword: string
): "Error: Wallet does not exist.""Error: Only the account owner can change the password""Error: The password can only be reset once a day""Unknown error: Unable to access to local computer""No internet access.""reset_password: only alphanumeric characters are allowed as password""reset_password: name and password cannot exceed the 16 character limit."1
copyChange the password of the wallet. Only the account owner can perform this action. If the process is completed successfully, a number
with the value one will be returned. In case of an error, a string
with details will be returned. Any deviation from the method signature will result in null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
if reset_password(wallet, "test") == 1 then
print "You got a new password!"
end if
reset_password_coin(self: coin, newPassword: string
): "Error: coin does not exist""Error: Only the account owner can change the password""Unknown error: Unable to access to local computer""error: No internet access.""reset_password: only alphanumeric characters are allowed as password""reset_password: name and password cannot exceed the 16 character limit."1
copyResets the password of the coin. It returns a number
with the value one if resetting was successful; otherwise, it will return a string
. If an invalid coin object is provided, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
result = reset_password(coin, "test")
if typeof(result) == "string" then
exit "Failed to reset password due to: " + result
end if
print "Successfully reset password"
reverse(value: list<any>
):
copyReverses the order of all values in the list
. This operation will mutate the list
.
myList = [42, 1, 3]
reverse(myList)
print("Reversed list: " + myList.split(", "))
rnd(seed?: number
):
copyReturns a random number
between 0 and 1. Optionally a seed number
can be provided.
min = 10
max = 20
output = floor(rnd * (max - min + 1) + min)
input = user_input("Guess a number between 10 and 20!").to_int
if (input == output) then
print("You guessed right!")
else
print("You failed! The number was " + output)
end if
round(value: number = 0, fixed: number = 0
):
copyReturns number
rounded to the integer value of the provided number
.
price = 25.43467
rounded = round(price * 100) / 100
print("Price: " + rounded)
rshell_client(self: metaxploit, ip: string, port: number = 1222, processName: string = "rshell_client"
): "No internet access.""Remote host is down""Unable to find service ${service}""Invalid target service port configuration.""connection rejected: port forward removed by admin""Unable to connect: missing ${library}""Unable to connect: invalid ${library}""Unexpected library found. Not a valid ${library} library.""Unknown error""rshell_client: Invalid IP address""Error: only alphanumeric allowed as proccess name.""Error: proccess name cannot exceed the limit of 28 characters.""Error: ${programName} is a reserved process name""rshell_client: IP address not found: ${ip}""rshell_client: unable to find remote server at port ${port}"1
copyLaunches a process on the victim's computer
, silently attempting to continuously connect in the background to the specified address and port. For the reverse shell to run successfully, the rshell
service must be installed, and the port forward must be configured correctly on the machine where the server is waiting for the victim's connection. If the launch was successful, a number
with the value one will be returned. In case of failure, a string
with details will be returned.
metax = include_lib("/lib/metaxploit.so")
rshell_client(metax, "1.1.1.1", 1222, "bgprocess")
rshell_server(self: metaxploit
): stringorlist<shell>ornull
"rshell_server: No internet connection""rshell_server: The service cannot be started on this network.""error: service rshelld is not running""error: rshell portforward is not configured correctly"
copyThis method returns a list
of shell
objects that have been reverse shell connected to this computer. To manage the connections received, the rshell
service must be installed on the machine that receives the victims' connections. In case of failure a string
will be returned with details. If the provided object is anything other than metaxploit
this method will return null
.
metax = include_lib("/lib/metaxploit.so")
shells = rshell_server(metax)
firstShell = shells[0]
chmod(File(host_computer(firstShell), "/"), "o-wrx", true)
scan(self: metaxploit, metaLib: metaLib
):
copyReturns a list
where each item is a string
representing a memory area which has vulnerabilities related to the provided library. These memory areas can be used to make further scans via scan_address
. In case of failure, this method returns null
instead. An example of a memory area would be "0x7BFC1EAA". Using this method within a SSH encryption process will throw a runtime exception.
metax = include_lib("/lib/metaxploit.so")
metaLib = load(metax, "/lib/init.so")
scanResult = scan(metax, metaLib)
for area in scanResult
print("Memory area containg vulnerability: " + area)
end for
scan_address(self: metaxploit, metaLib: metaLib, memoryAddress: string
):
copyReturns a string
containing information about each vulnerability in the provided library and memory area. In case the scanning fails this method will return null
. Using this method within a SSH encryption process will throw a runtime exception.
metax = include_lib("/lib/metaxploit.so")
metaLib = load(metax, "/lib/init.so")
scanResult = scan(metax, metaLib)
scanAddress = scan_address(metax, metaLib, scanResult[0])
segments = split(scanAddress, "Unsafe check: ")[1:]
exploits = []
for segment in segments
labelStart = indexOf(segment, "<b>")
labelEnd = indexOf(segment, "</b>")
push(exploits, segment[labelStart + 3: labelEnd])
end for
print("Available vulnerabilities: " + join(exploits, ", "))
scan_debuglib(self: debugLibrary
): "error: file not found""No potential issues have been found""Potential problems have been found in the following code:
${callengeDescription}"
copyScans the library in debug mode to identify potential code errors that may lead to vulnerabilities. If issues are detected, the relevant code snippets are printed. In case of an error, a string
containing the error message is returned. If an invalid debugLibrary
object is passed, this method will return null
.
metax = include_lib("/lib/metaxploit.so")
metaLib = load(metax, "/lib/init.so")
debugLib = debug_tools(metaLib, "test", "test")
print("Debug Library result: " + scan_debuglib(debugLib))
scp(self: shell, sourceFile: string, destinationFolder: string, remoteShell: shell
): "unknown error""Invalid path""${filepath} not found""permission denied""permission denied. ${filename} is protected""The copy can not be made. Reached maximum number of files in a folder""The copy can not be made. Reached maximum limit""${sourceFile} not found""${destinationFolder} not found""${destinationFolder} it's not a folder"1
copySend a file
to the computer
related to the provided shell
. You require permission to read the file
on the computer
from which you are uploading and write permissions in the folder of the computer
you are trying to upload to. In case of failure, this method will return a string
with the cause. Otherwise, a number
with the value one gets returned. If any of the passed arguments deviates from the types of the method signature, null
will be returned. In case the string
for sourceFile or destinationFolder is empty, an error will be thrown, preventing further script execution.
shell = get_shell
remoteShell = connect_service(shell, "1.1.1.1", 22, "test", "test")
result = scp(remoteShell, "/bin/ls", "/etc/", shell)
if typeof(result) == "string" then
print("There was an error while sending file: " + result)
else
print("File got sent successfully.")
end if
search(self: aptClient, search: string
): "Unknown error: Unable to access to local computer""/etc/apt/aptcache.bin not found. Launch apt with the update option to refresh the file""${search} not found in any repository""/etc/apt/aptcache.bin content is malformed. Launch apt with the update option to refresh the file"
copyThe search
method specifically looks for a package in any of the repositories listed in "/etc/apt/sources.txt"
. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
. On success, it will return a string
containing all packages that partially match the provided search value. On failure, it will return a string
with various error messages.
aptClient = include_lib("/lib/aptclient.so")
packages = search(aptClient, ".so")
packageList = split(packages, char(10) + char(10))
for packageItem in packageList
entry = split(packageItem, char(10))
if len(entry) != 2 then
print "something wrong in: " + entry
continue
end if
packageName = entry[0]
packageDescription = entry[1]
print "Title: <b>" + packageName + "</b>"
print "Description: <i>" + packageDescription + "</i>"
print "----------------------------"
end for
sell_coin(self: wallet, coinName: string, coinAmount: number, unitPrice: number, subwalletUser: string
): "Error: Coin ${coinName} does not exist""Error: Wallet does not exist""Subwallet ${subwalletID} does not exist""Error: subwallet does not contain enough coins to sell""Error: exceeded maximum of 21 million coins""Purchase failed: It is necessary to create a bank account to make transactions""Error: You already have a pending sale. Cancel it to create a new sale.""Error: You already have a pending purchase. Cancel it to create a new sale.""Not enough buyers found. Transaction is pending until a buyer is found.""A partial transaction has occurred. The data of your offer has been updated""Unknown error: Unable to access to local computer""No internet access.""sell_coin: coin amount and proposed price cannot be 0."1
copyPublishes a sale offer indicating the amount of coins you want to sell and the price ($) per unit you want to assign. The sale will be finalized if there is any purchase offer with a price greater than or equal to that proposed in the sale. If there is no existing offer to buy that matches the requirements at that time, the offer to sell will remain publicly visible until a new offer to buy satisfies the requirements. If the publication has been successful, a number
with the value one is returned. In case of error, a string
with the details is returned. Any deviation from the method signature will result in a runtime exception preventing further script execution.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
result = sell_coin(wallet, "test", 100, 20, "test")
if result == 1 then
print "Sucessfully created sell offer!"
else
print "Failed: " + result
end if
send(self: metaMail, emailAddress: string, subject: string, message: string
): "Unable to login into account. Wrong password.""${user} user not found""Unknown error: This email account cannot be obtained.""Invalid email address""Mail subject too large""Mail message too large""Unknown error: attachment failed""Error: attachment not found""Unable to attach file: permission denied""The email couldn't be sent. The recipient has blocked this email address.""The email couldn't be sent. The recipient has blocked emails sent by other players.""The email couldn't be sent. The recipient has blocked emails sent by other players using npcs accounts.""The mail could not be sent. Wait a moment before sending another email.""Unknown error: Unable to access to local computer""read: No internet access.""read: No email account registered""Mail not delivered"1
copySend a new mail to the provided email address. Keep in mind that the subject can not exceed 128 characters and the message size should not exceed 2500 characters. Returns a number
with the value one if the mail has been sent correctly, otherwise returns a string
with an error. If any of the provided values deviate from the method signature, it will return null
.
metaMail = mail_login(user_mail_address, "test")
result = send(metaMail, user_mail_address, "test subject", "test message")
if typeof(result) == "string" then
print("There was an error while sending mail: " + result)
else
print("Mail got send successfully.")
end if
set_address(self: coin, address: string
): "Error: ${coinName} does not exist""Unknown error: Unable to access to local computer""error: No internet access.""set_address: address ${address}not found"1
copyConfigures a valid address that will be shown to users who do not have the currency, indicating where to register. In case of an error, a string
with the details is returned. In case of success, a number
with a value of one will be returned. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
result = set_address(coin, "12.12.12.12")
if typeof(result) == "string" then
exit "Failed to set address due to: " + result
end if
print "Successfully set address!"
set_alarm(self: smartAppliance, enable: number
): "Unknown error: Unable to access to local computer""error: No internet access.""error: Device hardware malfunction""set_alarm: denied: The alarm settings are locked for security reasons."1
copyActivates or deactivates the sound alarm indicating any appliance malfunction. If the operation is successful, a number
with the value one is returned; otherwise, a string
containing error details is returned. If any arguments deviate from the defined signature, this method will return null
.
libSmartapp = include_lib("/lib/libsmartappliance.so")
setAlarmResult = set_alarm(libSmartapp, false)
if setAlarmResult == 1 then
print("Alarm was disabled successfully!")
else
print("Disabling alarm failed due to: " + setAlarmResult)
end if
set_content(self: file, content: string = ""
): "I can't save the file. The maximum of 160,000 characters has been exceeded.""set_content: unable to use this method in encryption configuration""can't open ${filepath}. Binary file."10
copySaves text into a file
. The content will not get appended to the file
; therefore, existing content will be overridden. To set new content, the user requires write permissions or being root. Keep in mind that text files cannot exceed the character limit of 160,000. In case setting the content was successful, a number
with the value one will be returned. Otherwise, a string
with details will be returned. If this method is used within an SSH encryption process, an error will be thrown, preventing any further script execution. If the provided content is null
, an invalid file
object gets passed or permissions are lacking, this method will return a number
with the value zero. In case the file gets deleted this method will return null
.
computer = host_computer(get_shell("root", "test"))
passwdFile = File(computer, "/etc/passwd")
setResult = set_content(passwdFile, "moo")
if typeof(setResult) == "string" then
print("There was an error while setting file content: " + setResult)
else if setResult == 0 then
print("Unable to set content of file!")
else
print("File content got changed successfully.")
end if
set_cycle_mining(self: coin, rateHours: number = 3
): "Unknown error: Unable to access to local computer""error: No internet access.""the mining cycle cannot exceed the maximum of 2160 hours""the mining cycle cannot be less than 1 hour"1
copyDefines the interval (in-game hours) in which each user receives a coin reward when mining. The interval cannot be lower than 1 and not be higher than 2160. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
. On success, it will return a number
with the value one. In case of failure, the method will return a string
with details.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
result = set_cycle_mining(coin, 20)
if result == 1 then
print "Successful updated mining interval"
else
print "Failed updating mining interval"
end if
set_group(self: file, group: string = "", recursive: number = 0
): "Permission denied"
copyChange the group related to this file. Optionally the group can get applied recursively. The group name cannot exceed 15 characters. Additionally either write permissions or being root is required. In case of failure, a string
with details. On success, an empty string
gets returned. In case the current file gets deleted, an invalid file
object gets passed or the passed group is not a string
, this method will return null
. If the passed group value is empty, the group value is longer than 15 characters, or the passed recursive value deviates from its original type, an error will be thrown, preventing further script execution.
computer = host_computer(get_shell)
lsBinary = File(computer, "/bin/ls")
ownerResult = set_group(lsBinary, "root")
if typeof(ownerResult) == "string" then
print("There was an error while changing group: " + ownerResult)
else
print("File group changed successfully.")
end if
set_info(self: subWallet, info: string
): "Error: ${coinName} does not exist""Error: ${subWalletUser} does not exist""Error: main wallet linked to ${subWalletUser} does not exist anymore""Error: exceeded maximum of 256 characters""Unknown error: Unable to access to local computer""No internet access."1
copyStores optional information in the Subwallet for any use. Upon success, a number
with the value one will be returned. In case of failure, a string
with details will be returned. If an object is passed that is not a subWallet
, this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
subWallet = coin.get_subwallet("test")
result = subWallet.set_info("test")
if result == 1 then
print "Subwallet info got set!"
end if
set_owner(self: file, owner: string = "", recursive: number = 0
): "Permission denied"
copyChange the owner of this file. Optionally the owner can get applied recursively. The owner's name cannot exceed 15 characters. Additionally either write permissions or being root is required. In case of failure a string
gets returned containing the cause. Otherwise an empty string
gets returned. In case the current file gets deleted, an invalid file
object gets passed or the passed owner value is not a string
, this method will return null
. If the passed owner value is empty, the owner value is longer than 15 characters, or the passed recursive value deviates from its original type, an error will be thrown, interrupting further script execution.
computer = host_computer(get_shell)
lsBinary = File(computer, "/bin/ls")
ownerResult = set_owner(lsBinary, "root")
if typeof(ownerResult) == "string" then
print("There was an error while changing owner: " + ownerResult)
else
print("File owner changed successfully.")
end if
set_reward(self: coin, coinAmount: number = 1
): "Unknown error: Unable to access to local computer""error: No internet access.""Error: The reward cannot be less than 1 coin""Error: Coin does not exist"1
copyAssigns the reward that miners will receive after each mining cycle. The reward value has to be above one. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
. On success, the method will return a number
with the value one. In case of failure, the method will return a string
with details.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
result = set_reward(coin, -1)
if typeof(result) == "string" then
exit "Failed setting reward due to: " + result
end if
print "Successfully set reward!"
show(self: aptClient, repository: string
): "Unknown error: Unable to access to local computer""/etc/apt/aptcache.bin not found. Launch apt with the update option to refresh the file""${repository} repository not found""/etc/apt/aptcache.bin content is malformed. Launch apt with the update option to refresh the file"
copyDisplays all the packages available in a repository. The repository must be listed in the "/etc/apt/sources.txt"
file. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
. If it cannot find a repository, it will return a string with an error message. On success, it will return a string
containing all packages and their descriptions, with each entry separated by a newline.
aptClient = include_lib("/lib/aptclient.so")
packages = show(aptClient, "177.202.15.132")
packageList = split(packages, char(10) + char(10))
pop(packageList) // remove last empty item
for packageItem in packageList
entry = split(packageItem, char(10))
packageName = entry[0]
packageDescription = entry[1]
print "Title: <b>" + packageName + "</b>"
print "Description: <i>" + packageDescription + "</i>"
print "----------------------------"
end for
show_history(self: blockchain, coinName: string
): map<number,list<any>>orstringornull
"Unknown error: Unable to access to local computer""show_history: No internet access."
copyReturns a map
with the latest changes in the value of a specific cryptocurrency. The key of the map
is an index represented by a number
. The value is a list
, where index 0 is the historical price of the coin and index 1 is the date when the price change occurred. If any of the provided parameters have a type that deviates from the defined signature, or if no coin exists with this name, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
history = show_history(blockchain, "test")
if typeof(history) == "string" then
exit "Couldnt fetch history due to: " + history
end if
for entry in values(history)
price = entry[0]
date = entry[1]
print "The price on " + date + " was " + price
end for
show_nodes(self: wallet, coinName: string
): "Unknown error: Unable to access to local computer""No internet access.""show_nodes: wallet does not exist""show_nodes: coin does not exist"
copyReturns a number
representing the count of devices mining a specific coin for the same wallet
. In case of an error, a string
with details is returned. Any deviation from the method signature will result in null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
print "Active miners: " show_nodes(wallet, "test")
show_procs(self: computer
):
copyReturns a string
providing an overview of all active processes on the computer
. This includes information about the username, PID, CPU usage, memory consumption, and command name. Using this method in an SSH encryption process will throw an error, preventing further script execution. If an invalid computer
object is passed, this method will return null
.
computer = host_computer(get_shell)
procs = show_procs(computer)
list = procs.split(char(10))[1:]
processes = []
for item in list
parsedItem = item.split(" ")
process = {}
process.user = parsedItem[0]
process.pid = parsedItem[1]
process.cpu = parsedItem[2]
process.mem = parsedItem[3]
process.command = parsedItem[4]
processes.push(process)
end for
print(processes)
shuffle(self: list<any>ormap<any,any>
):
copyRandomizes content of an object. Valid data types for this method are list
and map
. In case a map-like object such as a file
or computer
a runtime exception will be thrown.
list = [0, 1, 2, 3, 4, 5]
shuffle(list)
print("And the winner is: " + list[0])
sign(value: number = 0
):
copyReturns a one or minus one, indicating the sign of the number passed as argument. If the input is zero, it will be returned as-is.
print(sign(40))
print(sign(-40))
print(sign(0))
sin(value: number = 0
):
copyReturns the sine of a number
in radians.
radians = 1
radius = 10
circleY = sin(radians) * radius
print(circleY)
size(self: file
):
copyReturns a string
with the size of the file in bytes. There is no correlation between file size and actual file content. Instead, the file size is depending on the name of the file. In case the current file gets deleted or an invalid file
object gets passed, this method will return null
.
computer = host_computer(get_shell)
lsBinary = File(computer, "/bin/ls")
size = size(lsBinary)
if size.to_int > 1000 then
print("File size is bigger than 1000 bytes.")
else
print("File size is below 1000 bytes.")
end if
slice(value: list<any>orstring, startIndex: number = 0, endIndex?: number
):
copyReturns a sliced version of the passed object. Valid data types for slicing are string
and list
. The returned object will contain all elements related to the provided start and end index. If no start or end index is provided this method will essentially return a shallow copy of the passed object. If an invalid data type is passed, null
is returned.
myString = "not your text"
print("my " + slice(myString, 9))
smtp_user_list(self: crypto, ip: string, port: number
): list<string>orstringornull
"invalid IP address""host is down""host doesn't exist""ip address not found""port ${port} not found""invalid target service""service not found""Error: Invalid ip address"
copyReturns a list
of the existing users on the computer
where the SMTP service is running. If these users also have an email account registered on the SMTP server, it will be indicated in the list
. SMTP services are usually running on port 25
. In case of failure, this method will return a string
containing the cause. If any of the provided values deviate from the signature types, this method will return null
.
crypto = include_lib("/lib/crypto.so")
print(smtp_user_list(crypto, "192.168.0.4", 25))
sniffer(self: metaxploit, saveEncSource: number = 0
):
copyThe terminal listens to the network packets of any connection that passes through the computer. When any connection information gets captured, it will print a string
with the obtained data. In case saving of encryption source is enabled it will download the source code of the script responsible for encryption. In case the operation fails this method will return null
. Using this method within a SSH encryption process will throw a runtime exception.
metax = include_lib("/lib/metaxploit.so")
result = sniffer(metax)
print(result)
sort(self: list<any>, byKey: any, ascending: number = 1
):
copySorts the values of a list
alphanumerically. This operation mutates the original list
. Optionally, a key can be provided, which is used if the items are map
s or list
s. Finally, this method returns the updated list
. If a type other than list
is passed, the method returns the passed value without any changes.
list = [9, 3, 5, 7]
sort(list)
print("Sorted list: " + list.join(", "))
split(self: string, pattern: string, regexOptions: string = "none"
):
copyReturns a list
where each item is a segment of the string
, separated by the provided separator string
. This method uses regular expressions for matching, so remember to escape special characters such as dots. If any of the provided arguments deviate from the method signature types, this method will return null
. In case the pattern is empty, the provided regexOptions are invalid, or the regular expression times out, an error will be thrown, preventing further script execution.
myString = "42 as an answer is wrong"
segments = split(myString, " ")
if segments[0] != "42" then
print("Invalid information spotted!")
else
print("Information seems valid!")
end if
sqrt(value: number = 0
):
copyReturns the square root of a number
.
a = 3
b = 4
calcHypotenuse = sqrt((a * a) + (b * b))
print("Hypotenuse: " + calcHypotenuse)
start_service(self: service
): "Denied. Only root user can install this service.""<color=yellow>${reason} The chat service can't be accessed.</color>"1
copyStarts the service and opens its associated port
on the local machine. The service requires a port forwarded to the router to be accessible from the outside. If the service starts correctly, it returns a number
with the value one. In case of an error, it returns a string
with details. If the passed object is not a service
this method will cause a crash.
service = include_lib("/lib/libhttp.so")
result = start_service(service)
if result == 1 then
print "Successfully started service"
else
print "Starting service failed: " + result
end if
start_terminal(self: shell
):
copyLaunches an active terminal. The terminal's color will change, displaying the IP of the connected shell. Script execution will be stopped upon starting a new terminal, unless this is called from another script that was executed via shell.launch
. In that case, you will enter the shell after closing your root-level script within that terminal window. Using this method within an SSH encryption process will cause an error to be thrown, preventing further script execution.
start_terminal(get_shell)
stop_service(self: service
): "Denied. Only root user can install this service."10
copyStops the service and closes its associated port
on the local machine. If the service is stopped successfully, it returns a number
with the value one. If an error occurs during the process, it returns a string
with details. In some cases, the returned number
might be zero, indicating that the service removal failed. If the passed object is not a service
this method will cause a crash.
service = include_lib("/lib/libhttp.so")
result = stop_service(service)
if result == 1 then
print "Successfully stopped service"
else
print "Stopping service failed: " + result
end if
str(value: any
):
copyReturns the string
value of provided data. Can be used to turn a number
into a string
or to get the signature of a function
.
signature = str(@user_input)
argSegment = signature[9:signature.len - 1]
args = argSegment.split(",")
print("Function has " + args.len + " arguments.")
string():
copyReturns a map
which enables to extend string types with custom methods.
string.color = function(colorValue = "red")
return "<color=" + colorValue + ">" + self + "</color>"
end function
print "My text: ".color + "Hello world".color("yellow")
sum(self: list<any>ormap<any,any>
):
copyReturns a number
representing the sum of all items within a map
or a list
. If any non-supported type is passed, this method will return a number
with the value zero.
list = [0, 1, 2, 3, 4, 5]
print("Sum of all items is: " + sum(list))
symlink(self: file, path: string = "", newName: string = ""
): "Can't create file. Unknown error""Can't create file. Reached maximum limit""Invalid path""Can't create file ${pathFolderDest}/${filename}. Permission denied""There is not enough free space on the hard disk.""The copy can not be made. Reached maximum number of files in a folder""Unknown error.""Error: empty destination path""Error: only alphanumeric allowed as folder name.""Error: name cannot exceed the limit of 128 characters.""permission denied""${filename} file exists""Can't create folder. Reached maximum limit""The maximum number of subfolders has been exceeded""Error: only alphanumeric allowed as newname""Error: invalid path""The file already exists"1
copyCreates a symlink to the specified path. Symlinks can only be created if the user has write permissions or is root. The new filename must be alphanumeric and under 128 characters. Upon success, this method returns a number
with the value one. On failure, it returns a string
with details. If any parameters deviate from the method signature, if used within an SSH encryption process, if the new name exceeds 128 characters, or if the path is too long, an error will be thrown, interrupting script execution. In case the current file gets deleted or an invalid file
object is passed, this method will return null
.
computer = host_computer(get_shell("root", "test"))
lsFile = File(computer, "/bin/ls")
symResult = symlink(lsFile, "/bin", "alternativeLS")
if typeof(symResult) == "string" then
print("There was an error while creating symlink: " + symResult)
else
print("Symlink got created successfully.")
end if
tan(value: number = 1
):
copyReturns the tangent of a number
in radians.
degrees = 90
tanFromDegrees = tan(degress * pi / 180)
print("Tan from degrees: " + tanFromDegrees)
time():
copyReturns a number
of seconds representing the elapsed time since the script started.
start = time
for i in range(10000)
var = i * 100
end for
endTime = time - start
print("Script execution done within: " + endTime)
to_int(self: string
):
copyReturns a number
which is parsed from the string
as an integer. In case the string
is not numeric it will return the original string
. If the passed value is not a string
this method will return null
.
myString = "1"
print(to_int(myString) + 41)
touch(self: computer, path: string, fileName: string
): "Can't create file. Unknown error""Can't create file. Reached maximum limit""Invalid path""Can't create file ${pathFolderDest}/${filename}. Permission denied""There is not enough free space on the hard disk.""The copy can not be made. Reached maximum number of files in a folder""Error: invalid path""Error: nameFile must be string""Error: only alphanumeric allowed as file name.""Error: name cannot exceed the limit of 128 characters.""touch: path too large""The file already exists"1
copyCreates an empty text file
at the provided path. Certain limitations apply to file creation: the file
name must be alphanumeric and below 128 characters. Creation will fail if a file
already exists at the specified path or if there are insufficient permissions. Additionally, there is a file limit of about 250 per folder and 3125 files overall on the computer. If successful, it returns a number
with the value one. On failure, it returns a string
with details. Using this method in an SSH encryption process will cause an error to be thrown, preventing further script execution. If an invalid computer
object is passed, this method will return null
.
path = "/home/" + active_user + "/Desktop"
computer = host_computer(get_shell)
createResult = touch(computer, path, "myFile.txt")
if typeof(createResult) == "string" then
print("There was an error when creating the file: " + createResult)
else
print("File got created at given path " + path)
end if
transaction(self: coin, subWalletOrig: string, subWalletDest: string, valAmount: number
): "Error: coin does not exist""Error: ${subWalletOrig} not found""Error: ${subWalletDest} not found""Error: wallet ${subWalletOrig} does not exist""Error: target wallet does not exist""${subWalletOrig} need to be registered in ${coinName} to be able to receive this coin.""Error: subwallet ${subWalletDest} does not have coins in the selected currency""Error: insufficient funds to complete the transaction""Unknown error: Unable to access to local computer""error: No internet access.""Error: amount value cannot be less than 1"1
copyMakes a transaction of the currency between the indicated subwallets. In case of an error, a string
with the details is returned. In case of success, a number
with a value of one will be returned. If any of the provided parameters have a type that deviates from the defined signature, the method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
result = transaction(coin, "test", "test2", 20)
if typeof(result) == "string" then
exit "Failed transaction due to: " + result
end if
print "Successfully transfered!"
trim(self: string
):
copyReturns a new string
stripped of any spacing at the beginning and ending. If any value gets passed that is not a string
this method will return null
.
myString = " 42 "
print(trim(myString))
typeof(value: any
):
copyReturns a string
containing the type of the entity provided. There are following types by default: "aptclientLib"
, "blockchainLib"
, "ctfEvent"
, "coin"
, "computer"
, "cryptoLib"
, "debugLibrary"
, "file"
, "function"
, "list"
, "map"
, "MetaLib"
, "MetaMail"
, "MetaxploitLib"
, "NetSession"
, "null"
, "number"
, "port"
, "router"
, "service"
, "shell"
, "ftpshell"
, "SmartAppliance"
, "string"
, "subwallet"
, "TrafficNet"
, "wallet"
. Custom types can be added as well by using the classID
property in a map
.
myObj = { "classID": "myType" }
if typeof(myObj) == "myType" then
print("Object is myType.")
else
print("Object is not myType.")
end if
unit_testing(self: debugLibrary, errorLines: list<number>
): "error: file not found""Test failed: No potential issues have been found""Starting testing in selected lines...
${methods}
New vulnerability found: ${vulnerability}""Test failed: No errors have been found in one or more of the provided lines, or not all lines with errors have been provided."
copyConducts automated tests on the specified lines of code. If potential vulnerabilities are detected due to errors in these lines, this method will print partial objects that could be obtained by exploiting the vulnerability, along with the affected memory zone and detailed vulnerability information. In case of failure, this function returns a string
with an error message. If any of the provided values deviates from the defined types in the method signature, this method will return null
.
metax = include_lib("/lib/metaxploit.so")
metaLib = load(metax, "/lib/init.so")
debugLib = debug_tools(metaLib, "test", "test")
print("Unit test results: " + unit_testing(debugLib, [1, 2, 3]))
update(self: aptClient
): "Unknown error: Unable to access to local computer""apt_update: No internet access.""${source} repository not found""/etc/apt/sources.txt content is malformed"0
copyRefreshes the list of available packages after adding a new repository in "/etc/apt/sources.txt"
, or if the remote repository has updated its information in "/server/conf/repod.conf"
. If either the "/etc/apt/sources.txt"
file has an invalid format or an invalid aptClient
object is passed, this method will return a number
with the value zero. On a successful update, an empty string
will be returned. In case of failure, a string
with an error message will be returned.
aptClient = include_lib("/lib/aptclient.so")
result = update(aptClient)
if result == "" then
print "Update successful!"
else
print "Error while updating: " + result
end if
upper(self: string
):
copyReturns a string
which is the uppercase transformed version of the provided string
. In case anything other than a string
gets passed this method will return the passed value again.
myString = upper("hello world")
print(myString)
used_ports(self: router
):
copyReturns a list
where each item is a port
used inside the router. In case the passed object is not a router
this method will return null
.
router = get_router
ports = used_ports(router)
for port in ports
print("Port " + port_number(port) + " is available!")
end for
user_bank_number():
copyReturns a string
containing the bank account number of the player who is executing the script. If the user does not have a bank this method will return null
.
print("My Bank number is: " + user_bank_number)
- copy
Puts script execution on hold to receive input from the user. Input can be submitted by pressing Enter. You can style the output message using TextMeshPro rich-text tags. Two optional arguments are available: isPassword
, which defines whether input should be masked by asterisk signs, and anyKey
, which enables capturing of keys individually. Using this method within an SSH encryption process or passing values deviating from the defined method signature will cause an error to be thrown, interrupting further script execution.
num = 0
aboveIncludingZeroTag = "<color=yellow>"
belowZeroTag = "<color=red>"
while (true)
clear_screen
output = aboveIncludingZeroTag + num
if (num < 0) then
output = belowZeroTag + num
end if
print(output)
key = user_input("Press arrow up/down to change value.", false, true)
if (key == "UpArrow") then
num = num + 1
else if (key == "DownArrow") then
num = num - 1
else
exit("Bye!")
end if
end while
user_mail_address():
copyReturns a string
containing the email address of the player who is executing the script. If the user does not have an email address this method will return null
.
print("My EMail address is: " + user_mail_address)
val(self: numberorstring = 0
):
copyCasts a string
to a number
. If the provided string
does not represent a valid number
, the number
zero will be returned. If any type other than string
or number
is passed, this method will return null
.
num = val("1.25")
print("Number in string is: " + num)
values(self: map<any,any>orstring
):
copyReturns a list
containing all values of an object. Supported types are map
s and string
s. In case the passed type deviates from these two, it will return the passed value itself.
indexesOfStr = values("test")
print("Following values are available: " + indexesOfStr.join(", "))
version(self: metaLib
):
copyReturns a string
containing the version number of the library. An example of a version number would be "1.0.0"
. In case an invalid metaLib
object gets passed this method will return null
.
metax = include_lib("/lib/metaxploit.so")
metaLib = load(metax, "/lib/init.so")
print("Init.so version: " + version(metaLib))
wait(delay: number = 1
):
copyPauses the script execution. Optionally, the duration can be provided via the time
argument. By default, the duration will be 1 second. The duration cannot be below 0.01 or above 300; otherwise, this method will throw a runtime exception.
start = time
wait(5)
elapsed = time - start
print("Waited: " + elapsed)
wallet_username(self: subWallet
): "Unknown error: Unable to access to local computer""No internet access."
copyReturns a string
with the name of the wallet
to which this subwallet belongs. If an object is passed that is not a subWallet
, this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
print "SubWallet username: " + subWallet.wallet_username
whois(ip: string
): "Invalid IP address: ${ip}""Error: the IP address must be public""No Info available""Address not found"
copyReturns a string
containing the administrator information behind an IP address provided. In case of failure the returned string
will contain an error message instead. If the provided ip is not a string
or is empty this method will throw an error causing the script to stop.
adminInfo = whos("1.1.1.1")
infoLines = adminInfo.split(char(10))
infoObject = {}
infoObject.domainName = infoLines[0].split(":")[1].trim
infoObject.administrativeContact = infoLines[1].split(":")[1].trim
infoObject.emailAddress = infoLines[2].split(":")[1].trim
infoObject.phone = infoLines[3].split(":")[1].trim
print("Phone number: " + infoObject.phone)
wifi_networks(self: computer, netDevice: string
):
copyReturns a list of the Wi-Fi networks that are available for the provided interface. Each item in the list
is a string
containing information on the BSSID, PWR, and ESSID. If no matching netDevice can be found or an invalid computer
object is passed, this method will return null
. In case the active network card is not a Wi-Fi card, an error will be thrown, preventing any further script execution.
computer = host_computer(get_shell("root", "test"))
networks = wifi_networks(computer, "wlan0")
result = []
for network in networks
parsedItem = network.split(" ")
item = {}
item.BSSID = parsedItem[0]
item.PWR = parsedItem[1]
item.ESSID = parsedItem[2]
result.push(item)
end for
print(result)
yield():
copywhile (true)
yield
print("tick")
end while
list
Create a list
with square brackets. Then iterate over the list
with for, or pull out individual items with a 0-based index in square brackets. A negative index counts from the end. Get a slice (subset) of a list
with two indices, separated by a colon.
x = [2, 4, 6, 8]
print(x[0]) // get first item from list
print(x[-1]) // get last item from list
print(x[1:3]) // slice items from index 1 to 3
x[2] = 5 // set item at index 2 to 5
print(x)
print(x + [42]) // concatenate two lists
hasIndex(index: number
): 01
copyReturns a number
. If the provided index is available in the list
, the value will be one. Otherwise, the value will be zero.
myList = [42, 1, 3]
containsIndex = myList.hasIndex(1)
if containsIndex then
print("List contains index of 1.")
else
print("List does not contain index of 1.")
end if
indexOf(value: any, offset?: number
):
copyReturns a number
which indicates the first matching index of the provided value inside the list
. Optionally a start index can be provided. In case the value does not exist inside the list
a null
gets returned.
myList = [42, 1, 3]
index = myList.indexOf(42)
if index != null then
print("The answer for everything is at the following index: " + index)
else
print("No answer for everything found.")
end if
indexes():
copyReturns a list
containing all available indexes.
myList = [42, 1, 3]
for i in myList.indexes
print(myList[i])
end for
insert(index: number, value: any
):
copyInserts a value into the list
at the index provided. Due to the insertion the list
will get mutated. Returns the mutated list
. If the passed index is not a number
, this method throws an error, preventing further script execution.
myList = [1, 3]
myList.insert(1, 42)
print("This list does contain the answer to everything: " + myList.split(", "))
join(delimiter: string
):
copyReturns a concatenated string
containing all stringified values inside the list
. These values will be separated via the provided separator. In case the list
exceeds 16777215L
items or the delimiter exceeds 128 characters, this method will throw an error, interrupting further script execution.
myList = [42, 1, 3]
print(myList.join(" .-*'*-. "))
len():
copyReturns a number
representing the count of values inside the list
.
myList = [42, 1, 3]
print("myList contains " + myList.len + " items")
pop():
copyReturns and removes the last item in the list
. This operation will mutate the list
. If the map
is empty, this method will return null
.
myList = [1, 3, 42]
answer = myList.pop
print("Answer to everything: " + answer)
pull():
copyReturns and removes the first item in the list
. This operation will mutate the list
. If the map
is empty, this method will return null
.
myList = [42, 1, 3]
answer = myList.pull
print("Answer to everything: " + answer)
push(value: any
):
copyAppends a value to the end of the list
. This operation will mutate the list
. Additionally, this method will return the updated list
. However, it throws an error if you attempt to push a value into itself or into a map-like object such as a file
, halting further script execution.
myList = [1, 3]
myList.push(42)
print("This list does contain the answer to everything: " + myList.split(", "))
remove(index: number
):
copyRemoves an item from the list
with the provided index. Due to the removal the list
will get mutated. If the passed index is null
this method will throw an error preventing further script execution.
myList = [1, 42, 3]
myList.remove(1)
print("This list does not contain the answer to everything: " + myList.split(", "))
replace(oldVal: any, newVal: any, maxCount?: number
):
copyReturns updated list
where each value matching with the provided replace argument gets replaced. This operation will mutate the list
.
myList = [1, 2, 2, 7]
myList.replace(2, 3)
print(myList.join(""))
reverse():
copyReverses the order of all values in the list
. This operation will mutate the list
.
myList = [42, 1, 3]
myList.reverse
print("Reversed list: " + myList.split(", "))
shuffle():
copyShuffles all values in the list
. This operation will mutate the list
.
myList = [42, 1, 3]
myList.shuffle
print("New list order: " + myList.split(", "))
sort(key: any, ascending: number = 1
):
copySorts the values of a list
alphanumerically. This operation mutates the original list
. Optionally, a key can be provided, which is used if the items are map
s or list
s. Finally, this method returns the updated list
.
myList = [{ "key": 42 }, { "key": 2 }, { "key": 1 }]
myList.sort("key")
print(myList)
sum():
copyReturns sum of all values inside the list
. Any non-numeric values will be considered a zero.
myList = [42, 1, 3]
sum = myList.sum
print("Sum of all items in list: " + sum)
values():
copyReturns a list
containing all available values. Note that this will not create a copy of the original list
. The returned instance will the same as original list
, so any mutations made to the returned list
will also affect the original one.
myList = [42, 1, 3]
for v in myList.values
print(v)
end for
map
A map
is a set of values associated with unique keys. Create a map
with curly braces; get or set a single value with square brackets. Keys and values may be any type.
x = { "test": 123 }
x.foo = 42 // set property foo to 42
print(x.foo) // get value of property foo
print(x + { "bar": 2 }) // concatenate two maps
hasIndex(key: any
): 01
copyReturns a number
. If the provided key is available in the map
, the value will be one. Otherwise, the value will be zero.
myMap = { "answer": 42, "bar": 23, "foo": "moo" }
containsIndex = myList.hasIndex("answer")
if containsIndex then
print("Map contains the answer.")
else
print("Map does not contain the answer.")
end if
indexOf(value: any
):
copyReturns a value which can be of any type since map
keys can be of any type. In case the value does not exist inside the map
, null
is returned.
myMap = { "answer": 42, "bar": 23, "foo": "moo" }
key = myList.indexOf(42)
if key != null then
print("Map contains the answer.")
else
print("Map does not contain the answer.")
end if
indexes():
copyReturns a list
containing all available keys. Keys can be of any type.
myMap = { "answer": 42, "bar": 23, "foo": "moo" }
for key in myMap.indexes
print(myMap[key])
end for
len():
copyReturns a number
representing the count of items inside the map
.
myMap = { "answer": 42, "bar": 23, "foo": "moo" }
print("myMap contains " + myMap.len + " items")
pop():
copyReturns and removes the first item in the map
. This operation will mutate the map
. Passing a map-like object such as file
or computer
will result in an error, interrupting further script execution. If the map
is empty, this method will return null
.
myMap = { "answer": 42, "bar": 23, "foo": "moo" }
print(myMap.pop)
pull():
copyReturns and removes the first item in the map
. This operation will mutate the map
. Passing a map-like object such as file
or computer
will result in an error, interrupting further script execution. If the map
is empty, this method will return null
.
myMap = { "answer": 42, "bar": 23, "foo": "moo" }
print(myMap.pull)
push(key: any
):
copyAdds the value 1 to the provided key. This operation will mutate the map
. The updated map
will be returned. However, it throws an error if you attempt to push a value into itself or into a map-like object such as a file
, halting further script execution. If the passed key is null
an error will be thrown as well.
myMap = { "answer": 42, "bar": 23, "foo": "moo" }
myMap.push("answer")
print(myMap.answer)
remove(key: string
): 01
copyRemoves an item from the map
with the provided key. Due to the removal, the map
will get mutated. If the value is removed successfully, this method will return a number
with the value one. If the removal fails, the value will be zero. Passing any map-like object, such as a file or computer, will cause an error to be thrown, stopping further script execution.
myMap = { "answer": 42, "bar": 23, "foo": "moo" }
myMap.remove("answer")
print(myMap)
replace(oldVal: any, newVal: any, maxCount?: number
):
copyReturns updated map
where each value matching with the provided replace argument gets replaced. This operation will mutate the map
. In case this method gets used on a map-like object such as file
this method will throw a runtime error.
myObject = { "answer": 45 }
myObject.replace(45, 42)
print(myObject.answer)
shuffle():
copyShuffles all values in the map
. This operation will mutate the map
.
myMap = { "answer": 42, "bar": 23, "foo": "moo" }
myMap.shuffle
print(myMap)
sum():
copyReturns sum of all values inside the map
. Any non-numeric values will be considered a zero.
myMap = { "answer": 42, "bar": 23, "foo": "moo" }
sum = myMap.sum
print("Sum of all items in map: " + sum)
values():
copyReturns a list
containing all available values within map
.
myMap = { "answer": 42, "bar": 23, "foo": "moo" }
for value in myMap.values
print(value)
end for
A metaLib
object can be obtained by either using load or dump_lib. The classID
used for this object is "MetaLib"
.
- copy
Returns a library in debug mode as a debugLibrary
object. A valid Neurobox engineer's username and password are required to access this mode. If successful, the debugLibrary
object is returned; in case of an error, a string
with details is provided. Passing values that deviate from the defined signature will result in null
.
metax = include_lib("/lib/metaxploit.so")
metaLib = metax.load("/lib/init.so")
debugLib = metaLib.debug_tools("test", "test")
if typeof(debugLib) == "debugLibrary" then
print("Received debug libary object!")
end if
- copy
Returns by default a number indicating whether the library has been patched. A value of one indicates that the library has been patched, while zero indicates that it has not. If the getdate parameter is set to true
, the function will return a string
containing the date of the last patch. The data format is as follows: "dd/MM/yyyy"
. Additionally if there is any error the return value will be a string
. Providing values that deviate from the defined signature will cause null
to be returned.
metax = include_lib("/lib/metaxploit.so")
metaLib = metax.load("/lib/init.so")
isPatchedResult = metaLib.is_patched
if isPatchedResult == 1 then
print("init.so has been patched!")
end if
- copy
Returns a string
containing the name of the library. An example of a name would be "init.so"
.
metax = include_lib("/lib/metaxploit.so")
metaLib = metax.load("/lib/init.so")
print("Name for library is: " + metaLib.lib_name)
- copy
Exploits vulnerabilities. The returned value can be of various data types. Therefore, using typeof
is advisable. optArgs
are required when changing a password or obtaining a computer
via a router. It should be the desired password or LAN IP, respectively. Change password, traffic light and firewall disable exploits will return a number
, where the value is either one or zero. One indicates success while zero indicates failure. Shell, computer, and file exploits either return an instance of their type or null
. Providing values that deviate from the defined signature will cause a runtime exception to be thrown.
metax = include_lib("/lib/metaxploit.so")
metaLib = metax.load("/lib/init.so")
scanResult = metax.scan(metaLib)
target = scanResult[0]
scanAddress = metax.scan_address(metaLib, target)
segments = scanAddress.split("Unsafe check: ")
exploit = null
for segment in segments
hasRequirement = segment.indexOf("*") != null
if (not hasRequirement) then
labelStart = segment.indexOf("<b>")
labelEnd = segment.indexOf("</b>")
exploit = segment[labelStart + 3: labelEnd]
end if
end for
if (exploit) then
print("Exploiting... " + target + ":" + exploit)
print(metaLib.overflow(target, exploit))
else
print("No exploit found with zero requirements")
end if
- copy
Returns a string
containing the version number of the library. An example of a version number would be "1.0.0"
.
metax = include_lib("/lib/metaxploit.so")
metaLib = metax.load("/lib/init.so")
print("Init.so version: " + metaLib.version)
A MetaMail
object can be obtained by using mail_login. The classID
used for this object is "MetaMail"
.
- copy
Delete the email corresponding to the provided email ID. Returns a number
with the value one if the email removal was successful. Otherwise, a string
with an error message will be returned. If the provided mailId is anything other than a string
this method will return null
.
metaMail = mail_login(user_mail_address, "test")
mails = metaMail.fetch
results = []
for mail in mails
segments = mail.split(char(10))
mailId = segments[2][8:]
print(metaMail.delete(mailId))
end for
print("Deleted every mail!")
- copy
Returns a list
where each item is a string
containing mail id, from, subject and a small preview of the content consisting of the first 125 characters. If there is any issue a string
will be returned with details.
metaMail = mail_login(user_mail_address, "test")
mails = metaMail.fetch
results = []
for mail in mails
segments = mail.split(char(10))
item = {}
item.mailId = segments[2][8:]
item.from = segments[3][6:]
item.subject = segments[4][9:]
item.preview = segments[5:]
results.push(item)
end for
print(results)
- copy
Returns a string
containing the content of a mail related to the provided mail id. The mail id argument can be obtained with fetch
. In case the mail cannot be found this method will return "Mail not found". If the provided mailId is not a string
, this method will return null
.
metaMail = mail_login(user_mail_address, "test")
mails = metaMail.fetch
results = []
for mail in mails
segments = mail.split(char(10))
mailId = segments[2][8:]
print(metaMail.read(mailId))
end for
- copy
Send a new mail to the provided email address. Keep in mind that the subject can not exceed 128 characters and the message size should not exceed 2500 characters. Returns a number
with the value one if the mail has been sent correctly, otherwise returns a string
with an error. If any of the provided values deviate from the method signature, it will return null
.
metaMail = mail_login(user_mail_address, "test")
result = metaMail.send(user_mail_address, "test subject", "test message")
if typeof(result) == "string" then
print("There was an error while sending mail: " + result)
else
print("Mail got send successfully.")
end if
A metaxploit
object can be obtained by using include_lib. The classID
used for this object is "MetaxploitLib"
.
- copy
Returns a metaLib
object for the provided path to the library binary. Keep in mind that this can only be used on library files. On failure, this method will return null
. If the provided path is empty, this method will throw a runtime exception, preventing further script execution.
metax = include_lib("/lib/metaxploit.so")
libFolder = get_shell.host_computer.File("/lib")
for file in libFolder.get_files
metaLib = metax.load(file.path)
print("Library: " + metaLib.lib_name + " - " + metaLib.version)
end for
- copy
Returns a netSession
object for the provided IP address and port. Note that if the port is set to zero, it will return a netSession
related to the kernel router. The main purpose of this method is to gain a netSession
and then use dump_lib
to receive a metaLib
object to exploit vulnerabilities. In case of failure, this method will return null
. If this method is used within an SSH encryption process or with disabled internet, or if an invalid target IP is provided, this method will throw a runtime exception.
metax = include_lib("/lib/metaxploit.so")
ports = get_router("1.1.1.1").used_ports
for port in ports
netSession = metax.net_use("1.1.1.1", port.port_number)
metaLib = netSession.dump_lib
print("Library: " + metaLib.lib_name + " - " + metaLib.version + " on port " + port.port_number)
end for
- copy
Launches a process on the victim's computer
, silently attempting to continuously connect in the background to the specified address and port. For the reverse shell to run successfully, the rshell
service must be installed, and the port forward must be configured correctly on the machine where the server is waiting for the victim's connection. If the launch was successful, a number
with the value one will be returned. In case of failure, a string
with details will be returned.
metax = include_lib("/lib/metaxploit.so")
metax.rshell_client("1.1.1.1", 1222, "bgprocess")
- copy
This method returns a list
of shell
objects that have been reverse shell connected to this computer. To manage the connections received, the rshell
service must be installed on the machine that receives the victims' connections. In case of failure a string
will be returned with details.
metax = include_lib("/lib/metaxploit.so")
shells = metax.rshell_server
firstShell = shells[0]
firstShell.host_computer.File("/").chmod("o-wrx", true)
- copy
Returns a list
where each item is a string
representing a memory area which has vulnerabilities related to the provided library. These memory areas can be used to make further scans via scan_address
. In case of failure, this method returns null
instead. An example of a memory area would be "0x7BFC1EAA". Using this method within a SSH encryption process will throw a runtime exception.
metax = include_lib("/lib/metaxploit.so")
metaLib = metax.load("/lib/init.so")
scanResult = metax.scan(metaLib)
for area in scanResult
print("Memory area containg vulnerability: " + area)
end for
- copy
Returns a string
containing information about each vulnerability in the provided library and memory area. In case the scanning fails this method will return null
. Using this method within a SSH encryption process will throw a runtime exception.
metax = include_lib("/lib/metaxploit.so")
metaLib = metax.load("/lib/init.so")
scanResult = metax.scan(metaLib)
scanAddress = metax.scan_address(metaLib, scanResult[0])
segments = scanAddress.split("Unsafe check: ")[1:]
exploits = []
for segment in segments
labelStart = segment.indexOf("<b>")
labelEnd = segment.indexOf("</b>")
exploits.push(segment[labelStart + 3: labelEnd])
end for
print("Available vulnerabilities: " + exploits.join(", "))
- copy
The terminal listens to the network packets of any connection that passes through the computer. When any connection information gets captured, it will print a string
with the obtained data. In case saving of encryption source is enabled it will download the source code of the script responsible for encryption. In case the operation fails this method will return null
. Using this method within a SSH encryption process will throw a runtime exception.
metax = include_lib("/lib/metaxploit.so")
result = metax.sniffer
print(result)
netSession
A netSession
object can be obtained by using net_use. The classID
used for this object is "NetSession"
.
dump_lib():
copyReturns the metaLib
associated with the remote service. For example if the metaxpoit
method net_use
was used on a ssh port it will return the metaLib
related to the ssh service. In case the port was zero is will return a metaLib
related to the kernel router.
metax = include_lib("/lib/metaxploit.so")
ports = get_router("1.1.1.1").used_ports
netSession = metax.net_use("1.1.1.1", ports[0].port_number)
metaLib = netSession.dump_lib
print("Library: " + metaLib.lib_name + " - " + metaLib.version + " on port " + ports[0].port_number)
get_num_conn_gateway():
copyReturns the number of devices using this router as a gateway. If you obtained your netSession
from a computer, it will fetch and return the value from its gateway router.
metax = include_lib("/lib/metaxploit.so")
ports = get_router("1.1.1.1").used_ports
netSession = metax.net_use("1.1.1.1", ports[0].port_number)
print("Gateway clients: " + netSession.get_num_conn_gateway)
get_num_portforward():
copyReturns the number of ports forwarded by this router. If you obtained your netSession
from a computer, it will fetch and return the value from its gateway router.
metax = include_lib("/lib/metaxploit.so")
ports = get_router("1.1.1.1").used_ports
netSession = metax.net_use("1.1.1.1", ports[0].port_number)
print("Port forwards: " + netSession.get_num_portforward)
get_num_users():
copyReturns the number of user accounts on the system.
metax = include_lib("/lib/metaxploit.so")
ports = get_router("1.1.1.1").used_ports
netSession = metax.net_use("1.1.1.1", ports[0].port_number)
print("User accounts: " + netSession.get_num_users)
is_any_active_user(): 01
copyReturns a number
. If there is an active user on the system it will be one. Otherwise, it will be zero.
metax = include_lib("/lib/metaxploit.so")
ports = get_router("1.1.1.1").used_ports
netSession = metax.net_use("1.1.1.1", ports[0].port_number)
print("User Active?: " + netSession.is_any_active_user)
is_root_active_user(): 01
copyReturns a number
. If there is an active root on the system it will be one. Otherwise, it will be zero.
metax = include_lib("/lib/metaxploit.so")
ports = get_router("1.1.1.1").used_ports
netSession = metax.net_use("1.1.1.1", ports[0].port_number)
print("Root Active?: " + netSession.is_root_active_user)
number
All numbers are stored in full-precision format. Numbers also represent true == 1
and false == 0
.
a = 20
b = 22
print(a + b) // addition
print(a - b) // substraction
print(a / b) // division
print(a * b) // multiply
print(a % b) // modulo
print(a - b) // substraction
print(a ^ b) // power
print(a and b) // logical and
print(a or b) // logical or
print(not a) // logical not
print(a == b) // comparison equal
print(a != b) // comparison unequal
print(a > b) // comparison greater than
print(a < b) // comparison lower than
print(a >= b) // comparison greater equal than
print(a <= b) // comparison lower equal than
port
A port
object can be obtained by using get_ports, ping_port, used_ports or device_ports. The classID
used for this object is "port"
. Generally there are no restrictions in regards to which service runs on which port but there are some default ports for each service. List of the most common ports: 21
(FTP), 22
(SSH), 25
(SMTP), 80
(HTTP), 141
(SQL), 8080
(HTTP), 1222
(RSHELL), 1542
(Repository), 3306
(SQL), 3307
(SQL), 3308
(SQL), 6667
(Chat), 37777
(CCTV)
get_lan_ip():
copyReturns a string
containing the local IP address of the computer to which the port is pointing.
router = get_router
ports = router.used_ports
for port in ports
print("Port " + port.port_number + " is pointed to " + port.get_lan_ip + "!")
end for
is_closed(): 01
copyReturns a number
, where one indicates that the specified port
is closed and zero indicates that the port is open.
router = get_router
ports = router.used_ports
for port in ports
state = "open"
if (port.is_closed) then state = "closed"
print("Port " + port.port_number + " is " + state + "!")
end for
port_number():
copyReturns the number
which is used for the port.
router = get_router
ports = router.used_ports
for port in ports
print("Port " + port.port_number + " is in use!")
end for
router
A router
object can be obtained by either using get_router or get_switch. The classID
used for this object is "router"
.
bssid_name():
copyReturns a string
with the BSSID value of the router.
router = get_router
bssid = router.bssid_name
print("BSSID: " + bssid)
device_ports(ip: string
):
copyReturns a list
where each item is an open port
related to the device of the provided LAN IP address. The device needs to be within the network of the router
. In case of failure, this method will return null
or a string
with details. In case an empty ip is provided this method will throw a runtime exception.
router = get_router
devices = router.devices_lan_ip
for ip in devices
ports = router.device_ports(ip)
openPorts = []
for port in ports
if port.is_closed then continue
openPorts.push(port)
end for
if (openPorts.len == 0) then
print(ip + " has no open ports")
else
print(ip + " contains following open ports:")
for port in openPorts
print("|-" + port.port_number)
end for
end if
end for
devices_lan_ip():
copyReturns a list
where each item is a string
representing a LAN IP address. All devices are within the network of the router and can be reached by using the ping
method. Some of the devices might be behind a firewall.
router = get_router
devices = router.devices_lan_ip
for ip in devices
print(ip + " found!")
end for
essid_name():
copyReturns a string
with the ESSID value of the router.
router = get_router
essid = router.essid_name
print("ESSID: " + essid)
firewall_rules():
copyReturns a list
where each item is a string
containing a firewall rule.
router = get_router
rules = router.firewall_rules
print("Firewall rules: " + rules.join(", "))
kernel_version():
copyReturns a string
with the version of the kernel_router.so
library.
router = get_router
version = router.kernel_version
print("Kernel router version: " + version)
local_ip():
copyReturns a string
with the local IP address of the router.
router = get_router
localIp = router.local_ip
print("Local IP: " + localIp)
ping_port(port: number
):
copyReturns a port
that is behind the port number
provided. In case the port
does not exist null
gets returned.
router = get_router
ports = router.used_ports
for port in ports
pingedPort = router.ping_port(port.port_number)
if (pingedPort == null) then continue
print("Pinged " + pingedPort.port_number)
end for
port_info(port: port
):
copyReturns a string
with information about the provided port, including details about the running service and its version. For example, the output could be "http 1.0.0"
. If the operation fails, null
will be returned.
router = get_router
ports = router.used_ports
for port in ports
info = router.port_info(port)
print(info)
end for
public_ip():
copyReturns a string
with the public IP address of the router.
router = get_router
publicIp = router.public_ip
print("Public IP: " + publicIp)
used_ports():
copyReturns a list
where each item is a port
used inside the router.
router = get_router
ports = router.used_ports
for port in ports
print("Port " + port.port_number + " is available!")
end for
service
The service object can be obtained by using include_lib. The classID
used for this object is "service"
. List of all installable services: "FTP"
, "SSH"
, "HTTP"
, "Repository"
, "Chat"
install_service(): "Denied. Only root user can install this service."1
copyInstalls the necessary files for the correct functioning of the service and starts it. If the installation is completed successfully, it returns a number
with the value one. In case of an error, it returns a string
with details.
service = include_lib("/lib/libhttp.so")
result = service.install_service
if result == 1 then
print "Successfully installed service"
else
print "Service installation failed: " + result
end if
start_service(): "Denied. Only root user can install this service.""<color=yellow>${reason} The chat service can't be accessed.</color>"1
copyStarts the service and opens its associated port
on the local machine. The service requires a port forwarded to the router to be accessible from the outside. If the service starts correctly, it returns a number
with the value one. In case of an error, it returns a string
with details.
service = include_lib("/lib/libhttp.so")
result = service.start_service
if result == 1 then
print "Successfully started service"
else
print "Starting service failed: " + result
end if
stop_service(): "Denied. Only root user can install this service."10
copyStops the service and closes its associated port
on the local machine. If the service is stopped successfully, it returns a number
with the value one. If an error occurs during the process, it returns a string
with details. In some cases, the returned number
might be zero, indicating that the service removal failed.
service = include_lib("/lib/libhttp.so")
result = service.stop_service
if result == 1 then
print "Successfully stopped service"
else
print "Stopping service failed: " + result
end if
shell
A shell
object can be acquired by either using get_shell, connect_service or overflow. The classID
used for this object is "shell"
. In case you want to use connect_service to connect to a SSH port it will be usually at port 22
.
build(pathSource: string, pathBinary: string, allowImport: number = 0
): "pathSource and programName can't be empty""Invalid shell""Unknown error: Unable to access to local computer""Can't find ${pathSource}""Can't find ${pathBinary}""Can't access to ${pathSource}. Permission denied.""Can't build ${pathSource}. Binary file""Can't create binary in ${pathBinary}. Permission denied.""Can't build ${pathSource}. Invalid extension.""Can't compile. Source code is empty"
copyCompiles a plain code file provided in the arguments to a binary. On success, the new binary will be available under the provided build folder. The binary name will be the same as the source file just without the file extension. Optionally, an allowImport flag can be set which enables the use of import_code
on the binary. All provided paths must be absolute. Returns an empty string on success. On failure, it will return a string containing details about the reason for failure. In case any provided values deviate from the defined signature a runtime exception will be thrown.
shell = get_shell
computer = shell.host_computer
computer.touch(home_dir, "test.src")
computer.File(home_dir + "/test.src").set_content("print(""hello world"")")
buildResult = shell.build(home_dir + "/test.src", home_dir + "/Desktop")
if buildResult != "" then
print("There was an error while compiling: " + buildResult)
else
print("File has been compiled.")
end if
connect_service(ip: string, port: number, user: string, password: string, service: string = "ssh"
): shellorftpShellorstringornull
"No internet access.""Remote host is down""Unable to find service ${service}""Invalid target service port configuration.""connection rejected: port forward removed by admin""Unable to connect: missing ${library}""Unable to connect: invalid ${library}""Unexpected library found. Not a valid ${library} library.""Unknown error""ip address not found""can't connect: the remote server has been temporarily disabled due to non-payment""can't connect: port ${port} not found""can't connect: port closed""can't connect: There is no active machine behind the port ${port}""can't connect: service not found behind the port ${port}""Invalid service ID""can't connect: incorrect user/password""Unknown error: Unable to access to local computer""Direct connections cannot be made outside of this network"
copyReturns a shell
if the connection attempt to the provided IP was successful. This method can only connect to ports running an SSH or FTP service. SSH services usually run on port 22 and FTP services usually on port 21. Keep in mind to pass the right service value depending on which service is going to be used. By default, it will use SSH as the service. Please note that connecting will leave a log entry. In case of failure, a string is returned containing details. If any provided arguments deviate from the method signature, if this method is run in an SSH encryption process, or if the computer is not connected to the internet, a runtime exception will be thrown.
shell = get_shell
connectionResult = shell.connect_service("1.1.1.1", 22, "test", "test")
if typeof(connectionResult) != "shell" then
print("There was an error while connecting: " + connectionResult)
else
print("Connected!")
end if
host_computer():
copyReturns a computer
related to the shell
.
shell = get_shell
computer = shell.host_computer
print("Computer public IP is: " + computer.public_ip)
launch(program: string, params: string = ""
): "Invalid shell""Can't find computer"10
copyLaunches the binary located at the provided path. Optionally, parameters can be passed. Returns a number
. If the launch was successful, the value will be one; otherwise, it will be zero. In some cases, a string
will be returned containing an error message. If you need to share variables between a launched script and the current process, consider using get_custom_object
. Note that launching a script is not asynchronous, meaning that the current script will pause its execution until the launched script finishes. This method cannot be used to execute binaries with an EXE extension (GUI interface). If any provided values deviate from the method signature, a runtime exception will be thrown.
shell = get_shell("root", "test")
shell.launch("/bin/cat", "/etc/passwd")
ping(ip: string
): "ping: invalid ip address"10
copyReturns a number
. If the remote address could be reached the value will be one, zero otherwise. Firewalls do not block ping requests. Passing an invalid ip will cause the method to return a string
with an error message. If any provided arguments deviate from the method signature a runtime exception will be thrown.
shell = get_shell
isPingable = shell.ping("1.1.1.1")
if isPingable then
print("Ping was successful!")
else
print("Ping failed!")
end if
scp(file: string, folder: string, remoteShell: shell
): "unknown error""Invalid path""${filepath} not found""permission denied""permission denied. ${filename} is protected""The copy can not be made. Reached maximum number of files in a folder""The copy can not be made. Reached maximum limit""${sourceFile} not found""${destinationFolder} not found""${destinationFolder} it's not a folder"1
copySend a file
to the computer
related to the provided shell
. You require permission to read the file
on the computer
from which you are uploading and write permissions in the folder of the computer
you are trying to upload to. In case of failure, this method will return a string
with the cause. Otherwise, a number
with the value one gets returned. If any of the passed arguments deviates from the types of the method signature, null
will be returned. In case the string
for sourceFile or destinationFolder is empty, an error will be thrown, preventing further script execution
shell = get_shell
remoteShell = shell.connect_service("1.1.1.1", 22, "test", "test")
result = remoteShell.scp("/bin/ls", "/etc/", shell)
if typeof(result) == "string" then
print("There was an error while sending file: " + result)
else
print("File got sent successfully.")
end if
start_terminal():
copyLaunches an active terminal. The terminal's color will change, displaying the IP of the connected shell. Script execution will be stopped upon starting a new terminal, unless this is called from another script that was executed via shell.launch
. In that case, you will enter the shell after closing your root-level script within that terminal window. Using this method within an SSH encryption process will cause an error to be thrown, preventing further script execution.
shell = get_shell
shell.start_terminal
smartAppliance
A smartAppliance
object can be obtained by using include_lib. The classID
used for this object is "SmartAppliance"
.
model(): "Unknown error: Unable to access to local computer""error: No internet access.""error: Device hardware malfunction"
copyReturns a string
with the appliance model ID.
libSmartapp = include_lib("/lib/libsmartappliance.so")
modelResult = libSmartapp.model
if modelResult.matches("^[A-Z]+$") then
print("Model is: " + modelResult)
else
print("Model couldn't be determined due to: " + modelResult)
end if
override_settings(power: number, temperature: number
): "Unknown error: Unable to access to local computer""error: No internet access.""error: Device hardware malfunction""override_settings: denied: The settings are locked for security reasons."1
copyOverrides the power and temperature settings of the appliance. If successful, it returns a number
with the value one; otherwise, it returns a string
detailing the error. If any arguments deviate from the defined signature, this method will return null
.
libSmartapp = include_lib("/lib/libsmartappliance.so")
overrideResult = libSmartapp.override_settings(1000, 20)
if overrideResult == 1 then
print("Override was successful!")
else
print("Override failed due to: " + overrideResult)
end if
set_alarm(enable: number
): "Unknown error: Unable to access to local computer""error: No internet access.""error: Device hardware malfunction""set_alarm: denied: The alarm settings are locked for security reasons."1
copyActivates or deactivates the sound alarm indicating any appliance malfunction. If the operation is successful, a number
with the value one is returned; otherwise, a string
containing error details is returned. If the enable
argument deviates from the defined signature, the method will return null
.
libSmartapp = include_lib("/lib/libsmartappliance.so")
setAlarmResult = libSmartapp.set_alarm(false)
if setAlarmResult == 1 then
print("Alarm was disabled successfully!")
else
print("Disabling alarm failed due to: " + setAlarmResult)
end if
string
Text is stored in strings of Unicode characters. Write strings by surrounding them with quotes. If you need to include a quotation mark in the string, write it twice.
a = "hello"
b = "world"
print(a + b) // concatinate a and b
print(a * 10) // repeat hello ten times
print(a[0]) // prints h
print(a[1:3]) // prints ell
code():
copyReturns a number
representing the Unicode code of the first character of the string
.
myString = "HELLO WORLD"
print(myString.code)
hasIndex(index: number
): 01
copyReturns a number
. If the provided index is available in the string
, the value will be one. Otherwise, the value will be zero.
myString = "42 as an answer is wrong"
containsIndex = myString.hasIndex(1)
if containsIndex then
print("String contains index of 1.")
else
print("String does not contain index of 1.")
end if
indexOf(value: string, offset?: number
):
copyReturns a number
which indicates the first matching index of the provided value inside the list
. Optionally a start index can be provided. In case the value does not exist inside the string
a null
gets returned.
myString = "42 as an answer is wrong"
index = myString.indexOf("wrong")
if index != null then
print("Invalid information spotted at: " + index)
else
print("Information seems valid.")
end if
indexes():
copyReturns a list
where each item is a number
representing all available indexes in the string
.
myString = "42"
print(myString.indexes)
insert(index: number, value: string
):
copyReturns a string
with the newly inserted string
at the provided index. If the passed index is not a number
, this method throws an error, preventing further script execution.
myString = "42 as an answer is wrong"
index = myString.lastIndexOf("w") - 1
newString = myString.insert(index, "not ")
print(newString)
is_match(pattern: string, regexOptions: string = "none"
): 10
copyUses regular expression to check if a string matches a certain pattern. If it matches, it will return a number
with the value one. If it does not match, the value of the number
will be zero. If any provided arguments deviate from the method signature types, if the pattern is empty, if the provided regexOptions are invalid, or if the regular expression times out, an error will be thrown, preventing further script execution.
myString = "42 as an answer is wrong"
hasWordAtTheEnd = myString.is_match("\w+$")
print(hasWordAtTheEnd)
lastIndexOf(searchStr: string
):
copyReturns a number
which indicates the last matching index of the provided value inside the list
. In case the value does not exist inside the string
a -1
gets returned. If the provided searchStr is not a string
, this method will return null
.
myString = "42 as an answer is wrong"
index = myString.lastIndexOf("wrong")
if index != -1 then
print("Invalid information spotted at: " + index)
else
print("Information seems valid.")
end if
len():
copyReturns a number
representing the length of the string
.
myString = "HELLO WORLD"
print("Size of string is: " + myString.len)
lower():
copyReturns a new string
in which all characters are transformed into lowercase.
myString = "HELLO WORLD"
print(myString.lower)
matches(pattern: string, regexOptions: string = "none"
):
copyReturns a map
with all search results for the provided regular expression. Each key contains the index and the value contains the matching string
. If any provided arguments deviate from the method signature types, if the pattern is empty, if the provided regexOptions are invalid, or if the regular expression times out, an error will be thrown, preventing further script execution.
myString = "42 as an answer is wrong"
result = myString.matches("w")
print(result)
remove(value: string
):
copyReturns a new string
with the provided value removed. Any value other than null
can be passed, but note that it will be cast to a string. If null
is passed, this method will throw an error, preventing further script execution.
myString = "42 as an answer is wrong"
newString = myString.remove("wrong")
print(newString + "right")
replace(pattern: string, newValue: string, regexOptions: string = "none"
):
copyReturns a string
with the replaced content by using regular expressions. If any provided arguments deviate from the method signature types, if the pattern is empty, if the provided regexOptions are invalid or if the regular expression times out, an error will be thrown, preventing further script execution.
myString = "42 as an answer is wrong"
newString = myString.replace("wrong", "right")
print(newString)
split(pattern: string, regexOptions: string = "none"
):
copyReturns a list
where each item is a segment of the string
, separated by the provided separator string
. This method uses regular expressions for matching, so remember to escape special characters such as dots. If any of the provided arguments deviate from the method signature types, this method will return null
. In case the pattern is empty, the provided regexOptions are invalid, or the regular expression times out, an error will be thrown, preventing further script execution.
myString = "42 as an answer is wrong"
segments = myString.split(" ")
if segments[0] != "42" then
print("Invalid information spotted!")
else
print("Information seems valid!")
end if
to_int():
copyReturns a number
which is parsed from the string
as an integer. In case the string
is not numeric it will return the original string
.
myString = "1"
print(myString.to_int + 41)
trim():
copyReturns a new string
stripped of any spacing at the beginning and ending.
myString = " 42 "
print(myString.trim)
upper():
copyReturns a new string
in which all characters are transformed into uppercase.
myString = "hello world"
print(myString.upper)
val():
copyReturns a number
which is parsed from the string
. In case the string
is not numeric it will return a zero.
myString = "1.25"
print(myString.val + 40.75)
values():
copyReturns a list
where each item is a string
representing all available characters in the string
. Could be compared to using split
but without any separator.
myString = "hello world"
print(myString.values)
subWallet
A subWallet
object can be obtained by either using get_subwallet or get_subwallets. The classID
used for this object is "subwallet"
.
check_password(password: string
): "Unknown error: Unable to access to local computer""No internet access.""login_subwallet: the account does not exist."10
copyReturns a number
with the value one if the credentials are correct, otherwise, the value is zero. For some cases, this method will return a string
with an error message.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
password = user_input("SubWallet password:", true)
if check_password(subWallet, password) == 1 then
print "Password is correct!"
end if
delete(): "Unknown error: Unable to access to local computer""No internet access."10
copyDeletes the account registered in the cryptocurrency. Returns a number
where one indicates successful deletion and zero indicates failure. In case of certain failures, this method may return a string
with details.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
result = delete_subwallet(subWallet)
if result == 1 then
print "Subwallet got deleted!"
end if
get_balance(): "get_balance: The account does not exist.""Unknown error: Unable to access to local computer""No internet access."
copyReturns a number
of coins of a given currency. In case of error, a string
with the details is returned.
blockchain = include_lib("/lib/blockchain.so")
coin = blockchain.get_coin("test", "test", "test")
subWallet = coin.get_subwallet("test")
print "Balance: " + subWallet.get_balance
get_info(): "Error: ${coinName} does not exist""Error: ${subWalletUser} does not exist""Error: main wallet linked to ${subWalletUser} does not exist anymore""Error: Coin ${coinName}does not exist in the Wallet user""Unknown error: Unable to access to local computer""No internet access."
copyReturns a string
with the information stored by the coin creator.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
print "Subwallet info: " + get_info(subWallet)
get_user(): "Unknown error: Unable to access to local computer""No internet access."
copyReturns a string
with the username associated with this subwallet. On failure, this method returns a string
with an error message.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
print "Subwallet user: " + get_user(subWallet)
last_transaction(): list<any>ornumberorstring
"Unknown error: Unable to access to local computer""No internet access."0
copyReturns a list
with the information of the last transaction. Index 0 is a string
with the other subWallet. Index 1 is an integer with the amount. Index 2 is a number
indicating the direction of the transaction (0 for Deposit, 1 for Withdrawal). Index 3 is a string
indicating the date of the transaction. On failure, this method will either return a number
with the value zero or a string
with an error message.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
transactionItem = last_transaction(subWallet)
destinationAccount = transactionItem[0]
amount = transactionItem[1]
direction = transactionItem[2]
completeDate = transactionItem[3]
if direction == 0 then
print "Received " + amount + " from " + destinationAccount + " got completed at the " + completeDate
else
print "Send " + amount + " to " + destinationAccount + " got completed at the " + completeDate
end if
mining(): "Unknown error: Unable to access to local computer""No internet access.""all existing coins of ${coinName} have been mined.""Only one mining process is allowed.""Error: GPU is damaged. Unable to start the mining process.""Error: GPU returned corrupted data while performing floating point tests. Unable to start the mining process.""Hardware error"1
copyStarts the process of mining the cryptocurrency. The process leaves the terminal busy until a coin is mined. On success, this method will return a number
with the value one. On failure, this method will return a string
with details.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
while mining(subWallet) == 1
print "Mining...", true
print "Balance " + get_balance_subwallet(subWallet)
end while
set_info(info: string
): "Error: ${coinName} does not exist""Error: ${subWalletUser} does not exist""Error: main wallet linked to ${subWalletUser} does not exist anymore""Error: exceeded maximum of 256 characters""Unknown error: Unable to access to local computer""No internet access."1
copyStores optional information in the Subwallet for any use. Upon success, a number
with the value one will be returned. In case of failure, a string
with details will be returned.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
result = set_info(subWallet, "test")
if result == 1 then
print "Subwallet info got set!"
end if
wallet_username(): "Unknown error: Unable to access to local computer""No internet access."
copyReturns a string
with the name of the wallet
to which this subwallet belongs.
blockchain = include_lib("/lib/blockchain.so")
coin = get_coin(blockchain, "test", "test", "test")
subWallet = get_subwallet(coin, "test")
print "SubWallet username: " + wallet_username(subWallet)
trafficNet
A trafficNet
object can be obtained by using include_lib. The classID
used for this object is "TrafficNet"
.
camera_link_system(): "Unknown error: Unable to access to local computer""error: No internet access.""error: This device is not registered on any police network"1
copyAccesses the traffic camera system, opening a window with controls to switch between different cameras. If the window opens successfully, this method returns a number
with the value one. In case of an error, it returns a string
with details.
libTraffic = include_lib("/lib/libtrafficnet.so")
linkSystemResult = libTraffic.camera_link_system
if linkSystemResult == 1 then
print("Initiated camera broadcast!")
end if
get_credentials_info(): "Unknown error: Unable to access to local computer""error: No internet access.""error: This device is not registered on any police network""${job} ${name}"
copyReturns string which contains job and name of a NPC. If an error occurs, a string
with details is returned.
libTraffic = include_lib("/lib/libtrafficnet.so")
print(libTraffic.get_credentials_info)
locate_vehicle(licensePlate: string, password: string
): "Error: This user cannot access the global camera system for another 24 hours.""Error: This network has disabled access to the traffic cameras.""error: Workstation not found. Unable to get the credentials info from ${credentials}""error: Incorrect password. Access denied.""Unknown error: Unable to access to local computer""error: Invalid license plate.""Error: Unable to use the camera at this time. Too many calls.""error: No internet access.""error: This device is not registered on any police network""locate_vehicle: License plate not found.""The vehicle could not be located in the camera system at this time."1
copyPerforms a search for the specified license plate to locate the vehicle. If the vehicle is visible on any camera, the viewer will switch to the camera currently displaying it and return a number
with the value one. If the vehicle cannot be located or the license plate is incorrect, a string
indicating the error is returned. If any of the provided values deviates from the defined types in the method signature, this method will return null
.
libTraffic = include_lib("/lib/libtrafficnet.so")
libTraffic.camera_link_system
vehicleSearchResult = libTraffic.locate_vehicle("1L2M3N", "pass")
if vehicleSearchResult == 1 then
print("Found vehicle!")
end if
wallet
A wallet
object can be obtained by either using create_wallet or login_wallet. The classID
used for this object is "wallet"
.
buy_coin(coinName: string, coinAmount: number, unitPrice: number, subwalletUser: string
): "Unknown error: Unable to access to local computer""No internet access.""sell_coin: coin amount and proposed price cannot be 0."1
copyPublishes a purchase offer indicating the number of coins you wish to buy and the price ($) per unit you are willing to pay. The purchase will be finalized if there is any sale offer with a price less than or equal to the one proposed in the purchase. If there is no eligible offer to sell at that time, the offer to buy will remain publicly visible until a new offer to sell satisfies the requirements. If the publication has been successful, a number
with the value one is returned. In case of error, a string
with the details is returned. Any deviation from the method signature will result in a runtime exception preventing further script execution.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
result = wallet.buy_coin("test", 100, 20, "test")
if result == 1 then
print "Sucessfully created purchase offer!"
else
print "Failed: " + result
end if
cancel_pending_trade(coinName: string
): "Unknown error: Unable to access to local computer""No internet access."
copyCancel any pending offer of a certain coin. On success, an empty string
will be returned. On failure, a string
with an error message will be returned. Any deviation from the method signature will result in null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = blockchain.login_wallet("test", "test")
if wallet.cancel_pending_trade("test") == "" then
print "Trade got canceled!"
end if
get_balance(coinName: string
): "Unknown error: Unable to access to local computer""No internet access.""Error: wallet does not exist/incorrect credentials.""get_balance: wallet does not have coins in the selected currency"
copyReturns a number
of coins of a given currency. In case of error, a string
with the details is returned. If the passed coinName is anything other than a string
this method will return null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = blockchain.login_wallet("test", "test")
for coinName in wallet.list_coins
print "You have " + wallet.get_balance(coinName) + " coins of the currency """ + coinName + """"
end for
get_global_offers(coinName: string
): stringormap<string,list<any>>ornull
"Unknown error: Unable to access to local computer""No internet access."
copyReturns a map
with all the offers made by any player of a given currency. The key of the map
represents the WalletID of the player who has made the offer, and the value of the map
is a list
where index 0 represents the type of offer with a string
(Buy/Sell), index 1 represents the amount to sell or buy, and index 2 represents the price per unit. In case of failure, this method returns a string
with details. Any deviation from the method signature will result in null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = blockchain.login_wallet("test", "test")
for item in wallet.get_global_offers("test")
walletId = item.key
trade = item.value
isBuying = trade[0] == "Buy"
quantity = trade[1]
unitPrice = trade[2]
print "-" * 10
print "<b>" + walletId + "</b>"
if isBuying then
print "<color=green>Is buying</color>"
else
print "<color=yellow>Is selling</color>"
end if
print quantity + " coins with a unit price of " + unitPrice
end for
get_pending_trade(coinName: string
): "Unknown error: Unable to access to local computer""No internet access."
copyReturns a list
with the pending sale or purchase offer of this wallet for a certain currency. Index 0 of the list
represents the type of offer with a string
(Buy/Sell), index 1 represents the quantity to be sold or bought, and index 2 represents the price per unit. On failure, this method will return a string
with details. Any deviation from the method signature will result in a null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = blockchain.login_wallet("test", "test")
result = wallet.get_pending_trade("test")
isBuying = result[0] == "Buy"
quantity = result[1]
unitPrice = result[2]
currentBalance = wallet.get_balance("test")
if isBuying then
print "After buying was successful your balance will be " + (quantity * unitPrice + currentBalance)
else
print "After selling was successful your balance will be " + (currentBalance - quantity * unitPrice)
end if
get_pin(): "Unknown error: Unable to access to local computer""No internet access."
copyReturns a string
with a PIN that refreshes every few minutes. This PIN is used to obtain an account in cryptocurrency services.
blockchain = include_lib("/lib/blockchain.so")
myShell = get_shell
myComputer = myShell.host_computer
wallet = blockchain.login_wallet("test", "test")
myComputer.touch("/root", "pin_launch.src")
myFile = myComputer.File("/root/pin_launch.src")
myFile.set_content("
blockchain = include_lib(""/lib/blockchain.so"")
myShell = get_shell
myComputer = myShell.host_computer
wallet = blockchain.login_wallet(""test"", ""test"")
if params[0] == wallet.get_pin then
get_custom_object.secret = ""The answer is 42""
else
get_custom_object.secret = ""The answer is 10053""
end if
")
myShell.build("/root/pin_launch.src", "/root")
myFile.delete
myShell.launch("/root/pin_launch", wallet.get_pin)
print "The secret: " + get_custom_object.secret
list_coins(): "Unknown error: Unable to access to local computer""No internet access.""Error: wallet does not exist/incorrect credentials."
copyReturns a list
where each item is a string
with the names of the coins available in the wallet
. On failure this method returns a string
with an error message.
blockchain = include_lib("/lib/blockchain.so")
wallet = blockchain.login_wallet("test", "test")
print "My wallet is connected to: " + wallet.list_coins.join(", ")
list_global_coins(): "Unknown error: Unable to access to local computer""No internet access."
copyReturns a list
where each item is a string
containing the names of all the currencies that exist. In case of failure, this method returns a string
with details.
blockchain = include_lib("/lib/blockchain.so")
wallet = blockchain.login_wallet("test", "test")
print "All existing coins: " wallet.list_global_coins.join(", ")
reset_password(newPassword: string
): "Error: Wallet does not exist.""Error: Only the account owner can change the password""Error: The password can only be reset once a day""Unknown error: Unable to access to local computer""No internet access.""reset_password: only alphanumeric characters are allowed as password""reset_password: name and password cannot exceed the 16 character limit."1
copyChange the password of the wallet. Only the account owner can perform this action. If the process is completed successfully, a number
with the value one will be returned. In case of an error, a string
with details will be returned. Any deviation from the method signature will result in null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = blockchain.login_wallet("test", "test")
if wallet.reset_password("test") == 1 then
print "You got a new password!"
end if
sell_coin(coinName: string, coinAmount: number, unitPrice: number, subwalletUser: string
): "Unknown error: Unable to access to local computer""No internet access.""sell_coin: coin amount and proposed price cannot be 0."1
copyPublishes a sale offer indicating the amount of coins you want to sell and the price ($) per unit you want to assign. The sale will be finalized if there is any purchase offer with a price greater than or equal to that proposed in the sale. If there is no existing offer to buy that matches the requirements at that time, the offer to sell will remain publicly visible until a new offer to buy satisfies the requirements. If the publication has been successful, a number
with the value one is returned. In case of error, a string
with the details is returned. Any deviation from the method signature will result in a runtime exception preventing further script execution.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
result = wallet.sell_coin("test", 100, 20, "test")
if result == 1 then
print "Sucessfully created sell offer!"
else
print "Failed: " + result
end if
show_nodes(coinName: string
): "Unknown error: Unable to access to local computer""No internet access.""show_nodes: wallet does not exist""show_nodes: coin does not exist"
copyReturns a number
representing the count of devices mining a specific coin for the same wallet
. In case of an error, a string
with details is returned. Any deviation from the method signature will result in null
.
blockchain = include_lib("/lib/blockchain.so")
wallet = login_wallet(blockchain, "test", "test")
print "Active miners: " show_nodes(wallet, "test")