0

Do any of you know how i might go about making a crawler that in every page it looks for a certain script? Do you have any suggestions... I am looking to see if it can identify this script:

 $app = vB5_Frontend_Application::init('config.php'); 
 error_reporting(E_ALL | E_STRICT); 

 $config = vB5_Config::instance(); 
 if (!$config->report_all_php_errors) { 
 error_reporting(E_ALL & ~(E_NOTICE | E_STRICT));
 } 

 $routing = $app->getRouter(); 
 $method = $routing->getAction(); 
 $template = $routing->getTemplate(); 
 $class = $routing->getControllerClass(); 

 if (!class_exists($class)) 
 { 
     die("Couldn't find controller file for $class");
 } 

 vB5_Frontend_ExplainQueries::initialize(); 
 $c = new $class($template); 

 call_user_func_array(array(&$c, $method), $routing->getArguments()); 

 vB5_Frontend_ExplainQueries::finish();
N00B101
  • 1
  • 1
  • Do you have access to the server you're running this on? Guessing this is PHP, is that correct? – Hex Jan 04 '18 at 23:34
  • Welcome to StackOverflow! To let us help you better, please include an example of what you have tried in your post. See: [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – Rob Wilkins Jan 04 '18 at 23:44
  • Yes I do, as I've written a PHP web crawler. They are more for scraping publicly readable content, like HTML, CSS & JS. For PHP (which is private content), you may want to get Notepad++ or VSCode and do a file search. It will look through your PHP code base to find what you're looking for. Simply key off of anything that is unique in that script & you should be able to find any matches on your file system. Like `$app = vB5_Frontend_Application::init('config.php');` – Clomp Jan 05 '18 at 01:21
  • @Clomp how did you write the php web crawler? – N00B101 Jan 05 '18 at 11:26
  • 1
    It took years to write it, but you can't make a web crawler scan for PHP code. The PHP code is protected by the web server. The PHP files output: HTML, CSS, JavaScript, JSON & XML. The PHP code - in your code example - isn't visible to the end user, via the browser. Search bots have to be able to see visible code. To detect your script, try using a web editor to do a file system search for that code. Some of them let you do multi-line searches. It's easy to do with a web editor. Good luck! – Clomp Jan 06 '18 at 04:48
  • If you really want to try writing one, check out this page: https://stackoverflow.com/questions/2313107/how-do-i-make-a-simple-crawler-in-php – Clomp Jan 06 '18 at 04:54

0 Answers0