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
- 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. - 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.) - 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/*. - 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 namedscenarioCodebut 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 globalGetCardBinListhits delisted bins and returns-404/-600, which is indistinguishable from a permissions wall unless you check the flow. - 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 returnsaccountChangeAmount,cardChangeAmount,totalFeeAmountandfeeItems[].{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:GetCardBinListmay advertiseopenCardFee: 0.00whilefeeType=1charges a ten-dollar open fee. - Balance-gated action: stop mutating the action endpoint once the fee is known.
OpenCardanswers the same "balance insufficient" code forfeePayTypevariants (CARD/ACCOUNT/FREE/0), negative or oversizedrechargeAmount, and injectedopenCardFee/totalFeeAmountfields. 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. - Card-data reachability is a separate question from PAN guessing.
GetCardDetail/GetCardCvv/GetCardListare owner-scoped; a guessed PAN returning-404proves 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. - 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". - 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 toSCOPE_DENIED— that is proof of CHECK ORDER (signature before scope), not a bypass, and no scope can be reached without a real credential./healthon the API subdomain returningHealthyis a low-severity exposure worth one report line. - 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-400for every unknown field (that is the evidence of a whitelist); a permissive one ignores or, worse, applies it. - 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. - 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:
- Config from APK:
assets/flutter_assets/app_config/project_config.jsongivescompany_idanddomain;project_config_debug.jsongives a second tenant and an internal debug host (usually IP-allowlisted, unreachable from the internet). - Signing:
sign = HMAC-SHA1(key, "k=v&..." sorted); addtime=<epoch seconds / 60>. The key is a 16-char literal inlibapp.so. Empty params are stripped before signing (empty value in the map breaks the signature →100005 Illegal Request). - 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. - 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. - 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. - Register:
POST /api/login/send/code/v2 {account, type:0}→ read mail →rsa/pub(seq_no)→POST /api/login/registerwithaccount,password= RSA(password),valid_code= plaintext code,seq_no,invite_code. Undocumented: registration needs a real invite code (6 chars,110032if wrong,100003if empty); public codes are findable in promo videos. Registration rate limit110068is per-IP and trustsX-Forwarded-For— rotate the header per attempt. - 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 with100019. - Session: the token is sent as header
cloudTokentogether with headerudid.x-access-token,Authorization: BearerandcloudTokenas a query param all return100022 User Information Expired. - 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=1mails 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 answers100004 Invalid Request Parameterseven though the code is correct. After binding,google_status:1. - Email:
tempmail.lolinboxes receiveno-reply@mail.payfun.commail (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 answers100027 Incorrect or Expired Verification Codeeven though the mail just arrived. When a code fails once, dump the mail body and confirm the match context before re-running the flow. - 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. send/msgis the email-code switchboard — thetypevalue selects the mail template:1bind GA,2turn off GA,3set login password,4delete access key,5change 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 Lateris a per-account send cooldown (~60 s) — wait it out, do not rotate parameters.- 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. login/info/status?account=is NOT a user-existence oracle — it answers success for random accounts. Usestep/oneinstead:100019= account exists / wrong password,110042= account does not exist.- Version gate:
/api/common/aws/configanswers100065 The API has been upgradedfor everyBuild-CUvalue 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. 100028on 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 atype=5mail code — then retry;100004on that call whilekyc_status:0points at the KYC gate, not at the parameter shape.- HTTP method and transport are part of the contract:
user/card/listis GET-only (POST → 405 Method Not Allowed);card/private/infoandcard/access/token/getparse a JSON body (query-only answers100004, body-only reaches the GA check and answers100028). Probe method × transport once per endpoint before concluding the parameters are wrong — and do not assume one transport rule covers the whole API. - Sensitive card/payment calls are biometric-signed on top of the token.
card/private/info,card/access/token/getandupdate/public_keyare issued throughPFNetWork::biometricRequest; the client addstime,bio_sign(fast_rsasignPSS) andidentity_code, with the private key held in device storage (BiometricStore). A script holding onlycloudTokencannot reproduce that signature — treat100028as a missing state/signature gate, not a TOTP problem, and stop re-deriving the code. - The user-facing API is owner-scoped — retire IDOR there fast.
card/info,trans/list,consumption/infoandwithdraw/infoignore foreign ids andcard_id;kyc/v2/auth/detail?account=<other>always answers100015;ext/config?module=ignores the module. Record these as retired and move to the merchant/PCI surface. - Two API generations coexist.
/api/common/aws/configanswers100065;/api/common/aws/config/v2exists and answers100004for every guessed param set. The v2 contract exists only in the current store build — read the APK'sversionNamewithpyaxmlparserbefore fuzzing parameters, and do not assume the sideload copy is current. - Merchant and PCI surfaces are publicly documented but IP-gated.
docs-payment-merchant.keysecure.iopublishes 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 inreferences/keysecure-merchant-and-pci-surface.md. - The H5 invite-register endpoint is a decoy for data access.
/api/h5/public/invite/registeraccepts an emptyinvite_codeand answers success, andregister/checkwill confirm whether a code exists — but the account it creates has no password, sostep/oneanswers100019forever. Use it only as an invite-code oracle; create the working account through/api/login/registerwith the RSA-encrypted password, then verifystep/onesucceeds before spending time on any authenticated endpoint.
PayFun / KeySecure — round-2 findings
- Vendor GitHub org is the doc goldmine:
github.com/Key-securepublishespayment-guide-docs(15 MB merchant manual, 67 commits) plus java/php/js custody SDKs and MPC apps. Clone with full history and rungit log -pfor 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 hascard_no/cvv/pan/exp_month/exp_year.GET /open-api/v1/merchant/client/{card_no}/tokenissues a 300 sclient_access_tokenfor 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 samelibapp.sobuild; only the brand config differs. - KYC self-report is inert:
POST /api/user/kyc/v2/auth/report?auth_status=1&auth_token=xanswers Success butkyc_statusstays 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, butPOST /api/user/apply/open/card(package_id/google_code/password, body or query, plain/RSA) answers100004for every encoding — the gate is KYC/state, not parameter shape.capital/password/setalso100004across plain/MD5/SHA256/RSA(PKCS1v15/OAEP); run one matrix, then stop. - S3
custody-pay/kyc/<uid>.jpgis 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.txtand/llms-full.txt) list every endpoint, the exact auth headers, error codes and identifier formats (e.g.C+YYYYMMDD+seqcard 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,openLimitcome from a catalog endpoint and can lag behind billing. Report a catalog-vs-CalculateFeemismatch 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 bareMGLNDD_<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
-401is 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
100028on 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— workedCalculateFeeresponse shape,feeTypetable, 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, predictableC.../U...identifiers), the PCI iframe token/JWE chain, and the internaldw2nn.com/ OSS / Global Accelerator notes.