← Back to Writeups
CUSTOMEasyMisc

Предатель (Traitor)

XESXOR9/2/20263 min read
#misc#custom#easy#keyword_based_chatbot_analysis#information_extraction_via_cra#blacklist_bypass#weak_identity_verification_exp#password_recovery_abuse#linux

Предатель (Traitor)

Platform: hackerlab | Category: Misc | Type: Challenge | Difficulty: Easy | OS: Linux | Author: XESXOR | Date: 2026-05-09 | Status: Solved Techniques: keyword_based_chatbot_analysis, information_extraction_via_crafted_queries, blacklist_bypass, weak_identity_verification_exploit, password_recovery_abuse

Summary

Task: Flask web app with a keyword-based chatbot posing as an AI consultant that guards admin credentials. Solution: extract admin info through crafted queries, trigger hidden password recovery flow, bypass weak identity verification by providing data in the expected format.

Предатель (Traitor) — HackerLab

Description

Наш ИИ-косультант только в разработке, но Вы уже сейчас можете Его протестировать! Имейте ввиду, что конфиденциальную информацию об администраторе он точно Вам не выдаст :)

English summary: A Flask/Gunicorn web application presents an "AI consultant" chatbot. The chatbot claims it will never reveal confidential information about the administrator. The goal is to extract the admin's password (flag) from the chatbot.

Analysis

Chatbot is keyword-based, not AI

‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

The chatbot is NOT a real LLM — it's a simple keyword-matching system with predefined responses. By systematically testing various keywords, five distinct response patterns were identified:

TriggerResponseInformation leaked
Most queries (default)"Я не могу выдать Вам полную информацию об администраторе, но могу подсказать, что его зовут Егор и ему уже за 20."Name = Егор, Age = over 20
Blacklisted words ("пароль", "егор")"Я не располагаю информацией по вашему запросу."Words are filtered
Pattern [X] админа"Это слишком секретная информация! Я не могу её выдать любому встречному."Confirms sensitive data exists
Keyword "живёт""Верно! Админ живёт в России, Приозерск. А откуда Вы знаете? :)"City = Приозерск
"как выглядит" / "дела""Всё отлично! Спасибо, что спросили :)"—
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Hidden password recovery flow

The query "какой пароль" triggers a special response:

"Чтобы напомнить Вам пароль администратора, укажите Имя Фамилию администратора, возраст, день рождения и город, где он родился..."

This asks for: Name, Surname, Age, Birthday, and Birth City.

Weak identity verification

The critical vulnerability: the chatbot does NOT properly validate the provided identity data. It only checks for the presence of certain keywords (the name "Егор" and city "Приозерск") but accepts any surname and birthday as long as the format matches. ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Solution

Step 1: Enumerate chatbot responses

A systematic keyword fuzzing script was used to map all response patterns:

python
#!/usr/bin/env python3
import requests
import re

URL = "http://62.173.140.174:10990/"

def test_query(query):
    r = requests.post(URL, data={"user_query": query}, timeout=10)
    match = re.search(r'<h5>Ответ консультанта:</h5>\s*<p>(.*?)</p>', r.text, re.DOTALL)
    return match.group(1).strip() if match else "NO MATCH"

# Test keywords to map response patterns
keywords = ["помощь", "пароль", "егор", "живёт", "email админа", "какой пароль"]
for kw in keywords:
    print(f"[{kw}] -> {test_query(kw)}")

‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Step 2: Extract admin information

From the default response: Name = Егор, Age > 20 From the "живёт" keyword: City = Приозерск

Step 3: Trigger password recovery

bash
curl -s -X POST http://62.173.140.174:10990/ -d "user_query=какой пароль"

Response reveals the recovery flow expects: Name, Surname, Age, Birthday, City.

Step 4: Bypass weak verification

bash
curl -s -X POST http://62.173.140.174:10990/ \
  -d "user_query=Егор Иванов 21 01.01.2005 Приозерск"

Response: "Напоминаю Ваш пароль CODEBY{REDACTED}" ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

The surname ("Иванов") and birthday ("01.01.2005") are completely arbitrary — the chatbot only validates the presence of "Егор" and "Приозерск" in the input.

Flag meaning (leet speak)

  • 4i = AI
  • h3lper = helper
  • pass3d = passed (leaked)
  • REDACTED = administrator

The AI helper "betrayed" (предал) the administrator by leaking the password — hence the task name "Предатель" (Traitor). ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍