zin0 Posted November 28, 2013 Report Posted November 28, 2013 (edited) am gasit sciptu pe un forum , precizez ca nu e scris de mine , doar copy/paste<?php/* * Author: Xt3mP * Name: Dorks link grabber * Version: 1.0 Bing * Contact: xt3mp[at]null[dot]net * Website: [url]http://xt3mp.mx[/url] | [url]http://backroot.org[/url] */?><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Dorks links Grabber (Bing version) | Xt3mP</title><style type="text/css">body{background-color:#2b2b2b;color:#777;font-family:Courier,"Courier New",monospace,sans-serif;font-size:12px}div#container{height:auto;margin:0 auto;width:600px}fieldset{background-color:#222;border:1px dashed #777;float:left;margin:5px;padding:5px;width:100%}legend{background-color:#555;border:1px dashed #777;color:#FFF;font-weight:700;margin:5px;padding:5px}label{float:left;margin-right:5px;padding-top:5px;text-align:right;width:100px}input,select{background-color:#E7E7E7;border:1px dashed #777;float:left;font-family:Courier,"Courier New",monospace,sans-serif;font-size:12px;margin-bottom:5px;padding:3px;width:490px}input[type=submit]{width:600px}h1{margin:0;padding:0}a{color:#CCC;font-weight:700}a:hover{color:#FFF;text-decoration:underline}</style></head><body><?phpset_time_limit(0);class dorkGrabber{ private $bing; private $checkfile; public function __construct() { $this->bing = 'http://www.bing.com/search?q='; } private function getSource($target) { $target = @file_get_contents($target); return $target; } private function remakeUrl($url) { $url = explode("/", $url); for($z = 0; $z < count($url) - 1; $z++) { $new .= $url[$z].'/'; } return $new; } private function checkUrl($url) { if(@fopen($this->remakeUrl($url).$this->checkfile, 'r')) return true; else return false; } private function parseLinks($target) { $data['rawlinks'] = array(); $data['correctlinks'] = array(); $data['badlinks'] = array(); for($i = 0; $i < 21; $i++) { $first = ($i == 0) ? 0 : ($i * 10) + 1; $source = $this->getSource($target.'&first='.$first); $pattern = "/<h3><a href=\"(.*?)\" onmousedown=/"; $preg = preg_match_all($pattern, $source, $output, PREG_PATTERN_ORDER); if(count($output[1]) != 0) { for($x = 0; $x<count($output[1]); $x++) { if(!in_array($this->remakeUrl($output[1][$x]), $data['correctlinks'])) { if($this->checkUrl($output[1][$x])) { $data['rawlinks'][] = $output[1][$x]; $data['correctlinks'][] = $this->remakeUrl($output[1][$x]); }else{ $data['rawlinks'][] = $output[1][$x]; $data['badlinks'][] = $output[1][$x]; } } } }else{ break; } } return $data; } private function getLinks($target) { $newTarget = $this->getSource($target); $check = "/<h1>No se han encontrado resultados para <strong>/"; if(@preg_match($check, $newTarget)) return false; else return $this->parseLinks($target); } private function makeData($type, $links, $output = null) { switch($type) { case 'raw': $title = '<h1>Raw links</h1>'; foreach($links['rawlinks'] as $link) { $linkdir .= $link."\r\n"; } $data = $title.'<textarea rows="5" style="width: 600px; font-size: 11px;">'.$linkdir.'</textarea>'; break; case 'correct': $title = '<h1>Correct links</h1>'; foreach($links['correctlinks'] as $link) { $linkdir .= $link."$this->checkfile\r\n"; } $data = $title.'<textarea rows="5" style="width: 600px; font-size: 11px;">'.$linkdir.'</textarea>'; break; case 'bad': $title = '<h1>Bad links</h1>'; if(empty($links['badlinks'])) { $data = $title.'<textarea rows="5" style="width: 600px; font-size: 11px;">None</textarea>'; }else{ foreach($links['badlinks'] as $link) { $linkdir .= $link."\r\n"; } $data = $title.'<textarea rows="5" style="width: 600px; font-size: 11px;">'.$linkdir.'</textarea>'; } break; case 'txt': $title = '<h1>Output file</h1>'; foreach($links['correctlinks'] as $link) { $linkdir .= $link.$this->checkfile; } $tot = count($links['correctlinks']) + count($links['badlinks']); $statistics = ' [Total links: <b>'.$tot.'</b>] [Correct links: <b>'.count($links['correctlinks']).'</b>] [Bad links: <b>'.count($links['badlinks']).'</b>]'; $file = fopen($output, 'w+'); if($file) { fwrite($file, $linkdir); fclose($file); $filedir = $output.' > http:/'.dirname($_SERVER["PHP_SELF"]).'/'.$output; $data = $title.'<textarea rows="5" style="width:600px;font-size:11px;margin-bottom:5px;">'.$filedir.'</textarea>'; $data .= $statistics.' <a href="./'.$output.'" target="_blank">[View output file]</a>'; }else{ $data = $title.$statistics.' [Can\'t make output file]'; } break; } return $data; } public function makeDirective($dork, $output, $checkfile = null) { $dork = urlencode($dork); $target = $this->bing.$dork; $this->checkfile = $checkfile; $grabber = $this->getLinks($target); $result = '<fieldset style="text-align: justify"><legend>Result</legend>'; if($grabber === false) { $result .= 'The DORK (<b>'.urldecode($dork).'</b>) doesn\'t return any results.'; }else{ $result .= $this->makeData('raw', $grabber); $result .= $this->makeData('correct', $grabber); $result .= $this->makeData('bad', $grabber); $result .= $this->makeData('txt', $grabber, $output); } $result .= '</fieldset>'; return $result; }}?><div id="container"> <fieldset> <legend>Dorks links Grabber (Bing version) | <a href="http://xt3mp.mx" target="_blank">Xt3mP</a></legend> <form action="" method="POST"> <label>Insert DORK:</label><input type="text" name="dork"/><br /> <label>Search eng.:</label><input type="text" name="engine" value="Bing" disabled="disabled"><br /> <label>Output file:</label><input type="text" name="output" /><br /> <label>Check file:</label><input type="text" name="check"/><br /> <input type="submit" name="get" value="Get Links!" /> </form> </fieldset> <?php if(isset($_POST['get'])) { if(empty($_POST['dork']) or empty($_POST['output'])) { echo '<script>alert("Some fields are empty!.");</script>'; }else{ $mtime = microtime(); $mtime = explode(' ',$mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime; $dorkGrabber = new dorkGrabber(); echo $dorkGrabber->makeDirective($_POST['dork'], $_POST['output'], $_POST['check']); $mtime = microtime(); $mtime = explode(' ',$mtime); $mtime = $mtime[1] + $mtime[0]; $endtime = $mtime; $totaltime = ($endtime - $starttime); echo 'This page took '.round($totaltime).' seconds to load.'; } } ?></div></body></html> Edited November 28, 2013 by aelius php vb tags Quote