public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* reply: problem with nc 1.107-4
@ 2017-03-30  6:48 高锋
  2017-03-30 16:50 ` Michael Enright
  2017-03-30 18:31 ` Andrey Repin
  0 siblings, 2 replies; 4+ messages in thread
From: 高锋 @ 2017-03-30  6:48 UTC (permalink / raw)
  To: cygwin

Two days ago,i wanted to determine whether a udp port of another machine is open or not, which is deployed on different subnet.
But windows platform does not provide utility that can dose this.So i downloaded a setup.exe from cygwin,of which version is 2.877(64 bit),and i had never use this utility before.
-----邮件原件-----
发件人: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] 代表 Michael Enright
发送时间: 2017年3月30日 12:30
收件人: cygwin@cygwin.com
主题: Re: problem with nc 1.107-4

On Wed, Mar 29, 2017 at 7:24 PM, 高锋  wrote:
> I just installed the latest nc 1.107-4 on windows 7 platform.When 
> lauched the command like:
> nc -vuz 10.31.28.188 6110
> ,each time it reported connecting successed,even if the target ip
> 10.31.28.188 does not really exists.
> Could someone tell what wrong with me?
>

It's possible that you are accustomed to using, or using a script written for, the 'nc' command that was included in the 'netcat'
package, which was superceded in Cygwin some years ago. This could have happened if you were using Cygwin 1.7 (I think) and then upgraded to a brand new version of Cygwin. It is common, in my experience, that someone would have installed an old version of Cygwin, used it for years, and then upgraded to a new version.

Message from Vinschen about this change:
https://cygwin.com/ml/cygwin-announce/2012-05/msg00015.html

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: reply: problem with nc 1.107-4
  2017-03-30  6:48 reply: problem with nc 1.107-4 高锋
@ 2017-03-30 16:50 ` Michael Enright
  2017-03-30 19:52   ` Brian Inglis
  2017-03-30 18:31 ` Andrey Repin
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Enright @ 2017-03-30 16:50 UTC (permalink / raw)
  To: cygwin

On Wed, Mar 29, 2017 at 11:28 PM, 高锋 wrote:
> Two days ago,i wanted to determine whether a udp port of another machine is open or not, which is deployed on different subnet.
> But windows platform does not provide utility that can dose this.So i downloaded a setup.exe from cygwin,of which version is 2.877(64 bit),and i had never use this utility before.

I tried this command on Debian 8.7. My conclusion is that this didn't
tell me that the UDP port is listened to by another machine. I used
your exact command, which had similarly uninformative results as
yours. There is no 10.31.x.x machine that I can reach, yet 'nc -u'
allowed me to send text to that address and port. Strace of 'nc -uz'
showed that the special -z option (zero i/o port scan) code "sent
successfully" a single byte to the destination, even though it doesn't
exist.

I conclude that "nc -uz" can't be used to determine unambiguously if a
UDP host is available, because it will succeed even if the host is not
present. And that carries to all systems that use the same 'nc'
utility as Debian or Cygwin.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: reply: problem with nc 1.107-4
  2017-03-30  6:48 reply: problem with nc 1.107-4 高锋
  2017-03-30 16:50 ` Michael Enright
@ 2017-03-30 18:31 ` Andrey Repin
  1 sibling, 0 replies; 4+ messages in thread
From: Andrey Repin @ 2017-03-30 18:31 UTC (permalink / raw)
  To: 高锋, cygwin

Greetings, 高锋!

Please don' top-post. Thank you.

> Two days ago,i wanted to determine whether a udp port of another machine is
> open or not, which is deployed on different subnet.
> But windows platform does not provide utility that can dose this.So i
> downloaded a setup.exe from cygwin,of which version is 2.877(64 bit),and i had never use this utility before.

UDP protocol is inherently stateless.
You can't determine remote port state unless it explicitly reported (i.e.
answers to the messages sent on that port).


-- 
With best regards,
Andrey Repin
Thursday, March 30, 2017 19:36:15

Sorry for my terrible english...
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: reply: problem with nc 1.107-4
  2017-03-30 16:50 ` Michael Enright
@ 2017-03-30 19:52   ` Brian Inglis
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Inglis @ 2017-03-30 19:52 UTC (permalink / raw)
  To: cygwin

On 2017-03-30 10:44, Michael Enright wrote:
> On Wed, Mar 29, 2017 at 11:28 PM, 高锋 wrote:
>> Two days ago, I wanted to determine whether a udp port of another 
>> machine is open or not, which is deployed on different subnet. But
>> Windows platform does not provide utility that can do this. So I
>> downloaded a setup.exe from cygwin, of which version is 2.877 (64 
>> bit), and I had never used this utility before.
> 
> I tried this command on Debian 8.7. My conclusion is that this didn't
> tell me that the UDP port is listened to by another machine. I used
> your exact command, which had similarly uninformative results as
> yours. There is no 10.31.x.x machine that I can reach, yet 'nc -u'
> allowed me to send text to that address and port. Strace of 'nc -uz'
> showed that the special -z option (zero i/o port scan) code "sent
> successfully" a single byte to the destination, even though it 
> doesn't exist.
> 
> I conclude that "nc -uz" can't be used to determine unambiguously if
> a UDP host is available, because it will succeed even if the host is
> not present. And that carries to all systems that use the same 'nc' 
> utility as Debian or Cygwin.

man nc CAVEATS says -uz always reports success and suggests how it 
could be used.

nc is used, instead of a network daemon, as a patient network pipe that 
can be used to move arbitrary bytes, without having to previously set 
up direct routes between systems or daemons to handle specific types of 
connections e.g. if you have sshd set up on a target system, and a 
route to it, you may do:

src $ tar -cf - -C /export/mnt/home . | ssh dest tar -xf - -C /nfs/home

with nc if you don't have any direct route to the target or sshd set up 
still you may do:

 dest $ nc -dl 9000 | tar -xf - -C /nfs/home

inter $ nc -dl 9000 | nc 10.123.456.789 9000

  src $ tar -cf - -C /export/mnt/home . | nc 192.168.123.456 9000

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-30 18:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-30  6:48 reply: problem with nc 1.107-4 高锋
2017-03-30 16:50 ` Michael Enright
2017-03-30 19:52   ` Brian Inglis
2017-03-30 18:31 ` Andrey Repin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).