Looking for scripts I already know of, I found one we use in Brazil to authenticate our adsl connections. Here, we need to do 2 authentications, the first to the access provider when ppp is established and other to our ISP, which does nothing to us except billing for this. But,
this script is a jewel of PERL, at least for me, which is a language yet unexplored. The script name is "id-velox.pl" and, you will find many references of it on google. Its author is Marcelo Toledo, and his page is
www.marcelotoledo.org. You can get this script in
http://www.marcelotoledo.org/stuff/p...x/id-velox.pl. Well, it's written in PERL and portuguese but the important stuff is in "function autentica()", in the line 150. There is a socket open for a specified host, port and protocol. If all you need is to open the port, wait 15 seconds and then close that port, it's time to learn PERL.
Good luck!