Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
a9b39301
Commit
a9b39301
authored
Jun 09, 2021
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhance&Fix:Core/JSP_JS) 修正 JSP_JS decoder 入口函数名, 新增base64解码器
parent
bbe17532
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
3 deletions
+36
-3
base64.js
source/core/jsp_js/decoder/base64.js
+33
-0
default.js
source/core/jsp_js/decoder/default.js
+1
-1
index.js
source/core/jsp_js/index.js
+2
-2
No files found.
source/core/jsp_js/decoder/base64.js
0 → 100644
View file @
a9b39301
/**
* jsp_js::base64解码器
*/
'use strict'
;
module
.
exports
=
{
/**
* @returns {string} asenc 将返回数据base64编码
*/
asoutput
:
()
=>
{
return
`function asenc(str){
importPackage(Packages.sun.misc);
importPackage(Packages.java.util);
var ret = "";
try {
ret = new Base64().getEncoder().encodeToString(str.getBytes());
} catch (e) {
ret = new BASE64Encoder().encode(str.getBytes());
}
ret = ret.replaceAll("\\r|\\n", "");
return ret;
}`
.
replace
(
/
\n\s
+/g
,
''
);
},
/**
* 解码 Buffer
* @param {Buffer} buff 要被解码的 Buffer
* @returns {Buffer} 解码后的 Buffer
*/
decode_buff
:
(
buff
)
=>
{
return
Buffer
.
from
(
buff
.
toString
(),
'base64'
);
}
}
\ No newline at end of file
source/core/jsp_js/decoder/default.js
View file @
a9b39301
...
...
@@ -9,7 +9,7 @@ module.exports = {
* @returns {string} asenc 加密返回数据的函数
*/
asoutput
:
()
=>
{
return
`function as
output
(str){
return
`function as
enc
(str){
return str;
}
`
.
replace
(
/
\n\s
+/g
,
''
);
...
...
source/core/jsp_js/index.js
View file @
a9b39301
...
...
@@ -45,7 +45,7 @@ class JSP_JS extends Base {
}
get
decoders
()
{
return
[
"default"
];
return
[
"default"
,
"base64"
];
}
/**
* HTTP请求数据组合函数
...
...
@@ -124,7 +124,7 @@ class JSP_JS extends Base {
output.append("ERROR:// " + e.toString());
}
try {
response.getWriter().print(tag_s + as
output
(output.toString()) + tag_e);
response.getWriter().print(tag_s + as
enc
(output.toString()) + tag_e);
} catch (e) {}
`
.
replace
(
/
\n\s
+/g
,
''
).
replace
(
/#randomPrefix#/g
,
this
.
__opts__
.
otherConf
[
"random-Prefix"
]);
// 使用编码器进行处理并返回
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment