← Back to Writeups
CUSTOMMediumReversing

Go task

XESXOR9/10/20261 min read
#reversing#custom#medium#goroutine_analysis#polynomial_root_finding#uint64_arithmetic

Go task

Platform: rev-kids20.forkbomb.ru | Category: Reversing | Type: Challenge | Difficulty: Medium | OS: NA | Author: XESXOR | Date: 2026-03-09 | Status: Solved Techniques: goroutine_analysis, polynomial_root_finding, uint64_arithmetic

Summary

Language: Go. Source code provided. Enter serial in format num1-num2 that satisfies two polynomial equations.

Go task — Reverse Kids 2.0

Description

Language: Go. Source code provided. Enter serial in format num1-num2 that satisfies two polynomial equations.

Analysis

The program uses goroutines and channels:

  1. test1: checks n1^4 - 333*n1^3 - 502852*n1^2 + 32232192*n1 + 46093059072 == 0
  2. test2: checks n2^4 - 259*n2^3 - 455274*n2^2 - 50590424*n2 + 11117720960 == 0
  3. test3: sums only odd results from test1 and test2
  4. If sum > 0: flag = BigEndian(wow * 31337 + 54203286357058)

Solution

Finding polynomial roots:

  • test1: 816, 337, -432, -388 (337 is odd)
  • test2: 848, -388, -310, 109 (109 is odd) ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍
python
wow = 337 + 109  # = 446
flag_val = 446 * 31337 + 54203286357058
bs = struct.pack('>Q', flag_val)
# b'\x00\x001L0vG0' → "Flag{REDACTED}" (null bytes are discarded)

Serial: 337-109

Note: when submitting the flag, null bytes at the beginning need to be removed — the platform accepts Flag{REDACTED}. ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍