Bypass_Debugger

Bypass new Function --> debugger && constructor --> debugger && eval --> debugger

当前为 2024-12-31 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Bypass_Debugger
  3. // @namespace https://github.com/0xsdeo/Bypass_Debugger
  4. // @version 2024-12-06
  5. // @description Bypass new Function --> debugger && constructor --> debugger && eval --> debugger
  6. // @author 0xsdeo
  7. // @match http://*/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. let temp_eval = eval;
  16. let temp_toString = Function.prototype.toString;
  17.  
  18. Function.prototype.toString = function () {
  19. if (this === eval) {
  20. return 'function eval() { [native code] }';
  21. } else if (this === Function) {
  22. return 'function Function() { [native code] }';
  23. } else if (this === Function.prototype.toString) {
  24. return 'function toString() { [native code] }';
  25. } else if (this === Function.prototype.constructor) {
  26. return 'function Function() { [native code] }';
  27. }
  28. return temp_toString.apply(this, arguments);
  29. }
  30.  
  31. window.eval = function () {
  32. if (typeof arguments[0] == "string") {
  33. arguments[0] = arguments[0].replaceAll(/debugger/g, '');
  34. }
  35. return temp_eval(...arguments);
  36. }
  37.  
  38. let Bypass_debugger = Function;
  39.  
  40. Function = function () {
  41. for (let i = 0; i < arguments.length; i++) {
  42. if (typeof arguments[i] == "string") {
  43. arguments[i] = arguments[i].replaceAll(/debugger/g, '');
  44. }
  45. }
  46. return Bypass_debugger(...arguments);
  47. }
  48.  
  49. Function.prototype = Bypass_debugger.prototype;
  50.  
  51. Function.prototype.constructor = function () {
  52. for (let i = 0; i < arguments.length; i++) {
  53. if (typeof arguments[i] == "string") {
  54. arguments[i] = arguments[i].replaceAll(/debugger/g, '');
  55. }
  56. }
  57. return Bypass_debugger(...arguments);
  58. }
  59.  
  60. Function.prototype.constructor.prototype = Function.prototype;
  61. })();