文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

ks协议请求APP sig __NS_sig3 __NStokensig

2023-09-01 12:26

关注

前面已经公布了一些流程,除了sig3在so层,其他都是java层;

目前看了下最新版,9-最新版本逻辑一致,9以下 sig3 42位。

快手__nsTokensig和sig签名 :

https://codeooo.blog.csdn.net/article/details/127639252

抓包:
https://codeooo.blog.csdn.net/article/details/127637178

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述看了下参数:
keyword关键词
client_key : 3c2cd3f3
token是登陆账号的值,这里测试关键词搜索可以忽略;

关键词API:

import uuidimport requestsfrom sig import sig3_start, getsig3url = "https://apijs.gifshow.com/rest/n/search/new?earphoneMode=1&mod=Xiaomi%28MI%208%20Lite%29&appver=11.1.40.29872&isp=&language=zh-cn&ud=0&did_tag=0&egid=DFP8FD17773009A01528832DDF38472E89F25E8A6302690B44B87CC4BA032C66&net=WIFI&kcv=1507&app=0&kpf=ANDROID_PHONE&bottom_navigation=false&ver=11.1&oDid=ANDROID_1df15ab612781d06&android_os=0&boardPlatform=sdm660&kpn=KUAISHOU&androidApiLevel=27&newOc=XIAOMI&slh=0&country_code=CN&nbh=130&hotfix_ver=&did_gt=1689592942281&keyconfig_state=2&cdid_tag=7&sys=ANDROID_8.1.0&max_memory=256&cold_launch_time_ms=1689642804517&oc=XIAOMI&sh=2280&ddpi=440&deviceBit=0&browseType=4&socName=Qualcomm%20Snapdragon%20660&is_background=0&c=XIAOMI&sw=1080&ftt=&abi=arm64&userRecoBit=0&device_abi=arm64&totalMemory=5710&grant_browse_type=AUTHORIZED&iuid=&rdid=ANDROID_254db5af72b2742d&sbh=110&darkMode=false&did=ANDROID_1df15ab612781d06"headers = {    'X-Client-Info': 'model=V1923A;os=Android;nqe-score=4;network=WIFI;signal-strength=4;',    'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',    'Content-Type': 'application/x-www-form-urlencoded',    'Accept': '*/*',    'Host': 'apijs.ksapisrv.com',    'Connection': 'keep-alive'}data = {    "isRecoRequest": "false",    "ussid": "",    "fromPage": "4",    "fromPageSessionId": "",    "pcursor": "1",    "requestTabId": "",    "keyword": "捡到男鬼后脱单了",    "queryId": "",    "extParams": "{\"hasSelectedInterest\":false,\"searchTabId\":1,\"imei\":\"869809038521435\",\"layoutStyle\":2,\"referVideoId\":\"5259078570990334169\",\"referLog\":\"mK0HEgwV5jN3GgGrsx0WMuQeeCwDVHGyotnXt9E9Fgcl+Y7h4SbxHUabOCL7u4LuFVpcZropLisGgpu3D+B5Nc6HYx0Bo56uQYl11HqvhORo+ftH2sf15fliA/zGpT1D\",\"isAd\":false,\"referAuthorId\":\"359335788\",\"kwaiSource\":\"search_entrance_bottom_featured\",\"disableCorrection\":false,\"filterType\":\"\",\"collContinuePlayInfo\":{},\"signalParams\":\"H4sIAAAAAAAAAFNi4WARYNSK5ZIvTk0sSs6IT80rKUrMS06NT8ovKcnPjU9LTSwpLUpNUbLi+A8DjAKT/u3ZMs1QitfN1TEkNMjVJT7A0d3VgNGC2UnY1MjU0sDcwtTcwNLSwNjYxNDMEgBhdY5yZQAAAA==\"}",    "videoModelCrowdTag": "1_99",    "os": "android",    "cs": "false",    "client_key": "3c2cd3f3",    "startSessionId": str(uuid.uuid4()),    "uQaTag": ""}sig, sig3str = sig3_start(url, data)sig3 = getsig3(sig3str)url = url + f"&sig={sig}&__NS_sig3={sig3}"response = requests.request("POST", url, headers=headers, data=data)print(response.text)

在这里插入图片描述

主页作品页:

用户主页这个得登陆了,登陆后会有个token参数;

在这里插入图片描述
这个token登陆时候,会生成一个盐值,可以使用hook sha256
在这里插入图片描述
去拿到入参,因为入参是 sig + 盐值,所以只需要取后32位:

在这里插入图片描述
在这里插入图片描述

8b9a761435578761df9a4838bc942cb58b0b05731c79f830684dd7436181859d
8b9a761435578761df9a4838bc942cb58b0b05731c79f830684dd7436181859d
8b0b05731c79f830684dd7436181859d 8b0b05731c79f830684dd7436181859d

token_client_salt : 8b0b05731c79f830684dd7436181859d

import requestsfrom urllib.parse import parse_qslfrom sig import sig3_start, getsig3, get_tokeningurl = "https://apijs2.gifshow.com/rest/n/feed/profile2?earphoneMode=1&mod=Xiaomi%28MI%208%20Lite%29&appver=11.1.40.29872&isp=&language=zh-cn&ud=3115604858&did_tag=0&egid=DFP4343AA6498BDCA87F15D3B59ADB3A045F45AE4152A8BA42C5CDA172EB32C3&net=WIFI&kcv=1507&app=0&kpf=ANDROID_PHONE&bottom_navigation=false&ver=11.1&oDid=ANDROID_1df15ab612781d06&android_os=0&boardPlatform=sdm660&kpn=KUAISHOU&androidApiLevel=27&newOc=XIAOMI&slh=0&country_code=CN&nbh=130&hotfix_ver=&did_gt=1689657031040&keyconfig_state=2&cdid_tag=7&sys=ANDROID_8.1.0&max_memory=256&cold_launch_time_ms=1689731923266&oc=XIAOMI&sh=2280&ddpi=440&deviceBit=0&browseType=4&socName=Qualcomm%20Snapdragon%20660&is_background=0&c=XIAOMI&sw=1080&ftt=&abi=arm64&userRecoBit=0&device_abi=arm64&totalMemory=5710&grant_browse_type=AUTHORIZED&iuid=&rdid=ANDROID_254db5af72b2742d&sbh=110&darkMode=false&did=ANDROID_1df15ab612781d06"headers = {    'Host': 'apijs.gifshow.com',    'User-Agent': 'kwai-android aegon/3.26.4',    'Content-Type': 'application/x-www-form-urlencoded'}payload = 'user_id=1471088950&lang=zh&count=20&privacy=public&pcursor=1.689605697445E12&referer=ks%3A%2F%2Fprofile%2F1351720628%2F5200250302942104746%2F1_u%2F2002357763686114370_bs4356%2F90&displayType=3&teenagerMode=false&tubeCustomParams=%7B%22tubeCardABParam%22%3A1%7D&preRequest=false&videoModelCrowdTag=1_16&os=android&token=98d1568e5e05486b86091441dfb93076-3115604858&cs=false&client_key=3c2cd3f3&kuaishou.api_st=&uQaTag=0%23'data = dict(parse_qsl(payload))print(data)sig, sig3str = sig3_start(url, data)tokensig = get_tokening(sig, "8b0b05731c79f830684dd7436181859d")sig3 = getsig3(sig3str)print(sig, sig3str, sig3)url = url + f"&sig={sig}&__NStokensig={tokensig}&__NS_sig3={sig3}"print(url)response = requests.request("POST", url, headers=headers, data=data)print(response.text)for res in response.json()['feeds']:    try:        time = res['time']        duration = res['duration']        caption = res['caption']        author = res['soundTrack']['name']        share_info = res['share_info']        print('caption: ' + str(caption) + '  author: ' + str(author) + '  time: ' + str(time) + '  duration: ' + str(            duration) + '  share_info: ' + str(share_info))    except Exception as a:        print(a)        continue

在这里插入图片描述

评论: API

# -*- coding: utf-8 -*-import requestsfrom sig import sig3_start, getsig3url = "https://api3.gifshow.com/rest/n/comment/list/v2?mod=Google%28Pixel%20XL%29&abi=arm32&country_code=CN&kpn=KUAISHOU&is_background=0&cdid_tag=7&deviceBit=0&oc=ANDROID_SHENMA_ZW_SSYQ_CPC&egid=DFP1B2A7E8DB6DEF92C673F3F4C5B7C685731D7598AD80345580EFAE1208BCA2&sbh=84&hotfix_ver=&appver=11.1.30.29775&sh=2560&grant_browse_type=AUTHORIZED&userRecoBit=0&cold_launch_time_ms=1689577363668&nbh=168&socName=Qualcomm%20MSM8996PRO-AB&newOc=ANDROID_SHENMA_ZW_SSYQ_CPC&androidApiLevel=25&max_memory=256&isp=&kcv=1507&earphoneMode=1&browseType=4&kpf=ANDROID_PHONE&ddpi=560&did=ANDROID_60a02c5de917fa4c&android_os=0&boardPlatform=msm8996&app=0&net=WIFI&device_abi=arm64&did_tag=0&ud=0&c=ANDROID_SHENMA_ZW_SSYQ_CPC&sys=ANDROID_7.1.2&bottom_navigation=false&slh=0&sw=1440&oDid=ANDROID_60a02c5de917fa4c&ftt=&keyconfig_state=2&rdid=ANDROID_453bb538c86218be&language=zh-cn&darkMode=false&totalMemory=3764&iuid=&did_gt=1689577366128&ver=11.1"headers = {    'Host': 'api3.gifshow.com',    'User-Agent': 'kwai-android aegon/3.26.4',    'Content-Type': 'application/x-www-form-urlencoded'}data = {    "photoId": "5249508419472077227",    "user_id": "1544872123",    "order": "desc",    "count": "10",    "photoPageType": "145",    "enableEmotion": "true",    "expTag": "1_i/2002353905121107874_scn0",    "urlPackagePage2": "USER_TAG_SEARCH",    "ptp": "",    "feedCommentCount": "83",    "commentPanelType": "1",    "client_key": "3c2cd3f3",    "uQaTag": "",    "cs": "false",    "os": "android",    "videoModelCrowdTag": "1_99"}sig, sig3str = sig3_start(url, data)sig3 = getsig3(sig3str)url = url + f"&sig={sig}&__NS_sig3={sig3}"print(sig, sig3str, sig3)response = requests.request("POST", url, headers=headers, data=data)print(response.text)

在这里插入图片描述

来源地址:https://blog.csdn.net/weixin_38927522/article/details/131848058

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯