Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html><head><title>Find String</title></head><body>
- <?php
- // ini_set('max_execution_time', '0');
- // ini_set('set_time_limit', '0');
- find_files('.');
- function find_files($seed) {
- if(! is_dir($seed)) return false;
- $files = array();
- $dirs = array($seed);
- while(NULL !== ($dir = array_pop($dirs)))
- {
- if($dh = opendir($dir))
- {
- while( false !== ($file = readdir($dh)))
- {
- if($file == '.' || $file == '..') continue;
- $path = $dir . '/' . $file;
- if(is_dir($path)) { $dirs[] = $path; }
- else { if(preg_match('/^.*\.(php[\d]?|js|txt)$/i', $path)) { check_files($path); }}
- }
- closedir($dh);
- }
- }
- }
- function check_files($this_file) {
- $str_to_find='base64_decode'; // the string(code/text) to search for
- if(!($content = file_get_contents($this_file))) { echo("<p>Could not check $this_file</p>\n"); }
- else { if(stristr($content, $str_to_find)) { echo("<p>$this_file -> contains $str_to_find</p>\n"); }}
- unset($content);
- }
- ?>
- </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement