-
Notifications
You must be signed in to change notification settings - Fork 2
/
rest.java
26 lines (20 loc) · 882 Bytes
/
rest.java
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
//Use the following Slack tokens to notify our channels:
//Token: xoxa-138345894953-696810253864-FOS0555nxMGs5eUucRWLnluySCvMvUtU
//Token: xoxa-854319131133-068839258816-Nm7tVqUt50t1Tc1gqdG7FQbLzelCbkpk
package net.kvak.log4shell;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestHeader;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class RESTController {
@RestController
public static class Log4ShellController {
private static final Logger logger = LogManager.getLogger("Log4shellApplication");
@RequestMapping("/")
String home(@RequestHeader(value = "User-Agent") String ua) {
logger.info("User-agent: {}", ua);
return "<html>Hello from Log4Shell</html>";
}
}
}