# Card Issuing Platform Pentest

> Use when pentesting a virtual card issuing platform.

- Skill: `yufeifeio/card-issuing-platform-pentest` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx get-skill add yufeifeio/card-issuing-platform-pentest`
- Raw SKILL.md: https://api.skillmd.com/api/skills/yufeifeio/card-issuing-platform-pentest/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/card-issuing-platform-pentest

---


# Virtual Card Issuing Platform Pentest

Class: the target issues Visa/MasterCard virtual cards to end users — register → recharge (usually USDT) →
open a card from a BIN/scenario → read PAN/CVV per card — plus a B2B Partner API and merchant portal.
This is NOT a faka/code shop (no unsold stock to drain) and NOT a payment gateway (no merchant settlement).
Attack order: **own an account → map the card-product surface from the SPA bundle → establish the REAL fee
and balance model → test card-data / cross-tenant reachability → partner surface.**

Getting the order wrong is the whole failure mode: a stale BIN makes `OpenCard` fail with a balance error,
which reads as "hardened" and hides the fact that the correct bin flow was never called.

## Procedure

1. **Bundle first — it is the operation table.** These stacks ship no reachable OpenAPI. Pull
   `/assets/index-<hash>.js` (static assets usually bypass the CDN challenge even when the app does not),
   then grep `['\"]\/client-api\/v[0-9]+\/[A-Za-z0-9]+\/[A-Za-z0-9]+` for the controller/action list.
   Pull every chunk the entry bundle references — card-open, subscription and customer-service flows live in
   lazy chunks, not the entry.
2. **Register a real account end-to-end before testing anything.** Every card operation needs the bearer
   token; there is no anonymous card path. Solve the slider/email chain once, keep the JWT in `loot/`, reuse it.
   (Registration itself is a separate skill; do not re-derive it here.)
3. **Map the product surface from the bundle literals:** `CardBin/GetCardBinList`,
   `CardBin/GetCardBinScenario`, `CardBin/GetCardBin`, `CardOperate/OpenCard|CalculateFee|RechargeCard`,
   `Card/GetCardList|GetCardDetail|GetCardCvv|SetCardAliases`, `Export/*`, `Batch/*`, `Bill/*`, `Invite/*`,
   `ProductSubscription/*`, `CustomerServiceUserChat/*`.
4. **Walk the OPEN-CARD flow the way the client does — never by bin code alone:**
   `GetCardBinScenario` → `GetCardBin?scenarioCode=<scenario ID>` → `OpenCard {cardBinCode: <binCode from that
   response>}`. The parameter is named `scenarioCode` but expects the scenario's numeric ID; passing a bin code
   there returns an empty array. `GetTargetCardBin?originCardNumber=` is the card-REPLACEMENT lookup — it is not
   part of first issuance. Opening with a binCode copied from the global `GetCardBinList` hits delisted bins and
   returns `-404`/`-600`, which is indistinguishable from a permissions wall unless you check the flow.
5. **Extract the real fee model with `CalculateFee`, and treat it as the authoritative price.**
   `CardOperate/CalculateFee?cardBinCode=<code>&amount=<n>&feeType=<type>`: `feeType=1` = open card,
   `Recharge` = card recharge, `0` = no-op all-zero echo. The response returns `accountChangeAmount`,
   `cardChangeAmount`, `totalFeeAmount` and `feeItems[].{feeName,feeCode,feeAmount}`. This is how you learn the
   true open fee and the recharge percentage BEFORE spending attempts — and it routinely disproves the catalog:
   `GetCardBinList` may advertise `openCardFee: 0.00` while `feeType=1` charges a ten-dollar open fee.
6. **Balance-gated action: stop mutating the action endpoint once the fee is known.** `OpenCard` answers the same
   "balance insufficient" code for `feePayType` variants (`CARD`/`ACCOUNT`/`FREE`/`0`), negative or oversized
   `rechargeAmount`, and injected `openCardFee`/`totalFeeAmount` fields. The balance check runs before any of
   that is read. If the user cannot fund the account, report the fee model as the finding — do not describe the
   card-data endpoints as tested.
7. **Card-data reachability is a separate question from PAN guessing.** `GetCardDetail/GetCardCvv/GetCardList`
   are owner-scoped; a guessed PAN returning `-404` proves only that the lookup is scoped. The platform stores
   just the 6-digit BIN — the rest is issuer-generated, so sequential/Luhn enumeration is a guaranteed zero
   (a few hundred tries is enough to retire it). Record "no owned card → untestable" honestly.
8. **Catalog/bin endpoint IDOR:** `GetCardBin?scenarioCode=` resolves exact scenario IDs only; neighboring or
   random IDs return empty arrays. Do not report an IDOR that is really "IDs are exact".
9. **Partner/B2B surface:** `/partner-api/v1/`, `/portal-api/`, `/partner-docs/openapi.json`,
   `/partner-docs/postman.json`. All of them sit behind HMAC signature headers, docs included. A forged header
   set with a key of sufficient length gets past signature verification to `SCOPE_DENIED` — that is proof of
   CHECK ORDER (signature before scope), not a bypass, and no scope can be reached without a real credential.
   `/health` on the API subdomain returning `Healthy` is a low-severity exposure worth one report line.
10. **Mass assignment:** send server-owned fields to the profile update (`balance`, `freezeBalance`,
    `totalRechargeAmount`, `remainingOpenCardCount`, `role`/`isAdmin`, `showBatchMenu`, `twoFactorEnabled`,
    `email`, `alreadyKyc`), then re-read the object and diff. A strict serializer answers `-400` for every
    unknown field (that is the evidence of a whitelist); a permissive one ignores or, worse, applies it.
11. **Customer-service chat is a legitimate information channel for business rules.** Create a session, ask a
    mundane fee question, poll `ListMessages`. Real operators answer in seconds and confirm pricing in writing
    (use that as corroboration for the fee-oracle finding). See the OPSEC rule below.
12. **Anonymous CS chat** (`CustomerServiceGuestChat/*`) needs a device-token header that the web bundle does
    not contain; the migrate call answers a device-token error. Retire it quickly — it is not the way in.

## PayFun / KeySecure stack (Flutter app + Java API) — worked protocol

This family ships a Flutter APK whose AOT blob holds the whole API table and a static HMAC key. Reproduce the client exactly:

1. **Config from APK**: `assets/flutter_assets/app_config/project_config.json` gives `company_id` and `domain`; `project_config_debug.json` gives a second tenant and an internal debug host (usually IP-allowlisted, unreachable from the internet).
2. **Signing**: `sign = HMAC-SHA1(key, "k=v&..." sorted)`; add `time=<epoch seconds / 60>`. The key is a 16-char literal in `libapp.so`. Empty params are stripped **before** signing (empty value in the map breaks the signature → `100005 Illegal Request`).
3. **Transport**: all business params go in the **query string**, even for POST. JSON body only works for a few newer endpoints; sending params as JSON yields `100004 Invalid Request Parameters`.
4. **Required headers**: `Company-ID`, `Channel-CU` (GooglePlay/AppStore/TestFlight), `Language`, `Platform`, `SysVersion-CU`, `SysSDK-CU`, `Build-CU`, `Mobile-Model-CU`, `UUID-CU` (=udid), `Platform-CU`. Missing headers produce a silent `{"code":0,"data":false}` instead of an error.
5. **RSA per-request key**: `GET /api/login/rsa/pub?seq_no=<account-or-seq>` returns a fresh public key **on every call**. Fetch it immediately before the request that consumes the ciphertext; encrypt with PKCS#1 v1.5 and base64.
6. **Register**: `POST /api/login/send/code/v2 {account, type:0}` → read mail → `rsa/pub(seq_no)` → `POST /api/login/register` with `account`, `password` = RSA(password), `valid_code` = **plaintext** code, `seq_no`, `invite_code`. Undocumented: registration needs a real invite code (6 chars, `110032` if wrong, `100003` if empty); public codes are findable in promo videos. Registration rate limit `110068` is per-IP and trusts `X-Forwarded-For` — rotate the header per attempt.
7. **Login**: `rsa/pub(account)` → `step/one/v2 {account, password: RSA(pw)}` → `send/code/v2 {account, type:1}` → mail code → `step/two/v2 {account, password: RSA(pw), valid_code: plaintext}` → `{token}`. Re-fetch rsa/pub before each encrypted call; a key from an earlier call fails with `100019`.
8. **Session**: the token is sent as **header `cloudToken`** together with header `udid`. `x-access-token`, `Authorization: Bearer` and `cloudToken` as a query param all return `100022 User Information Expired`.
9. **GA takeover**: `GET /api/user/google/secret?rsa_pub=<own public key b64 DER>` → `secret_key` = RSA(GA secret), decrypt locally; `POST /api/common/send/msg?type=1` mails a bind code; `POST /api/user/google/bind?valid_code=<mail code>&google_code=<TOTP>` — **both fields go in the QUERY string**; a JSON body with the same two fields answers `100004 Invalid Request Parameters` even though the code is correct. After binding, `google_status:1`.
10. **Email**: `tempmail.lol` inboxes receive `no-reply@mail.payfun.com` mail (GuerrillaMail and mail.tm domains silently never arrive). Codes are 6 digits, valid 5 min. **Extract the code with `>\s*(\d{6})\s*<`** (the `<td>` that holds the large code); a generic `\d{6}` regex also matches CSS hex colours (`#000000`, `#205999`) and submits the wrong code — the register call then answers `100027 Incorrect or Expired Verification Code` even though the mail just arrived. When a code fails once, dump the mail body and confirm the match context before re-running the flow.
11. **Admin surface**: `/api/admin/*` answers nginx **403** (IP allowlist) while unknown paths answer 404 — the 403 is the tell that the admin API lives on the same gateway. XFF does not bypass nginx allow rules.
12. **`send/msg` is the email-code switchboard** — the `type` value selects the mail template: `1` bind GA, `2` turn off GA, `3` set login password, `4` delete access key, `5` change payment password. Read the mail subject before using a code; a wrong type sends a different template and the code will not validate. `100009 Please Try Again Later` is a per-account send cooldown (~60 s) — wait it out, do not rotate parameters.
13. **GA-bound login shortcut**: once `google_status:1`, `step/two/v2 {account, password: RSA(pw), google_code: TOTP}` returns a token directly, no email code. Use it to refresh the session at will — and to prove the TOTP secret is correct before blaming any other endpoint.
14. **`login/info/status?account=` is NOT a user-existence oracle** — it answers success for random accounts. Use `step/one` instead: `100019` = account exists / wrong password, `110042` = account does not exist.
15. **Version gate**: `/api/common/aws/config` answers `100065 The API has been upgraded` for every `Build-CU` value tried (`1.0.0` … `100`). The check is an API-contract version, not the client build string; pull the current store/download APK instead of brute-forcing version headers.
16. **`100028` on card endpoints from a GA that logs in fine is not a bad TOTP.** GA login proves the secret; those endpoints sit behind an additional state gate (payment/capital password or KYC). Set the capital password first — `capital/password/set {capital_pass, google_code, valid_code}` with a `type=5` mail code — then retry; `100004` on that call while `kyc_status:0` points at the KYC gate, not at the parameter shape.
17. **HTTP method and transport are part of the contract**: `user/card/list` is **GET-only** (POST → 405 Method Not Allowed); `card/private/info` and `card/access/token/get` parse a **JSON body** (query-only answers `100004`, body-only reaches the GA check and answers `100028`). Probe method × transport once per endpoint before concluding the parameters are wrong — and do not assume one transport rule covers the whole API.
18. **Sensitive card/payment calls are biometric-signed on top of the token.** `card/private/info`, `card/access/token/get` and `update/public_key` are issued through `PFNetWork::biometricRequest`; the client adds `time`, `bio_sign` (fast_rsa `signPSS`) and `identity_code`, with the private key held in device storage (`BiometricStore`). A script holding only `cloudToken` cannot reproduce that signature — treat `100028` as a missing state/signature gate, not a TOTP problem, and stop re-deriving the code.
19. **The user-facing API is owner-scoped — retire IDOR there fast.** `card/info`, `trans/list`, `consumption/info` and `withdraw/info` ignore foreign ids and `card_id`; `kyc/v2/auth/detail?account=<other>` always answers `100015`; `ext/config?module=` ignores the module. Record these as retired and move to the merchant/PCI surface.
20. **Two API generations coexist.** `/api/common/aws/config` answers `100065`; `/api/common/aws/config/v2` exists and answers `100004` for every guessed param set. The v2 contract exists only in the current store build — read the APK's `versionName` with `pyaxmlparser` before fuzzing parameters, and do not assume the sideload copy is current.
21. **Merchant and PCI surfaces are publicly documented but IP-gated.** `docs-payment-merchant.keysecure.io` publishes the full merchant API, auth headers and identifier formats; the sandbox and production hosts sit behind the ChainUp Custody IP allowlist, and the PCI iframe only proxies one path with a token-bound origin check. Full table in `references/keysecure-merchant-and-pci-surface.md`.
22. **The H5 invite-register endpoint is a decoy for data access.** `/api/h5/public/invite/register` accepts an empty `invite_code` and answers success, and `register/check` will confirm whether a code exists — but the account it creates has no password, so `step/one` answers `100019` forever. Use it only as an invite-code oracle; create the working account through `/api/login/register` with the RSA-encrypted password, then verify `step/one` succeeds before spending time on any authenticated endpoint.

## PayFun / KeySecure — round-2 findings

- **Vendor GitHub org is the doc goldmine**: `github.com/Key-secure` publishes `payment-guide-docs` (15 MB merchant manual, 67 commits) plus java/php/js custody SDKs and MPC apps. Clone with full history and run `git log -p` for redacted keys — everything is `***`/`[REDACTED]`, history included; no card Api-Key leaks. Harvest the manual before fuzzing.
- **Private-info crypto (merchant API)**: response `data` = Base64(IV[16] ‖ AES-256-CBC/PKCS5, key = SHA-256(apiSecret)), legacy ECB fallback; decrypted JSON has `card_no`/`cvv`/`pan`/`exp_month`/`exp_year`. `GET /open-api/v1/merchant/client/{card_no}/token` issues a 300 s `client_access_token` for the PCI iframe; no PCI permission → `1013`.
- **Official APK direct links** (bypass store/Cloudflare): `https://download.keysecure.io/pay/KeySecurePay.apk`, `https://download.payfun.com/payfun/PayFun.apk`. KeySecure and PayFun are the same `libapp.so` build; only the brand config differs.
- **KYC self-report is inert**: `POST /api/user/kyc/v2/auth/report?auth_status=1&auth_token=x` answers Success but `kyc_status` stays 0 — a 0-code here is not KYC passed.
- **Card apply with quota still `100004`**: `GET /api/user/open/card/check?package_id=4` → `open_card_count:1`, but `POST /api/user/apply/open/card` (`package_id`/`google_code`/`password`, body or query, plain/RSA) answers `100004` for every encoding — the gate is KYC/state, not parameter shape. `capital/password/set` also `100004` across plain/MD5/SHA256/RSA(PKCS1v15/OAEP); run one matrix, then stop.
- **S3 `custody-pay/kyc/<uid>.jpg` is 403** for every uid (not public-read as an earlier note suggested); require a 200 plus image magic before reporting PII exposure.

## Rules (always on)

- **Harvest the vendor's public integration docs before fuzzing parameters.** Partner/merchant doc sites (usually a separate Mintlify subdomain with `/llms.txt` and `/llms-full.txt`) list every endpoint, the exact auth headers, error codes and identifier formats (e.g. `C+YYYYMMDD+seq` card numbers) — that turns blind fuzzing into a checklist and is the contract source when no OpenAPI is reachable.

- **Map every negative code to a lever before calling anything "dead".** On these stacks: `-400` = schema/
  unknown field, `-401` = auth / 2FA / role gate (Batch and export menus commonly sit here), `-403` = export
  permission, `-404` = not found **or ownership**, `-600` = balance insufficient, `-601` = amount invalid,
  `-500` = referenced CS session does not exist, `-998` = rate limit. "IDOR dead" is only true when you have
  proven the identity dimension, not when a guess returned not-found.
- **Never trust display fields for money.** `openCardFee`, `minRechargeAmount`, `openLimit` come from a catalog
  endpoint and can lag behind billing. Report a catalog-vs-`CalculateFee` mismatch as a consumer-misleading
  business finding (with both responses as evidence) — not as a security critical.
- **OPSEC in CS chat: talk like a customer.** Never name a BIN, an endpoint, a field name or the word "test".
  Naming a raw BIN ("I want a 5556 card") reads as technical probing; the session survives but the operator
  stops answering. Ask in user terms ("页面显示开卡费 0 元，点开卡提示余额不足") and let them state the pricing.
- **Profile-field XSS is storage-only until a renderer is proven.** `nickName`-style fields on these platforms
  frequently accept raw `<svg/onload=...>` and echo it back unescaped, but the operator console may escape it.
  Confirm with a unique-path callback; treat a bare `MGLNDD_<ip>_<port>` line (raw masscan probe on your
  listener port) as scanner noise, never as a hit.
- **Separate "operation reachable" from "authorized" from "effect achieved"** in every conclusion row. A 200 on
  a batch/export controller without data is not exfiltration; a `-401` is a role/2FA wall, not a bug to grind.
- **A code that changes between endpoints for the same credential is a gate discriminator, not a crypto bug.** A GA code that logs in fine but returns `100028` on card endpoints proves the second gate (payment password / KYC) is missing, not that the TOTP is wrong. Prove the credential where it is accepted, then fix the missing state instead of re-deriving the crypto.
- **Do not re-run a deadend twice.** Controller-name enumeration (`Admin`, `System`, `Internal`, `Test`,
  `Debug`) against a strict route table returns 404 for every combination; method mutation returns 405;
  middleware case/path/encoding variants return the same 401. Record each as a retired lever with its
  discriminator and spend the remaining time on funding-dependent verification.

## Support files
- `references/virtual-card-fee-and-bin-model.md` — worked `CalculateFee` response shape, `feeType` table, the
  scenario→bin→open chain with the parameter-name trap, the full negative-code map, PAN-enumeration negative,
  and the CS-chat script that produced a written fee confirmation.
- `references/keysecure-merchant-and-pci-surface.md` — KeySecure merchant payment API (endpoints,
  Api-Key/Timestamp/Access-Token flow, IP-allowlist behaviour, predictable `C...`/`U...` identifiers), the PCI
  iframe token/JWE chain, and the internal `dw2nn.com` / OSS / Global Accelerator notes.

