Re: PortQry and port scanning

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Alexander Nickolov (agnickolov_at_mvps.org)
Date: 09/14/04


Date: Tue, 14 Sep 2004 10:21:40 -0700

You need to use non-blocking connect. Then if you don't get
WSAECONNREFUSED or a successful connect within a short
timeout you can assume the macine is simply not there. The
former response means the port is not in use, the latter means
there's somebody listening. This assumes you are interested
in TCP ports of course, there's no reliable way of detecting
UDP ports.

-- 
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"Suresh" <Suresh@discussions.microsoft.com> wrote in message 
news:7620A586-6BCB-45F2-9619-D8FAC179A6DA@microsoft.com...
> Hi All,
>
> I need to find out a port on a remote machine is in listening mode or not.
> I found that PortQry application does it very fast. Any idea how portQry
> achieve this? I tried connecting to the trarget machine and select-timeout
> for response but it takes atleast 30+ seconds to get the reliable 
> response. I
> think it is not the right way to do it.
>
> -Suresh 


Relevant Pages

  • Re: Best Plan of action for 2 forest.......
    ... PortQry reports the status of a port in one of the following ways: ... ..LISTENING This response indicates that a process is listening on the target ...
    (microsoft.public.windows.server.active_directory)
  • RE: MBSA and MSs attempts at "security"
    ... >the port status of TCP and UDP ports on a computer you choose. ... you can also query an LDAP service. ... LDAP query and interpret an LDAP server's response to ...
    (Focus-Microsoft)
  • RE: Using a dynamic request - response port
    ... Saravana Kumar ... I don't have any direct experience working with WSS adapter, ... You need to make sure, you are getting some response back from Sharepoint ... May be its worth investigating using a static solict-response send port ...
    (microsoft.public.biztalk.general)
  • Re: Cant connect to Mailserver
    ... chance yet to dig into the server and find out why. ... When I telnet to port 25 I should get a response from your exchange ... Are the correct ports open in the router? ...
    (microsoft.public.windows.server.sbs)
  • Re: how to set timeout for read command
    ... >> The shell will attempt to connect to that TCP port, get an error response, ... The desired behavior of the program is to ... in response to the refusal to open the connection. ... The remote machine has something listening on the port, ...
    (comp.unix.shell)