Scriptlets icon indicating copy to clipboard operation
Scriptlets copied to clipboard

Improve 'abort-on-stack-trace' — add StackDepth support

Open Yuki2718 opened this issue 10 months ago • 1 comments

Compare these commits: https://github.com/AdguardTeam/AdguardFilters/commit/d466f3a974ee229dcb4a59db1ff499336eb6f9bd https://github.com/uBlockOrigin/uAssets/commit/ee77cdf6e9edb6e0e0eeac42356f3dd599aa8dd3

As both the script and function names are randomized, StackDepth or the number of lines in the stack logs may be the only clue to distinguish legit and anti-adb calls. I guess it's actually possible to utilize StackDepth by complex regex, as AG logs stack trace in multiline mode (uBO logs in singleline mode), but I gave up as it's too complicated. For the above commit I happend to find the names are not totally random and exploited that the 4-th character is always numbers, but this was only fortune.

Yuki2718 avatar Apr 11 '25 05:04 Yuki2718

Also, current stack logs on Chrome only includes the file name and not path as shown in https://github.com/AdguardTeam/Scriptlets/issues/469. It's better if we can use full URL.

Yuki2718 avatar Apr 11 '25 05:04 Yuki2718