remote port redirection

I want to get data from a remote machine, and serve it on a local machine.

Get the remote data first.

I am using telnet (yes I know it is a security issue) but this is what is provided.

I have to provide a username hence the "a45wg" bit.

echo "a45wg" | nc telnet.reversebeacon.net 7000 

Now I see this works... we want to output this to a local named pipe.

Create Named Pipe

To create a NamedPipe we do

mkfifo lclq

This stands for LoCaLQ !!

I also want to use the utility called tee, this is a pipeline to stdout utility.

So the command looks like this

mkfifo lclq
echo "a45wg" | nc telnet.reversebeacon.net 7000 | tee -a > lclq

With pv so I can see pipe volume

cat command.txt | nc -t telnet.reversebeacon.net 7000 | pv | tee > lclq

Can I read from the Named Pipe

Before we go any further can we read from this named pepe ?

tail -f lclq

as I see

DX de SM6FMB-#:  10104.4  LZ2LP          CW    13 dB  22 WPM  CQ      0641Z
DX de DO4DXA-#:   7031.7  EA3JZ          CW    24 dB  18 WPM  CQ      0641Z
DX de OL7M-#:    14005.9  SM6OID         CW    21 dB  17 WPM  CQ      0641Z
DX de KM3T-#:     3513.9  K8ZBN          CW    17 dB  29 WPM  CQ      0641Z
DX de DK9IP-#:    7030.8  OH6NPV         CW     0 dB  28 WPM  CQ      0641Z
DX de W4KKN-#:    3513.9  K8ZBN          CW    26 dB  29 WPM  CQ      0642Z
DX de W1NT-#:     7031.6  EA3JZ          CW    28 dB  19 WPM  CQ      0642Z
DX de K3LR-#:     3513.9  K8ZBN          CW    30 dB  29 WPM  CQ      0642Z
DX de K3LR-#:     7031.7  EA3JZ          CW    20 dB  22 WPM  CQ      0642Z
DX de KM3T-2-#:   3513.9  K8ZBN          CW    21 dB  29 WPM  CQ      0642Z
DX de KM3T-2-#:   7031.6  EA3JZ          CW    21 dB  19 WPM  CQ      0642Z
DX de LZ7AA-#:    7041.7  RA3GFI         PSK63 21 dB  63 BPS  CQ      0642Z

This looks good.

Serve Data Locally

We stop the tail -f, however the netcat output will also die.

So you need to start it again.

Now we cat the fifo device into netcat as a server