Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the two ways to monitor the browser environment in JS reverse?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

What are the two ways to monitor the browser environment in JS reverse? in order to solve this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

1. The first thing I want to say is definitely Proxy. Let's skip the introduction and go directly to the code:

Window = new Proxy (global, {get: function (target, key, receiver) {console.log ("window.get", key, target [key]) If (key== "location") {location = new Proxy (target [key], {get: function (_ target, _ key, _ receiver) {console.log ("window.get", key, _ key, _ target [_ key]) If (_ key== "port") {console.log ("follow the official account [writing code]")} return _ target [_ key];}})} return target [key];}, set: function (target, key, value, receiver) {console.log ("window.set", key, value) Target [key] = value;}})

Window.a = {}; window.a;_window.location = {a: 2}; _ window.location.a;window.b = {a: 2}; window.b.a;location.port;console.log ("-"); _ window.location.port

Execution result of node environment:

2. Hook mode of object attributes

Execute in the browser:

3, needless to say, the role of this monitoring system, that is, it is often said that it needs to be used where it is missing. Now there are more and more scenarios of replenishing the environment. Some well-known js anti-climbing products can use this idea. If the environment is good, it can be used everywhere. It can also save a lot of trouble and get more with one stone.

This is the answer to the question about what are the two monitoring methods of the browser environment in reverse of JS. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report