LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-14-2012, 10:14 AM   #1
A-Rap
LQ Newbie
 
Registered: Jul 2011
Location: Estonia
Distribution: Debian
Posts: 4

Rep: Reputation: Disabled
Using BusyBox version of netcat for listening tcp port


I need to listen some arbitrary port inside the Linux embedded box. I chose port 6660 because it is meant for uncrypted connections anyway and since the Linux box running customized Linux OS there are not many ports open. I found out that netcat (nc on command line) would be the easiest and the best ready to go solution for that, so I do not have to start programming some C program for that purpose.

I managed to grasp the command and options and I implemented simplest way to listen plain text on my PC from another PC like this:

sven@sven:~$ nc 192.168.4.110 6660
sven@sven:~$ hello there!
anotherUser@userg:~$ nc -l -p 6660
anotherUser@userg:~$ hello there!

But the case is that the netcat tool is coming with the busybox package on that Linux box. And I am not sure what would be the syntax how to listen a port (6660 for example). I always get the same dialog:

~ # nc -l -p 6660
BusyBox v1.17.1 (Debian 1:1.17.1-8) multi-call binary.
Usage: nc [IPADDR PORT]
Open a pipe to IP:PORT
Also I've tried many other ways how to implement listening but cant get it done. I assume at least it would give me any options? also

nc -h
or

nc --help
dont give any "minus" options

But sending the text from Linux embedded box to my PC works:

~ # nc 192.168.4.130 6660
fsdf
tere
^C
~ #
sven@sven:~$ nc -l -p 6660
fsdf
tere
Linux embedded box has fully functional net connection inside the same local network and has existing eth0 and lo links

eth0 Link encap:Ethernet HWaddr D0:E3:47:00:03:5F
inet addr:192.168.4.179 Bcast:192.168.4.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:28046281 errors:0 dropped:0 overruns:0 frame:0
TX packets:428464 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2458890234 (2.2 GiB) TX bytes:83021395 (79.1 MiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2282 errors:0 dropped:0 overruns:0 frame:0
TX packets:2282 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:444956 (434.5 KiB) TX bytes:444956 (434.5 KiB)

So that version of netcat does not support lsitening? Are there any simple workarounds?
Thanks in advance!

Töövõite!
 
Old 03-14-2012, 05:26 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,200

Rep: Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563
You never know with busybox apps. They are compressed as far as they can go. Not all have full functionality.


http://www.digipedia.pl/usenet/thread/18071/7733/
 
Old 03-14-2012, 05:42 PM   #3
zk1234
4MLinux Maintainer
 
Registered: Oct 2010
Location: Poland
Distribution: 4MLinux, Slackware
Posts: 700

Rep: Reputation: 133Reputation: 133
It looks that you're not the only one with this problem:
http://freecode.com/projects/partedm...eleases/342109

Perhaps you should do the same (real "nc").
 
Old 03-15-2012, 04:31 AM   #4
A-Rap
LQ Newbie
 
Registered: Jul 2011
Location: Estonia
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: Disabled
okay thanks!

I forgot to mention that it is running on ARM and there is some limitations, so no package installations etc...
I'll try out some raw arm binaries...
 
Old 03-15-2012, 05:27 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,200

Rep: Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563
They (busybox) left out the -l option to save space is my guess.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script listening on TCP port pcmilhouse Linux - Networking 2 10-24-2006 01:15 PM
TCP Port not listening Craig Cox Linux - Security 1 10-10-2006 12:08 PM
tcp listening port help pbaxter Linux - Networking 4 07-11-2006 04:38 PM
AMaViS not listening on tcp port nutcake Linux - Software 1 09-13-2005 09:44 AM
What is busboy ??? Listening on TCP port 998 tallship Linux - Security 3 12-17-2004 08:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration