Commit 0cc3f0d3 authored by Medicean's avatar Medicean

(Enhance: Chunked) 分块传输自动根据黑名单字符(eg: eval, assert, execute, response 等)进行随机切割(thx @phith0n)

parent a5cbe4c1
......@@ -2,6 +2,12 @@
> 有空会补补BUG、添添新功能。
> 同时也欢迎大家的参与!感谢各位朋友的支持! .TAT.
## `v(2.0.6-dev)`
### 后端模块
* 分块传输自动根据黑名单字符(eg: eval, assert, execute, response 等)进行随机切割(thx @phith0n)
## 2019/03/04 `v(2.0.5)`
### 后端模块
......
......@@ -450,11 +450,19 @@ class AntRead extends Readable {
// 重写自定义的可读流的 _read 方法
_read() {
let blakwords = /eval|assert|base64_decode|preg_replace|call_user_func|create_function|str_replace|array_map|system|popen|exec|function_exists|passthru|shell_exec|frombase64string|unsafe|response|execute/i;
let step = this.randomNum(this.o.step, this.o.stepmax);
if (this.index >= this.chunk.length) {
this.push(null);
}else{
this.push(this.chunk.substring(this.index, this.index + step) + "");
let _subcode = this.chunk.substring(this.index, this.index + step) + "";
let m = _subcode.match(blakwords);
if(m) {
let sub_step = this.randomNum(1, m[0].length - 1);
_subcode = _subcode.substring(0, m.index + sub_step);
step = m.index + sub_step;
}
this.push(_subcode);
}
this.index += step;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment