Skip to content

Instantly share code, notes, and snippets.

@powerexploit
Created May 3, 2020 15:16
Show Gist options
  • Save powerexploit/b8a3d043330d1cb5fb8289dcaec2e18c to your computer and use it in GitHub Desktop.
Save powerexploit/b8a3d043330d1cb5fb8289dcaec2e18c to your computer and use it in GitHub Desktop.
Hackthebox invite generator
#!/usr/bin/python
# Hackthebox invite code generator
import requests
import base64
import json
from os import system
system('tput setaf 9')
print("""
██░ ██ ▄▄▄█████▓ ▄▄▄▄ ██░ ██ ▄▄▄ ▄████▄ ██ ▄█▀
▓██░ ██▒▓ ██▒ ▓▒▓█████▄ ▓██░ ██▒▒████▄ ▒██▀ ▀█ ██▄█▒
▒██▀▀██░▒ ▓██░ ▒░▒██▒ ▄██▒██▀▀██░▒██ ▀█▄ ▒▓█ ▄ ▓███▄░
░▓█ ░██ ░ ▓██▓ ░ ▒██░█▀ ░▓█ ░██ ░██▄▄▄▄██ ▒▓▓▄ ▄██▒▓██ █▄
░▓█▒░██▓ ▒██▒ ░ ░▓█ ▀█▓░▓█▒░██▓ ▓█ ▓██▒▒ ▓███▀ ░▒██▒ █▄
▒ ░░▒░▒ ▒ ░░ ░▒▓███▀▒ ▒ ░░▒░▒ ▒▒ ▓▒█░░ ░▒ ▒ ░▒ ▒▒ ▓▒
▒ ░▒░ ░ ░ ▒░▒ ░ ▒ ░▒░ ░ ▒ ▒▒ ░ ░ ▒ ░ ░▒ ▒░
░ ░░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ > coded By AnkitDobhal
░ ░
""")
url = "https://www.hackthebox.eu/api/invite/generate"
headers = {'User-Agent': 'My User Agent 1.0'}
res = requests.post(url,headers=headers)
data = json.loads(res.text)
encoded_data = data['data']['code'].encode("utf-8")
print("Encoded code is :",encoded_data)
invite_code = base64.b64decode(encoded_data)
print("Your HacktheBox invite code is:",invite_code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment