Skip to content

nice bash trick - how to send data over the net only with bash interna

Quite some time ago I found a real cool bash trick in a forum, that I didn't know. And when it's written here, it will help you and it will help me to find it again (if I forget it ;-) ).

You can easily make a network connection and send data through it with this:

cat file.txt > /dev/tcp/192.168.xxx.xxx/1337


This will send data to thie ip 192.168.xxx.xxx to the port 1337 with tcp. I tested it with netcat and it works fine. Until I have seen this, I usually worked with netcat. But with this little trick, I don't need netcat on every machine I use to send data.

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

The author does not allow comments to this entry

Add Comment

Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
Form options

Submitted comments will be subject to moderation before being displayed.