How to

How to get Invite key for Hack The Box ?

How to get invite key for hackthebox

HackTheBox is an online platform which allows you to enhance your penetration testing skills by completing the tasks and challenges while exchanging ideas and techniques with many cyber security enthusiasts around the globe.

You cannot right away sign up to this site, you need to put in effort and find the invite key for you to proceed ahead with registration on this site.

READ: How to Secure Your Ecommerce Transactions with Let’s Encrypt SSL Certificate?

Once you click on the Invite Link you’ll be presented with a screen asking for ‘Invite code’, and yes, you won’t get any invite code from the site 🙂 , you have to dig in and find it yourself. This is like an entry challenge for new users.

NOTE: It is highly recommended that you try to find the invite key yourself, and proceed with the following tutorial ONLY if you want to skip the fun of finding the key yourself.

Let’s go ahead with the tutorial:

Step 1: Go to Invite Page and right click, then view page source, keep in mind that some parts on the page won’t give you ‘View Page Source’ option on right click, make sure you click on other page parts where you get the view page source option. Or to make things easy you can directly put this URL in your browser:

view-source:https://www.hackthebox.eu/invite

HackTheBox Invite Page
HackTheBox Invite Page

On the bottom most line of the code you’ll see “/js/inviteapi.min.js” link. If you find it difficult to read the code feel free to use HTML Formatter to format the code properly and make it more readable.

Page Source for HackTheBox invite page
Page Source for HackTheBox invite page

Step 2: Now paste this directory structure alone with the base URL of site in your browser ( https://www.hackthebox.eu/js/inviteapi.min.js ):

Invite API JS HackTheBox
Invite API JS

You’ll see a text makeInviteCode here, this will be the method we’ll be using on browser console.

Step 3: Go back to https://www.hackthebox.eu/invite and right click > inspect

Inspect Invite Page HackTheBox
Inspect Invite Page HackTheBox

READ: How to find out saved password from browser.

Then open ‘Console’ and put makeInviteCode() there and hit enter, you’ll see a 200 success message along with a data tree and a text which is in BASE64 encoding.

Key generation Base64 HackTheBox
Key generation Base64 HackTheBox

Step 4: Copy this text and decrypt it with a base64 decoder ( Eg: https://www.base64decode.org/ ), make sure you don’t take double quotes along with the text.

Decode Base64 key HackTheBox
Decode Base64 key HackTheBox

You will receive a decoded message which says “In order to generate the invite code, make a POST request to /api/invite/generate”, now your next step will be to make a POST request to the mentioned api endpoint.

Step 5: To make a POST request the best method is to install a browser extension called ‘Poster’ as you will be using this tool quite often going forward as well.

Once installed open poster and put the URL we got from above step in ‘URL’ field and hit ‘POST’, once you make a POST request, you’ll get a 200 success message along with another key.

POST Request API HackTheBox
POST Request API HackTheBox

Copy this key for our next step.

Step 6: Now go back to https://www.base64decode.org/ and enter the text there then hit DECODE.

You will get a key after decoding, and this is your final invite key for hackthebox.

Decode API response HackTheBox
Decode API response HackTheBox

Step 7: Now use this key on the Invite page ( https://www.hackthebox.eu/invite ) to register your account on HackTheBox site.

Invite Key for HackTheBox
Invite Key for HackTheBox

You will receive a congratulations page along with the user registration form, go ahead and register your account.

User registration form HackTheBox
User registration form HackTheBox
User registration HackTheBox
User registration

NOTE: Don’t try to use my key for registration as the key are one time use only. 🙂

User registration confirmation HackTheBox
User registration confirmation HackTheBox

Excited to hear from you, comment below !