HackTheBox currently has 55 vulnerable machines.
To join HackTheBox, you need to first solve a little Invite challenge and then you can only register yourself. Here’s the link for Invite/Join page – https://www.hackthebox.eu/invite
Analyze the source code properly, and you’ll find some interesting JS files which are –
Now open it and you can see some console functions like POST, makeInviteCode, verifyInviteCode etc
Press F12 and go to Console Mode, where you can actually see the banner of HackTheBox.
Now type “makeInviteCode()” in the console terminal.
makeInviteCode() function generate invite code by sending “POST” to “/api/invite/how/to/generate“. Once the post has been sent, the data comes.
As soon as you execute the above function inside console window, you’ll get the 200 Response code with some encrypted data either in ROT13 or Base64 format.
This is the encrypted text which we got – “Va beqre gb trarengr gur vaivgr pbqr, znxr n CBFG erdhrfg gb /ncv/vaivgr/trarengr” in ROT13 format.
ROT13 (“rotate by 13 places”, sometimes hyphenated ROT-13) is a simple letter substitution cipher that replaces a letter with the 13th letter after it, in the alphabet. ROT13 is a special case of the Caesar cipher, developed in ancient Rome.
To decode above text with ROT13, go to http://www.rot13.com/
So the original text behind this ROT13 encryption is “In order to generate the invite code, make a POST request to /api/invite/generate“.
It means you need to send a POST request to the site via /api/invite/generate link to generate the Invite code for registration.
To send a simple POST request, either you can use BurpSuite or you can simply use the HackBar(v1.1.7) Addon which is freely available for Firefox browser and can be install via Extensions.
Press F12 again, and you’ll see the new tab of HackBar where you can actually send the POST request as per below screenshot.
As you can see that, the server accept the POST request and replies with a success message which contains again encrypted text which is in BASE64 format and can easily be decoded at https://www.base64decode.org/
So this is your original Invite Code which helps you to register into HackTheBox.eu website.
You can also generate the invite code with a python file which you need to download it in your Linux machine by typing the following command:
Command: wget https://raw.githubusercontent.com/ihebski/HackTheBox/master/inviteCode.py
Execute the above python script by typing “python inviteCode.py” and you’ll get the invite code for registration into HackTheBox.eu website.