当前位置: 首页 > news >正文

js逆向之补环境代理模板

let setProxyArr = function (proxyObjArr) {for (let i = 0; i < proxyObjArr.length; i++) {const handler = `{get:function(target,property,receiver){console.log("方法:","get","对象","${proxyObjArr[i]}","属性:",
property,"属性类型:",typeof property,"属性值:",target[property],"属性值类型:",typeof target[property]);
return Reflect.get(...arguments)},set:function(target,property,value,receiver){console.log("方法:","set","对象:","${proxyObjArr[i]}","属性:",
property,"属性类型:",typeof property,"属性值:",value,"属性值类型:",typeof target[property]);return Reflect.set(...arguments);}}`;eval(`try{${proxyObjArr[i]};${proxyObjArr[i]} = new Proxy(${proxyObjArr[i]},${handler});} catch (e){${proxyObjArr[i]} = {};${proxyObjArr[i]} = new Proxy(${proxyObjArr[i]},${handler});}`);}
}
function watch(object) {const handler = {get: function (target, property, receiver) {if (property !== 'isNaN' && property !== 'encodeURI' && property !== "Uint8Array" && property !== 'undefined' && property !== 'JSON') {console.log("方法:", "get", "对象", target, "属性:",property, "属性类型:", typeof property, "属性值:", target[property], "属性值类型:", typeof target[property]);}return Reflect.get(...arguments)},set: function (target, property, value, receiver) {console.log("方法:", "set", "对象:", target, "属性:",property, "属性类型:", typeof property, "属性值:", value, "属性值类型:", typeof target[property]);return Reflect.set(...arguments);}}return new Proxy(object, handler)
}
const safeFunction = function safeFunction(func) {//处理安全函数Function.prototype.$call = Function.prototype.call;const $toString = Function.toString;const myFunction_toString_symbol = Symbol('('.concat('', ')'));const myToString = function myToString() {return typeof this === 'function' && this[myFunction_toString_symbol] || $toString.$call(this);}const set_native = function set_native(func, key, value) {Object.defineProperty(func, key, {"enumerable": false,"configurable": true,"writable": true,"value": value});}delete Function.prototype['toString'];set_native(Function.prototype, "toString", myToString);set_native(Function.prototype.toString, myFunction_toString_symbol, "function toString() { [native code] }");const safe_Function = function safe_Function(func) {set_native(func, myFunction_toString_symbol, "function" + (func.name ? " " + func.name : "") + "() { [native code] }");}return safe_Function(func)
}//创建函数
const makeFunction = function makeFunction(name) {// 使用 Function 保留函数名let func = new Function("v_log", `return function ${name}() {v_log('函数${name}传参-->', arguments);};`)(v_log); // 传递 v_log 到动态函数safeFunction(func);func.prototype = myProxy(func.prototype, `方法${name}.prototype`);return func;
}
window = global
window.Buffer = Buffer
window.Window = function Window() { }
Object.setPrototypeOf(window, window.Window.prototype)
window.Document = function Document() { }
delete global
delete Buffer
delete __dirname
delete __filename
delete process
safeFunction(window.Window)
safeFunction(window.Document)function HTMLDocument() {}
Object.setPrototypeOf(HTMLDocument.prototype, window.Document.prototype)
HTMLDocument.prototype.constructor = HTMLDocument
document = new HTMLDocument()
window.HTMLDocument = HTMLDocument
safeFunction(window.HTMLDocument)function Navigator() {}
navigator = new Navigator()
window.Navigator = Navigator
safeFunction(window.Navigator)function Screen() {}
screen = new Screen()
window.Screen = Screen
safeFunction(window.Screen)function History() {}
history = new History()
window.History = History
safeFunction(window.History)function Location() {}
location = new Location()
window.Location = Location
safeFunction(window.Location)
setProxyArr(['window', 'document', 'location', 'history', 'screen', 'navigator'])
http://www.sczhlp.com/news/59548/

相关文章:

  • 微网站是手机网站吗wordpress加载单页面内容
  • 新手想做网站赚钱北京网站开发培训班
  • 制作企业网站页面html网站开发与数据库有关系吗
  • 网站建设验收报告模板做网站怎么跟别人讲价
  • 正规的淘宝代运营公司衡水seo网站建设优化排名
  • win10虚拟机做网站wordpress查看所有文章
  • 重庆做网站怎么做360搜索入口
  • 网站建设管理条例山东免费网站制作
  • 做暖暖视频网站有哪些昆明网站优化建设
  • 第二周-对于hadoop框架的大概认识
  • 好的宝安网站建设网站建设 推广人员
  • 网站 文章 keywords 和主页keywords了解网站基本知识
  • 番禺区大石做网站国内比较大的源码网站
  • 西安网站运营网站的分享按键
  • FT测试工程师岗位常见的面试问题
  • 实测墨刀AI生成原型图功能:3大使用技巧与避坑指南
  • 画中画有哪些网站可以做网站怎么优化关键词
  • 如何用电脑做网站企业网站建设与网页设计
  • 电子商务网站建设常用工具优化网站页面
  • pc网站原型设计工具python做网站项目
  • 电子商务发展趋势有哪些新seo排名点击软件
  • 做营销型网站一般要多少钱找做网站的个人
  • 网站开发服务 退款广告网站设计公司
  • 站长友情链接平台网上开店创业
  • 怎么在手机上搭建网站重庆网站建设 九度互联
  • 企业网站的新闻资讯版块有哪些wordpress ajax -1
  • 奢侈品网站建设wordpress 百度知道主题
  • 泉州刺桐古建筑公司网站网站搭建文案
  • AI推理方法演进:CoT、ToT与GoT技术对比分析
  • 相关名词