Playing with the netcat chat

Tips and Tricks for Networking

Moderator: jkerr82508

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Playing with the netcat chat

Postby viking60 » 14 Nov 2012, 11:17

Netcat is pretty much a a Swiss Army knife of networks, and can be used for a lot.
This includes a Command line chat in a terminal.
So I googled and got tips how to do this all over the place....and it did not work.
Most places wanted me to do a.

Code: Select all

netcat -l -p 6666
6666 is an example of a portnumber you can pick another one.

So I started that on my Mandriva box and went to an Arch computer and entered:

Code: Select all

nc <IP_TO_THE_MANDRIVABOX> 6666

And as I said it did not work :berserk2

So I connected to my Mandriva box via SSH and altered the command like this:

Code: Select all

nc -l 6666

Then I opened another terminal on my Archbox and entered

Code: Select all

nc 192.168.0.3 5555
Where 192.168.0.3 is the IP of the Mandriva box
Now the both terminals were in ready to write/receive mode and I wrote Smalahove (the first thing any Berserk can think of) and oh wonder it immediately poped up in my Mandriva terminal.
Answering in the Mandriva terminal immediatly pooped up on my Arch terminal so the chat was working to perfection. +1
To stop it, just hit CTRL+C

How can this be practical you say?
I dunno :confused I did say I was playing.....
But just maybe there will come tips later that will make you see the light - who knows....
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Re: Playing with the netcat chat

Postby rolf » 14 Nov 2012, 15:15

:gimme Smalahove!?! :o I keep having to tell GF (from VN), "No bones, no eyeballs, no chicken feet!", and this does not help. :naughty:

The author describes this as a "bare-metal" program and that is along the lines of my inclinations, aka "nuts and bolts". I can imagine a cool, lean and mean irc session with one individual for some project or something, for example. However, like many cool things, there is not much current demand atm, hereabouts.

In Mandriva 2011, there is netcat-gnu, or netcat-openbsd, or netcat-traditional and I have the last installed. Also, I see gtknetcat, which looks interesting, as well:

Code: Select all

[rolf@localhost ~]$ urpmq -i gtknetcat
Name        : gtknetcat
Version     : 0.1
Release     : 5mdv2011.0
Group       : Graphical desktop/Other
Size        : 59323                        Architecture: x86_64
Source RPM  : gtknetcat-0.1-5mdv2011.0.src.rpm
URL         : http://lxde.sourceforge.net/
Summary     : Easy-to-use and handy GUI frontend of netcat (nc) command
Description :
Easy-to-use and handy GUI frontend of netcat (nc) command letting you
transfer files to another computer via direct wired connection.


Back to "bare-metal", there is /usr/share/doc/netcat-traditional/README that is quite rich with explanation, including reference to some scripts, such as /usr/share/doc/netcat-traditional/scripts/irc that might be of interest to Fearless Leader. All in all, netcat looks like a very good program.
Thanks for the Tip! :s

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Playing with the netcat chat

Postby viking60 » 14 Nov 2012, 16:00

Ah ... Smalahove is really close to your favorite then - Does a skull even qualify as bones? And yes it has eyeballs but other than that...
Image
I have to admit it is quite good +1 Have some Beer and Aquavit with it and you have a perfect meal. (the traditional way to eat the eye is to pick it out and put it in the Aquavit before you take the lot).

And netcat is a bit insecure so it has more or less been replaced by socat.... I guess I will come back to it.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Playing with the netcat chat

Postby viking60 » 14 Nov 2012, 16:08

Try

Code: Select all

nc viking60.no-ip.org 5566
to chat with me right now!
Edit:
No that does not work.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Re: Playing with the netcat chat

Postby rolf » 14 Nov 2012, 16:53

viking60 wrote:Try

Code: Select all

nc viking60.no-ip.org 5566
to chat with me right now!
Edit:
No that does not work.

Don't you have to give some option switches?

Code: Select all

-p port      local port number (port numbers can be individual or ranges: lo-hi [inclusive])
...
-s addr      local source address
...
:confused

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Playing with the netcat chat

Postby viking60 » 14 Nov 2012, 18:20

Yes on the server side - that was the client / your side
I Noticed there is a difference between Mandriva and Arch (between netcat versions - I guess) so in Arch I have to use the -p switch too.
The reason the above attempt did not work is due to the firewall which is fine...Netcat is good for testing stuff like that.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"


Return to “Networking”