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
aa3d7702
Commit
aa3d7702
authored
Aug 18, 2018
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v2.0:: parse user encoder
parent
9f32a6c6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
21 deletions
+46
-21
app.entry.js
source/app.entry.js
+36
-16
index.js
source/core/asp/index.js
+1
-1
index.js
source/core/aspx/index.js
+1
-1
base.js
source/core/base.js
+4
-0
index.js
source/core/custom/index.js
+1
-1
index.js
source/core/php/index.js
+1
-1
form.js
source/modules/shellmanager/list/form.js
+2
-1
No files found.
source/app.entry.js
View file @
aa3d7702
...
...
@@ -41,7 +41,7 @@ const antSword = window.antSword = {
*/
logs
:
[],
/**
*
核心模块
*
自定义编码器
* @type {Object}
*/
encoders
:
{},
...
...
@@ -127,24 +127,44 @@ antSword['language'] = require('./language/');
// 加载编码
antSword
[
'encoders'
]
=
(
function
(){
var
encoders
=
{
asp
:[],
aspx
:[],
php
:[],
custom
:[]};
let
custom_path
=
path
.
join
(
process
.
env
.
AS_WORKDIR
,
'antData/encoder'
);
var
encoders_path
=
{
asp
:[],
aspx
:[],
php
:[],
custom
:[]};
let
userencoder_path
=
path
.
join
(
process
.
env
.
AS_WORKDIR
,
'antData/encoders'
);
// 初始化
!
fs
.
existsSync
(
custom_path
)
?
fs
.
mkdirSync
(
custom_path
)
:
null
;
// custom
let
es
=
fs
.
readdirSync
(
custom_path
);
if
(
es
){
es
.
map
((
_
)
=>
{
let
farr
=
_
.
split
(
"#"
);
encoders
[
farr
[
0
]].
push
(
farr
[
1
].
slice
(
0
,
-
3
));
});
}
// default
!
fs
.
existsSync
(
userencoder_path
)
?
fs
.
mkdirSync
(
userencoder_path
)
:
null
;
[
'asp'
,
'aspx'
,
'php'
,
'custom'
].
map
((
t
)
=>
{
antSword
[
"core"
][
t
].
prototype
.
encoders
.
map
((
e
)
=>
{
encoders
[
t
].
push
(
e
);
});
encoders
[
t
]
=
encoders
[
t
].
unique
();
!
fs
.
existsSync
(
path
.
join
(
userencoder_path
,
`
${
t
}
`
))?
fs
.
mkdirSync
(
path
.
join
(
userencoder_path
,
`
${
t
}
`
)):
null
;
let
t_path
=
path
.
join
(
userencoder_path
,
`
${
t
}
/encoder/`
);
!
fs
.
existsSync
(
t_path
)
?
fs
.
mkdirSync
(
t_path
)
:
null
;
let
es
=
fs
.
readdirSync
(
t_path
);
if
(
es
){
es
.
map
((
_
)
=>
{
if
(
!
_
.
endsWith
(
".js"
)){
return
}
encoders
[
t
].
push
(
_
.
slice
(
0
,
-
3
));
encoders_path
[
t
].
push
(
path
.
join
(
t_path
,
_
.
slice
(
0
,
-
3
)));
});
}
antSword
[
"core"
][
t
].
prototype
.
user_encoders
=
encoders_path
[
t
];
});
// // custom
// let es = fs.readdirSync(userencoder_path);
// if(es){
// es.map((_)=>{
// console.log(_);
// let farr = _.split("#");
// encoders[farr[0]].push(farr[1].slice(0,-3));
// });
// }
// default
// ['asp','aspx','php','custom'].map((t)=>{
// antSword["core"][t].prototype.encoders.map((e)=>{
// encoders[t].push(e);
// });
// encoders[t] = encoders[t].unique();
// });
// fs.readdirSync(path.join(process.env.AS_WORKDIR,'encoder'),(err,f) => {
// if(err || !f) return ;
// console.debug(f);
...
...
source/core/asp/index.js
View file @
aa3d7702
...
...
@@ -34,7 +34,7 @@ class ASP extends Base {
* @return {array} 编码器列表
*/
get
encoders
()
{
return
(
localStorage
.
getItem
(
'encoders_asp'
)
||
'xxxxdog'
).
split
(
','
)
;
return
[
'xxxxdog'
]
;
}
/**
...
...
source/core/aspx/index.js
View file @
aa3d7702
...
...
@@ -37,7 +37,7 @@ class ASPX extends Base {
* @return {array} 编码器列表
*/
get
encoders
()
{
return
(
localStorage
.
getItem
(
'encoders_aspx'
)
||
"base64,hex"
).
split
(
','
)
;
return
[
"base64"
,
"hex"
]
;
}
/**
...
...
source/core/base.js
View file @
aa3d7702
...
...
@@ -51,6 +51,10 @@ class Base {
](
pwd
,
data
);
}
}
// 解析自定义编码器
this
.
user_encoders
.
map
((
_
)
=>
{
this
.
parseEncoder
(
`
${
_
}
`
);
});
}
/**
...
...
source/core/custom/index.js
View file @
aa3d7702
...
...
@@ -30,7 +30,7 @@ class CUSTOM extends Base {
* @return {array} 编码器列表
*/
get
encoders
()
{
return
(
localStorage
.
getItem
(
'encoders_custom'
)
||
'base64,hex'
).
split
(
','
)
;
return
[
'base64'
,
'hex'
]
;
}
/**
...
...
source/core/php/index.js
View file @
aa3d7702
...
...
@@ -35,7 +35,7 @@ class PHP extends Base {
* @return {array} 编码器列表
*/
get
encoders
()
{
return
(
localStorage
.
getItem
(
'encoders_php'
)
||
"chr,base64"
).
split
(
','
)
;
return
[
"base64"
,
"chr"
,
"chr16"
,
"rot13"
]
;
}
/**
...
...
source/modules/shellmanager/list/form.js
View file @
aa3d7702
...
...
@@ -196,7 +196,8 @@ class Form {
_parseTypes
(
_default
=
'php'
,
_encoder
=
'default'
)
{
let
ret
=
[];
for
(
let
c
in
antSword
[
'core'
])
{
let
encoders
=
antSword
[
'core'
][
c
].
prototype
.
encoders
;
// 加载默认编码器和用户自定义编码器
let
encoders
=
antSword
[
'core'
][
c
].
prototype
.
encoders
.
concat
(
antSword
[
'encoders'
][
c
]);
ret
.
push
({
text
:
c
.
toUpperCase
(),
value
:
c
,
selected
:
c
===
_default
,
...
...
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