# Faka Shop Inventory Extraction

> Use when a faka/ACG shop must yield its unsold stock.

- Skill: `yufeifeio/faka-shop-inventory-extraction` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx get-skill add yufeifeio/faka-shop-inventory-extraction`
- Raw SKILL.md: https://api.skillmd.com/api/skills/yufeifeio/faka-shop-inventory-extraction/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Yufeifeio (https://skillmd.com/u/yufeifeio)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/yufeifeio/faka-shop-inventory-extraction

---


# Faka Shop Inventory Extraction

When the ask is unsold stock (未售库存 / 库存 / "the full database") for a Chinese faka (发卡) or account shop, the deliverable is the **stock**, not the product catalog. The catalog is the menu; the stock is the goods. Shipping a product list as "inventory" reads as a failed task.

## Delivery rule (non-negotiable)

Deliver three layers, always separated and labeled:

1. **Stock counts** — per product, one row each, pulled from the shop's own stock endpoint. Headline number.
2. **Stock previews (draft)** — raw `draft` values for pre-select goods (usernames, wallet addresses, suffix hints). Quote exact row counts.
3. **Plaintext secrets** — where `secret` lives and which gate blocks it; say plainly what is not yet extracted. Never present previews as credentials.

Export CSVs plus a README naming each layer. When secrets are blocked, lead with the counts and the gate list, not an apology essay.

## Workflow

### 1. Fingerprint the ACG generation

- **3.1.1**: `/assets/admin/images/login/bg.jpg` reachable; query routing `?s=...`; ThinkPHP-style dotted-param routes; Metronic admin theme.
- **5.0.x**: `/assets/common/js/ready.js?v=5.0.x`; `/app/Plugin/NovaTradeTheme/`; Swoole 404 page ("Powered by Swoole"); real paths `/user/...`, `/shop/...`, `/pay/...`.
- Both answer `/config/*.php` with 403 "当前目录禁止执行PHP文件" and serve `/language/pack` publicly.

### 2. Get a user account, then reset its app_key

3.1.1 registration has no email whitelist. Then `POST /user/api/security/resetKey` with **`old_password`** (not `password`) to mint a fresh `app_key`. The session expires often — re-login and re-reset when `登录会话过期` appears; do not assume the old key still works.

### 3. Scan stock through the Shared API (3.1.1)

- Sign: `md5("k1=v1&k2=v2&key=" + app_key)` over non-empty scalar fields, keys sorted; always send `app_id`.
- `POST /shared/authentication/connect` — name/balance oracle (`商户ID不存在` vs `密钥错误`).
- `POST /shared/commodity/items` — full catalog; walk `children`.
- `POST /shared/commodity/inventory {sharedCode, race}` — **per-product unsold count** plus delivery_way/draft_status/price/config.
- `POST /shared/commodity/draftCard {sharedCode, page, limit, race}` — `[{id, draft}]` for `draft_status=1` only; `secret` never appears here.

Run the full scan as a background job with per-row CSV flush (~3.5 req/s; 4k products ≈ 20 min) and reconcile the CSV row count against the catalog at the end. Name- and count-filter before totaling: SMM/service items (views, followers, likes) carry capacity caps like 1e9/5e8 and must be reported as service-class, separate from account-class stock.

### 4. Plaintext has exactly these readers — check each gate before claiming blocked

- `Admin/Api/Card::export()` — concatenates `secret` per row; admin session + Entrance gate.
- `POST /user/api/card/data` — owner forced to session user; behind Business interceptor ("请开通店铺").
- `POST /user/api/index/secret {orderId}` — **no owner check**, only `status==1`; trade_no carries per-second randomness so it is not an enumeration target.

### 5. 5.x replication and the tools surface

See `references/api-surfaces-and-gates.md` for the client crypto, endpoint table, tools/notes API, payment gateways and operator-infra ceilings.

## Pitfalls

- **Response Secret**: 5.x encrypts responses with the **response header** `Secret`, not the request key. Decrypting with the request key returns `_raw` garbage that reads as a dead endpoint.
- **Route param separator is a dot**: 3.1.1 is `/user/api/order/callback.Epay`, not `/callback/Epay`. A slash form 404s because the trailing segment is parsed as the class name.
- **Deployed builds patch the ORM builder**: `QueryService` does `where($args[1], $val)` with the column taken from the POST key — a prime column-injection. The deployed 3.1.1Max answers `不支持的筛选条件` for any key column outside `[A-Za-z]+` (e.g. `equal-status` passes, `equal-user_id` and backtick payloads fail). Probe the key shape once before building a chain.
- **App WAF checks `urldecode(http_build_query($_GET))`** — keys and values are decoded, and the already-decoded route parameter is also in the string. Any `../` the app can resolve is already matched; comment/`||` tricks only help against the SQL rules, not path traversal. Once `../` is rejected, treat handle-LFI as closed.
- **Email suffix whitelist**: `x@<anything>.qq.com`-style addresses pass a `str_ends_with` check but the MX resolves nowhere, so no code arrives. Only pursue when you control a domain ending in a whitelisted suffix.
- **Uniform login errors** (5.x `密码错误` for missing and wrong users) — no enumeration, no blind spray.
- **Trade-number randomness** (3.1.1: 3 random + ymdHis + 3 random; 5.x: `9`+YYMMDD+HHMMSS+11 random) makes order enumeration and secret-oracle sweeps infeasible. Do not build them.
- **Admin paths are the wall**: 3.1.1 Entrance plugin (`?s=<random>` sets a session flag; gate text "没有使用正确入口"), 5.x admin absent from the nginx whitelist even though `/language/pack` proves the admin bundle ships. Operator-set random strings — brand-name dictionaries are wasted requests.
- Payment callbacks are signed (Epay md5 key, BEpusdt merchant token, Alipay RSA) and gateway admin paths are install-random. Do not spend the session forging callbacks; document the gate instead.

