With a netcat listener like:nc -l <port> < ~/.bashrcI can grab my .bashrc on a new machine (doesn't have nc or LDAP) with:cat < /dev/tcp/<ip>/<port> > ~/.bashrcMy question is: Is there a way to mimic the capabilities of nc -l <port> in my first line with /dev/tcp instead of nc?The machines I'm working on are extremely hardened lab/sandbox environment RHEL (no ssh, no nc, no LDAP, no yum, I can't install new software, and they are not connected to the internet)
/dev/tcp listen instead of nc listen
bash;shell;rhel;io redirection;netcat
As perl will be installed.perl -MIO::Socket::INET -ne 'BEGIN{$l=IO::Socket::INET->new(  LocalPort=>1234,Proto=>tcp,Listen=>5,ReuseAddr=>1);  $l=$l->accept}print $l $_' < ~/.bashrcwould work, unless a local firewall doesn't allow incoming connections to 1234.If socat is installed:socat -u - tcp-listen:1234,reuseaddr < ~/.bashrcIf zsh is installed:zmodload zsh/net/tcpztcp -ld3 1234 && # start listening socket on fd 3  ztcp -ad4 3 && # accept connection on fd 4  ztcp -c 3 && # close the listening socket that is no longer needed  cat < ~/.bashrc >&4 && # send the data  ztcp -c 4 # close the communication socket to tell the other end we're finished