MCPcopy Create free account
hub / github.com/Drun1baby/JavaSecurityLearning / exec

Method exec

JavaSecurity/Java Basic/Java 回显技术/fdEcho.java:8–23  ·  view source on GitHub ↗
(String cmd)

Source from the content-addressed store, hash-verified

6
7public class fdEcho {
8 public static String exec(String cmd) {
9 try {
10 Process process = Runtime.getRuntime().exec(cmd);
11 InputStream fis = process.getInputStream();
12 InputStreamReader isr = new InputStreamReader(fis);
13 BufferedReader br = new BufferedReader(isr);
14 String line = null;
15 StringBuilder builder = new StringBuilder();
16 while ((line = br.readLine()) != null) {
17 builder.append(line);
18 }
19 return builder.toString();
20 } catch (Exception ignore) {
21 }
22 return "";
23 }
24
25 public static String ipToHex(String ip) {
26 StringBuilder sb = new StringBuilder();

Callers 15

fdEchoClass · 0.95
VulAutoCloseableMethod · 0.80
ExploitMethod · 0.80
setCmdMethod · 0.80
getPropertiesMethod · 0.80
doFilterMethod · 0.80
doFilterMethod · 0.80
requestInitializedMethod · 0.80
serviceMethod · 0.80
serviceMethod · 0.80
CalcClass · 0.80
readObjectMethod · 0.80

Calls 2

getInputStreamMethod · 0.80
toStringMethod · 0.45

Tested by 3

serviceMethod · 0.64
readObjectMethod · 0.64
doFilterMethod · 0.64