← Back to Lessons

The Trail Between the Letters: Finding the Impostor

Python as a Search Tool
Techniques You Will Apply

Sometimes, there are no cameras, no alerts, no obvious logs or precise records. Only fragments remain—a gender, a misplaced letter, a quantity. In this challenge, there is no malware, no payload. Just a hidden identity and a truth that refuses to be forgotten.

In Blue Team, we are also hunters, but instead of weapons, we use code. Instead of maps, we use patterns. Today, you will have to find someone, and to do so, you must think like someone reconstructing a puzzle without knowing what the final image is.

Python as a Search Tool

In this challenge, you will work with a Python script that simulates an investigation. You will need to modify the code so it generates possible names that meet certain clues:

  • It must be a male name
  • It must have 7 letters
  • It must contain the letter C (but you don't know where)

The logic you write or modify will be that of a true digital investigator—a mix of patterns, filters, and validations.

Techniques You Will Apply

Lists in Python

Lists are ordered collections of elements. They are very useful for storing data such as names, users, IPs, log events, among others.

1names = ["Carlos", "Michael", "Brandon"]

You can access elements by their position (index):

1print(names[0]) # Prints 'Carlos'

And loop through them to analyze:

1for name in names: 2 print(name.upper())

Filtering with Conditionals

To meet specific conditions, you need to use if and logical operators like and, or, in.

1if len(name) == 7 and "c" in name.lower(): 2 print("Possible match:", name)

Useful Functions

Python includes many built-in functions that help you transform and analyze data.

  • len(string) → Returns the number of characters
  • "c" in string → Checks if a letter is present
  • string.lower() → Converts everything to lowercase

These functions are key when processing data with specific restrictions.

Editing Scripts

Modifying existing code is not destroying it.
It’s like restoring a damaged painting.
You must respect its structure, understand its purpose, and adapt it to achieve your goal.

Make sure to:

  • Not delete key functions without understanding their role
  • Not break the program’s logic
  • Temporarily comment out parts if you need to isolate them

Where to Get Names?

You can create a manual list of names or use external sources. The important thing is not just the quantity, but the quality of your filtering logic.

For example:

1names = ["Matthew", "Spencer", "Andrew", "Cristal"] 2# Then apply filters to this list

Validation and Tool Usage

Once you find the correct name, you will get something else—a hidden message, a flag, but in a different language. That language is base64, and to decode it, you have a powerful tool:

  • CyberChef: A Swiss Army knife for data analysts.

Paste the encrypted content, find the right recipe, and turn noise into truth. Not all clues are clear, not all attacks are visible, and not all names are innocent. Today, your job was not to prevent an attack, but to find who already committed it and remember that defense is not always a shield—sometimes, it is also light.

See you at the next level!