Reverse Wordle
Reverse Wordle
Platform: uoftctf2026 | Category: Misc | Type: Challenge | Difficulty: Medium | OS: NA | Author: XESXOR | Date: 2026-01-10 | Status: Solved Techniques: api_research, constraint_solving, game_mechanics_analysis
Summary
Task: Given Wordle share patterns from three games with the same unknown starting word, find that word and submit its SHA256 hash. Solution: Looked up historical Wordle answers via the NYT API for games 1, 67, and 1336, then brute-forced the 5-letter word dictionary to find SQUIB matching all three color patterns.
Reverse Wordle - UofTCTF 2026
Description
My friend said they always use the same starting word, can you help me find out what it is? Submit the sha256 hash of the ALL CAPS word wrapped in the flag format uoftctf{...}
We're given a file chall.txt containing Wordle share results from three different games.
Analysis
Challenge Files
The file contains three Wordle game results:
Wordle 1 3/6*
ā¬ā¬šØā¬šØ
ā¬šØā¬š©š©
š©š©š©š©š©
Wordle 67 4/6*
šØā¬ā¬ā¬ā¬
ā¬š©ā¬š©ā¬
š©š©š©š©ā¬
š©š©š©š©š©
Wordle 1,336 6/6*
ā¬ā¬ā¬šØā¬
ā¬ā¬šØā¬ā¬
ā¬š©ā¬ā¬ā¬
ā¬š©ā¬ā¬šØ
š©š©š©š©ā¬
š©š©š©š©š©
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Understanding Wordle Mechanics
Wordle color meanings:
- š© (green) = correct letter in correct position
- šØ (yellow) = letter exists in word but wrong position
- ⬠(gray) = letter not in word
The key insight: the first row of each game represents the same starting word (as stated in the challenge). We need to reverse engineer this word from the patterns.
Finding Historical Wordle Answers
The Wordle number corresponds to days_since_launch. Using the NYT Wordle API (https://www.nytimes.com/svc/wordle/v2/YYYY-MM-DD.json), we can find the actual answers:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
| Wordle # | Date | Answer |
|---|---|---|
| 1 | June 20, 2021 | REBUT |
| 67 | Aug 25, 2021 | CRASS |
| 1336 | Feb 14, 2025 | DITTY |
Constraint Analysis
Now we have three constraints for our unknown starting word:
- vs REBUT:
ā¬ā¬šØā¬šØ- positions 3 and 5 are yellow - vs CRASS:
šØā¬ā¬ā¬ā¬- position 1 is yellow - vs DITTY:
ā¬ā¬ā¬šØā¬- position 4 is yellow
Solution
Solver Script
python read-only ⢠copy allowed#!/usr/bin/env python3 """ Reverse Wordle Solver Finds the starting word that matches all three Wordle patterns """ āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā def check_wordle_result(guess, answer): """Simulate Wordle's color-coding algorithm""" result = ['ā¬'] * 5 answer_chars = list(answer.lower()) guess = guess.lower() # First pass: mark greens (correct position) for i in range(5): if guess[i] == answer_chars[i]: result[i] = 'š©' answer_chars[i] = None # Second pass: mark yellows (wrong position) for i in range(5): if result[i] == 'ā¬' and guess[i] in answer_chars: result[i] = 'šØ' answer_chars[answer_chars.index(guess[i])] = None return ''.join(result) āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā def main(): # Target patterns (first row of each game) targets = [ ('REBUT', 'ā¬ā¬šØā¬šØ'), # Wordle 1 ('CRASS', 'šØā¬ā¬ā¬ā¬'), # Wordle 67 ('DITTY', 'ā¬ā¬ā¬šØā¬'), # Wordle 1336 ] # Load valid 5-letter words with open('wordle_words.txt', 'r') as f: words = [line.strip().upper() for line in f if len(line.strip()) == 5] # Find word matching all constraints for word in words: matches_all = True for answer, expected_pattern in targets: if check_wordle_result(word, answer) != expected_pattern: matches_all = False break if matches_all: print(f'Found starting word: {word}') return word print('No matching word found') return None āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā if __name__ == '__main__': main()
Result
Running the solver finds: SQUIB
Verification:
SQUIBvsREBUT:ā¬ā¬šØā¬šØā (U yellow at pos3, B yellow at pos5)SQUIBvsCRASS:šØā¬ā¬ā¬ā¬ā (S yellow at pos1)SQUIBvsDITTY:ā¬ā¬ā¬šØā¬ā (I yellow at pos4)
Generate Flag
python read-only ⢠copy allowedimport hashlib word = 'SQUIB' sha256_hash = hashlib.sha256(word.encode()).hexdigest() print(f'uoftctf{{{sha256_hash}}}') # Output: uoftctf{REDACTED}
Tools & Resources
- NYT Wordle API:
https://www.nytimes.com/svc/wordle/v2/YYYY-MM-DD.json - Wordle word lists: Available from various GitHub repos
- Python hashlib: For SHA256 hash generation āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Lessons Learned
- Game share results often leak information that can be reversed
- Historical game data is often accessible via APIs
- Constraint satisfaction can narrow down possibilities quickly
- Always verify your solution against all given constraints āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā