Skip to main content
1 of 5
h3rrmiller
  • 13.5k
  • 5
  • 34
  • 42

/dev/tcp listen instead of nc listen

With a netcat listener like:

nc -l <port> < ~/.bashrc

I can grab my .bashrc on a new machine (doesn't have nc or LDAP) with:

cat < /dev/tcp/<ip>/<port> > ~/.bashrc

My 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 (no ssh, no nc, no LDAP, no yum, I cant install new software per policy, and they are not connected to the internet)

h3rrmiller
  • 13.5k
  • 5
  • 34
  • 42