Created
July 10, 2018 04:24
-
-
Save ferdousulhaque/d14c9d3bc342b0c1d5c9edaa68365ea6 to your computer and use it in GitHub Desktop.
For Internal Port Scan from Web. Usually for security purpose db is not exposed to internet, it stays in the internal zones. So this will help in that case.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('max_execution_time', 0); | |
ini_set('memory_limit', -1); | |
if(!empty($_GET["ip"]) && !empty($_GET["port"])){ | |
$ip = $_GET["ip"]; | |
$port = $_GET["port"]; | |
//nginx Check | |
$connection = @fsockopen($ip, $port, $errno, $errstr, 2); | |
if (is_resource($connection)){ | |
fclose($connection); | |
http_response_code(200); | |
}else{ | |
http_response_code(404); | |
} | |
} else{ | |
http_response_code(404); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment