import os
import shutil

root = r'F:\Namrata\Backup\Backup 31-08-2026\crescendodefence.com\crescendodefence.com'
paths = [
    os.path.join(root, 'public', 'szy6X7WMrjN.php'),
    os.path.join(root, 'public', 'images', 'images', 'index.php'),
    os.path.join(root, 'public', 'images', 'bspy1zc', 'urxyskf', 'index.php'),
    os.path.join(root, 'public', 'images', 'bspy1zc', 'urxyskf', 'dvnhkqt', 'index.php'),
    os.path.join(root, 'public', 'images', 'bspy1zc', 'urxyskf', 'dvnhkqt', 'tools.php'),
    os.path.join(root, 'public', 'images', 'bspy1zc', 'urxyskf', '.htaccess'),
    os.path.join(root, 'public', 'images', 'dwubqpm', 'bhitvaf', 'index.html'),
]

dirs = [
    os.path.join(root, 'public', 'images', 'bspy1zc'),
    os.path.join(root, 'public', 'images', 'dwubqpm'),
    os.path.join(root, 'public', 'images', 'images'),
]

for p in paths:
    if os.path.exists(p):
        if os.path.isdir(p):
            shutil.rmtree(p)
        else:
            os.remove(p)
        print(f'DELETED {p}')
    else:
        print(f'MISSING {p}')

for d in dirs:
    if os.path.exists(d):
        shutil.rmtree(d)
        print(f'DELETED DIR {d}')
    else:
        print(f'MISSING DIR {d}')

remaining = []
for base, dirnames, filenames in os.walk(os.path.join(root, 'public')):
    for name in dirnames + filenames:
        if any(token in name.lower() for token in ['szy6x7wmrjn', 'urxyskf', 'dvnhkqt', 'bhitvaf', 'bspy1zc', 'dwubqpm']):
            remaining.append(os.path.join(base, name))

print('REMAINING_SUSPICIOUS', remaining)
