PerryRaptor Posted March 18, 2006 Share Posted March 18, 2006 Any way to test to see if a specific port is open on a remote server? Ping() doesn't determine open ports. Because of Firewall and Router PING isn't telling me that the server is online. If I use NMAP.exe and test to see if a specific port is open I then know the server is available and that the particular application is available. I do not want to use NMAP in my script. Anyone know of another free lightweight alternative to NMAP that is scriptable? Also interested in C+ call too. I'd like to try AutoIT calls to C+. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 18, 2006 Moderators Share Posted March 18, 2006 Any way to test to see if a specific port is open on a remote server? Ping() doesn't determine open ports.Because of Firewall and Router PING isn't telling me that the server is online. If I use NMAP.exe and test to see if a specific port is open I then know the server is available and that the particular application is available. I do not want to use NMAP in my script.Anyone know of another free lightweight alternative to NMAP that is scriptable?Also interested in C+ call too. I'd like to try AutoIT calls to C+.Have you seen this thread to see if it was what you were looking for? http://www.autoitscript.com/forum/index.ph...topic=22343&hl= Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
PerryRaptor Posted March 18, 2006 Author Share Posted March 18, 2006 @SmOke N, I'm not interested in hidden or cloaked web pages...I want to know if the server is online and that a particular application is running. Game Servers behind firewalls and/or routers that have not forwarded port 445, allow incoming echo requests ICMP, are not pingable. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 18, 2006 Moderators Share Posted March 18, 2006 Sorry, that must have been the wrong post, I remember it not talking about cloaking the the pages, but in fact telling you if the server was online. Maybe I misunderstood the thread, sorry it was of no use. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
billmez Posted March 19, 2006 Share Posted March 19, 2006 Anyone know of another free lightweight alternative to NMAP that is scriptable?MS has a command line port query tool that may work for you:http://support.microsoft.com/default.aspx?kbid=832919 Link to comment Share on other sites More sharing options...
PerryRaptor Posted March 19, 2006 Author Share Posted March 19, 2006 I'm looking at it right now...PortQry.exe...rather slow in comparision to NMAP but hey, I'm only checking one port. Link to comment Share on other sites More sharing options...
billmez Posted March 19, 2006 Share Posted March 19, 2006 I'm looking at it right now...PortQry.exe...rather slow in comparision to NMAP but hey, I'm only checking one port.I actually use cyberkit, but came across this and thought it might work for you. Link to comment Share on other sites More sharing options...
Geert Posted March 19, 2006 Share Posted March 19, 2006 $IpAddress = "127.0.0.1" $PortNumber = 1700 $var = Ping($IpAddress, 250) If $var Then; Ping OK TCPStartup() $socket = TCPConnect($IpAddress, $PortNumber);Try to connect to port TCPShutdown() If $socket == -1 Then MsgBox(0, @ScriptName, "port is closed") Else MsgBox(0, @ScriptName, "port is open") EndIf Else MsgBox(0, @ScriptName, "host not pingable") EndIf Link to comment Share on other sites More sharing options...
PerryRaptor Posted March 25, 2006 Author Share Posted March 25, 2006 Thanks Geert Link to comment Share on other sites More sharing options...
PerryRaptor Posted March 25, 2006 Author Share Posted March 25, 2006 Well the only problem with IF $socket == -1 is the fact that the Port could be FILTERED or CLOAKED. Also, if the IP/Url is offline you will also get a -1 result. $IpAddress = InputBox("IP/URL Port Status", "Enter IP/URL") $PortNumber = InputBox("IP/URL Port Status","Enter TCP Port Number") TCPStartup() $socket = TCPConnect($IpAddress, $PortNumber) TCPShutdown() If $socket == -1 Then MsgBox(0, IP/URL Port Status", "Port is closed or filtered...Socket Result: " & $Socket) Else MsgBox(0, IP/URL Port Status", "Port is open...Socket Result: " & $Socket) EndIf Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now