4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

Enter Hack The Box

Recently a friend of mine suggested to start playing CTF (Capture The Flag). So I started with "Hack the box".
Hack the box is basically a platform to test your skills in Penetration Testing.

In order to sign up, you've to crack the invite code

![01.png](https://cdn.steemitimages.com/DQmQQpvR2PGMr2Sy7GAtrroP4yrrThiR7V8npsqp4qQWFXF/01.png)

Start with inspect element and analyze that.
You'll find a script as /js/inviteapi.min.js

![02.png](https://cdn.steemitimages.com/DQmRbv6iVyaYXXeMvTb856MxvVRVySPnic3233twZyLbngi/02.png)

So now, go to https://www.hackthebox.eu/js/inviteapi.min.js . You will see a file like this

![03.png](https://cdn.steemitimages.com/DQmcDZMaiRkUYiwr6burTXSk8BbAgPVa81erjckA67pGsnV/03.png)

This is the point where I got stuck, since I don't have that much hold on JavaScript. So I'd search the web for further clarification.

Finally found a tool called jsbeautifier

"JavaScript beautifier" is a tool to unpack or deobfuscate JavaScript and HTML

![04.png](https://cdn.steemitimages.com/DQmTFG6av1pt4KEXmuc71vFzyeo3b56DDJZZdhWUmw6knGG/04.png)

You will see that there is a function named makeInviteCode()

This function actually make/generates your required invite code

Now make a POST request to the url mentioned in the function (/api/invite/how/to/generate)

![05.png](https://cdn.steemitimages.com/DQmexPs82jXkw9b7T5cNAPNtrKwGTDRzHukBjvG787EfGPu/05.png)

Observe that Base64 Encoding is used. Search online for Base64 decoder and decrypt it

![07.png](https://cdn.steemitimages.com/DQmWJUpYMJbFM5S73pr7sAzcaWbWLBqS37LkkNRLHKDhAjA/07.png)

Again make a POST request to /api/invite/generate

06.png

Notice that it says format:encoded, So try with base64 decoder

![08.png](https://cdn.steemitimages.com/DQmbdo4Pa2R9u2itHXvKhYhdEDscS2QfZLxXJJgH5Eq3VH2/08.png)

And voila, you've got the invite code. Happy Hunting

Note: You'll not always be able to capture the flag, there'll be times when you'll get stuck, but that's the fun part of playing CTF's. You'll always learn something new.

![kali.png](https://cdn.steemitimages.com/DQmd3D4gxHg42Jrw26t5k7T6VyaVdgYJMgBseNmgraMSR5X/kali.png)
1 upvotes $0.00

Replies (0)

Conversation

No replies yet

Replies will appear here as people join the conversation.

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: