Jump to content

PHP Port Checker Script


Recommended Posts

Hi, I am a network administrador of a High School and I want to make sure no torrent port is open in the lan. The router probably block every port, but I want to make sure all of them are closed. I looking something like uTorrent Port Checker to test port 1-12000, but I cant rip it off the php script and I have no idea of what is checking... Torrent is UDP or TCP protocol? Does anybody has any idea of a similar tool? I made a php script, but I'm looking for something lighter that would work just like the script of the utorrent port checker. Could you guys provide the source of that script?

Thanks in advance.


My beta php script (Not working too well):


function trace($obj)








* @version $1.0$

* @copyright 2008


$inicio = $_REQUEST["inicio"];

$t = file_get_contents("http://www.utorrent.com/testport.php?port=$inicio");







t=setTimeout("window.location = 'test_port.php?inicio=<?=$inicio + 1?>'",1000);


Link to comment
Share on other sites

Thanks! With that script I made my own port checker! :D

Mine is in portuguese. Checkout!


The translated script ready to go:

use test_port.php?first=FIRSTPORT*&last=LASTPORT

<?phpini_set('error_reporting', E_ALL);function trace($obj){    print("<pre>");    print_r($obj);    print("</pre>");}
$inicio = $_REQUEST["first"];$fim = $_REQUEST["last"];if (!$ip = getenv('HTTP_X_FORWARDED_FOR')){    $ip=getenv('REMOTE_ADDR');}trace('<span class="style1">YOUR IP: </span><span class="style2">'.$ip.'</span></br>');for($i=$first;$i<=$last;$i++){
    if (!@fsockopen($ip, (int)$i, $errno, $errstr, 10)){        trace("CLOSED: $i");    } else {        trace("OPENED: $i");    }    flush();}
Link to comment
Share on other sites

This probably doesn't belong in the Feature Requests forum... so uh, moved to the General forum (and merged with your previous thread). Thanks :)

Edit: In retrospect, I'm not sure how wise it is to have a bugmenot account post scripts... It's a public account, so anyone can modify your script while we're not looking (so what looks like me "approving" of this currently-innocuous script might end up looking like me approving of a modified, malicious script by some other anonymous user). I don't mean that I don't trust you, but as this is the situation, I think I'll be copying the code into this post instead -- full credits to you, though, of course :P If you want, you can create a real account on your own, post the script, and I'll remove it from this post.


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...