hackthebox.machine — HTB Machines

Machines

class hackthebox.machine.Machine(data: dict, client: hackthebox.htb.HTBClient, summary: bool = False)[source]

The class representing Hack The Box machines

name

The Machine name

Type

str

os

The name of the operating system

Type

str

points

The points awarded for completion

Type

int

release_date

The date the Machine was released

Type

datetime.datetime

user_owns

The number of user owns the Machine has

root_owns

The number of root owns the Machine has

Type

int

free

Whether the Machine is available on free servers

Type

bool

user_owned

Whether the active User has owned the Machine’s user account

Type

bool

root_owned

Whether the active User has owned the Machine’s user account

Type

bool

reviewed

Whether the active User has reviewed the Machine

Type

bool

stars

The average star rating of the Machine

Type

float

avatar

The relative URL of the Machine avatar

Type

str

difficulty

The difficulty of the machine

Type

str

active

Whether the Machine is active

Type

bool

retired

Whether the Machine is retired

Type

bool

avg_difficulty

The average numeric difficulty of the Machine

Type

int

completed

Whether the active User has completed the Machine :noindex: user_own_time: How long the active User took to own user :noindex: root_own_time: How long the active User took to own root

Type

bool

user_blood

The Solve of the Machine’s first user blood

Type

hackthebox.solve.MachineSolve

root_blood

The Solve of the Machine’s first root blood

Type

hackthebox.solve.MachineSolve

user_own_time

How long the first User took to own user

Type

datetime.timedelta

root_own_time

How long the first User took to own root

Type

datetime.timedelta

difficulty_ratings

A dict of difficulty ratings given

Type

dict

property authors: List[User]

Fetch the author(s) of the Machine

Returns: List of Users

property ip

The IP of an active machine.

spawn(release_arena=False) hackthebox.machine.MachineInstance[source]

Spawn an instance of this machine.

Parameters

release_arena – Whether to use Release Arena to spawn the machine

Returns

The spawned MachineInstance

start(release_arena=False) Optional[hackthebox.machine.MachineInstance][source]

Alias for Machine.spawn()

submit(flag: str, difficulty: int)[source]

Submits a flag for a Machine

Parameters
  • flag – The flag for the Machine

  • difficulty – A rating between 10 and 100 of the Machine difficulty. Must be a multiple of 10.

Machine Instances

class hackthebox.machine.MachineInstance(ip: str, server: hackthebox.vpn.VPNServer, machine: hackthebox.machine.Machine, client: hackthebox.htb.HTBClient)[source]

Representation of an active machine instance

ip

The IP the instance can be reached at

Type

str

server

The VPNServer that the machine is on

Type

hackthebox.vpn.VPNServer

machine

The Machine this is an instance of

Type

hackthebox.machine.Machine

client

The passed-through API client

Type

hackthebox.htb.HTBClient

reset()[source]

Request the instance be reset.

stop()[source]

Request the instance be stopped.