Created
March 26, 2014 16:36
-
-
Save gerjantd/9787538 to your computer and use it in GitHub Desktop.
Bash/nc: netcat as a simple ftp server
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
DATA TRANSFER | |
The example in the previous section can be expanded to build a basic data transfer model. Any information input into one end of the connection will be output to the other end, and input and output can be easily captured in order to emulate file trans‐ | |
fer. | |
Start by using nc to listen on a specific port, with output captured into a file: | |
$ nc -l 1234 > filename.out | |
Using a second machine, connect to the listening nc process, feeding it the file which is to be transferred: | |
$ nc host.example.com 1234 < filename.in | |
After the file has been transferred, the connection will close automatically. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment