TShopping

 找回密碼
 註冊
搜索
查看: 770|回復: 0
打印 上一主題 下一主題

[教學] port_scanner.php

[複製鏈接]
跳轉到指定樓層
1#
發表於 2022-4-4 23:15:05 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
 
Push to Facebook
  1. <?php
  2. ini_set('max_execution_time', 0);
  3. ini_set('memory_limit', -1);

  4. $host = 'google.com';
  5. $ports = array(21, 25, 80, 81, 110, 143, 443, 587, 2525, 3306);

  6. foreach ($ports as $port){
  7.     $connection = @fsockopen($host, $port, $errno, $errstr, 2);
  8.     if (is_resource($connection)){
  9.         echo '<h2>' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</h2>' . "\n";
  10.         fclose($connection);
  11.     } else{
  12.         echo '<h2>' . $host . ':' . $port . ' is not responding.</h2>' . "\n";
  13.     }
  14. }
複製代碼

文章出處
https://gist.github.com/akalongman/b50bc11a9303adb6f2db

 

臉書網友討論
*滑块验证:
您需要登錄後才可以回帖 登錄 | 註冊 |

本版積分規則



Archiver|手機版|小黑屋|免責聲明|TShopping

GMT+8, 2024-4-30 15:20 , Processed in 0.061813 second(s), 22 queries .

本論壇言論純屬發表者個人意見,與 TShopping綜合論壇 立場無關 如有意見侵犯了您的權益 請寫信聯絡我們。

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表