Rogue Bot (Evaluative)
Rogue Bot (Evaluative)
Platform: HackTheBox | Category: Web | Type: Challenge | Difficulty: Easy | OS: NA | Author: D3v0o0Nu11 | Date: 2026-01-26 | Status: Solved Techniques: polynomial_evaluation, script_submission
Summary
Task: Compute an 8th-degree polynomial value given coefficients and x. Solution: Submit a Python script to the /run endpoint that evaluates the polynomial using environment variables.
Recon
Port scan
bash read-only • copy allowednmap -p- -sV -sC <TARGET> --min-rate 1000 -Pn
| Port | Service | Version | Notes |
|---|---|---|---|
| <PORT> | <SVC> | <VER> | <notes> |
Enumeration highlights
- Event:
hackthebox| ID:20260126_hackthebox_rogue_bot - Tags: python, web, polynomial
- Indicators: evaluate a polynomial, /run endpoint
- Source:
20260126_hackthebox_rogue_bot.md
Foothold
Vulnerability / Misconfiguration
- polynomial_evaluation
- script_submission
bash read-only • copy allowed<command>
Exploitation
- See original writeup content for detailed exploitation.
Privilege Escalation
Enumeration
bash read-only • copy allowedsudo -l find / -perm -4000 2>/dev/null getcap -r / 2>/dev/null cat /etc/crontab ps aux
Exploitation
- N/A for challenge-type writeup; see exploitation above.
- Flag obtained via challenge solve.
bash read-only • copy allowed<command>
Flags
| Flag | Location | Value |
|---|---|---|
| flag | REDACTED |
Key Takeaways / Lessons
- polynomial_evaluation
- script_submission
- Tags: python, web, polynomial
Original Writeup
<details><summary>Click to expand original content</summary>Rogue Bot (Evaluative) — HackTheBox
Description
The web application presents a task to compute the value of an 8th-degree polynomial: $P(x) = a_0 + a_1 x + a_2 x^2 + a_3 x^3 + a_4 x^4 + a_5 x^5 + a_6 x^6 + a_7 x^7 + a_8 x^8$
Given the coefficients $a_i$ and the value $x$, the solution must be submitted to the server.
Analysis
The application has a /run endpoint that accepts a Python script for execution. The task is to write a script that computes the polynomial value based on the provided input data.
Solution
A Python script was written to accept the coefficients and the value $x$, compute the result, and output it.
python read-only • copy allowed#!/usr/bin/env python3 def solve(): # Example input data (received from the server in a real scenario) # In this case, the script is submitted to /run and must perform the calculation # Coefficients a0...a8 and value x are typically passed via environment variables # or standard input, depending on the platform implementation. # For this task, it was sufficient to implement the computation logic itself. import os # Assume coefficients and x are passed as arguments or variables # In Rogue Bot they are often hardcoded in the task or passed to the script a = [int(os.environ.get(f'A{i}', 0)) for i in range(9)] x = int(os.environ.get('X', 0)) result = sum(a[i] * (x**i) for i in range(9)) print(result) if __name__ == "__main__": solve()
After submitting the script to the /run endpoint, the server executed it and returned the flag.
signed by XESXOR