mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-15 20:05:13 +02:00
[pitboss] phase 14: Track B — Java harness emitter shapes
This commit is contained in:
parent
7628c48930
commit
bd1bd0ce84
36 changed files with 1793 additions and 155 deletions
20
tests/dynamic_fixtures/java/servlet_dopost/Benign.java
Normal file
20
tests/dynamic_fixtures/java/servlet_dopost/Benign.java
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// Phase 14 — servlet doPost, benign.
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class Benign {
|
||||
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws Exception {
|
||||
System.out.print("__NYX_SINK_HIT__\n");
|
||||
String unused = req.getBody();
|
||||
if (unused == null) unused = "";
|
||||
String[] cmd = {"/bin/sh", "-c", "echo hello"};
|
||||
Process p = Runtime.getRuntime().exec(cmd);
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
System.out.println(line);
|
||||
}
|
||||
p.waitFor();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue