Board index » delphi » Port scanner

Port scanner


2005-03-17 07:48:23 AM
delphi70
Does anyone know how to scan ports with indy components?
 
 

Re:Port scanner

"Jacques" <XXXX@XXXXX.COM>writes
Quote
Does anyone know how to scan ports with indy components?
Indy is not designed for that. The only way to port scan with Indy is to
actually open a socket to the target IP/port, disconnect immediately after
connecting, and catch any connection errors in between.
Gambit
 

Re:Port scanner

thanks Remy
Is there perhaps another way this can be done? I just need to know if a port
is open and if so, what program is using it. I have googled but could not
find any info on this.
thanks
"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes
Quote

"Jacques" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...

>Does anyone know how to scan ports with indy components?

Indy is not designed for that. The only way to port scan with Indy is to
actually open a socket to the target IP/port, disconnect immediately after
connecting, and catch any connection errors in between.


Gambit


 

Re:Port scanner

"Jacques" <XXXX@XXXXX.COM>writes
Quote
I just need to know if a port is open
If the port is on the local machine, then simply binding a socket to the
port (not connecting or listening on the port) will tell you if it is
available or not.
Quote
and if so, what program is using it.
For that, you have to perform a low-level query directly to the OS or socket
stack. The socket API does not provide for that functionality. Have a look
at the TCPView utility from www.sysinternals.com.
Gambit
 

Re:Port scanner

Thanks Remy,
I found what iwas looking for.
Cheers
"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes
Quote

"Jacques" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...

>I just need to know if a port is open

If the port is on the local machine, then simply binding a socket to the
port (not connecting or listening on the port) will tell you if it is
available or not.

>and if so, what program is using it.

For that, you have to perform a low-level query directly to the OS or
socket
stack. The socket API does not provide for that functionality. Have a
look
at the TCPView utility from www.sysinternals.com.


Gambit