绕过 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. 双重检查锁定及单例模式(ibm社区)

    本文来自ibm社区 单例创建模式是一个通用的编程习语.和多线程一起使用时,必需使用某种类型的同步.在努力创建更有效的代码时,Java 程序员们创建了双重检查锁定习语,将其和单例创建模式一起使用,从而限 ...

  2. 基于antlr的表达式解析器

    package formula; import java.util.HashMap; import java.util.List; import java.util.Map; import org.a ...

  3. Java深度历险(三)——Java线程​:基本概念、可见性与同步

    开发高性能并发应用不是一件容易的事情.这类应用的例子包括高性能Web服务器.游戏服务器和搜索引擎爬虫等.这样的应用可能需要同时处理成千上万个请求.对于这样的应用,一般采用多线程或事件驱动的架构.对于J ...

  4. 元数建模工具之chiner

    chiner,发音:[kaɪˈnər],使用React+Electron+Java技术体系构建的一款元数建模平台. 下载地址:https://gitee.com/robergroup/chiner/r ...

  5. 定时任务监控服务Healthchecks

    GitHub地址:https://github.com/healthchecks/healthchecks 官方文档:https://healthchecks.io/docs/ 按照步骤进行安装: 1 ...

  6. Graylog之安装

    Graylog是一个开源的日志聚合.分析.审计.展现和预警工具.功能上和ELK类似,但又比ELK要简单,依靠着更加简洁,高效,部署使用简单的优势很快受到许多人的青睐 安装部署: 单机部署,最小化部署 ...

  7. 探索实用的Java工具类

    1.排序 有时需要对集合进行排序.此时可以使用Collections的sort方法. List<Integer> list = new ArrayList<>(); list. ...

  8. python多版本

    1.分别下载并安装两个版本的python 2.去安装的文件夹中将python.exe 和pythonw.exe改名加上版本号 3.将python.exe文件目录和当前目录下的Scripts目录都加到用 ...

  9. ng-alain: i18n

    https://github.com/ng-alain/delon/blob/master/packages/theme/src/services/i18n/i18n.ts interface Ala ...

  10. Arch Linux 安装完成后配置声音

    安装完 Arch Linux 后,虽然已经装了 alsa-utils,但是仍然可能出现无法播放声音的情况,这里记录了一种解决方案,在我的 Dell 上成功. 如果使用 alsamixer 解除静音后还 ...