Results 1 to 5 of 5

Thread: PHP Port Checker Script

  1. #1
    Join Date
    Apr 2010
    Posts
    206

    PHP Port Checker Script

    I need to be sure that there is no torrent port is open in the LAN connection. The router mostly blocks every port, but I need to be sure about all of them are closed. I am searching for something as uTorrent Port Checker to test port 1-12000, but I am unable to rip this off the php script and I am not sure that what it is checking for ..... Torrent is UDP or TCP protocol? Does anyone has some suggestion of a closer tool like this ? I have created a php script, but I am searching for something lighter which would be able to perform just as the script of the utorrent port checker.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,005

    Re: PHP Port Checker Script

    I have created for my personal and you are the first user, I am going to share this . This is my beta php script and it may be also useful for you to manage this :

    <?php
    function detect($objct)
    {
    print("<pre>");
    print_r($objct);
    print("</pre>");
    }


    $inicio = $_REQUEST["inicio"];
    $t = file_get_contents("URL of the site .. ?port=$inicio");
    detect($t);
    detect("<hr>");
    flush();
    ?>
    <script>
    //clearTimeout(t);
    t=setTimeout("window.location = 'test_port.php?inicio=<?=$inicio + 1?>'",1000);
    </script>

  3. #3
    Join Date
    Apr 2010
    Posts
    206

    Re: PHP Port Checker Script

    Thank you very much ! With that script I have created my own port checker script which is going well ! The translated script ready to move .. You need to use the test_port.php?first=FIRSTPORT*&last=LASTPORT


    Code:

    <?php
    ini_set('error_reporting', E_ALL);
    function detect($objct)
    {
    print("<pre>");
    print_r($objct);
    print("</pre>");
    }


    $inicio = $_REQUEST["first"];
    $fim = $_REQUEST["last"];
    if (!$ip = getenv('HTTP_X_FORWARDED_FOR')){
    $ip=getenv('REMOTE_ADDR');
    }
    detect('<span class="style1">YOUR IP: </span><span class="style2">'.$ip.'</span></br>');
    for($lop=$first;$lop<=$last;$lop++){

    if (!@fsockopen($ip, (int)$lop, $errnumber, $errstr, 10)){
    detect("CLOSED: $lop");
    } else {
    detect("OPENED: $lop");
    }
    flush();
    }

    ?>

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: PHP Port Checker Script

    This is very easy script which will attempt to connect with the site:port with the help of fsockopen to find out that if a service is currently running onto the port.

    Code:
    < ?php
    
    $site_name = "www............";
    $port = 80;
    
    $fp = fsockopen($site_name,$port,$errnumber,$errstr,10);
    if(!$fp)
    {
    echo "Unable to connect to server";
    }
    
    else{
    echo "Connect established  - no errors on Port ".$port." at ".$site_name;
    fclose($fp);
    }
    
    ?>

  5. #5
    Join Date
    Apr 2010
    Posts
    84

    Re: PHP Port Checker Script

    Dear everyone ,
    I need to ask something here about the port manipulation , if it's possible to get the source code for TestPort because I need to integrate this to one CMS system in the Intranet for internal purpose only. This is the cause for what I am looking for the internet and would like to know your testPort and how this works. If someone here can help me because I am a new guy for PHP!

Similar Threads

  1. Port checker says open but still yellow
    By pkat304 in forum Networking & Security
    Replies: 1
    Last Post: 12-01-2011, 11:01 AM
  2. Replies: 5
    Last Post: 26-06-2010, 05:21 PM
  3. Can't get the Port Checker function to work
    By Its_Shaili in forum Networking & Security
    Replies: 4
    Last Post: 26-06-2010, 05:17 PM
  4. Port Forwarded but Still get Port Checker Error
    By Vayya in forum Networking & Security
    Replies: 5
    Last Post: 26-06-2010, 05:16 PM
  5. Port checker OK but red dot
    By Rishab in forum Networking & Security
    Replies: 3
    Last Post: 23-06-2010, 03:14 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,134,390.11158 seconds with 17 queries