Giter Club home page Giter Club logo

htb-api's Introduction

HackTheBox API Script 1.3

Simple python script to interact with HackTheBox's API

usage: htb.py [-h] [-m [machine] | -a | -w [machine] | -t | -T machine | -S machine | -K | -R | -F flag]

simple commands to call the HackTheBox v4 API
all commands are mutually exclusive

options:
  -h, --help    show this help message and exit
  -m [machine]  print info about a machine (default: active)
  -a            show currently active (spawned) machine
  -w [machine]  get official pdf writeup for a machine (default: active) and save it to a file
  -t            print current to-do list
  -T machine    add or remove a machine from your to-do list
  -S machine    spawn an instance of a machine
  -K            kill the currently active machine
  -R            request a reset for the currently active machine
  -F flag       submit flag for the currently active machine - either flag text or a filename

Usage

First, clone this repo:

git clone https://github.com/anton-3/htb-api
cd htb-api

Install dotenv if you haven't already:

python3 -m pip install python-dotenv

Copy the .env.example over to .env:

cp .env.example .env

You need an API token in order to use this script. In order to get one, head over to your Profile Settings in HackTheBox and click Create App Token. Copy that token and replace your_api_token_here in .env with your API token.

Example

$ ./htb.py -m lame  

      Lame - Easy Linux - Retired - by ch4p
      https://app.hackthebox.com/machines/1
      Released March 14, 2017 (1975 days ago)
      User Difficulty Rating 26/100
      42127 User Owns, 44889 Root Owns

      Rating - 4.6/5 Stars - 137 Reviews
         ##############################################----

      Difficulty Ratings:
      1  ################################################## 23780
      2  ##################################---------------- 16372
      3  ########################-------------------------- 11465
      4  #######------------------------------------------- 3585
      5  ###########################----------------------- 12951
      6  #------------------------------------------------- 648
      7  -------------------------------------------------- 380
      8  -------------------------------------------------- 203
      9  -------------------------------------------------- 88
      10 -------------------------------------------------- 240

Current Features

  • Retrieving details about any active, retired, or starting point HackTheBox machine
  • Print that data to the console in a human readable format
  • Retrieve info about current spawned machine
  • Spawn a machine
  • Kill a spawned machine
  • Reset a spawned machine
  • Submit flags
  • Read from and update your HackTheBox machine to-do list

Upcoming Features

  • Submit a machine review
  • Get info about a specific user (or yourself)
  • Print a list of machines based on criteria

I'm unoriginal

Here's a few other people who've done the same thing but better:

htb-api's People

Contributors

anton-3 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.