hackthebox.challenge — HTB Challenges

Challenges

class hackthebox.challenge.Challenge(data: dict, client: HTBClient, summary: bool = False)[source]

The class representing Hack The Box challenges

name

The name of the challenge

Type

str

retired

Whether the challenge is retired

Type

bool

difficulty

The official difficulty of the challenge

Type

str

avg_difficulty

The average user-given difficulty

Type

int

points

The points awarded on completion

Type

int

difficulty_ratings

A dict of difficulty ratings given

solves

The number of solves a challenge has

Type

int

likes

The number of likes a challenge has

Type

int

dislikes

The number of dislikes a challenge has

Type

int

release_date

The date the challenge was released

Type

datetime.datetime

solved

Whether the active user has completed the challenge

Type

bool

is_liked

Whether the active user has liked the challenge

Type

bool

is_disliked

Whether the active user has disliked the challenge

Type

bool

description

The challenge description

Type

str

category

The name of the category

Type

str

has_download

Whether the challenge has a download available

Type

bool

has_docker

Whether the challenge has a remote instance available

Type

bool

Initialise a Challenge using API data

property authors: List[User]

Fetch the author(s) of the Challenge

Returns: List of Users

download(path=None) str[source]
Parameters

path – The name of the zipfile to download to. If none is provided, it is saved to the current directory.

Returns: The path of the file

start() hackthebox.challenge.DockerInstance[source]

Requests the challenge be started

Returns

The DockerInstance that was started

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

Submits a flag for a Challenge

Parameters
  • flag – The flag for the Challenge

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