Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <center>
- <form method='post' action=''>
- IP: <input name='ip' type='text' id='ip' size='17' maxlength='17' />
- From Port: <input name='port' type='text' id='port' size='17' maxlength='17' />
- To Port: <input name='port2' type='text' id='port2' size='17' maxlength='17' />
- <input type='submit' name='submit' value='Check' />
- </form>
- <?
- echo '<br>';
- echo 'Your IP is '.$_SERVER["HTTP_CF_CONNECTING_IP"];
- echo '<br>';
- //Disable PHP warnings to prevent errors.
- error_reporting(~E_ALL);
- $from = $_POST['port'];
- $to = $_POST['port2'];
- //TCP ports
- $host = $_POST['ip'];
- for($port = $from; $port <= $to ; $port++)
- {
- $fp = fsockopen($host , $port);
- if ($fp)
- {
- echo "<br>port $port open on ".$_POST['ip']."\n";
- $info - stream_get_meta_data($fp);
- fclose($fp);
- if ($info['timed_out']) {
- echo 'Port '.$port.' on '.$host.'.';
- } else {
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment