Hack The Box Invitecode
To become the member of https://www.hackthebox.eu/ we need invite code. I suggest you guys to give a shot yourself, if you haven’t tried it yet, if still you not in then follow the below steps.
Right click on click on inspect.
you will see the url https://www.hackthebox.eu/js/inviteapi.min.js
Go to the url found above: https://www.hackthebox.eu/js/inviteapi.min.js .
When you will open the url https://www.hackthebox.eu/js/inviteapi.min.js. you will see a lot of method call. Open the above image to enlarge. makeInviteCode is the one we are looking for.
In console type makeInviteCode()
You can see the encryption type is base64. You need to decode data. This can be done in two ways 1) visit https://www.base64decode.org/ 2) Decode using command line, we hacker we prefer command line as because there is so much to learn.
Copy the value of data. In my case it is “SW4gb3JkZXIgdG8gZ2VuZXJhdGUgdGhlIGludml0ZSBjb2RlLCBtYWtlIGEgUE9TVCByZXF1ZXN0IHRvIC9hcGkvaW52aXRlL2dlbmVyYXRl”
Open terminal type the below
Syntax: echo <base64_code> | base64 ––decode
$ echo "SW4gb3JkZXIgdG8gZ2VuZXJhdGUgdGhlIGludml0ZSBjb2RlLCBtYWtlIGEgUE9TVCByZXF1ZXN0IHRvIC9hcGkvaW52aXRlL2dlbmVyYXRl" | base64 --decode
In order to generate the invite code, make a POST request to /api/invite/generate
So we decoded the data, message is to make a post request to https://www.hackthebox.eu/api/invite/generate to generate invitecode.
$ curl -XPOST https://www.hackthebox.eu/api/invite/generate
Copy the code value and its look like base64 encryption. So we need to decode it.
Decode the code value and don’t use any of the above code value, as its keep changing.
$ echo "T05WR0gtRVNCWkwtQ0RaRFMtQk5VTkctTlZSWE4=" | base64 --decode
You have the invite code now, use your invite code and become the member of Hack The Box.