Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 159119 - Netcat doesn't work correctly on UDP ports (scanning)
Summary: Netcat doesn't work correctly on UDP ports (scanning)
Alias: None
Product: Fedora
Classification: Fedora
Component: nc
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Radek Vokal
QA Contact: Ben Levenson
Depends On:
TreeView+ depends on / blocked
Reported: 2005-05-30 07:03 UTC by Bojan Smojver
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 1.84-6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-07-10 08:41:32 UTC

Attachments (Terms of Use)
Slightly improving UPD scan by giving the target machine a chance to reply (deleted)
2006-07-02 23:30 UTC, Tomas Heinrich
no flags Details | Diff

Description Bojan Smojver 2005-05-30 07:03:41 UTC
Description of problem:
When a UDP port is scanned with netcat (nc) on a remote IP address, nc always
returns success.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Run "nc -uz IP port"
2. Run "echo $?"
Actual results:
Returns 0 (success).

Expected results:
Should return 1

Additional info:

On xen2 box:
[root@xen2 ~]# ping -c 1 xen1
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=0 ttl=64
time=0.109 ms

--- ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.109/0.109/0.109/0.000 ms, pipe 2
[root@xen2 ~]# nc -uz xen1 4005
Connection to xen1 4005 port [udp/*] succeeded!
[root@xen2 ~]# echo $?
[root@xen2 ~]# nc -uz 4005
Connection to 4005 port [udp/*] succeeded!
[root@xen2 ~]# echo $?

On xen1 box:
[root@xen1 ~]# netstat -an | grep 4005
[root@xen1 ~]# nc -uz 4005
[root@xen1 ~]# echo $?
[root@xen1 ~]# nc -uz xen1 4005
[root@xen1 ~]# echo $?

BTW, xen1 and xen2 are connected via a private interconnect. All is good when
scanning TCP ports.

Comment 1 Bojan Smojver 2005-10-07 10:27:02 UTC
Still the same with Rawhide (FC5) nc-1.82-1.

Comment 2 Tomas Heinrich 2006-07-02 23:30:16 UTC
Created attachment 131866 [details]
Slightly improving UPD scan by giving the target machine a chance to reply

Comment 3 Radek Vokal 2006-07-10 08:41:32 UTC
Thanks, patch applied on rawhide.

Note You need to log in before you can comment on or make changes to this bug.