hackerrankHack The Boo 2024 - Competition

Celebrate Halloween with spooky cybersecurity challenges! Test your skills and join the fun!

Coding

  1. Replacement

  2. MiniMax

Difficulty - Easy

A cursed spell has altered a scroll, changing key letters. Replace the haunted letter with a random one to break the curse!

Replacement

Code Summary

  1. Inputs: The user provides a string and two values.

  2. Replacement: It replaces all occurrences of the first value in the string with the second value.

  3. Output: The modified string is printed.

Crypto

  1. binary basis

  2. hybrid unifier

Difficulty - Easy

In the depths of an old tomb, a cryptic puzzle guarded a powerful relic. Many had attempted to break its code, but none had succeeded. This time, a daring cryptographer discovered a faint inscription on the wall—a clue, seemingly meaningless, about pairs and shadows of two. As they delved into the cipher, the hint began to make sense, guiding their steps through the labyrinth of numbers. But as the final secret unraveled, the crypt echoed with a low whisper: "Some things are better left in darkness." The relic was revealed, but the curse had only just begun.

This code attempts to recover a flag encrypted with RSA using a provided set of parameters. Let's break down its main steps and purpose:

  1. Parameter Extraction: It reads values of n (modulus), e (public exponent), c (ciphertext), and an extra variable treat from an output.txt file.

  2. Prime Factor Recovery:

    • The code aims to retrieve the prime factors of n from treat by extracting prime numbers using bit shifts and modulus operations. These primes are likely used to reconstruct n, representing an RSA modulus.

  3. Private Key Calculation:

    • Using the recovered prime factors, the code computes ϕ(n)\phi(n)ϕ(n) (Euler's totient), which is essential for calculating the RSA private key, d, as the modular inverse of e modulo ϕ(n)\phi(n)ϕ(n).

  4. Decryption of Ciphertext:

    • Finally, the ciphertext ccc is decrypted using the private key d to get the original message m.

    • long_to_bytes converts the integer message m into a byte string, assumed to be the flag.

Points of Consideration

  • Prime Calculation: The code for treat likely assumes some specific RSA key generation behavior, such as primes structured in a certain way. Make sure this operation aligns with the actual RSA key structure for the encryption scheme.

  • Error Handling: Adding error handling for file reading and modular inversions (in case of issues with inverse) can help avoid runtime errors.

Web

  1. WayWitch

  2. Cursed Stale Policy

Difficulty - Easy

NOTE: Access through https://[IP]:[PORT]/

Hidden in the shadows, a coven of witches communicates through arcane tokens, their messages cloaked in layers of dark enchantments. These enchanted tokens safeguard their cryptic conversations, masking sinister plots that threaten to unfold under the veil of night. However, whispers suggest that their protective spells are flawed, allowing outsiders to forge their own charms. Can you exploit the weaknesses in their mystical seals, craft a token of your own, and infiltrate their circle to thwart their nefarious plans before the next moon rises ?

First, you need to grab the cookie session token from the website using Burp.

WayWitch

We already saw a secret key in the source code.

Cookie

Now copy the session token and go to the official jwt.io websitearrow-up-right.

JWT

Put your token in the encoded section, change your username from '"guest_1234" to "admin", Now copy the encoded token again, and do not click on the secret base64 encoded option.

Now go back to the challenge website again and add /tickets .

Storage

Go to the storage section, remove the old value of the session token, and paste the new value from the JWT website.

Flag

Then just refresh the website; now we can see the flag or press Ctrl + F to find 'HTB{'.

Pwn

  1. El Pipo

  2. El Mundo

Difficulty - Easy

Visit the challenge website, put this in the submit section and click on Submit, you can find the flag easily.

El Pipo Web

Here is your flag.

Reversing

  1. LinkHands

  2. Terrorfryer

Difficulty - Easy

I was just trying to check if xxd works, but the reverse challenge is very easy, and we can see the flag easily.

We just need to rearrange the flag's format.

Here is your flag.

chevron-rightReversing - LinkHandshashtag

Last updated