mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-09 19:45:13 +02:00
Dynamic (#77)
This commit is contained in:
parent
55247b7fcd
commit
991c84a1eb
1464 changed files with 225448 additions and 1985 deletions
23
tests/dynamic_fixtures/java/spring_controller/Vuln.java
Normal file
23
tests/dynamic_fixtures/java/spring_controller/Vuln.java
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Spring `@RestController`, vulnerable.
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/run")
|
||||
public class Vuln {
|
||||
@Autowired
|
||||
private CommandRunner runner;
|
||||
|
||||
@GetMapping
|
||||
public String run(@RequestParam("payload") String payload) throws Exception {
|
||||
System.out.print("__NYX_SINK_HIT__\n");
|
||||
CommandRunner r = (runner != null) ? runner : new CommandRunner();
|
||||
String out = r.run("echo hello " + payload);
|
||||
System.out.print(out);
|
||||
return out;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue