Re:65k Open TCP Ports
by dave1010uk on Thursday October 20, 2011 @08:20AM
(#3134459)
You can use bash expansion to do this:
curl http://open.zorinaq.com:{100..200}/
Unfortunately the server doesn't send back the port number in the HTML. Use this to see which port numbers you can connect to: curl -v http://open.zorinaq.com:{100..600}/ 2>&1 | grep 'Connected to'Oh yes! I forgot totally about bash expansion. :)
This script should work with any system that has curl with some little modifications, but I've only tested it in fedora 15. You can find it from codepad and the script will run over all ports if the port range has not been specified.
The first terminal argument will be the range start and second argument will be the range end. For example: php port_test.php 1 24 will run the test on ports 1-24
http://codepad.org/8O1WDywv