Created
March 20, 2013 02:44
-
-
Save eye9poob/5201901 to your computer and use it in GitHub Desktop.
URL Find [PHP Engine]
This file contains hidden or 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 | |
$get_url = trim($_GET['url']); | |
$post_url = trim($_POST['url']); | |
if (empty($get_url)) { | |
if (empty($post_url)) { | |
echo "-1"; | |
exit(); | |
} else { | |
$url = $post_url; | |
} | |
} else { | |
$url = $get_url; | |
} | |
function http_response($url){ | |
$resURL = curl_init(); | |
curl_setopt($resURL, CURLOPT_URL, $url); | |
curl_setopt($resURL, CURLOPT_BINARYTRANSFER, 1); | |
curl_setopt($resURL, CURLOPT_HEADERFUNCTION, 'curlHeaderCallback'); | |
curl_setopt($resURL, CURLOPT_FAILONERROR, 1); | |
curl_exec ($resURL); | |
$intReturnCode = curl_getinfo($resURL, CURLINFO_HTTP_CODE); | |
curl_close ($resURL); | |
if ($intReturnCode != 200 && $intReturnCode != 302 && $intReturnCode != 304) { return 0; } else return 1; | |
} | |
$file_handle = fopen("admin_pattern.txt", "rb"); | |
while (!feof($file_handle) ) { | |
$line_of_text = fgets($file_handle); | |
$parts = explode('=', $line_of_text); | |
if (http_response($url . $parts[0]) == 1) { | |
echo $parts[0]; | |
exit(); | |
} | |
} | |
echo "-2"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment