Re: Problem with NC.1.107

2018-04-13 Thread Brian Inglis
On 2018-04-13 02:44, L A Walsh wrote:
> Jay Cotton wrote:
> You said:
>> I don't see the PE32+ executable (console) x86-64, for MS Windows
>>> >>> string.
> Whereas, when I used the file command, it printed out exactly
> what you were searching for.  Thus my assertion that your file
> command is the likely culprit.
>> file /usr/bin/nc
>> /usr/bin/nc: PE32+ executable (console) x86-64 (stripped to external PDB),
>> for MS Windows
> As for the not-executable error message, have you checked,
> as suggested elsewhere, whether or not you have some cheap
> anti-virus installed that blocks programs that are not viruses
> like 'nc'?

Try:
$ which file nc | xargs ls -glo
-rwxr-xr-x 1 22035 Mar 18 08:18 /usr/bin/file
-rwxr-xr-x 1 24576 Mar 19  2013 /usr/bin/nc
$ which file nc | xargs file
/usr/bin/file: PE32+ executable (console) x86-64, for MS Windows
/usr/bin/nc:   PE32+ executable (console) x86-64 (stripped to external PDB), for
MS Windows
$ printf "HEAD / HTTP/1.0\r\n\r\n" | nc cygwin.com 80
HTTP/1.1 200 OK
Date: Fri, 13 Apr 2018 11:45:41 GMT
Server: Apache
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Security-Policy: default-src 'self' http: https:
Connection: close
Content-Type: text/html; charset=UTF-8

-- 
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



Re: Problem with NC.1.107

2018-04-13 Thread L A Walsh

Jay Cotton wrote:

Here is the package listing at cygwin

nc: A simple but powerful network tool (installed binaries and support
files)

2013-03-19 15:35   0 usr/
2013-03-19 15:35   0 usr/bin/
2013-03-19 15:35   24576 usr/bin/nc.exe
2013-03-19 15:35   0 usr/share/
2013-03-19 15:35   0 usr/share/man/
2013-03-19 15:35   0 usr/share/man/man1/
2013-03-19 15:305052 usr/share/man/man1/nc.1.gz



---
Right.  It has the two files I mentioned below, and
nc.exe isn't a text file or makefile -- but is shown by the
cygwin "file" command as an executable.


You said:

I don't see the PE32+ executable (console) x86-64, for MS Windows

>>> string.


Whereas, when I used the file command, it printed out exactly
what you were searching for.  Thus my assertion that your file
command is the likely culprit.


file /usr/bin/nc
>>
/usr/bin/nc: PE32+ executable (console) x86-64 (stripped to external PDB),
for MS Windows



As for the not-executable error message, have you checked,
as suggested elsewhere, whether or not you have some cheap
anti-virus installed that blocks programs that are not viruses
like 'nc'?


--
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



Re: Problem with NC.1.107

2018-04-09 Thread Marco Atzeri

On 10/04/2018 06:12, Jay Cotton wrote:

Here is the package listing at cygwin

nc: A simple but powerful network tool (installed binaries and support
files)

 2013-03-19 15:35   0 usr/
 2013-03-19 15:35   0 usr/bin/
 2013-03-19 15:35   24576 usr/bin/nc.exe
 2013-03-19 15:35   0 usr/share/
 2013-03-19 15:35   0 usr/share/man/
 2013-03-19 15:35   0 usr/share/man/man1/
 2013-03-19 15:305052 usr/share/man/man1/nc.1.gz




post bottom here, and also trim the reply please.

As I highlighted before, you wrote:

  $ nc 192.168.1.135 23
  bash: /usr/bin/nc: Permission denied

the message is from bash and it reports that bash can not execute
nc. This happens when a Antivirus denies access to the program.
For example Symantec always blocks any nc.

Please note that nc replies to

$ nc --version
nc: unknown option -- -
usage: nc [-46CDdhklnrtUuvz] [-I length] [-i interval] [-O length]
  [-P proxy_username] [-p source_port] [-s source] [-T ToS]
  [-V rtable] [-w timeout] [-X proxy_protocol]
  [-x proxy_address[:port]] [destination] [port]


Regards
Marco








--
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



Re: Problem with NC.1.107

2018-04-09 Thread Jay Cotton
Here is the package listing at cygwin

nc: A simple but powerful network tool (installed binaries and support
files)

2013-03-19 15:35   0 usr/
2013-03-19 15:35   0 usr/bin/
2013-03-19 15:35   24576 usr/bin/nc.exe
2013-03-19 15:35   0 usr/share/
2013-03-19 15:35   0 usr/share/man/
2013-03-19 15:35   0 usr/share/man/man1/
2013-03-19 15:305052 usr/share/man/man1/nc.1.gz



On Mon, Apr 9, 2018 at 6:51 PM, L A Walsh  wrote:

> Andrey Repin wrote:
>
>> Greetings, Jay Cotton!
>>
>> Since nc does not reply to --version, I have no way to tell if it's the
>> same
>> you are running with.
>>
> ---
> That's odd.  But has to do with what version of ncat is run.
> I notice my linux machine says:
>
> nc --version
>>
> Ncat: Version 6.47 ( http://nmap.org/ncat )
>
> But the version in cygwin:
>
> cygcheck -f /usr/bin/nc
>>
> nc-1.107-4
>
> is very different.  Not sure which is newer or better, but
> the version at nmap.org supports SCTP, though the BSD version
> supports QOS.  Not sufficiently versed in either to know
> all the differences.  Seems like the nmap.org version has more
> options: 44 vs. BSD's 28 (didn't double count switches from nmap
> that have a short+long form).
> Where do the sources from the BSD version come from?   It
> doesn't seem to list a website.
>
>
>> The file permissions are messed up.
>>>
>> ---
> I didn't notice this.
>
>>
>> $ file /usr/bin/nc
>>> /usr/bin/nc: writable, executable, regular file, no read permission
>>>
>>
>> I don't see the PE32+ executable (console) x86-64, for MS Windows
>>> string.
>>>
>> ---
> weird -- when I tried that, got:
>
> file /usr/bin/nc
>>
> /usr/bin/nc: PE32+ executable (console) x86-64 (stripped to external PDB),
> for MS Windows
>
>
> here is the file in /usr/bin
>>> $ ls -l nc*
>>> -rwxr-xr-x 1 lbmgm lbmgm 24576 Mar 19  2013 nc.exe
>>>
>> 
> Looks like the same file I have:
>
>> ll /usr/bin/nc
>>
> -rwxr-xr-x+ 1 24576 Mar 19  2013 /usr/bin/nc*
>
> I'm not sure your file command is referencing the same file,
> since my ls shows the same size and date as yours, and clearly
> both show read+execute for U,G and other and write only for owner.
>
> I looked at the make file, it seems to be o.k. for generating a
>>> runable program.  (uses gcc) but I don't have enough stuff installed
>>> to allow a build.
>>>
>> ---
>I think something is wrong with your 'file' command.  My nc-binary
> didn't come with a makefile (only binary & manpage):
>
>> cygcheck -l nc
>>
> /usr/bin/nc.exe
> /usr/share/man/man1/nc.1.gz
>
>
> --
> 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



Re: Problem with NC.1.107

2018-04-09 Thread L A Walsh

Andrey Repin wrote:

Greetings, Jay Cotton!

Since nc does not reply to --version, I have no way to tell if it's the same
you are running with.

---
That's odd.  But has to do with what version of ncat is run.
I notice my linux machine says:


nc --version

Ncat: Version 6.47 ( http://nmap.org/ncat )

But the version in cygwin:


cygcheck -f /usr/bin/nc

nc-1.107-4

is very different.  Not sure which is newer or better, but
the version at nmap.org supports SCTP, though the BSD version
supports QOS.  Not sufficiently versed in either to know
all the differences.  Seems like the nmap.org version has more
options: 44 vs. BSD's 28 (didn't double count switches from nmap
that have a short+long form).  


Where do the sources from the BSD version come from?   It
doesn't seem to list a website. 






The file permissions are messed up.

---
	I didn't notice this.  



$ file /usr/bin/nc
/usr/bin/nc: writable, executable, regular file, no read permission



I don't see the PE32+ executable (console) x86-64, for MS Windows
string.

---
weird -- when I tried that, got:


file /usr/bin/nc

/usr/bin/nc: PE32+ executable (console) x86-64 (stripped to external PDB), for 
MS Windows



here is the file in /usr/bin
$ ls -l nc*
-rwxr-xr-x 1 lbmgm lbmgm 24576 Mar 19  2013 nc.exe


Looks like the same file I have:

ll /usr/bin/nc

-rwxr-xr-x+ 1 24576 Mar 19  2013 /usr/bin/nc*

I'm not sure your file command is referencing the same file,
since my ls shows the same size and date as yours, and clearly
both show read+execute for U,G and other and write only for owner.


I looked at the make file, it seems to be o.k. for generating a
runable program.  (uses gcc) but I don't have enough stuff installed
to allow a build.

---
   I think something is wrong with your 'file' command.  My nc-binary
didn't come with a makefile (only binary & manpage):

cygcheck -l nc

/usr/bin/nc.exe
/usr/share/man/man1/nc.1.gz

--
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



Re: Problem with NC.1.107

2018-03-28 Thread Andrey Repin
Greetings, Jay Cotton!

>  Just installed nc 1.107-4  expecting to use it to debug some code.

> This is what I get when I try to run it.
> $ nc 192.168.1.135 23
> bash: /usr/bin/nc: Permission denied

[C:\Programs\Cygwin_64\bin]$ nc.exe 192.168.1.1 23
♥
Dlink-Router login:
[C:\Programs\Cygwin_64\bin]$

Since nc does not reply to --version, I have no way to tell if it's the same
you are running with.

> The file permissions are messed up.

> $ file /usr/bin/nc
> /usr/bin/nc: writable, executable, regular file, no read permission

> I don't see the PE32+ executable (console) x86-64, for MS Windows
> string.


> here is the file in /usr/bin
> $ ls -l nc*
> -rwxr-xr-x 1 lbmgm lbmgm 24576 Mar 19  2013 nc.exe

> I looked at the make file, it seems to be o.k. for generating a
> runable program.  (uses gcc) but I don't have enough stuff installed
> to allow a build.


-- 
With best regards,
Andrey Repin
Wednesday, March 28, 2018 17:07:26

Sorry for my terrible english...

Re: Problem with NC.1.107

2018-03-28 Thread Marco Atzeri

On 27/03/2018 20:13, Jay Cotton wrote:

  Just installed nc 1.107-4  expecting to use it to debug some code.

This is what I get when I try to run it.
$ nc 192.168.1.135 23
bash: /usr/bin/nc: Permission denied


most Antivirus block the nc program

Reards
Marco



--
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 with NC.1.107

2018-03-27 Thread Jay Cotton
 Just installed nc 1.107-4  expecting to use it to debug some code.

This is what I get when I try to run it.
$ nc 192.168.1.135 23
bash: /usr/bin/nc: Permission denied


The file permissions are messed up.

$ file /usr/bin/nc
/usr/bin/nc: writable, executable, regular file, no read permission

I don't see the PE32+ executable (console) x86-64, for MS Windows
string.


here is the file in /usr/bin
$ ls -l nc*
-rwxr-xr-x 1 lbmgm lbmgm 24576 Mar 19  2013 nc.exe

I looked at the make file, it seems to be o.k. for generating a
runable program.  (uses gcc) but I don't have enough stuff installed
to allow a build.

--
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



RE: problem with nc 1.107-4

2017-03-30 Thread gaofeng
The manual saying:

NC(1) BSD General Commands ManualNC(1)

NAME
 nc — arbitrary TCP and UDP connections and listens

SYNOPSIS
 nc [-46CDdhklnrStUuvz] [-I length] [-i interval] [-O length]
[-P proxy_username] [-p source_port] [-s source] [-T toskeyword]
[-V rtable] [-w timeout] [-X proxy_protocol] [-x proxy_address[:port]]
[destination] [port]

DESCRIPTION
 The nc (or netcat) utility is used for just about anything under the sun
 involving TCP, UDP, or UNIX-domain sockets.  It can open TCP connections,
 send UDP packets, listen on arbitrary TCP and UDP ports, do port scan‐
 ning, and deal with both IPv4 and IPv6.  Unlike telnet(1), nc scripts
 nicely, and separates error messages onto standard error instead of
 sending them to standard output, as telnet(1) does with some.
 
 -u  Use UDP instead of the default option of TCP.  For UNIX-domain
 sockets, use a datagram socket instead of a stream socket.  If a
 UNIX-domain socket is used, a temporary receiving socket is cre‐
 ated in /tmp unless the -s flag is given.

PORT SCANNING
 It may be useful to know which ports are open and running services on a
 target machine.  The -z flag can be used to tell nc to report open ports,
 rather than initiate a connection.  For example:

EXAMPLES
 Open a UDP connection to port 53 of host.example.com:

   $ nc -u host.example.com 53

-Original Message-
From: cygwin-ow...@cygwin.com [mailto:cygwin-ow...@cygwin.com] On Behalf Of 
David Bala?ic
Sent: Thursday, March 30, 2017 10:58 PM
To: cygwin@cygwin.com
Subject: Re: problem with nc 1.107-4

On 30 March 2017 at 04:24, 高锋 <gao_f...@139.com> 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.

What exactly does it say?
Because with UDP there are no connections, so there can not be any successful 
connection.

Regards,
David

--
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



Re: reply: problem with nc 1.107-4

2017-03-30 Thread Brian Inglis
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



Re: reply: problem with nc 1.107-4

2017-03-30 Thread Andrey Repin
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



Re: reply: problem with nc 1.107-4

2017-03-30 Thread Michael Enright
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



Re: problem with nc 1.107-4

2017-03-30 Thread David Balažic
On 30 March 2017 at 04:24, 高锋  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.

What exactly does it say?
Because with UDP there are no connections, so there can not be any
successful connection.

Regards,
David

--
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



reply: problem with nc 1.107-4

2017-03-30 Thread 高锋
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-ow...@cygwin.com [mailto:cygwin-ow...@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



Re: problem with nc 1.107-4

2017-03-29 Thread Michael Enright
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 with nc 1.107-4

2017-03-29 Thread 高锋
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?



--
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