I'm working on a research project, which involves remoting into a Windows machine from Linux via NetCat. The command to open up a listener is
nc.exe -Ldp PORT -e cmd.exe
And the command to connect from Linux is
nc -v IP PORT
When issuing the second command on Linux, I'm dropped into a cmd shell in whatever directory NetCat is in. And then from here I can issue DOS commands willy-nilly.
But alas, I can't seem to pass NetCat a DOS command to execute from my Linux machine. It would be really cool if I could just pipe my DOS commands into the command to connect to the NetCat listener. Then I don't have to worry about connecting via Linux, waiting to drop into a CMD shell, and then issue my DOS command. I could just string 'em all together.
How can I pipe DOS commands into NetCat in Linux such that it connects to the Windows machine and executes my commands?