{"id":19891157,"url":"https://github.com/kajweb/stop-debugger","last_synced_at":"2025-05-02T18:31:18.004Z","repository":{"id":152024714,"uuid":"303186585","full_name":"kajweb/stop-debugger","owner":"kajweb","description":"a proxy-server for disable the debugger function in Chrome DevTools;","archived":false,"fork":false,"pushed_at":"2024-04-05T04:20:18.000Z","size":2622,"stargazers_count":95,"open_issues_count":0,"forks_count":29,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-07T04:36:01.723Z","etag":null,"topics":["chrome","chrome-extension","debugger","proxy-server"],"latest_commit_sha":null,"homepage":"https://kajweb.github.io/stop-debugger","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kajweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"kajweb","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://blog.iwwee.com/images/donate/wxali.png"}},"created_at":"2020-10-11T18:29:28.000Z","updated_at":"2025-04-03T05:35:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa142b5e-5180-4ae8-a539-b4ca6f04ce91","html_url":"https://github.com/kajweb/stop-debugger","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kajweb%2Fstop-debugger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kajweb%2Fstop-debugger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kajweb%2Fstop-debugger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kajweb%2Fstop-debugger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kajweb","download_url":"https://codeload.github.com/kajweb/stop-debugger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252088399,"owners_count":21692788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chrome","chrome-extension","debugger","proxy-server"],"created_at":"2024-11-12T18:17:18.340Z","updated_at":"2025-05-02T18:31:15.066Z","avatar_url":"https://github.com/kajweb.png","language":"JavaScript","funding_links":["https://github.com/sponsors/kajweb","https://blog.iwwee.com/images/donate/wxali.png"],"categories":[],"sub_categories":[],"readme":"中文　　[English](docs/README_EN.md)  \r\n\r\n\u003cp align=\"right\"\u003e你是第 \u003cimg align=\"center\"  alt=\"visitors\" src=\"https://visitor-badge.glitch.me/badge?page_id=kajweb/stop-debugger\" /\u003e 个（次）人浏览 stop-debugger.\u003c/p\u003e\r\n\r\n# stop-debugger\r\n\r\n\u003cimg src=\"https://i.loli.net/2020/10/30/bF3u8VDjAkiqQIt.png\" width=\"200\"\u003e\r\n\r\n一个**禁止**`Chrome DevTools`中执行**debugger**的拓展和`系统代理`。\r\n\r\nA `Chrome Extension` and `system proxy`  for **disable** the **debugger** function in `Chrome DevTools`。\r\n\r\n\r\n\r\n## 运行效果\r\n\r\n- 未使用程序\r\n\r\n![TurnOff.gif](https://i.loli.net/2020/10/28/YpXkGZhVa5Hi6Lx.gif)\r\n\r\n- 使用程序\r\n\r\n![TurnOn.gif](https://i.loli.net/2020/10/28/TIqopWDmUzKrO5k.gif)\r\n\r\n\r\n\r\n## 原理架构\r\n\r\n- Proxy\r\n\r\n\r\n![theory.png](https://i.loli.net/2020/11/11/YwHRDBWr2eVmn3f.png)\r\n\r\n\r\n## 使用说明\r\n\r\n本程序分为两个部分：`chrome浏览器拓展`和`Node系统代理`。  \r\n\r\n- chrome浏览器扩展\r\n\r\n  `chrome浏览器拓展`用于覆盖浏览器特征函数，浏览器拓展的源码在：`chrome-extension`目录。使用前需要将该拓展安装到浏览器中，安装拓展完成后，需要开启扩展方可生效。  \r\n\r\n  [图文详解Chrome插件离线安装方法](https://huajiakeji.com/utilities/2019-01/1791.html)\r\n\r\n- Node系统代理端\r\n\r\n  `Node系统代理`用于处理javascript`、`html`、`json`等文件中出现的`debugger`，使用特定的正则表达式对`debugger`进行匹配，并注释相应的代码。\r\n  \r\n```bash\r\n  git clone https://github.com/kajweb/stop-debugger.git\r\n  cd stop-debugger/proxy-serve \r\n  npm i\r\n  npm run cn\r\n```\r\n\r\n\r\n\r\n\r\n\u003e https链接需要安装证书到`受信任的根证书颁发机构`，否则可能无法处理HTTPS请求。\r\n\u003e\r\n\u003e 对于`win7`、`win10`系统，会在Node客户端运行时调用系统程序导入证书到系统中。\r\n\u003e\r\n\u003e 其他系统暂时不支持自动导入证书。\r\n\r\n\r\n\r\n## 测试地址\r\n\r\n我们提供一个功能相对丰富的测试页面用来测试debugger，您可以打开`Chrome DevTools`控制台，点击相应的项查看运行结果。\r\n\r\n[debugger可用性测试地址](https://kajweb.github.io/stop-debugger)\r\n\r\n\r\n\r\n## 目录结构\r\n\r\n|       目录名称       | 作用                                                         |\r\n| :------------------: | :----------------------------------------------------------- |\r\n|      **depoly**      | github page部署页面，用于提供给开发者测试debugger运行情况    |\r\n|   **proxy-serve**    | Node代理服务器代码。用于屏蔽明文的debugger                   |\r\n| **chrome-extension** | chrome拓展的源码。用于屏蔽特定能执行`debugger`方法的函数，   |\r\n|                      | 如`Function()`、`eval()`、`Function.prototype.constructor`等方法 |\r\n|       **cert**       | 证书目录。用于生成CA证书与对客户端证书进行签名的代码。       |\r\n|                      | 事实上，已经将生成好的CA证书从`/cert/ca`复制到了`/proxy-serve/src/cert`。 |\r\n|                      | 后续客户端签发证书通过`/proxy-serve/src/cert/index.js`进行接管，开发者无需过多关注此目录。 |\r\n|       **dev**        | 程序测试开发目录，里面绝大部分都是没有意义的代码。           |\r\n|                      | 仅仅用于在开发过程中进行的各种实验性的测试，开发者无需过多关注此目录。 |\r\n|       **docs**       | 系统文档目录，覆盖各种语言的文档、                           |\r\n\r\n\r\n\r\n## 支持计划\r\n\r\n可以在[deploy](deploy)，或者打开[在线测试页面](http://test.iwwee.com/debugger/extensionSet.html)\r\n\r\n- - [x] 不带分号的debugger\r\n\r\n\r\n\u003e 此类型代码使用`proxy-serve`进行处理\r\n```js\r\nlet a = 1,b = 2;\r\ndebugger\r\nlet c = a+b;\r\n```\r\n\r\n- - [x] 带分号的debugger\r\n\r\n\u003e此类型代码使用`proxy-serve`进行处理\r\n\r\n```js\r\nlet a = 1,b = 2;\r\ndebugger;\r\nlet c = a+b;\r\n```\r\n\r\n- - [x] （多语句）后面还带语句的debugger\r\n\r\n\u003e此类型代码使用`proxy-serve`进行处理\r\n\r\n\r\n```js\r\nlet a = 1,b = 2;\r\ndebugger;let c = a+b;\r\n```\r\n\r\n- - [x] （多语句）前面、后面还带语句的debugger\r\n\r\n\u003e此类型代码使用`proxy-serve`进行处理\r\n\r\n\r\n```js\r\nlet a = 1,b = 2;debugger;let c = a+b;\r\n```\r\n\r\n- - [x] （多语句）前面还带语句的debugger\r\n\r\n\u003e此类型代码使用`proxy-serve`进行处理\r\n\r\n\r\n```js\r\nlet a = 1,b = 2;debugger\r\nlet c = a+b;\r\n```\r\n\r\n- - [x]  使用Function生成的debugger\r\n\r\n\u003e此类型代码使用`chrome-extension`进行处理\r\n\r\n\r\n```js\r\nlet fn = new Function(\"debu\"+\"gger\");\r\nfn()\r\n```\r\n\r\n- - [x] 使用Function生成的多参数debugger\r\n\r\n\u003e此类型代码使用`chrome-extension`进行处理\r\n\r\n```js\r\nlet fn = new Function(\"x\",\"debugger\");\r\nfn()\r\n```\r\n\r\n- - [x] 预防简单的检测\r\n\r\n\u003e此类型代码使用`chrome-extension`进行处理\r\n\r\n```js\r\nlet a = \";debugger;\"\r\nif( a!==\";debug\" + \"ger;\" ){\r\n\tconsole.log(\"用户行为异常\")\r\n}\r\ndebugger\r\n```\r\n\r\n- - [x] 使用eval执行debugger\r\n\r\n\u003e此类型代码使用`chrome-extension`进行处理\r\n\r\n```js\r\neval(\"debugger\");\r\n```\r\n\r\n- - [x] 使用Function执行debugger\r\n\r\n\u003e此类型代码使用`chrome-extension`进行处理\r\n\r\n```js\r\n// https://blog.csdn.net/zhsworld/article/details/104660742\r\nFunction.prototype.constructor(\"debugger\")()\r\n```\r\n\r\n\r\n- [ ] 使用Function执行debugger（经过混淆）\r\n\r\n\u003e此类型代码将使用`chrome-extension`进行处理\r\n\r\n```js\r\n// http://www.sc.10086.cn/service/login.html\r\n\r\nlet _0x2764ed = {\r\n\twcluU: \"debu\",\r\n\ttvBGO: \"gger\",\r\n\ttOyvN: \"action\",\t\r\n\tvyxZy(a,b){return a+b}\r\n}\r\n\r\nfunction xhs__0x4f79(e){\r\n\tswitch(e){\r\n\t\tcase '0x1e3':\r\n\t\t\treturn \"constructor\";\r\n\t\t\tbreak;\r\n\t\tcase '0x5c6':\r\n\t\t\treturn \"vyxZy\";\r\n\t\t\tbreak;\r\n\t\tcase '0x5ca':\r\n\t\t\treturn \"wcluU\";\r\n\t\t\tbreak;\r\n\t\tcase '0x5d0':\r\n\t\t\treturn \"tOyvN\";\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tthrow new RangeError( e );\r\n\t\t\tbreak;\r\n\t}\r\n}\r\n\r\n(function() {}[xhs__0x4f79('0x1e3')](_0x2764ed[xhs__0x4f79('0x5c6')](_0x2764ed[xhs__0x4f79('0x5ca')], _0x2764ed['\\x74\\x76\\x42\\x47\\x4f']))['\\x63\\x61\\x6c\\x6c'](_0x2764ed[xhs__0x4f79('0x5d0')]));\r\n\r\n(function() {}[\"constructor\"](\"debugger\")[\"call\"](\"action\"));\r\n```\r\n\r\n\r\n\r\n## 实现原理\r\n\r\n[RSS源](https://blog.iwwee.com/atom.xml)： 如果您对本程序的实现原理感兴趣，请关注[我的博客(kajweb - iwwee)](https://blog.iwwee.com)。  \r\n我将不定时地更新本程序的思想、开发过程和思想原理。\r\n\r\n\r\n\r\n**博文列表：**\r\n\r\n- [ ] 【stop-debugger】debugger介绍\r\n- [ ] 【stop-debugger】浏览器拓展的安装与开发\r\n- [ ] 【stop-debugger】HTTP代理原理及实现方法\r\n- [ ] 【stop-debugger】中间人攻击\r\n- [ ] 【stop-debugger】HTTP与HTTPS代理中的差异及细节\r\n- [ ] 【stop-debugger】实现一个最简单的HTTP代理\r\n- [ ] 【stop-debugger】实现一个最简单的HTTPS代理\r\n- [ ] 【stop-debugger】普通代理与隧道代理\r\n- [ ] 【stop-debugger】HTTP和HTTPS共用一个端口原理及实现\r\n- [ ] 【stop-debugger】……\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkajweb%2Fstop-debugger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkajweb%2Fstop-debugger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkajweb%2Fstop-debugger/lists"}