绕过 console-ban
绕过 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 方法
运行工具
fiddler

打开
After Responses模式

访问被测网站

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

修改
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";
}));
- 打开被测网站的控制台

绕过 console-ban的更多相关文章
- Scrapy 爬虫 使用指南 完全教程
scrapy note command 全局命令: startproject :在 project_name 文件夹下创建一个名为 project_name 的Scrapy项目. scrapy sta ...
- Scrapy 爬虫
Scrapy 爬虫 使用指南 完全教程 scrapy note command 全局命令: startproject :在 project_name 文件夹下创建一个名为 project_name ...
- Huawei AP3030DN固件升级
进入uboot: 上电,当出现Press f of F stop Auto-Boot in 3 seconds: 0 时按键盘上的F键 Password for uboot cmd line : 密码 ...
- 爬虫:Scrapy17 - Common Practices
在脚本中运行 Scrapy 除了常用的 scrapy crawl 来启动 Scrapy,也可以使用 API 在脚本中启动 Scrapy. 需要注意的是,Scrapy 是在 Twisted 异步网络库上 ...
- Scrapy系列教程(6)------怎样避免被禁
避免被禁止(ban) 有些网站实现了特定的机制,以一定规则来避免被爬虫爬取. 与这些规则打交道并不easy,须要技巧,有时候也须要些特别的基础. 假设有疑问请考虑联系 商业支持 . 以下是些处理这些网 ...
- 从偶然的机会发现一个mysql特性到wooyun waf绕过题
从偶然的机会发现一个mysql特性到wooyun waf绕过题 MayIKissYou | 2015-06-19 12:00 最近在测试的时候,偶然的机会发现了一个mysql的特性, 为啥是偶然的机会 ...
- 【QQ技术】群文件报毒怎样下载?~ 变相绕过QQ复杂检验过程
刚才又人问我,要是群文件被鉴定为病毒那怎么下载? 我简单说一下吧: 其实qq客户端过滤比较严的,而web段却还是老一套,很多人说出现这个情况其实是腾讯已经把他库里面的文件删了,其实不然 如果源删了,那 ...
- Js 关于console 在IE 下的兼容问题
程序员在开发代码的过程中,使用console作为调试代码过程的一种手段. 发布到测试生产环境,发现IE8 出现加载错误.使用开发者工具调试,发现可以绕过问题. 通过网络搜索和在项目中进行修正. 以下办 ...
- 浅析console和浏览器命令行API
一.console对象: F12或者Control+Shift+i(Win)/ Alt+Command+i(Mac)打开浏览器自带的开发工具,选择顶部tab中的最后一项console,这样你就可以尽情 ...
- 在iOS应用程序中使用Frida绕过越狱检测
阿里聚安全在之前的三篇博客中介绍了利用Frida攻击Android应用程序,整个过程仿佛让开发者开启上帝视角,在本篇博客中,我们将会介绍在iOS应用程序中使用Frida绕过越狱检测.即使 ...
随机推荐
- apache tomcat 6集群负载和session复制
无意间看到tomcat 6集群的内容,就尝试配置了一下,还是遇到很多问题,特此记录.apache服务器和tomcat的连接方法其实有三种:JK.http_proxy和ajp_proxy.本文主要介绍最 ...
- 性能检测工具之Lighthouse
转载:https://mp.weixin.qq.com/s?src=11×tamp=1618929340&ver=3020&signature=oXyx*RDLXjN ...
- 理解Java BlockingQueue
数据结构与算法是天生一对. BlockingQueue叫做阻塞队列,在Java线程池相关的实现中有广泛的使用. BlockingQueue实现的功能如下: 当队列为空时,往队列中读数据将被阻塞. 当队 ...
- Java基础 —— 集合(一)
集合(一) 数组和集合的区别 数组是固定长度的数据结构,而集合是动态的数据结构 数组可以包含基本数据类型和对象,集合只能包含对象 数组只能存放同一类型的数据,而集合可以蹲房不同类型的 数组可以直接访问 ...
- FineReport取消强制分页和调整宽度的设置方法
在decision里,找到管理系统-目录管理,打开相应挂载的报表,在参数设置里,添加以下内容: _bypagesize_ 字符串 false
- mybatis-plus 使用In查询
第一种在Dao接口中自定义SQL查询,拼接xml字符串 UserDaoMapper.java @Select("<script>" +"select * fr ...
- Consul-template, Nginx 实现Thrift Consul负载均衡
整体架构 我们先看下整个框架的架构是什么样子的,这里我们有三个服务提供者和三个服务调用者,它们通过 Consul 和 Nginx,以及 Consul-template 来实现负载均衡. 说明 本例子是 ...
- IntelliJ IDEA生成jar包运行报Error:A JNI error has occurred,please check your installation and try again
首先介绍一下IntelliJ IDEA生成jar包的方式: 1.打开项目,打开FIile->Project Structure...菜单.如下图: 选中Artifacts,点+号,选择JAR,再 ...
- Qt开发经验小技巧246-250
在编写类中有时候需要对变量进行赋值和取值,这时候一般用 setxxx.getxxx 之类的函数进行处理,而且往往里面就一行代码,这时候你可能会思考为何不直接将变量改成public暴露出来使用,还可以省 ...
- 七牛云API的使用包括Ajax上传功能及凭证生成
1.服务端(主要用于生成上传,删除,下载等凭证) 引入Qiniu的Get包.包就叫Qiniu. //上传凭证 //上传凭证:其余凭证类似的写法 public string UpLoadToken() ...