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:
- Stock counts — per product, one row each, pulled from the shop's own stock endpoint. Headline number.
- Stock previews (draft) — raw
draft values for pre-select goods (usernames, wallet addresses, suffix hints). Quote exact row counts.
- 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.
1---2name: faka-shop-inventory-extraction3description: "Use when a faka/ACG shop must yield its unsold stock."4version: 1.0.05tags: [pentest, faka, acg, inventory, stock, card-secret, shared-api, delivery]6metadata:7 source: https://skillmd.com/skills/yufeifeio/faka-shop-inventory-extraction8---910# Faka Shop Inventory Extraction1112When 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.1314## Delivery rule (non-negotiable)1516Deliver three layers, always separated and labeled:17181. **Stock counts** — per product, one row each, pulled from the shop's own stock endpoint. Headline number.192. **Stock previews (draft)** — raw `draft` values for pre-select goods (usernames, wallet addresses, suffix hints). Quote exact row counts.203. **Plaintext secrets** — where `secret` lives and which gate blocks it; say plainly what is not yet extracted. Never present previews as credentials.2122Export CSVs plus a README naming each layer. When secrets are blocked, lead with the counts and the gate list, not an apology essay.2324## Workflow2526### 1. Fingerprint the ACG generation2728- **3.1.1**: `/assets/admin/images/login/bg.jpg` reachable; query routing `?s=...`; ThinkPHP-style dotted-param routes; Metronic admin theme.29- **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/...`.30- Both answer `/config/*.php` with 403 "当前目录禁止执行PHP文件" and serve `/language/pack` publicly.3132### 2. Get a user account, then reset its app_key33343.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.3536### 3. Scan stock through the Shared API (3.1.1)3738- Sign: `md5("k1=v1&k2=v2&key=" + app_key)` over non-empty scalar fields, keys sorted; always send `app_id`.39- `POST /shared/authentication/connect` — name/balance oracle (`商户ID不存在` vs `密钥错误`).40- `POST /shared/commodity/items` — full catalog; walk `children`.41- `POST /shared/commodity/inventory {sharedCode, race}` — **per-product unsold count** plus delivery_way/draft_status/price/config.42- `POST /shared/commodity/draftCard {sharedCode, page, limit, race}` — `[{id, draft}]` for `draft_status=1` only; `secret` never appears here.4344Run 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.4546### 4. Plaintext has exactly these readers — check each gate before claiming blocked4748- `Admin/Api/Card::export()` — concatenates `secret` per row; admin session + Entrance gate.49- `POST /user/api/card/data` — owner forced to session user; behind Business interceptor ("请开通店铺").50- `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.5152### 5. 5.x replication and the tools surface5354See `references/api-surfaces-and-gates.md` for the client crypto, endpoint table, tools/notes API, payment gateways and operator-infra ceilings.5556## Pitfalls5758- **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.59- **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.60- **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.61- **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.62- **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.63- **Uniform login errors** (5.x `密码错误` for missing and wrong users) — no enumeration, no blind spray.64- **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.65- **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.66- 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.