Bug 159119 - Netcat doesn't work correctly on UDP ports (scanning)
Netcat doesn't work correctly on UDP ports (scanning)
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: nc (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-30 03:03 EDT by Bojan Smojver
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 1.84-6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-10 04:41:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Bojan Smojver 2005-05-30 03:03:41 EDT
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 06:27:02 EDT
Still the same with Rawhide (FC5) nc-1.82-1.
Comment 2 Tomas Heinrich 2006-07-02 19:30:16 EDT
Created attachment 131866 [details]
Slightly improving UPD scan by giving the target machine a chance to reply
Comment 3 Radek Vokal 2006-07-10 04:41:32 EDT
Thanks, patch applied on rawhide.

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