Last active
August 29, 2015 14:16
-
-
Save djromero/2b5d3d15d68d725ac6b8 to your computer and use it in GitHub Desktop.
Port forwarding with netcat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# forward port YYYY to remote-host:XXXX | |
forwarder-host$ mkfifo fifo_port_XXXX | |
forwarder-host$ nc -k -l YYYY 0<fifo_port_XXXX | nc remote-host XXXX 1>fifo_port_XXXX | |
# now we can access remote-host:XXXX in a machine with access only thru forwarder-host | |
local-host$ curl forwarder-host:YYYY | |
<output from remote-host server> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment