Challenge Name: Easy Message

Mohamed Samir
4 min readSep 27, 2024

--

I Have a Message for you.

Easy Message » CyberTalents → The Challenge link :)

I checked the page source of the target website, but nothing interesting. :)
I will take a look at the /robots.txt file. Just a hint for you: always check this file, because sometimes it contains important information.

So, I found a path in the robots.txt file called /?source. Let's try accessing this path and see where it directs us!

yea okay we got a simple php code which is :

<?php

$user = $_POST[‘user’];
$pass = $_POST[‘pass’];

include(‘db.php’);

if ($user == base64_decode(‘Q3liZXItVGFsZW50’) && $pass == base64_decode(‘Q3liZXItVGFsZW50’))
{
success_login();
}
else {
failed_login();
}

?>

1. Retrieving User Input:

$user = $_POST['user'];
$pass = $_POST['pass'];
  • this code retrieves the username and password entered by a user from an HTML form using the POST method.
  • $_POST['user']: Stores the submitted username.
  • $_POST['pass']: Stores the submitted password.

2. Including External File (db.php):

include('db.php');

This line includes a separate PHP file (db.php), which might contain database connection details or additional functions that are needed for the script to run.

2. Base64 Decoding and Credential Check:

if ($user == base64_decode('Q3liZXItVGFsZW50') && $pass == base64_decode('Q3liZXItVGFsZW50'))

if ($user == base64_decode(‘Q3liZXItVGFsZW50’) && $pass == base64_decode(‘Q3liZXItVGFsZW50’))

Let’s Decode these two values using our kali terminal:

So the decoded string is "Cyber-Talent".

4. Login Success or Failure:

success_login();

If the user provides the correct username and password (both "Cyber-Talent"), this function (likely defined in the db.php file) will be called, indicating a successful login.

failed_login();

If the credentials don’t match, the failed_login() function is called, indicating a failed login attempt.

So Base64 encoded values:

  • 'Q3liZXItVGFsZW50' = "Cyber-Talent"

let’s try to login with this cred.

So, here’s the message we need to analyze, and we need to figure out what kind of encoding it is. Let’s Google it and see what we find. Here is the message:

..-. .-.. .- — . -. — . .. -….- -.- -. — — — . — -….- -. — — — — ..- -….- .- .-. … — -….- — — — — .-. … … — -. — .-

I’ll ask ChatGPT, and I found that this message is written in Morse code. Let’s decode it using ChatGPT as well :)

The message you provided is written in Morse code. Let’s decode it:

.-.. .- — . -. — . .. -….- -.- -. — — — . — -….- -. — — — — ..- -….- .- .-. … — -….- — — — — .-. … … — -. — .-

Decoding the provided Morse code:

Let’s break it down:

  1. ..-. = F
  2. .-.. = L
  3. .- = A
  4. --. = G
  5. -.--. = ( (opening parenthesis)
  6. .. = I
  7. -....- = - (dash)
  8. -.- = K
  9. -. = N
  10. ----- = 0 (zero)
  11. .-- = W
  12. -....- = - (dash)
  13. -.-- = Y
  14. ----- = 0 (zero)
  15. ..- = U
  16. -....- = - (dash)
  17. .- = A
  18. .-. = R
  19. ...-- = 3
  20. -....- = - (dash)
  21. -- = M
  22. ----- = 0 (zero)
  23. .-. = R
  24. ... = S
  25. ...-- = 3
  26. -.--.- = ) (closing parenthesis)

FLAG(I-KN0W-Y0U-AR3-M0RS3)

So, let’s submit it and see if it’s correct or if ChatGPT was just joking with us :(
Yes, it’s right! Congrats, we solved the challenge! :)

Success is no accident. It is hard work, perseverance, learning, studying, sacrifice, and most of all, love of what you are doing or learning to do.” — Pelé

--

--

Mohamed Samir
Mohamed Samir

Written by Mohamed Samir

second-year Computer Science | Web PenTester | Offensive | Software Tester Trainee at @CLS Learning Solutions | CTF Player at THM | Top 4% on tryhackme

No responses yet