Skip to content

Latest commit

 

History

History
161 lines (135 loc) · 15.6 KB

shape.md

File metadata and controls

161 lines (135 loc) · 15.6 KB

返回首页 上一页 下一页

Shape

说明

  • 当看到 请求头 或者 post 表单/json 中有 x-xxxx-a 或者 xxxx-a, 代表存在 shape 验证
  • 如何区分 v1/v2:
    • 打开 f12 输入 window.__xr_bmobdb, 看看是否会输出一个对象, 如果输出了就是 v1, 输出的是 undefined 就是 v2

Request URL(POST):

版本 接口地址
v1 http://api.nocaptcha.io/api/wanda/shape/v1
v2 http://api.nocaptcha.io/api/wanda/shape/v2

Request Headers:

参数名 说明 必须
User-Token 用户密钥, 主页获取
Content-Type application/json
Developer-Id 开发者 ID, 开发者用户使用, 用户主页邀请链接的字符串(如 xxx/register?c=abcdef, 则 abcdef 为开发者 ID)

shape/v1 POST Data(JSON):

参数名 类型 说明 必须
href String 触发 shape 验证的页面地址
vmp_url String shape vmp 脚本的 url
vmp_content String shape vmp 脚本内容
country String 业务流程使用的代理所属地区国家 code, 如美国(us)、英国(uk), 详情可咨询管理
ip String 业务流程使用的代理流程的 ip 地址(例: 56.214.78.94), 详情可咨询管理
user_agent String 自定义 user_agent, 必须保持 user-agent 一致, 请传最新版 windows ua
cookies Object `请求 shape 脚本 vmp_url 会返回一个类似 A-pOe7WQAQAA6ZxjB-L2qpl728w8qxyqvIEfRgLl4tjbeVlhQKHxkNAbbgGOATo-EwCucuopwH9eCOfvosJeCA 1
fast Boolean 是否加速计算, 默认 false (网站风控低可使用该模式)
timeout Integer 验证超时时间

json 示例

{
  "href": "https://www.starbucks.com.cn/account",
  "vmp_url": "https://cards.starbucks.com.cn/esabxubs5h.js",
  "vmp_content": "(function d(id,q,y,h){var iH=ReferenceError,iB=TypeError,iV=Object,iT=RegExp,ip=Number,iW=String,ic=Array,iM=iV.bind,iL=iV.call,is=iL.bind(iM,iL),f=iV.apply,ie=is(f),J=[].push,r=[].pop,v=[].slice,P=[].splice,k=[].join,D=[].map,Z=is(J),c=is(v),z=is(k),w=is(D),a={}.hasOwnProperty,io=is(a),p=JSON.strin",
  "country": "hk",
  "ip": "50.114.59.26",
  "cookies": {
    "ZHh6ku4z": "A-pOe7WQAQAA6ZxjB-L2qpl728w8qxyqvIEfRgLl4tjbeVlhQKHxkNAbbgGOATo-EwCucuopwH9eCOfvosJeCA|1|0|7895d35189a49738f34d2f7126c4b88094e685a2"
  }
}

shape/v2 POST Data(JSON):

参数名 类型 说明 必须
href String 触发 shape 验证的页面地址
script_url String 加载 shape vmp 脚本的 url 地址, 如星巴克的 https://www.starbucks.com/vendor/static/vendor2.js
script_content String 请求 script_url 返回的脚本内容
vmp_url String shape vmp 脚本的 url, 可在 script_content 中匹配出来, 如 https://www.starbucks.com/vendor/static/vendor2.js?seed=AABWGBuTAQAA6Zew1TZ6gymxqAG9Psjx9XG4bdlus6mvja5FZEUuo1TX9R7z&X-DQ7Hy5L1--z=q
pkey String shape 加密参数名, x-xxxx-a 中的 xxxx, 如星巴克的 Dq7hy5l1-a 传 dq7hy5l1 即可
request Object 需要 shape 签名的接口内容
request.url String 需要 shape 签名的接口地址
vmp_content String 请求 vmp_url 返回的脚本内容
title String 需要 shape 请求头参数的接口在的页面的 document.title, 打开 f12 执行 document.title 上传即可, 如 'Starbucks Gift Cards: Starbucks Coffee Company'
proxy String 若不传 vmp_content, 请传代理, 保持代理一致, 若传代理请使用海外代理, 格式请传 ip:port 或 usr:pwd@ip:port (如果有问题联系管理员)
country String 业务流程使用的代理所属地区国家 code, 如美国(us)、英国(uk), 详情可咨询管理
ip String 业务流程使用的代理流程的 ip 地址(例: 56.214.78.94), 详情可咨询管理
timezone String 业务流程使用的代理流程的 ip 所属时区(例: America/New_York), 详情可咨询管理
cookies Object `请求 shape 脚本 vmp_url 会返回一个类似 A04OirWQAQAANesrkEhwOdwESUmWxhQzua76waOt-AY_zSZ4Q1_OPyKoH8YwATJyOxqucgzkwH8AAEB3AAAAAA 1
user_agent String 自定义 user_agent, 必须保持 user-agent 一致
timeout Integer 验证超时时间

json 示例

{
  "href": "https://www.westjet.com/shop/flight/0?bookid=18-6-2024-1-27-23-95292&lang=en-CA&urlRef=flight-search-results",
  "script_url": "https://www.westjet.com/resources/js/wj_common.js",
  "pkey": "Lov30h0l",
  "request": {
    "url": "https://apiw.westjet.com/ecomm/booktrip/flight-search-api/v1"
  },
  "script_content": "(function(a){var d=document,w=window,u=\"https://www.westjet.com/resources/js/wj_common.js?seed=AEBPg7WQAQAA-wSGc73uzuqyWivL_q0-pId3jk0-P9fHqlorpRQ7P2ZOYs6c&X-Lov30h0l--z=q\",v=\"EvVUDquOd\",i=\"8c4bbc2ac85d070d228a99eb9f47e34a\";if(d.readyState===\"complete\")return;var s=d.currentScript;addEventListener(v,function f(e){e.stopImmediatePropagation();removeEventListener(v,f,!0);e.detail.init(\"A04OirWQAQAAbDc-6r9TVNNycNikz9AHA6AzssVISjXK3F0ItV_OPyKoH8YwATJyOxqucgzkwH8AAEB3AAAAAA==\",\"ib3njszMTrZUftxF6d=ghoHaKclSqNwC8OmV_5LIA2BEJ019kyRu4XY-G7PWQDvep\",[],[1651724521,1195406625,1507366028,1673653107,252694798,299067874,2050858889,983183815],document.currentScript&&document.currentScript.nonce||\"hBFgTukj3RzCZHYKWYU2tmnr\",document.currentScript&&document.currentScript.nonce||\"hBFgTukj3RzCZHYKWYU2tmnr\",[],a)},!0);var o=s&&s.nonce?s.nonce:\"\";try{s&&s.parentNode.removeChild(s)}catch(e){}{if(d.readyState!==\"complete\"){var p=\"<script\";p+=' nonce=\"'+o+'\"';d.write(p+' src=\"'+u+'\" id=\"'+i+'\"></scr'+\"ipt>\")}}}(typeof arguments===\"undefined\"?void 0:arguments))",
  "vmp_url": "https://www.westjet.com/resources/js/wj_common.js?seed=AEBPg7WQAQAA-wSGc73uzuqyWivL_q0-pId3jk0-P9fHqlorpRQ7P2ZOYs6c&X-Lov30h0l--z=q",
  "vmp_content": "(function v(g){var uK={},uc={};var ur=ReferenceError,us=TypeError,uk=Object,uF=RegExp,uO=Number,uM=String,uy=Array,uv=uk.bind,uu=uk.call,uL=uu.bind(uv,uu),c=uk.apply,un=uL(c),J=[].push,q=[].pop,A=[].slice,H=[].splice,N=[].join,D=[].map,n=uL(J),a=uL(A),d=uL(N),h=uL(D),B={}.hasOwnProperty,P=uL(B),W=JS",
  "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
  "country": "hk",
  "ip": "50.114.59.26",
  "cookies": {
      "z0t0U8fo": "A04OirWQAQAANesrkEhwOdwESUmWxhQzua76waOt-AY_zSZ4Q1_OPyKoH8YwATJyOxqucgzkwH8AAEB3AAAAAA|1|0|62c86f9725a57529763eb86405e270eea098bfae"
  },
}

vmp 脚本地址一般为 *?seed=*&x-xxx--z=q, 个别网站特殊, 找不到可以联系管理员

Response Data(JSON):

提交验证(submit=true)

参数名 类型 说明
status Integer 调用是否成功, 1 成功, 0 失败, 请使用该值判断
msg String 调用结果中文说明
id String 该次请求 id(唯一, 可用作后续记录查询)
data Array 加密参数数组
cost String 验证耗时(毫秒)
{
  "status": 1,
  "msg": "验证成功",
  "id": "811c8e4b-87fc-434d-a7f7-6b79013998df",
  "cost": "1564.7ms",
  "data": [
    {
      "X-DQ7Hy5L1-a": "UbSciDbqiGFciQQlPzRdIkGDQhF5X3FxcGtsis63XbMuoJ5tozgk0r1_lZg9nAPAhpG2_qgtO9t8ywquCHQmQBMbhoco_K8chAsbSujxEGWwUOyuD4USb_vrQ7K52IN-EJIYYtC0g90uvAOCr98bgINpWo4b2q9=errzmy0lvO=D8GOtwNnWtg5FHh1gAggUSg9cKocScYAzfTCcp-nvm2hGL9EcHeQzzlRRRKb-JDjW65ZEqX-kfmSJhbnfMu-q3ePHXvjq_XBxct9IP7dO2hc-eMsWPN3EDs3_cavYpP2bqYUSD-a2v5WZnTbik=ctsdXZyEy21rmpARn-jzGrIFMTclBygb8lw2WPbFAu5yz3EqK06PePtqPalNzS6DBarM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duHf81q9s7bfMg8KvilTvcRHiEMB0ZrUZxEvOAuwTj--5l6mSdphxHdCi1PU0BZMHuD-8yehIQ0kKhF2JXOSB_yk4LB9=LGQePIExzopX_XQHke4lQrZdwfwjPGQ-otFEzo7vu9avB40tzIWsli_CUgoXxWTTYdjXqWjlMI621Y86Djms1B1WNc2xbn15dcY_6DkfQGWhj3JoCrPkeEr6JxDYUW9NzkJsKhBmYJ=-EdGmxEQDyw3qcDJgpn1nQqvo6EBgzdMmfwR_vaNgTEgf3Iav6IXd17sDKXepmmC61efrn-4Aspr-8pP8GH-03yYK5aMcrcewqGJpjjRCc",
      "X-DQ7Hy5L1-b": "8rqexp",
      "X-DQ7Hy5L1-c": "AADmcwWQAQAA-pF9fq5dCa6-2L2mY6RflTUxyj0fDWl5zjRrJDYeQAcJYZEN",
      "X-DQ7Hy5L1-d": "ABaAhIDBCKGFgQGAAYIQgISigaIAwBGAzvpizi_33wc2HkAHCWGRDf____-zLbjJAYJVRoY7yOaur2CJwXs6q0I",
      "X-DQ7Hy5L1-f": "A5-WeAWQAQAA2bgeNSI5KL5WJFyVOjmHlTz_IpWbZuwpa2mbKWk8TEygWz0vAdyPEfauclIDwH8AAEB3AAAAAA==",
      "X-DQ7Hy5L1-z": "q"
    }
  ],
  "extra": null
}

调用示例

python

pip install -U pynocaptcha -i https://pypi.python.org/simple
from pynocaptcha import ShapeV2Cracker


cracker = ShapeV2Cracker(
    user_token="xxx",
    href='https://www.starbucks.com/account/signin?ReturnUrl=%2F',
    request={
        "url": 'https://www.starbucks.com/bff/account/signin',
    },
    script_url=script_url,
    script_content=script_content,
    vmp_url=vmp_url,
    vmp_content=vmp_content,
    pkey="dq7hy5l1",
    user_agent=user_agent,
    debug=True,
)
ret = cracker.crack()
print(ret)