Skip to content

Instantly share code, notes, and snippets.

@insidenothing
Created January 15, 2020 15:53
Show Gist options
  • Save insidenothing/f2a2b12a5b6b3e1176902704293475f1 to your computer and use it in GitHub Desktop.
Save insidenothing/f2a2b12a5b6b3e1176902704293475f1 to your computer and use it in GitHub Desktop.
<?PHP
// input website
// output domains used
if(isset($_POST['url'])){
$site = $_POST['url'];
}else{
$site = 'https://www.';
}
?>
<form method='POST'>
<input name='url' size='150' value='<?PHP echo $site;?>'>
<input type='submit'>
</form>
<?PHP
if(isset($_POST['url'])){
function getPage($url){
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, $url);
curl_setopt ($curl, CURLOPT_USERAGENT, sprintf("Proxy Resource Testing/%d.0",rand(4,50)));
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
$html = curl_exec ($curl);
curl_close ($curl);
return $html;
}
$html = getPage($site);
echo htmlentities($html);
preg_match_all('#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $html, $match);
echo "<pre>";
print_r($match[0]);
echo "</pre>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment