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 Vokál
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
Type: ---
Embargoed:


Attachments (Terms of Use)
Slightly improving UPD scan by giving the target machine a chance to reply (1.07 KB, patch)
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 Vokál 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.