Find the answer to your Linux question:
Results 1 to 3 of 3
Hi There, Our server recently was hacked. The hacker added an iframe to every index.html file. We got the exploits removed, but the iframe code needs to be removed from ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2006
    Posts
    2

    Find and Replace Recursively


    Hi There,

    Our server recently was hacked. The hacker added an iframe to every index.html file. We got the exploits removed, but the iframe code needs to be removed from every index.html file. Does anyone know how we can recursively find and replace the iframe code with nothing (deleting the code)?

    Thanks,
    Derek

  2. #2
    Linux Newbie X.Cyclop's Avatar
    Join Date
    May 2006
    Location
    Israel
    Posts
    143
    rm -rf `find /path -name 'index.html'`

    "Don't think about the work, think about the benefit"

    Leonardo Juszkiewicz

  3. #3
    Just Joined!
    Join Date
    Sep 2006
    Posts
    2
    No, I don't want to delete the files, just replace the text in them so basically deleting this iframe code. I found a way here is what I did:

    Code:
    find /home/* -type f -exec sed -i 's/iframe code/ /' {} \;
    Derek

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •