OK, we all know how to use PING to test connectivity to an IP address. What I need to do is something similar but test if my outbound request to a given IP Address as well as a specif port (in the present case 1775) is successful. The test should be performed preferably from the command prompt.
相关问题
- How to change the IP address of a docker after cre
- Google recaptcha remoteip explanation
- Embed RTSP Stream into Browser
- Restrict User Activity Based on IP or on Cookie?
- Find IP of program trying to connect to ServerSock
相关文章
- PostgreSQL field data type for IPv4 addresses
- How to find that an IP address is a LAN IP or WAN
- Direct IP call android
- Automate ftp upload to ip
- Connect to another computer using IP address
- jQuery JSON request gets a '200 OK' answer
- Adding client IP info into django logger
- How to check if server is sending out spam?
If there is a server running on the target IP/port, you could use Telnet. Any response other than "can't connect" would indicate that you were able to connect.
To automate the awesome service portquiz.net, I did write a bash script :
If you're testing TCP/IP, a cheap way to test remote addr/port is to telnet to it and see if it connects. For protocols like HTTP (port 80), you can even type HTTP commands and get HTTP responses.
eg
Here is a small site I made allowing to test any outgoing port. The server listens on all TCP ports available.
http://portquiz.net
The bash script example of @benjarobin for testing a sequence of ports did not work for me so I created this minimal not-really-one-line (command-line) example which writes the output of the open ports from a sequence of 1-65535 (all applicable communication ports) to a local file and suppresses all other output:
Unfortunately, this takes 18.2 hours to run, because the minimum amount of connection timeout allowed integer seconds by my older version of curl is 1. If you have a curl version >=7.32.0 (type "curl -V"), you might try smaller decimal values, depending on how fast you can connect to the service. Or try a smaller port range to minimise the duration.
Furthermore, it will append to the output file ports.txt so if run multiple times, you might want to remove the file first.
The fastest / most efficient way I found to to this is with nmap and portquiz.net described here: http://thomasmullaly.com/2013/04/13/outgoing-port-tester/ This scans to top 1000 most used ports:
To scan them all (took 6 sec instead of 5):