MCPcopy Create free account
hub / github.com/0linlin0/CyberBox / getshell

Method getshell

Skay_Exp/src/tools/nc/NetcatServer.java:73–92  ·  view source on GitHub ↗
(int port)

Source from the content-addressed store, hash-verified

71 }
72
73 private static boolean getshell(int port) throws Exception {
74 connectionSocket = null;
75 ServerSocket serverSocket = new ServerSocket(port, 0);
76 Scanner sc = new Scanner(System.in);
77 boolean complete;
78 boolean a =sc.hasNext();
79 while (a){
80 if (connectionSocket == null) {
81 connectionSocket = serverSocket.accept();
82 }
83 DataOutputStream outToClient = new DataOutputStream(connectionSocket.getOutputStream());
84 String cmd = getcmd(sc);
85 outToClient.writeBytes(cmd + "\n");
86 upload();
87 outToClient.writeBytes(cmd + "\n");
88 upload();
89 }
90 connectionSocket.close();
91 return true;
92 }
93
94 /**
95 * In upload mode, server reads data from its standard input device and writes it to the socket.

Callers 1

mainMethod · 0.95

Calls 2

getcmdMethod · 0.95
uploadMethod · 0.95

Tested by

no test coverage detected