zhihu补环境(补96)

zhihu补环境(补96)

加密逻辑

  • 对 版本和请求参数的拼接字符串进行 魔改md5加密 (直接扣即可, 没难度)
  • 对加密后的字符串进行二次加密, 使用webpack中的1514向外暴露的加密算法 (扣webpack的加载器和模块, 补环境即可) (使用到的模块不多, 不需要吐模块)
    在这里插入图片描述

webpack 补环境

  • 挂代理, 不多说
  • 以检测 toString为主, 可以对检测的变量进行手动赋值toString的结果(注意 location.toString()的结果是url)
  • 补函数, 不多说
  • 会检测window的原型, 注意window的原型要有值, 不能为空对象{}

注意:
无法调试,无法调试, 否则结果结果无法正常输出
(暂未找到原因, 有大佬知道, 希望留言告知, 多谢)

验证正确性

由于输出结果一直在变, 判断是 Math.random 或 Date().getTime() 导致的
对其进行重写, 固定返回值( 经过实验, 导致变化的是 Math.random)

补环境代码

function Document(){}
Document.prototype.createElement=function(){
    if (arguments[0]=='canvas'){
        let canvas = {
            getContext: function(){
                console.log('====>',arguments);
                if (arguments[0] == '2d'){
                    d2={}
                    d2.toString=()=>'[object CanvasRenderingContext2D]'
                    return watch(d2,'canvas.getContext.2d')
                }
                return watch({},'canvas.getContext')
            }
        }
        canvas.toString=()=>'[object HTMLCanvasElement]';
        return watch(canvas,'canvas')
    }
}
Document.prototype.getElementById=function(){}
Document.prototype.getElementsByClassName=function(){}
document=new Document();
document.toString=()=>'[object HTMLDocument]'

function Navigator(){}
Navigator.prototype={}
navigator = new Navigator();
navigator.toString=()=>'[object Navigator]'

function Location() {}
Location.prototype = {
    "ancestorOrigins": {},
    "href": "https://www.zhihu.com/search?type=content&q=python",
    "origin": "https://www.zhihu.com",
    "protocol": "https:",
    "host": "www.zhihu.com",
    "hostname": "www.zhihu.com",
    "port": "",
    "pathname": "/search",
    "search": "?type=content&q=python",
    "hash": ""
};
let location = new Location();
location.toString=()=>'https://www.zhihu.com/search?type=content&q=python'

function Storage(){}
Storage.prototype={}
localStorage=new Storage();

function Screen() {}
Screen.prototype={}
screen = new Screen();
screen.toString=()=>'[object Screen]';

function History() {}
History.prototype = {};
history = new History();
history.toString=()=>'[object History]';




function Window(){}
Window.prototype={
    "TEMPORARY": 0,
    "PERSISTENT": 1
}
// window=new Window();
window=global;
window.__proto__=Window.prototype;
window.__ZH__= {补自己电脑上的就行, 内容较多,不展示}
window.name=''
window.alert=function(){}

window.document = document;
window.navigator = navigator;
window.location = location;
window.localStorage = localStorage;
window.screen = screen;
window.history = history;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值