声明:
本文章中所有内容仅供学习交流使用,不用于其他任何目的,抓包内容、敏感网址、数据接口等均已做脱敏处理,严禁用于商业用途和非法用途,否则由此产生的一切后果均与作者无关!
前言
最近遇到太多难点了卡了很久,魔改编译node,和直播弹幕dy/tiktok简单记录一下。进阶卡了好几天。
逆向过程
我也看了很多人开源了但是基本都是用不了的。不是417就是415补环境基本没补所以很容易被检测。我就随便照着网上开源项目改改就好了。
cp = execjs.compile(open('./abogus.js', 'r', encoding='utf8').read()) params = cp.call('getAb', roomId) print(params) response = requests.get('/webcast/im/fetch/', params=params, cookies=cookies,headers=headers) response = Response().parse(response.content) internal_ext=response.internal_ext cursor=response.cursor cp=execjs.compile(open('./sign.js',encoding='gbk',errors='ignore').read()) signature=cp.call('getSign',self.room_id)['X-Bogus'] wss = f'******&room_id={self.room_id}&heartbeatDuration=0&signature={signature}'
signature代理补一下
function get_enviroment(proxy_array) {for (var i = 0; i < proxy_array.length; i++) {handler = '{\n' +' get: function(target, property, receiver) {\n' +' console.log("方法:", "get ", "对象:", ' +'"' + proxy_array[i] + '" ,' +'" 属性:", property, ' +'" 属性类型:", ' + 'typeof property, ' +// '" 属性值:", ' + 'target[property], ' +'" 属性值类型:", typeof target[property]);\n' +' return target[property];\n' +' },\n' +' set: function(target, property, value, receiver) {\n' +' console.log("方法:", "set ", "对象:", ' +'"' + proxy_array[i] + '" ,' +'" 属性:", property, ' +'" 属性类型:", ' + 'typeof property, ' +// '" 属性值:", ' + 'target[property], ' +'" 属性值类型:", typeof target[property]);\n' +' return Reflect.set(...arguments);\n' +' }\n' +'}'eval('try{\n' + proxy_array[i] + ';\n'+ proxy_array[i] + '=new Proxy(' + proxy_array[i] + ', ' + handler + ')}catch (e) {\n' + proxy_array[i] + '={};\n'+ proxy_array[i] + '=new Proxy(' + proxy_array[i] + ', ' + handler + ')}')} }