绕过 console-ban

console-ban 项目介绍

console-ban 是一个高效且轻量级的 JavaScript 库,其核心功能是有效阻止用户通过浏览器的开发者工具(例如按 F12 键或审查元素功能)访问你的网站资源。这一设计旨在减少非法爬虫活动,并降低潜在的安全威胁。该库通过提供一种简洁易行的方式,实现当用户尝试打开控制台时,能够触发重定向、重写文档内容或执行自定义行为,从而确保网站资源的完整性和安全性。

console-ban.min.js 源代码

/*!
* console-ban v4.1.0
* (c) 2020-2022 fz6m
* Released under the MIT License.
*/
! function(e, t) {
"object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t((e = "undefined" != typeof globalThis ? globalThis : e || self)
.ConsoleBan = {})
}(this, (function(e) {
"use strict";
var t = function() {
return t = Object.assign || function(e) {
for (var t, i = 1, n = arguments.length; i < n; i++)
for (var o in t = arguments[i]) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
return e
}, t.apply(this, arguments)
},
i = {
clear: !0,
debug: !0,
debugTime: 3e3
},
n = 2,
o = function(e) {
return ~navigator.userAgent.toLowerCase()
.indexOf(e)
},
r = function(e, t) {
t !== n ? location.href = e : location.replace(e)
},
c = 0,
a = 0,
f = function(e) {
var t = 0,
i = 1 << c++;
return function() {
(!a || a & i) && 2 === ++t && (a |= i, e(), t = 1)
}
},
l = function(e) {
var t = /./;
t.toString = f(e);
var i = function() {
return t
};
i.toString = f(e);
var n = new Date;
n.toString = f(e), console.log("%c", i, i(), n);
var o, r, c = f(e);
o = c, r = new Error, Object.defineProperty(r, "message", {
get: function() {
o()
}
}), console.log(r)
},
u = function() {
function e(e) {
var n = t(t({}, i), e),
o = n.clear,
r = n.debug,
c = n.debugTime,
a = n.callback,
f = n.redirect,
l = n.write;
this._debug = r, this._debugTime = c, this._clear = o, this._callback = a, this._redirect = f, this._write = l
}
return e.prototype.clear = function() {
this._clear && (console.clear = function() {})
}, e.prototype.debug = function() {
if (this._debug) {
var e = new Function("debugger");
setInterval(e, this._debugTime)
}
}, e.prototype.redirect = function(e) {
var t = this._redirect;
if (t)
if (0 !== t.indexOf("http")) {
var i, n = location.pathname + location.search;
if (((i = t) ? "/" !== i[0] ? "/".concat(i) : i : "/") !== n) r(t, e)
} else location.href !== t && r(t, e)
}, e.prototype.callback = function() {
if ((this._callback || this._redirect || this._write) && window) {
var e, t = this.fire.bind(this),
i = window.chrome || o("chrome"),
r = o("firefox");
if (!i) return r ? ((e = /./)
.toString = t, void console.log(e)) : void
function(e) {
var t = new Image;
Object.defineProperty(t, "id", {
get: function() {
e(n)
}
}), console.log(t)
}(t);
l(t)
}
}, e.prototype.write = function() {
var e = this._write;
e && (document.body.innerHTML = "string" == typeof e ? e : e.innerHTML)
}, e.prototype.fire = function(e) {
this._callback ? this._callback.call(null) : (this.redirect(e), this._redirect || this.write())
}, e.prototype.ban = function() {
this.callback(), this.clear(), this.debug()
}, e
}();
e.init = function(e) {
new u(e)
.ban()
}, Object.defineProperty(e, "__esModule", {
value: !0
})
}));

绕过 console-ban 方法

  1. 运行工具 fiddler

  2. 打开 After Responses 模式

  3. 访问被测网站

  4. fiddler 里找到 console-ban.min.js 请求

  5. 修改 Raw 中的代码, 并点击 Run to Completion, 代码如下

!function(e, t) {
var u = function() {
function e(e) {
this.ban = function() {
};
}
return e;
}();
e.init = function(e) {
};
}(this, (function(e) {
"use strict";
}));
  1. 打开被测网站的控制台

绕过 console-ban的更多相关文章

  1. Scrapy 爬虫 使用指南 完全教程

    scrapy note command 全局命令: startproject :在 project_name 文件夹下创建一个名为 project_name 的Scrapy项目. scrapy sta ...

  2. Scrapy 爬虫

    Scrapy 爬虫 使用指南 完全教程   scrapy note command 全局命令: startproject :在 project_name 文件夹下创建一个名为 project_name ...

  3. Huawei AP3030DN固件升级

    进入uboot: 上电,当出现Press f of F stop Auto-Boot in 3 seconds: 0 时按键盘上的F键 Password for uboot cmd line : 密码 ...

  4. 爬虫:Scrapy17 - Common Practices

    在脚本中运行 Scrapy 除了常用的 scrapy crawl 来启动 Scrapy,也可以使用 API 在脚本中启动 Scrapy. 需要注意的是,Scrapy 是在 Twisted 异步网络库上 ...

  5. Scrapy系列教程(6)------怎样避免被禁

    避免被禁止(ban) 有些网站实现了特定的机制,以一定规则来避免被爬虫爬取. 与这些规则打交道并不easy,须要技巧,有时候也须要些特别的基础. 假设有疑问请考虑联系 商业支持 . 以下是些处理这些网 ...

  6. 从偶然的机会发现一个mysql特性到wooyun waf绕过题

    从偶然的机会发现一个mysql特性到wooyun waf绕过题 MayIKissYou | 2015-06-19 12:00 最近在测试的时候,偶然的机会发现了一个mysql的特性, 为啥是偶然的机会 ...

  7. 【QQ技术】群文件报毒怎样下载?~ 变相绕过QQ复杂检验过程

    刚才又人问我,要是群文件被鉴定为病毒那怎么下载? 我简单说一下吧: 其实qq客户端过滤比较严的,而web段却还是老一套,很多人说出现这个情况其实是腾讯已经把他库里面的文件删了,其实不然 如果源删了,那 ...

  8. Js 关于console 在IE 下的兼容问题

    程序员在开发代码的过程中,使用console作为调试代码过程的一种手段. 发布到测试生产环境,发现IE8 出现加载错误.使用开发者工具调试,发现可以绕过问题. 通过网络搜索和在项目中进行修正. 以下办 ...

  9. 浅析console和浏览器命令行API

    一.console对象: F12或者Control+Shift+i(Win)/ Alt+Command+i(Mac)打开浏览器自带的开发工具,选择顶部tab中的最后一项console,这样你就可以尽情 ...

  10. 在iOS应用程序中使用Frida绕过越狱检测

           阿里聚安全在之前的三篇博客中介绍了利用Frida攻击Android应用程序,整个过程仿佛让开发者开启上帝视角,在本篇博客中,我们将会介绍在iOS应用程序中使用Frida绕过越狱检测.即使 ...

随机推荐

  1. npm : 无法加载文件 D:\Program Files\nodejs\npm.ps1,因为在此系统上禁止运行脚本

    升级node和npm之后,npm run dev 启动一个Vue项目,报错如下: npm : 无法加载文件 D:\Program Files\nodejs\npm.ps1,因为在此系统上禁止运行脚本. ...

  2. 用python 将数字每三组分割

    def cut_num(n, sep=','): # 第一个参数是要传递的数字,第二个是分隔符 s = str(abs(n))[::-1] groups = [] i = 0 while i < ...

  3. Linux终端命令之screen

    screen的功能 screen的功能大体有三个: 会话恢复:只要Screen本身没有终止,在其内部运行的会话都可以恢复.这一点对于远程登录的用户特别有用--即使网络连接中断,用户也不会失去对已经打开 ...

  4. web移动端常见问题(二)

    1.input光标颜色 默认情况下,光标颜色与字体颜色color相同,但也可以通过caret-color属性来单独设置 但是IOS的光标与字体颜色无关,默认是蓝色 可以单独设置光标颜色,这样ios也有 ...

  5. Ant Design X:卓越的AI界面解决方案

    Ant Design X:卓越的AI界面解决方案 ​​ Ant Design X 是 Ant Design 的全新 AGI 组件库,旨在帮助开发者更轻松地研发 AI 产品用户界面.Ant Design ...

  6. 【Kotlin】select简介

    1 前言 ​ 协程的 select 是一种用于异步操作的选择器,它允许同时等待多个挂起函数的结果,并在其中一个完成时执行相应的操作. ​ 能够被 select 的事件都是 SelectClause,在 ...

  7. C# 企业微信消息推送对接,实现天气预报推送

    C# 企业微信消息推送对接,实现天气预报推送 迷恋自留地 准备工作 需要获取的东西1. 企业Id,2.应用secret 和 应用ID 获取企业id 注册完成后,在我的企业=>企业信息=>最 ...

  8. Taro微信小程序获取Tab页可视区域高度

    前情 公司有自己的小程序项目,因公司主要技术栈为react,所以选择了Taro来开发,Taro是京东出品的多端统一开发解决方案,用来开发小程序也相比用原生开发,在开发体验上好很多,而且还能使用成熟的R ...

  9. ie浏览器设置允许跨域

    前情 在访问测试搭建的测试环境的时候,发现接口因为跨域全部失败了,服务端又不想设置允许跨域,又急于使用,于是想到是不是可以使用跨域浏览器,上一次已解决chrome允许跨域,这一次来设置IE允许跨域 放 ...

  10. shell脚本实现Base64加解密

    暂时不支持中文字符 脚本: #!/bin/bash # ##################################################################### # ...