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.
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:
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.
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 ):
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
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.
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.
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.
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.
Step 7: Now use this key on the Invite page ( https://www.hackthebox.eu/invite ) to register your account on HackTheBox site.
You will receive a congratulations page along with the user registration form, go ahead and register your account.
NOTE: Don’t try to use my key for registration as the keys are one time use only. 🙂