ByteToFlag
Menu
Stage 1 learning path
  1. Module 1 · Task 1 · Read the Mark
  2. Module 2 · Task 2 · Find the Split
  3. Module 3 · Task 3 · Hear the Words
  4. Module 4 · Task 4 · Find the Gate
  5. Module 4 · Task 5 · Signal Check
  6. Stage 1 checkpoint · The Forged Ledger
Task contents

Hear the Words

Task 3 of 5 · Stage 1 · Read files · Next: Task 4 · Find the Gate

A program carries several possible watchwords. Inspect its strings, locate the bytes behind one lead, then test which input it accepts.

  • ~30 min
  • 4 checked steps
  • HxD · Detect It Easy
Prepare the sample → Set up your tools first
You will use this when
you get an unknown program: in the first minutes, its readable text shows web addresses, file names, error messages and commands without running anything. Reviewers do the same to find passwords left inside programs.
Later in this path
task 4 follows one of these strings into the code that decides; the Stage 1 checkpoint asks you to find a word the forger planted among real ones.
After this task you can
list a program’s strings, tell its own words from the file format’s, and test a lead by running the program safely.

Keeper: Here it is — a page that is also a program. It will not open until you speak its watchword. The Overwrite reached it before you did and wrote false words beside the true one, in the same hand. A plain program like this one carries its words inside it. Listen to all of them before you speak one.

You will learn

  • find readable strings reported by the tool
  • set the program's own words apart from the file format's
  • treat a string as a lead, and confirm it by what the program does
You need
Task 2: offsets and text in a hex dump · HxD and Detect It Easy from the lab setup · PowerShell
Time
~30 minutes; the Ghidra bonus adds ~10
Tools
Detect It Easy, HxD, a notes file. Ghidra only for the bonus

Where this is used

Strings can provide early leads before you read instructions: addresses, file names, error messages and commands may be stored as readable text. A candidate found this way still needs checking; its presence does not tell you whether or how the program uses it.

Get the page

Archive page 3

watchword.exe

A tiny console program written for this task. It reads one line you type and prints one line back. It borrows four functions from Windows and nothing else — step 1 shows you how to check that yourself.

SHA-256: bae7ca8566afb2773708c3c1cbca1815ec1eeced8cec7a0165b1479f06ed46de

VirusTotal: 0 / 60 engines reported a detection (scanned 26 November 2026). See the report.

Download watchword.exe

Save it in C:\b2f\samples. Before you run anything, read Downloads and safety: why Windows may warn you about a new, unsigned program, and how to compare its SHA-256 fingerprint.

Step 1 · ~6 min

Is it a program?

Before you listen to a file, inspect its format and look for clues about its behaviour. Detect It Easy reads the content, not the name, and reports the format. Its import list names functions declared for use from Windows libraries. These names are leads, not an exhaustive behaviour report: code can resolve functions while it runs, and packing can hide information from this view. For this exercise, record what the import table shows. It is not a complete account of every action the program could take.

  1. Drag watchword.exe into Detect It Easy. Read the file type on the first line.
  2. Open the import list. Write every DLL and function name under Observed.
  3. Before you check: which listed functions read or write through an existing handle? Do you see a function for opening a new file? Record the names and the limits of that observation.
Detect It Easy main window with watchword.exe loaded from C:\b2f\samples. The file type field, PE64, is outlined and marked 1; the Type field, Console, is outlined and marked 2.
Figure 3.1 — Detect It Easy names the format.
Detect It Easy import list for watchword.exe: one library, KERNEL32.dll, with four functions — GetStdHandle, ReadFile, WriteFile, ExitProcess — each marked.
Figure 3.2 — The functions listed in this sample's import table.
H1 · Direction

The answer is on the first lines of Detect It Easy's main window, before any button.

H2 · Method

The type is the name of the Windows program format followed by its width: 32 or 64.

H3 · Check

Two letters and two digits. If it shows a different width, you dragged in another file.

Step 2 · ~8 min

Hear every word

In the ASCII view used here, look for runs of four or more printable bytes: 0x20–0x7E, which covers the letters you used in task 2 plus space (0x20), digits 0–9 (0x30–0x39) and punctuation such as the hyphen (0x2D). Windows programs also store text as UTF-16: the ASCII-range characters used here appear as two bytes in UTF-16LE, with 00 second (A is 41 00). Other characters can have different byte patterns. Detect It Easy lists both kinds. The tool does not know what the program means by them. Most strings in a small program are not its own words: they belong to the file format (the old DOS message, section names such as .text), to the import list (DLL and function names), or to the version information. Set those aside first; what is left gives you candidates to investigate, not a list of confirmed behaviour.

  1. In Detect It Easy, open Strings.
  2. Cross out, in your notes, every string you can explain as format, import or version text.
  3. Copy the rest in the order they appear. Mark the ones shaped like a watchword: two words and four digits, joined by hyphens.
  4. Before you check: which candidate would someone pick who reads only the line after the prompt? Write it down — step 4 tests that habit.
Detect It Easy strings list for watchword.exe. The banner and the prompt are marked A; four watchword-shaped strings below the prompt are marked 1 to 4; the three replies after them are marked B.
Figure 3.3 — The program's own words, among the format's.
H1 · Direction

Ignore anything starting with a dot, anything ending in .dll, the four function names from step 1 and the sentence about DOS.

H2 · Method

Type a hyphen into the strings filter. Count only entries of the shape word-word-digits.

H3 · Check

More than two, fewer than six. All of them sit between the prompt and the first full sentence of the program's replies.

Step 3 · ~6 min

Two tools agree

A strings list is a report about the bytes. Before you trust it, go to the bytes. Detect It Easy gives each string an offset — where in the file it starts, a position, not a value. Jump there in HxD and read it yourself. Agreement confirms the string at that file offset; it does not show that the program uses it as the watchword.

  1. In the strings list, read the offset of the first watchword-shaped string.
  2. Open the file in HxD. Choose Search → Go To, choose hex, and type that offset.
  3. Read the bytes at the cursor and compare with the text column. Lowercase ASCII a–z occupy 0x61–0x7A, so lowercase c is 0x63.
  4. Before you check: the candidate starts with a lowercase c. Which byte value do you expect at the cursor?
Detect It Easy 4.0 hex view of watchword.exe at the offset taken from the strings list; the offset column is covered by a solid bar. The first byte, 63, is outlined and marked 1. Sixteen bytes are selected, and the Symbols column shows the first candidate.
Figure 3.4 — The same word, read from the bytes. Shown in the hex view of Detect It Easy; HxD shows the same bytes at the same offset.
H1 · Direction

The offset is a column in Detect It Easy's strings list, on the same row as the string.

H2 · Method

HxD's Go To accepts the offset in hex. If the cursor lands in the middle of other text, check that hex, not decimal, is selected.

H3 · Check

The byte at the cursor is 0x63. If it is not, the offset was copied from another row or read in the wrong base.

Step 4 · ~8 min · flag

Which word does the door hear?

Keeper: Four words in one hand, and three of them are lies. Do not choose by the look of them. Speak each one to the door and listen to what it says back.

A strings list tells you what is in a file, not what the program does with it. This exercise uses our task-specific sample. Before running it, follow the download and fingerprint checks in Downloads and safety; the import list alone is not a safety check. Our rule: run a program on your own system only when its SHA-256 matches the one printed on this site. A sample you found, were sent or cannot check goes into a virtual machine or Windows Sandbox (Windows Pro, Enterprise or Education), never onto your own system. Run it and let its answers decide. Each run is an observation: write the word you typed, the reply and the exit code.

  1. Open PowerShell in C:\b2f\samples. Run the program, type one candidate, press Enter.
  2. Read the reply, then the exit code: 0 accepted, 1 refused, 2 nothing typed.
  3. Repeat for each candidate. Type the one the door accepts below.
.\watchword.exe
$LASTEXITCODE
PowerShell window. First run: a forged candidate is typed, the reply names the Overwrite, and the exit code is 1. Second run: a word that is not a candidate is typed, the door stays shut, and the exit code is 1.
Figure 3.5 — Two refusals, two different replies.
H1 · Direction

You do not need to guess: you have a short list from step 2, and the program answers for every word on it.

H2 · Method

One run per candidate. Copy the word from your notes, not from memory — one wrong character is a different word. Keep a table: word · reply · exit code.

H3 · Check

There are two kinds of refusal, and one names the Overwrite. Only the watchword gives exit code 0. It is neither the first nor the last candidate in the list.

Walkthrough

Stuck after the hints? Show the walkthrough — it shows every answer
  1. 1. Detect It Easy: PE64, console; imports GetStdHandle, ReadFile, WriteFile, ExitProcess. No file-opening function appears in this import table; that alone does not prove the program cannot open files.
  2. 2. After the prompt: 4 candidates of one shape, then three replies.
  3. 3. The first candidate's offset, where HxD shows 63: 0x877.
  4. 4. Candidates 1, 2 and 4 get the reply that names the Overwrite, exit code 1. Candidate 3 gets the acceptance line, exit code 0: type candidate 3.

Bonus

Explain your finding

Four lines in your notes: Observed (format, imports, the candidates and their offsets, the runs) · Hypothesis (which word you expected before running, and why) · Verified (what two tools or a run confirmed) · Unknown (what you still have not seen).

Without running it. If Ghidra is set up (lab setup, Ghidra), import the file, let it analyse and open Window → Defined Strings. The cross-reference column shows which code uses each string. Follow the watchword's reference: what does that code print next? That is the doorway to task 4.

Ghidra Defined Strings window for watchword.exe, 44 items. The four candidate words are marked 1 to 4; the Reference Count column is marked 5 and shows one reference for each of them.
Figure 3.6 — Every string, and the code that uses it.
I have written my note — show the model note
Observed
Detect It Easy: PE64, console. Imports from KERNEL32.dll only: GetStdHandle, ReadFile, WriteFile, ExitProcess. Strings: a prompt, then four candidates of one shape; the first starts at the offset found in step 3, where HxD shows 63 (c). Runs: candidates 1, 2 and 4 → "forged by the Overwrite", exit 1; candidate 3 → accepted, exit 0.
Hypothesis
Before running: the strings list alone gave no reason to choose — all four share one shape, and a place in the list proves nothing. The first candidate was only the tempting one.
Verified
Detect It Easy reports PE64. The first candidate starts at file offset 0x877, where the hex view shows 63 (c). The tested watchword is candidate 3: the program accepts it with exit code 0. These checks do not establish every possible behaviour of the program.
Unknown
How the program compares the input — whole word, case, length. I saw its answers, not its check. That is task 4.

Check yours: does each claim name a tool, an offset or a run? Did you keep the tempting guess apart from what the program confirmed? Each “no” is what to add.

This is guided practice. After task 5, use the Stage 1 checkpoint, The Forged Ledger, to test your work without hints. A separate no-hints version of this task is planned.

Read further

Outside sites, not ByteToFlag. Links checked on 26 November 2026.

Take your method to the next task

Before you move on

  • Can you separate format and import text from candidate watchwords?
  • Can you locate a reported string at its file offset and explain what the second tool confirms?
  • Can you record each tested input, reply and exit code without treating an import list as a safety guarantee?

If one is unclear, revisit that step or compare your explanation with the model note. The final watchword check records this one task as guided practice when browser progress is on.

In Task 4, Find the Gate, move from observing replies to reading the code that makes a decision. Prepare Ghidra using the lab setup guide.

Task 4 · Find the Gate → Prepare Ghidra Back to Module 3