绕过 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绕过越狱检测.即使 ...
随机推荐
- axios获取上传进度报错xhr.upload.addEventListener is not a function
错误问题 Vue:xhr.upload.addEventListener is not a function 这个问题是因为mockjs改动了axios里面XMLHttpRequest对象致使的 根据 ...
- Python通过requests模块处理form-data请求格式
1.安装 requests_toolbelt 模块,引入该模块下的 MultipartEncoder 2.在 请求体 中使用该模块函数,请求头中增加对应参数值 from requests_toolbe ...
- Docker Registry之删除镜像、垃圾回收
Docker仓库在2.1版本中支持了删除镜像的API,但这个删除操作只会删除镜像元数据,不会删除层数据.在2.4版本中对这一问题进行了解决,增加了一个垃圾回收命令,删除未被引用的层数据.本文对这一特性 ...
- 论文解读《The Philosopher’s Stone: Trojaning Plugins of Large Language Models》
发表时间:2025 期刊会议:Network and Distributed System Security (NDSS) Symposium 论文单位:Shanghai Jiao Tong Univ ...
- angr-ctf
angr 的项目地址 https://github.com/jakespringer/angr_ctf angr实战 00 拖到IDA 就是输入正确的指令才能通关 这次试一下用angr来解题 goah ...
- 鸿蒙应用开发从入门到入行 - 篇8:Tabs选项卡页签视图切换
鸿蒙应用开发从入门到入行 第八天 - Tabs选项卡 导读:在本篇文章里,您将掌握使用Tabs选项卡做栏目分类,这是未来应用开发中极为常用的组件 首先说一声抱歉,比较忙很久没更新了.但放心吧,目前该忙 ...
- R数据分析:反事实框架和因果中介的理论理解
其实很早之前给大家写中介分析的做法的时候我也有思考过当中介变量或者因变量不是连续变量的时候,中介怎么做?或者说这个时候中介的结果如何解释?当时反正是一直没有太想明白这些问题,毕竟这些情况在发表的文献中 ...
- [SQL]null值被比较的结果问题
场景还原 有一个字段是 已删除 deleted 如果0 则是未删除 如果1 则是已删除 我写的where条件是 deleted != 1 然后数据库里面这个字段的值都是null 我当时就想,null值 ...
- Qt/C++音视频开发72-倍速推流/音视频同步倍速推流/不改变帧率和采样率/低倍速和高倍速
一.前言 最近多了个新需求,需要倍速推流,推流界的扛把子obs也有倍速推流功能,最高支持到两倍速.这里所说的倍速,当然只限定在文件,只有文件才可能有倍速功能,因为也只有文件才能倍速解码播放.实时视频流 ...
- Qt开源作品26-通用按钮地图效果
一.前言 在很多项目应用中,需要根据数据动态生成对象显示在地图上,比如地图标注,同时还需要可拖动对象到指定位置显示,能有多种状态指示,安防领域一般用来表示防区或者设备,可以直接显示防区号,有多种状态颜 ...