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.

Revisions

  1. powerexploit created this gist May 3, 2020.
    31 changes: 31 additions & 0 deletions HTBHACK
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    #!/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)