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)
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: nc
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Radek Vokal
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
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):
1.78-2

How reproducible:
Always.

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 xen1.test.det.nsw.edu.au (192.168.20.1) 56(84) bytes of data.
64 bytes from xen1.test.det.nsw.edu.au (192.168.20.1): icmp_seq=0 ttl=64
time=0.109 ms

--- xen1.test.det.nsw.edu.au 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 $?
0
[root@xen2 ~]# nc -uz 192.168.20.1 4005
Connection to 192.168.20.1 4005 port [udp/*] succeeded!
[root@xen2 ~]# echo $?
0
==============================================

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

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.