scriptz-team

[PHP] PORT CHECKER

May 30th, 2012
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <?php
  2. /*
  3. _____ _____ _ _____ _____ _____ _____ _____ _____
  4. ___| | __ |_| _ |_ _|___ ___|_ _| __| _ | |
  5. |_ -| --| -| | __| | | |- _|___| | | | __| | | | |
  6. |___|_____|__|__|_|__| |_| |___| |_| |_____|__|__|_|_|_|
  7. |s C R i P T z - T E A M . i N F O|
  8.  
  9. PORT CHECKER
  10.  
  11. USAGE:
  12. index.php?site=somesite.com&port=80
  13. */
  14. error_reporting(0);
  15. if (isset($_GET['site']) && $_GET['site'] != "" && $_GET['port'] != "") {
  16. $site = $_GET['site'];
  17. $port = $_GET['port'];
  18. $ch = curl_init();
  19. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  20. curl_setopt($ch, CURLOPT_HEADER, 1);
  21. curl_setopt($ch, CURLOPT_URL, $site . ":" . $port);
  22. $result = curl_exec($ch);
  23. $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  24. curl_close($ch);
  25. if ($httpcode >= 200) {
  26. echo "[!] w00t! Found Open Port [ $site:$port ]";
  27. } else {
  28. echo "[-] Nothing found on [$site:$port]";
  29. }
  30. }
  31.  
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment