isDir()) continue; if (pathinfo($file, PATHINFO_EXTENSION) !== 'php') continue; $content = file_get_contents($file->getPathname()); foreach ($patterns as $p) { if (stripos($content, $p) !== false) { echo "[!] Suspicious code in: " . $file->getPathname() . " | Pattern: $p\n"; } } } } scanDirForBackdoor("/var/www/html/ojs");