Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

API Reference [experimental]

Felix edited this page Oct 18, 2020 · 8 revisions

Services

/public_info

Returns public information about a service

Required parameters:

  • device_uuid: UUID of the device the service is running on [string, UUID]
  • service_uuid: UUID of the service [string, UUID]

Responses:

  • Success:
{
  "uuid": "<UUID of the service [string, UUID]>",
  "name": "<Name of the service [string]>",
  "running_port": "<Port the service runs on [number]>",
  "device": "<UUID of the device the service runs on [string, UUID]>"
}
  • The service does not exist:
{"error": "service_not_found"}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}

/use

Uses a simple service (currently portscan)

Required parameters:

  • device_uuid: UUID of the device the service runs on [string, UUID]
  • service_uuid: UUID of the service which should be used [string, UUID]

Parameters for the portscan service:

  • target_device: UUID of the device to run the port-scan on [string, UUID]

Responses:

  • Success (portscan service):
{
  "services": [{
    "uuid": "<UUID of the service [string, UUID]>",
    "name": "<Name of the service [string]>",
    "running_port": "<Port the service runs on [number]>",
    "device": "<UUID of the device the service runs on [string, UUID]>"
  }]
}
  • Service not found:
{"error": "service_not_found"}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}
  • Permission denied:
{"error": "permission_denied"}
  • That service cannot be used:
{"error": "service_cannot_be_used"}
  • Missing or invalid parameters:
{"error": "invalid_request"}

/private_info

Returns private information about a service

Required parameters:

  • device_uuid: UUID of the device the service is running on [string, UUID]
  • service_uuid: UUID of the service [string, UUID]

Responses:

  • Success:
{
  "uuid": "<UUID of the service [string, UUID]>",
  "device": "<UUID of the device the service runs on [string, UUID]>",
  "owner": "<UUID of the owner of the service [string, UUID]>",
  "name": "<Name of the service [string]>",
  "running": "<Whether the service is currently running [boolean]>",
  "running_port": "<Port the service runs on [number]>",
  "part_owner": "<UUID of the user who has hacked the service [string, UUID]>",
  "speed": "<Speed of the service [number]>"
}
  • Service not found or no permission:
{"error": "service_not_found"}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}
  • No permission to get private information about the service
{"error": "permission_denied"}

/toggle

Toggles a service between on and off

Required parameters:

  • device_uuid: UUID of the device the service is running on [string, UUID]
  • service_uuid: UUID of the service [string, UUID]

Responses:

  • Success:
{
  "uuid": "<UUID of the service [string, UUID]>",
  "device": "<UUID of the device the service runs on [string, UUID]>",
  "owner": "<UUID of the owner of the service [string, UUID]>",
  "name": "<Name of the service [string]>",
  "running": "<Whether the service is currently running [boolean]>",
  "running_port": "<Port the service runs on [number]>",
  "part_owner": "<UUID of the user who has hacked the service [string, UUID]>",
  "speed": "<Speed of the service [number]>"
}
  • The service does not exist:
{"error": "service_not_found"}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}
  • No permission to toggle the service:
{"error": "permission_denied"}
  • The service cannot be toggled by this endpoint:
{"error": "cannot_toggle_directly"}
  • There was an error while starting the service:
{"error": "could_not_start_service"}

/delete

Deletes an existing service

Required parameters:

  • device_uuid: UUID of the device the service is running on [string, UUID]
  • service_uuid: UUID of the service [string, UUID]

Responses:

  • Success:
{"ok": true}
  • The service does not exist:
{"error": "service_not_found"}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}
  • The service is enforced and therefore cannot be deleted
{"error": "cannot_delete_enforced_service"}
  • No permission to delete the service:
{"error": "permission_denied"}

/list

Returns a list of the services on a device

Required parameters:

  • device_uuid: UUID of the device [string, UUID]

Responses:

  • Success:
{
  "services": [{
    "uuid": "<UUID of the service [string, UUID]>",
    "device": "<UUID of the device the service runs on [string, UUID]>",
    "owner": "<UUID of the owner of the service [string, UUID]>",
    "name": "<Name of the service [string]>",
    "running": "<Whether the service is currently running [boolean]>",
    "running_port": "<Port the service runs on [number]>",
    "part_owner": "<UUID of the user who has hacked the service [string, UUID]>",
    "speed": "<Speed of the service [number]>"
  }]
}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}
  • No permission to get a list of the services:
{"error": "permission_denied"}

/create

Installs a new service on a device

Required parameters:

  • device_uuid: UUID of the device the service should be created on [string, UUID]
  • name: Name of the service (one of ssh, telnet, portscan, bruteforce or miner) [string]

Parameters if name is miner:

  • wallet_uuid: UUID of the wallet the generated coins from the miner should be transferred to [string, UUID]

Responses:

  • Success:
{
  "uuid": "<UUID of the service [string, UUID]>",
  "device": "<UUID of the device the service runs on [string, UUID]>",
  "owner": "<UUID of the owner of the service [string, UUID]>",
  "name": "<Name of the service [string]>",
  "running": "<Whether the service is currently running [boolean]>",
  "running_port": "<Port the service runs on [number]>",
  "part_owner": "<UUID of the user who has hacked the service [string, UUID]>",
  "speed": "<Speed of the service [number]>"
}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}
  • No permission to create a service on this device:
{"error": "permission_denied"}
  • The specified service in name does not exist:
{"error": "service_not_supported"}
  • The same service already is on the device
{"error": "already_own_this_service"}
  • The wallet for the miner does not exist:
{"error": "wallet_not_found"}
  • Missing or invalid parameters:
{"error": "invalid_request"}

/part_owner

Returns whether you have hacked a device and have access to it

Required parameters:

  • device_uuid: UUID of the device [string, UUID]

Responses:

  • You have access:
{"ok": true}
  • You have not hacked the device:
{"ok": false}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}

/list_part_owner

Returns a list of services the user has hacked

No parameters.

Responses:

  • Success:
{
  "services": [{
    "uuid": "<UUID of the service [string, UUID]>",
    "device": "<UUID of the device the service runs on [string, UUID]>",
    "owner": "<UUID of the owner of the service [string, UUID]>",
    "name": "<Name of the service [string]>",
    "running": "<Whether the service is currently running [boolean]>",
    "running_port": "<Port the service runs on [number]>",
    "part_owner": "<UUID of the user who has hacked the service [string, UUID]>",
    "speed": "<Speed of the service [number]>"
    }]
}

/device_init [MS]

Initiate a new device with the enoforced services

Required parameters:

  • device_uuid: UUID of the new device [string, UUID]
  • user: UUID of the owner of the device [string, UUID]

Responses:

  • Success:
{"ok": true}

/device_restart [MS]

Start the enforced services of a device that hast just been started

Required parameters:

  • device_uuid: UUID of the new device [string, UUID]
  • user: UUID of the owner of the device [string, UUID]

Responses:

  • Success:
{"ok": true}
  • There was an error while starting the service:
{"error": "could_not_start_service"}

/check_part_owner [MS]

Returns whether a user has hacked a device and has access to it

Required parameters:

  • device_uuid: UUID of the device [string, UUID]
  • user_uuid UUID of the user [string, UUID]

Responses:

  • The user has access:
{"ok": true}
  • The user has not hacked the device:
{"ok": false}

/hardware/scale [MS]

Scales a service to only use the given hardware resources

Required parameters:

  • service_uuid: UUID of the service [string, UUID]
  • cpu: Given cpu resources [number]
  • ram: Given ram resources [number]
  • gpu: Given gpu resources [number]
  • disk: Given disk resources [number]
  • network: Given network resources [number]

Responses:

  • Success:
{"ok": true}

/hardware/stop [MS]

Stops all services on a device

Required parameters:

  • device_uuid: UUID of the device [string, UUID]

Responses:

  • Success:
{"ok": true}

/hardware/delete [MS]

Deletes all services on a device

Required parameters:

  • device_uuid: UUID of the device [string, UUID]

Responses:

  • Success:
{"ok": true}

/delete_user [MS]

Deletes all services of a user

Required parameters:

  • user_uuid UUID of the user to delete [string, UUID]

Responses:

  • Success:
{"ok": true}

Bruteforce Service

/bruteforce/attack

Starts a bruteforce attack against a service

Required parameters:

  • device_uuid: UUID of the device the service which is used to start the attack is on [string, UUID]
  • service_uuid: UUID of the bruteforce service which is used to start the attack [string, UUID]
  • target_device: UUID of the target device [string, UUID]
  • target_service: UUID of the service to attack [string, UUID]

Responses:

  • Success:
{"ok": true}
  • The bruteforce or target service does not exist:
{"error": "service_not_found"}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}
  • Permission denied:
{"error": "permission_denied"}
  • The target service is not running:
{"error": "service_not_running"}
  • The bruteforce service is already running an attack:
{"error": "attack_already_running"}
  • There was an error while starting the service:
{"error": "could_not_start_service"}

/bruteforce/status

Returns the progress of a bruteforce attack

Required parameters:

  • device_uuid: UUID of the device the bruteforce service runs on [string, UUID]
  • service_uuid: UUID of the bruteforce service [string, UUID]

Responses:

  • Success:
{
  "uuid": "<The UUID of the bruteforce service [string, UUID]>",
  "started": "<Time stamp of the begin of the bruteforce attack or of the last time the /bruteforce/status endpoint was called [number]",
  "target_service": "<The UUID of the service the bruteforce service is currently attacking [string, UUID]>",
  "target_device": "<The UUID of the device the target service is running on [string, UUID]>",
  "progress": "<The progress of the bruteforce attack [number]>"
}
  • The bruteforce service does not exist:
{"error": "service_not_found"}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}
  • Permission denied:
{"error": "permission_denied"}
  • The bruteforce service is not currently running an attack:
{"error": "attack_not_running"}

/bruteforce/stop

Stops a running bruteforce attack

Required parameters:

  • device_uuid: UUID of the device the bruteforce service runs on [string, UUID]
  • service_uuid: UUID of the bruteforce service [string, UUID]

Responses:

  • Success:
{
  "ok": true,
  "access": "<Whether the attack was successful and you now have access to the device [boolean]>",
  "progress": "<The progress of the bruteforce attack [number]",
  "target_device": "<The target device you now have access to if the attack was successful [string, UUID]>"
}
  • The bruteforce service was not found or the bruteforce target service does not exist anymore:
{"error": "service_not_found"}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}
  • Permission denied:
{"error": "permission_denied"}
  • The bruteforce service is not currently running an attack:
{"error": "attack_not_running"}
  • The target service is not running anymore:
{"error": "service_not_running"}

Crypto-Miner Service

/miner/get

Returns properties of a miner service

Required parameters:

  • service_uuid: UUID of the miner service [string, UUID]

Responses:

  • Success:
{
  "uuid": "<The UUID of the miner service [string, UUID]>",
  "wallet": "<The wallet the miner currently transfers its generated morphcoins to [string, UUID]>",
  "started": "<The time stamp of the start or the last coin transfer [number]>",
  "power": "<The current power allocated to the miner [number, 0-1]>"
}
  • Service not found:
{"error": "service_not_found"}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}
  • Permission denied:
{"error": "permission_denied"}

/miner/list

Returns a list of miners which are connected to a wallet

Required parameters:

  • wallet_uuid: UUID of the wallet [string, UUID]

Responses:

  • Success:
{
  "miners": [{
    "miner": {
      "uuid": "<The UUID of the miner service [string, UUID]>",
      "wallet": "<The wallet the miner currently transfers its generated morphcoins to [string, UUID]>",
      "started": "<The time stamp of the start or the last coin transfer [number]>",
      "power": "<The current computing power allocated to the miner [number, 0-1]>"
    },
    "service": {
      "uuid": "<UUID of the service [string, UUID]>",
      "device": "<UUID of the device the service runs on [string, UUID]>",
      "owner": "<UUID of the owner of the service [string, UUID]>",
      "name": "<Name of the service [string]>",
      "running": "<Whether the service is currently running [boolean]>",
      "running_port": "<Port the service runs on [number]>",
      "part_owner": "<UUID of the user who has hacked the service [string, UUID]>",
      "speed": "<Speed of the service [number]>"
    }
  }]
}

/miner/wallet

Connects the miner to another wallet

Required parameters:

  • service_uuid: UUID of the miner service [string, UUID]
  • wallet_uuid: UUID of the wallet to connect to the miner [string, UUID]

Responses:

  • Success:
{
  "uuid": "<The UUID of the miner service [string, UUID]>",
  "wallet": "<The wallet the miner currently transfers its generated morphcoins to [string, UUID]>",
  "started": "<The time stamp of the start or the last coin transfer [number]>",
  "power": "<The current computing power allocated to the miner [number, 0-1]>"
}
  • Service not found:
{"error": "service_not_found"}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}
  • Permission denied:
{"error": "permission_denied"}
  • The new wallet does not exist:
{"error": "wallet_not_found"}

/miner/power

Changes the computing power allocated to a miner

Required parameters:

  • service_uuid: UUID of the miner service [string, UUID]
  • power: The new computing power [number, 0-1]

Responses:

  • Success:
{
  "uuid": "<The UUID of the miner service [string, UUID]>",
  "wallet": "<The wallet the miner currently transfers its generated morphcoins to [string, UUID]>",
  "started": "<The time stamp of the mining-start or the last coin transfer [number]>",
  "power": "<The current computing power allocated to the miner [number, 0-1]>"
}
  • Service not found:
{"error": "service_not_found"}
  • The device does not exist:
{"error": "device_not_found"}
  • The device is offline:
{"error": "device_not_online"}
  • Permission denied:
{"error": "permission_denied"}
  • The wallet the miner is connected to does not exist anymore:
{"error": "wallet_not_found"}
  • There was an error while starting the service:
{"error": "could_not_start_service"}

/miner/stop [MS]

Stops all miners connected to a specific wallet

Required parameters:

  • wallet_uuid: UUID of the wallet [string, UUID]

Responses:

  • Success:
{"ok": true}

/miner/collect [MS]

Returns all newly mined morphcoins from all miners which are connected to a given wallet

Required parameters:

  • wallet_uuid: UUID of the wallet [string, UUID]

Responses:

  • Success:
{
  "coins": "<Sum of all newly mined morphcoins for the given wallet [number]>"
}
Clone this wiki locally