public function run() { $exit = false; $count = 0; $numPaginator = 0; $countProxyVirgin = rand(0, count($this->listOfVirginProxies) - 1); $resultFinal = array(); while ($exit == false) { if ($count != 0) { $numPaginator = 100 * $count + 1; } $urlOfSearch = 'https://search.yahoo.com/search?p=' . urlencode($this->commandData['dork']) . '&fr=yfp-t-707&pz=100&b=' . $numPaginator; $this->output('Page ' . $count . "\n"); if ($this->commandData['virginProxies']) { $body = Utils::getBodyByVirginProxies($urlOfSearch, $this->listOfVirginProxies[$countProxyVirgin], $this->proxy); $arrLinks = Utils::getLinks($body); if ($countProxyVirgin == count($this->listOfVirginProxies) - 1) { $countProxyVirgin = 0; } else { ++$countProxyVirgin; } } else { $body = Utils::getBody($urlOfSearch, $this->proxy); $arrLinks = Utils::getLinks($body); } $this->output("\n" . $urlOfSearch . "\n"); $results = Utils::sanitazeLinks($arrLinks); if (count($results) == 0 and $body != 'repeat') { $exit = true; } $resultFinal = array_merge($resultFinal, $results); ++$count; } return $resultFinal; }
public function run() { $this->loadGoogleSite(); $exit = false; $count = 0; $paginator = ''; $countProxyVirgin = rand(0, count($this->listOfVirginProxies) - 1); $resultFinal = array(); $countProxyFail = array(); while ($exit == false) { if ($count != 0) { $numPaginator = 100 * $count; $paginator = '&start=' . $numPaginator; } $urlOfSearch = 'https://' . $this->siteGoogle . '/search?q=' . urlencode($this->commandData['dork']) . '&num=100&btnG=Search&pws=1' . $paginator; $this->output('Page ' . $count . "\n"); if ($this->commandData['virginProxies']) { $body = Utils::getBodyByVirginProxies($urlOfSearch, $this->listOfVirginProxies[$countProxyVirgin], $this->proxy); //Check if exist captcha //Check if next group of return data or not $arrLinks = array(); if (!$this->checkCaptcha($body) and $body != 'repeat') { $arrLinks = Utils::getLinks($body); } else { --$count; $countProxyFail[$countProxyVirgin] = $this->listOfVirginProxies[$countProxyVirgin]; $this->output("You has a problem with proxy, probaly you estress the engenier ...\n"); } //Check if next virgin proxy or repeat of 0 if ($countProxyVirgin == count($this->listOfVirginProxies) - 1) { $countProxyVirgin = 0; } else { ++$countProxyVirgin; } } else { $body = $this->getBody($urlOfSearch); $arrLinks = Utils::getLinks($body); } $this->output("\n" . $urlOfSearch . "\n"); $results = Utils::sanitazeLinks($arrLinks); if (count($results) == 0 && $body != 'repeat' && !$this->checkCaptcha($body) || count($countProxyFail) == count($this->listOfVirginProxies)) { $exit = true; } $resultFinal = array_merge($resultFinal, $results); ++$count; } return $resultFinal; }
public function run() { $exit = false; $count = 0; $numPaginator = 0; $countProxyVirgin = rand(0, count($this->listOfVirginProxies) - 1); $resultFinal = array(); $countProxyFail = array(); while ($exit == false) { if ($count != 0) { $numPaginator = $count; } $urlOfSearch = 'https://yandex.ru/search/?text=' . urlencode($this->commandData['dork']) . '&p=' . $numPaginator . '&lr=10136'; $this->output('Page ' . $count . "\n"); if ($this->commandData['virginProxies']) { $body = Utils::getBodyByVirginProxies($urlOfSearch, $this->listOfVirginProxies[$countProxyVirgin], $this->proxy); //Check if next group of return data or not $arrLinks = array(); if (!$this->checkCaptcha($body) and $body != 'repeat') { $arrLinks = Utils::getLinks($body); } else { --$count; //Count the proxys with fail and all fail proxys, finish action $countProxyFail[$countProxyVirgin] = $this->listOfVirginProxies[$countProxyVirgin]; $this->output("You has a problem with proxy, probaly you estress the engenier ...\n"); } //Check if next virgin proxy or repeat of 0 if ($countProxyVirgin == count($this->listOfVirginProxies) - 1) { $countProxyVirgin = 0; } else { ++$countProxyVirgin; } } else { $body = Utils::getBody($urlOfSearch, $this->proxy); $arrLinks = Utils::getLinks($body); } $this->output("\n" . $urlOfSearch . "\n"); $results = Utils::sanitazeLinks($arrLinks); if (count($results) == 0 && $body != 'repeat' && !$this->checkCaptcha($body) || count($countProxyFail) == count($this->listOfVirginProxies)) { $exit = true; } $resultFinal = array_merge($resultFinal, $results); ++$count; } return $resultFinal; }
public function run() { $exit = false; $count = 0; $numPaginator = 0; $countProxyVirgin = rand(0, count($this->listOfVirginProxies) - 1); $resultFinal = array(); $totalOutProxy = 5; $countOutProxy = 0; while ($exit == false) { if ($count != 0) { $numPaginator = 10 * $count; } $urlOfSearch = 'http://www.bing.com/search?q=' . urlencode($this->commandData['dork']) . '&filt=rf&first=' . $numPaginator; $this->output('Page ' . $count . "\n"); if ($this->commandData['virginProxies']) { $this->output('*' . $countProxyVirgin . '*'); $this->output('&' . $this->listOfVirginProxies[$countProxyVirgin] . '&'); $body = Utils::getBodyByVirginProxies($urlOfSearch, $this->listOfVirginProxies[$countProxyVirgin], $this->proxy); $arrLinks = Utils::getLinks($body); //Check if next virgin proxy or repeat of 0 if ($countProxyVirgin == count($this->listOfVirginProxies) - 1) { $countProxyVirgin = 0; } else { ++$countProxyVirgin; } } else { $body = Utils::getBody($urlOfSearch, $this->proxy); $arrLinks = Utils::getLinks($body); ++$countOutProxy; } $this->output("\n" . $urlOfSearch . "\n"); $results = Utils::sanitazeLinks($arrLinks); if (count($results) == 0 && $body != 'repeat' || $countOutProxy == $totalOutProxy) { $exit = true; } $resultFinal = array_merge($resultFinal, $results); ++$count; } return $resultFinal; }
public function sanitazeLinks($links = array()) { $hrefs = array(); if (!empty($links)) { foreach ($links as $keyLink => $valueLink) { $validResultOfBlackList = Utils::checkBlacklist($valueLink); if (!$validResultOfBlackList and $valueLink) { $hrefs[] = $valueLink; } } $hrefs = array_unique($hrefs); } return $hrefs; }