I'm trying to pass a windows command into a linux netcat shell and then read back the output.
So far I have:
cat <( printf 'ipconfig\n' )| nc -v 137.148.70.243 443
Which when copied and pasted into my pretty linux terminal gets the ip info from the connected windows machine.
However, when I try to call the same command via bash, I get the following error:
./DumpIP.sh: line n: syntax error near unexpected token `('
What gives?
EDIT
So if I try:
#!/bin/sh
cat <( printf 'ipconfig\n' )| nc -l
I get
./DumpCreds.sh: line 2: syntax error near unexpected token `('
./DumpCreds.sh: line 2: `cat <( printf 'ipconfig\n' )| nc -l'
catandprintf? Use a simpleecho ipconfig.nc -lon the other side) works exactly as expected.