Skip to content

[toString] #151

Answered by abrahamjuliot
wikiwiki000 asked this question in Q&A
Discussion options

You must be logged in to vote

That is a great question. In short, if we call the toString method on each of these (getDate, etc... methods), the result should be 'function getDate() { [native code] }' or 'function getDate() {\n [native code]\n}' depending on the JS engine. When object methods like this are overwritten or spoofed, the toString method no longer returns the native result. Instead, the result leaks the tampering code. For example, open the console in your browser and enter this with the extension on:

Date.prototype.setDate.toString()
Date.prototype.setDate.toString().toString()

Here's an in dept article on this topic.

https://adtechmadness.wordpress.com/2019/03/23/javascript-tampering-detection-and-stealth/

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by abrahamjuliot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #150 on September 19, 2021 02:00.